[mythtv] mythmusic visualition feature request

Andy Davidoff dert at pobox.com
Thu Feb 20 23:45:20 EST 2003


Patch against current CVS, set your
	VisualMode=BumpScope,MonoScope,StereoScope
and enjoy.


#if DanM /* Feb 20, 16:54 */
> I have a feature request for mythmusic.  in the settings file, there are 
> various options for VisualMode, one being random. However, I would like 
> to have the option of VisualMode being a list, ie VisualMode=BumpScope 
> MonoScope StereoScope  and mythmusic pick a random entry from the list.
> 
> I tried to write the code to do the task, but I'm not very familiar with 
> C/C++ and gave up.  Kept getting either compile errors or segfaults.  
> I'm sure its a piece of cake to write, heck I can write it in three or 
> four other languages, just don't know C :(
#endif /* dan at milkcarton.com */
-------------- next part --------------
diff -Naur mythmusic/mythmusic/playbackbox.cpp mymythmusic/mythmusic/playbackbox.cpp
--- mythmusic/mythmusic/playbackbox.cpp	2003-02-16 00:00:05.000000000 -0500
+++ mymythmusic/mythmusic/playbackbox.cpp	2003-02-20 23:40:41.000000000 -0500
@@ -260,10 +260,8 @@
     //
     //	Load Visualization settings and set up timer
     //
-	
-    visual_mode = gContext->GetSetting("VisualMode");
     QString visual_delay = gContext->GetSetting("VisualModeDelay");
-    
+
     bool delayOK;
     visual_mode_delay = visual_delay.toInt(&delayOK);
     if(!delayOK)
@@ -537,12 +535,17 @@
 
 void PlaybackBox::visEnable()
 {
+    // get the list of preferred vis modes
+    QString visual_mode = gContext->GetSetting("VisualMode");
+    QStringList modes = QStringList::split(",", visual_mode);
+
     if (!visualizer_is_active)
     {
         visual_mode_timer->stop();
         mainvisual->setVisual("Blank");
         mainvisual->showFullScreen();
-        mainvisual->setVisual(visual_mode);
+        // select one of the list of visualization modes
+        mainvisual->setVisual(modes[rand() % modes.size()]);
         visualizer_is_active = true;
     }
 }


More information about the mythtv-dev mailing list