[mythtv] [PATCH] Media monitoring in mythDVD
Xavier Hervy
maxpower44 at tiscali.fr
Thu Feb 19 06:27:54 EST 2004
This patch for mythDVD modify two files : main.cpp , settings.cpp
It allow users to select what default action execute on DVD insertion
between Do Nothing, Display mythDVD menu, play DVD ao ripp DVD
Xavier Hervy
-------------- next part --------------
Seulement dans /usr/local/src/mythdvd/: Makefile
diff -ru /usr/local/src/cvs/myth/mythdvd/mythdvd/main.cpp /usr/local/src/mythdvd/mythdvd/main.cpp
--- /usr/local/src/cvs/myth/mythdvd/mythdvd/main.cpp 2004-02-03 00:42:14.000000000 +0100
+++ /usr/local/src/mythdvd/mythdvd/main.cpp 2004-02-19 10:16:49.000000000 +0100
@@ -241,13 +241,26 @@
void handleMedia(void)
{
- mythplugin_run();
+ switch(gContext->GetSetting("DVDOnInsertDVD","1").toInt()){
+ case 0 : // Do nothing
+ break;
+ case 1 : // Display menu (mythdvd)*/
+ mythplugin_run();
+ break;
+ case 2 : // play DVD
+ playDVD();
+ break;
+ case 3 : //Rip DVD
+ startDVDRipper();
+ break;
+ }
}
void initKeys(void)
{
REG_JUMP("Play DVD", "Play a DVD", "", playDVD);
REG_MEDIA_HANDLER("MythDVD Media Handler", "", "", handleMedia, MEDIATYPE_VIDEO);
+
#ifdef VCD_SUPPORT
REG_JUMP("Play VCD", "Play a VCD", "", playVCD);
#endif
diff -ru /usr/local/src/cvs/myth/mythdvd/mythdvd/settings.cpp /usr/local/src/mythdvd/mythdvd/settings.cpp
--- /usr/local/src/cvs/myth/mythdvd/mythdvd/settings.cpp 2004-01-27 20:57:43.000000000 +0100
+++ /usr/local/src/mythdvd/mythdvd/settings.cpp 2004-02-19 10:00:24.000000000 +0100
@@ -50,6 +50,20 @@
};
};
+class SetOnInsertDVD: public ComboBoxSetting, public GlobalSetting {
+public :
+ SetOnInsertDVD():
+ GlobalSetting("DVDOnInsertDVD") {
+ setLabel(QObject::tr("On DVD insertion"));
+ addSelection(QObject::tr("Display mythdvd menu menu"),"1");
+ addSelection(QObject::tr("Do nothing"),"0");
+ addSelection(QObject::tr("Play DVD"),"2");
+ addSelection(QObject::tr("Rip DVD"),"3");
+ setHelpText(QObject::tr("Media Monitoring should be turn on to "
+ "allow this feature (Setup -> General -> CD/DVD Monitor"));
+ };
+};
+
DVDGeneralSettings::DVDGeneralSettings()
{
VerticalConfigurationGroup* general = new VerticalConfigurationGroup(false);
@@ -58,7 +72,8 @@
#ifdef VCD_SUPPORT
general->addChild(new SetVCDDevice());
#endif
- addChild(general);
+ general->addChild(new SetOnInsertDVD());
+ addChild(general);
}
More information about the mythtv-dev
mailing list