mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
@@ -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()))) {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user