Windows/Linux (VLC) DVD Playback

Added the option to select "DVD" from the video/media
list to playback a DVD if one is present.
This commit is contained in:
Mark Liversedge
2011-11-09 18:16:08 +00:00
parent 0a1e3cd53b
commit 2de1160fe5
2 changed files with 10 additions and 3 deletions

View File

@@ -330,6 +330,12 @@ TrainTool::configChanged()
QList<QTreeWidgetItem *> media = allMedia->takeChildren();
for (int i=0; i<media.count(); i++) delete media.at(i);
#ifndef Q_OS_MAC
// add dvd playback via VLC
QTreeWidgetItem *dvd = new QTreeWidgetItem(allMedia, WORKOUT_TYPE);
dvd->setText(0, "DVD");
#endif
MediaHelper mediaHelper;
foreach(QString video, mediaHelper.listMedia(QDir(workoutDir.toString()))) {

View File

@@ -35,7 +35,8 @@ GcWindow(parent), home(home), main(parent)
#ifdef Q_OS_LINUX
"--no-xlib", // avoid xlib thread error messages
#endif
"--verbose=-1" // -1 = no output at all
"--verbose=-1", // -1 = no output at all
"--quiet"
};
/* create an exception handler */
@@ -156,10 +157,10 @@ void VideoWindow::mediaSelected(QString filename)
if (m) libvlc_media_release(m);
m = NULL;
if (filename != "" && QFile(filename).exists()) {
if (filename.endsWith("/DVD") || (filename != "" && QFile(filename).exists())) {
/* open media */
m = libvlc_media_new_path(inst, filename.toLatin1());
m = libvlc_media_new_path(inst, filename.endsWith("/DVD") ? "dvd://" : filename.toLatin1());
/* set the media to playback */
if (m) libvlc_media_player_set_media (mp, m);