FFwd and Rewind Video (VLC)

When using the fast forward and rewind buttons for
a workout we now also fast forward and rewind the
video playback on Linux/Windows.

The same feature needs to be incorporated under
Mac where we use QTKit for video playback.

Fixes #594.
This commit is contained in:
Mark Liversedge
2012-01-12 11:39:31 +00:00
parent e83d667bf1
commit b0b9042ee4
4 changed files with 19 additions and 1 deletions

View File

@@ -82,6 +82,7 @@ GcWindow(parent), home(home), main(parent)
connect(main, SIGNAL(stop()), this, SLOT(stopPlayback()));
connect(main, SIGNAL(start()), this, SLOT(startPlayback()));
connect(main, SIGNAL(pause()), this, SLOT(pausePlayback()));
connect(main, SIGNAL(seek(long)), this, SLOT(seekPlayback(long)));
connect(main, SIGNAL(unpause()), this, SLOT(resumePlayback()));
connect(main, SIGNAL(mediaSelected(QString)), this, SLOT(mediaSelected(QString)));
@@ -149,6 +150,14 @@ void VideoWindow::resumePlayback()
libvlc_media_player_pause (mp);
}
void VideoWindow::seekPlayback(long ms)
{
if (!m) return;
// seek to ms position in current file
libvlc_media_player_set_time(mp, (libvlc_time_t) ms);
}
void VideoWindow::mediaSelected(QString filename)
{
// stop any current playback