diff gui/interface.c @ 34387:0ba85cad4c7e

Add audio CD playback support to the X11/GTK GUI. (The Win32 GUI already had this support. Add missing - although already used - user event evPlayCD here as well as internal event ivSetCDTrack - although it's unused - for consistency.)
author ib
date Sat, 31 Dec 2011 12:38:52 +0000
parents f05c75392897
children 9ee95c78e85f
line wrap: on
line diff
--- a/gui/interface.c	Sat Dec 31 12:20:08 2011 +0000
+++ b/gui/interface.c	Sat Dec 31 12:38:52 2011 +0000
@@ -410,6 +410,17 @@
         case STREAMTYPE_STREAM:
             break;
 
+#ifdef CONFIG_CDDA
+        case STREAMTYPE_CDDA:
+        {
+            char tmp[512];
+
+            sprintf(tmp, "cdda://%d", guiInfo.Track);
+            uiSetFileName(NULL, tmp, STREAMTYPE_CDDA);
+        }
+        break;
+#endif
+
 #ifdef CONFIG_VCD
         case STREAMTYPE_VCD:
         {
@@ -611,6 +622,13 @@
         guiInfo.StreamType = stream->type;
 
         switch (guiInfo.StreamType) {
+#ifdef CONFIG_CDDA
+        case STREAMTYPE_CDDA:
+            guiInfo.Tracks = 0;
+            stream_control(stream, STREAM_CTRL_GET_NUM_TITLES, &guiInfo.Tracks);
+            break;
+#endif
+
 #ifdef CONFIG_VCD
         case STREAMTYPE_VCD:
             guiInfo.Tracks = 0;
@@ -772,6 +790,15 @@
             break;
         }
 
+#ifdef CONFIG_CDDA
+        if (guiInfo.StreamType == STREAMTYPE_CDDA) {
+            uiNext();
+
+            if (guiInfo.Playing)
+                break;
+        }
+#endif
+
         if (guiInfo.Playing && (next = listSet(gtkGetNextPlItem, NULL)) && (plLastPlayed != next)) {
             plLastPlayed = next;
             uiSetFileName(next->path, next->name, STREAMTYPE_FILE);