[mythtv] [Patch] Media monitoring

J. Donavan Stanley jdonavan at gorpe.com
Fri Dec 12 06:32:24 EST 2003


Sorry this took so long, I've been a bit swamped lately.

The one contained in the archive adds the major functionality, 
monitoring of media devices and should be applied to the mythtv tree.  
99% of it lives in libmyth, only the code to create a MediaMonitor 
object and start it monitoring is in the frontend.  I ended up using a 
map similar to the JumpMap code, I had hoped to piggyback on the JumpMap 
itself but since no key defined == not in the map, that wasn't really an 
option.

The other smaller patch adds support to MythMusic for registering itself 
as a MediaHandler.  The call is indentical to the REG_JUMP call except 
we add an additional parameter that serves to indicate what type of 
media it handles (by ORing together MediaTypes).

Right now inserting a music / mixed CD into the CDROM will pop you to 
MythMusic automaticly.  I've got to sit down and figure out how to do 
the popup menu to allow the user to chose  how to handle the media, once 
that's done we can define multiple handlers within a single plugin (i.e. 
"play CD", "archive CD").


-------------- next part --------------
Index: mythmusic/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/main.cpp,v
retrieving revision 1.43
diff -u -r1.43 main.cpp
--- mythmusic/main.cpp	12 Dec 2003 00:26:25 -0000	1.43
+++ mythmusic/main.cpp	12 Dec 2003 11:15:51 -0000
@@ -24,6 +24,7 @@
 #include <mythtv/themedmenu.h>
 #include <mythtv/mythcontext.h>
 #include <mythtv/mythplugin.h>
+#include <mythtv/mythmedia.h>
 
 void CheckFreeDBServerFile(void)
 {
@@ -354,11 +355,19 @@
 void runMusicSelection(void);
 void runRipCD(void);
 
+void handleMedia(void);
+
+void handleMedia(void) {
+    mythplugin_run();
+}
+
+
 void setupKeys(void)
 {
     REG_JUMP("Play music", "", "", runMusicPlayback);
     REG_JUMP("Select music playlists", "", "", runMusicSelection);
     REG_JUMP("Rip CD", "", "", runRipCD);
+    REG_MEDIA_HANDLER("MythMusic Media Handler", "", "", handleMedia, MEDIATYPE_AUDIO | MEDIATYPE_MIXED);
 
     REG_KEY("Music", "DELETE", "Delete track from playlist", "D");
     REG_KEY("Music", "NEXTTRACK", "Move to the next track", ">,.,Z,End");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mm_patch.tar.gz
Type: application/gzip
Size: 9139 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20031212/fcc2cb9c/mm_patch.tar.bin


More information about the mythtv-dev mailing list