commit before audio rewrite
This commit is contained in:
+3
-1
@@ -90,6 +90,7 @@ bool Timeline::toggle_play() {
|
||||
void Timeline::play() {
|
||||
playhead_start = playhead;
|
||||
playback_timer.start();
|
||||
start_msecs = QDateTime::currentMSecsSinceEpoch();
|
||||
playback_updater.start();
|
||||
playing = true;
|
||||
|
||||
@@ -143,7 +144,8 @@ bool Timeline::focused() {
|
||||
|
||||
void Timeline::repaint_timeline() {
|
||||
if (playing) {
|
||||
playhead = playhead_start + (playback_timer.elapsed() * 0.001 * sequence->frame_rate);
|
||||
// playhead = playhead_start + (playback_timer.elapsed() * 0.001 * sequence->frame_rate);
|
||||
playhead = round(playhead_start + ((QDateTime::currentMSecsSinceEpoch()-start_msecs) * 0.001 * sequence->frame_rate));
|
||||
}
|
||||
ui->video_area->update();
|
||||
ui->audio_area->update();
|
||||
|
||||
@@ -77,6 +77,7 @@ public:
|
||||
void go_to_end();
|
||||
bool playing;
|
||||
long playhead_start;
|
||||
qint64 start_msecs;
|
||||
QTime playback_timer;
|
||||
QTimer playback_updater;
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ extern "C" {
|
||||
#include <libavcodec/avcodec.h>
|
||||
}
|
||||
|
||||
#include <QAudioOutput>
|
||||
|
||||
Viewer::Viewer(QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
ui(new Ui::Viewer)
|
||||
@@ -27,6 +29,10 @@ Viewer::~Viewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void Viewer::receiver() {
|
||||
qDebug() << "callback?";
|
||||
}
|
||||
|
||||
void Viewer::set_sequence(Sequence* s) {
|
||||
bool null_sequence = (s == NULL);
|
||||
sequence = s;
|
||||
@@ -45,6 +51,8 @@ void Viewer::set_sequence(Sequence* s) {
|
||||
}
|
||||
|
||||
init_audio(s);
|
||||
connect(audio_output, SIGNAL(notify()), this, SLOT(receiver()));
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ private slots:
|
||||
|
||||
void on_pushButton_3_clicked();
|
||||
|
||||
void receiver();
|
||||
|
||||
private:
|
||||
Ui::Viewer *ui;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user