Index: mythmusic/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/main.cpp,v
retrieving revision 1.57
diff -u -d -r1.57 main.cpp
--- mythmusic/main.cpp	23 Feb 2005 20:41:08 -0000	1.57
+++ mythmusic/main.cpp	15 May 2005 10:12:21 -0000
@@ -391,6 +391,7 @@
     REG_KEY("Music", "THMBUP", "Increase rating", "9");
     REG_KEY("Music", "THMBDOWN", "Decrease rating", "7");
     REG_KEY("Music", "REFRESH", "Refresh music tree", "8");
+    REG_KEY("Music", "FILTER", "Filter All My Music", "F");
 
     REG_MEDIA_HANDLER("MythMusic Media Handler", "", "", handleMedia, MEDIATYPE_AUDIO | MEDIATYPE_MIXED);
 }
Index: mythmusic/metadata.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/metadata.cpp,v
retrieving revision 1.35
diff -u -d -r1.35 metadata.cpp
--- mythmusic/metadata.cpp	3 May 2005 07:16:40 -0000	1.35
+++ mythmusic/metadata.cpp	15 May 2005 10:12:22 -0000
@@ -892,7 +892,8 @@
     Metadata *inserter;
     while ( (inserter = an_iterator.current()) != 0 )
     {
-        intoTree(inserter);
+        if (inserter->isVisible())
+            intoTree(inserter);
         ++an_iterator;
     }
 }
@@ -1203,6 +1204,17 @@
     }
 }
 
+void AllMusic::setAllVisible(bool visible)
+{
+    QPtrListIterator<Metadata> an_iterator( all_music );
+    Metadata *md;
+    while ( (md = an_iterator.current()) != 0 )
+    {
+        md->setVisible(visible);
+        ++an_iterator;
+    }
+}
+
 MusicNode::MusicNode(QString a_title, QStringList tree_levels, uint depth)
 {
     my_title = a_title;
Index: mythmusic/metadata.h
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/metadata.h,v
retrieving revision 1.17
diff -u -d -r1.17 metadata.h
--- mythmusic/metadata.h	23 Feb 2005 20:41:08 -0000	1.17
+++ mythmusic/metadata.h	15 May 2005 10:12:22 -0000
@@ -38,6 +38,7 @@
                 lastplay = llastplay;
                 compilation = lcompilation;
                 changed = false;
+                show = true;
             }
 
     Metadata(const Metadata &other) 
@@ -58,6 +59,7 @@
                 lastplay = other.lastplay;
                 playcount = other.playcount;
                 compilation = other.compilation;
+                show = other.show;
                 changed = false;
             }
 
@@ -110,6 +112,9 @@
     int PlayCount() { return playcount; }
     void incPlayCount();
 
+    bool isVisible() { return show; }
+    void setVisible(bool visible) { show = visible; }
+
     // track is part of a compilation album
     bool Compilation() { return compilation; }
     void setCompilation(bool state) { compilation = state; formattedartist = formattedtitle = ""; }
@@ -153,6 +158,8 @@
     QString filename;
     bool    changed;
 
+    bool    show;
+
     static QString m_startdir;
 
     // Various formatting strings
@@ -264,6 +271,7 @@
     bool        cleanOutThreads();
     int         getCDTrackCount(){return cd_data.count();}
     void        resetListings(){last_listed = -1;}
+    void        setAllVisible(bool visible);
     
   private:
   
Index: mythmusic/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/playbackbox.cpp,v
retrieving revision 1.86
diff -u -d -r1.86 playbackbox.cpp
--- mythmusic/playbackbox.cpp	3 May 2005 07:16:40 -0000	1.86
+++ mythmusic/playbackbox.cpp	15 May 2005 10:12:22 -0000
@@ -51,6 +51,8 @@
     curSmartPlaylistCategory = "";
     curSmartPlaylistName = "";
     
+    menufilters = gContext->GetNumSetting("MusicMenuFilters", 0);
+
     // Set our pointers the playlists and the metadata containers
 
     all_playlists = the_playlists;
@@ -163,7 +165,7 @@
     bool delayOK;
     visual_mode_delay = visual_delay.toInt(&delayOK);
     if (!delayOK)
-    	visual_mode_delay = 0;
+        visual_mode_delay = 0;
     if (visual_mode_delay > 0)
     {
         visual_mode_timer->start(visual_mode_delay * 1000);
@@ -316,7 +318,15 @@
         else if (action == "MUTE")
             toggleMute();
         else if (action == "MENU")
+        {
+            menufilters = false;
             showMenu();
+        }
+        else if (action == "FILTER")
+        {
+            menufilters = true;
+            showMenu();
+        }
         else if (action == "INFO")
             showEditMetadataDialog();
         else
@@ -554,25 +564,30 @@
     
     visual_mode_timer->stop();
 
-    all_playlists->getActive()->removeAllTracks();
+    if (!menufilters)
+        all_playlists->getActive()->removeAllTracks();
     all_playlists->getActive()->fillSonglistFromQuery(whereClause);
-    all_playlists->getActive()->fillSongsFromSonglist();
-    all_playlists->getActive()->postLoad();
+    all_playlists->getActive()->fillSongsFromSonglist(menufilters);
+    if (!menufilters)
+        all_playlists->getActive()->postLoad();
 
     if (visual_mode_delay > 0)
         visual_mode_timer->start(visual_mode_delay * 1000);
 
-    constructPlaylistTree();
-    
-    stop();
-    wipeTrackInfo();
-    
-    // move to first track in list
-    branches_to_current_node.clear();
-    branches_to_current_node.append(0); //  Root node
-    branches_to_current_node.append(1); //  We're on a playlist (not "My Music")
-    branches_to_current_node.append(0); //  Active play Queue
-    music_tree_list->moveToNodesFirstChild(branches_to_current_node);
+    if (!menufilters)
+    {
+        constructPlaylistTree();
+        
+        stop();
+        wipeTrackInfo();
+        
+        // move to first track in list
+        branches_to_current_node.clear();
+        branches_to_current_node.append(0); //  Root node
+        branches_to_current_node.append(1); //  We're on a playlist (not "My Music")
+        branches_to_current_node.append(0); //  Active play Queue
+        music_tree_list->moveToNodesFirstChild(branches_to_current_node);
+    }
     music_tree_list->refresh();
 }
 
@@ -584,7 +599,7 @@
 
     all_playlists->getActive()->removeAllTracks();
     all_playlists->getActive()->fillSonglistFromSmartPlaylist(category, name);
-    all_playlists->getActive()->fillSongsFromSonglist();
+    all_playlists->getActive()->fillSongsFromSonglist(menufilters);
     all_playlists->getActive()->postLoad();
 
     if (visual_mode_delay > 0)
@@ -791,13 +806,13 @@
 
         // TODO: Error checking that device is opened correctly!
         output = AudioOutput::OpenAudio(adevice, 16, 2, 44100, 
-	                                 AUDIOOUTPUT_MUSIC, true );	
+                                     AUDIOOUTPUT_MUSIC, true ); 
         output->setBufferSize(outputBufferSize * 1024);
         output->SetBlocking(false);
         output->addListener(this);
         output->addListener(mainvisual);
         output->addVisual(mainvisual);
-	
+    
         startoutput = true;
 
     }
Index: mythmusic/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/playbackbox.h,v
retrieving revision 1.36
diff -u -d -r1.36 playbackbox.h
--- mythmusic/playbackbox.h	3 May 2005 07:16:40 -0000	1.36
+++ mythmusic/playbackbox.h	15 May 2005 10:12:22 -0000
@@ -129,6 +129,8 @@
     bool isplaying;
     bool lcd_volume_visible;
 
+    bool menufilters;
+
     MainVisual *mainvisual;
 
     QString visual_mode;
Index: mythmusic/playlist.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/playlist.cpp,v
retrieving revision 1.27
diff -u -d -r1.27 playlist.cpp
--- mythmusic/playlist.cpp	23 Feb 2005 20:41:08 -0000	1.27
+++ mythmusic/playlist.cpp	15 May 2005 10:12:22 -0000
@@ -319,10 +319,10 @@
     cd_playlist.clear();
 
     active_playlist->loadPlaylist("default_playlist_storage", my_host);
-    active_playlist->fillSongsFromSonglist();
+    active_playlist->fillSongsFromSonglist(false);
     
     backup_playlist->loadPlaylist("backup_playlist_storage", my_host);
-    backup_playlist->fillSongsFromSonglist();
+    backup_playlist->fillSongsFromSonglist(false);
 
     all_other_playlists->clear();
 
@@ -342,7 +342,7 @@
             Playlist *temp_playlist = new Playlist(all_available_music);   //  No, we don't destruct this ...
             temp_playlist->setParent(this);
             temp_playlist->loadPlaylistByID(query.value(0).toInt(), my_host);
-            temp_playlist->fillSongsFromSonglist();
+            temp_playlist->fillSongsFromSonglist(false);
             all_other_playlists->append(temp_playlist); //  ... cause it's sitting on this PtrList
         }
     }
@@ -520,9 +520,13 @@
         name = "and they should **REALLY** never see this";
 }
 
-void Playlist::fillSongsFromSonglist()
+void Playlist::fillSongsFromSonglist(bool filter)
 {
     int an_int;
+
+    if (filter)
+        all_available_music->setAllVisible(false);
+
     QStringList list = QStringList::split(",", raw_songlist);
     QStringList::iterator it = list.begin();
     for (; it != list.end(); it++)
@@ -530,9 +534,18 @@
         an_int = QString(*it).toInt();
         if (an_int != 0)
         {
-            Track *a_track = new Track(an_int, all_available_music);
-            a_track->setParent(this);
-            songs.append(a_track);
+            if (filter)
+            {
+                Metadata *md = all_available_music->getMetadata(an_int);
+                if(md)
+                    md->setVisible(true);
+            }
+            else
+            {
+                Track *a_track = new Track(an_int, all_available_music);
+                a_track->setParent(this);
+                songs.append(a_track);
+            }
         }
         else
         {
@@ -541,6 +554,12 @@
             cerr << "            If this happens on repeated invocations of mythmusic, then something is really wrong" << endl;
         }
     }
+
+    if (filter)
+    {
+        all_available_music->buildTree();
+        all_available_music->sortTree();
+    }
 }
 
 void Playlist::fillSonglistFromSongs()
@@ -833,7 +852,7 @@
                                             (RAND_MAX + 1.0));
                     int integer_rating = (int) (4000001 - rating_value * 10000);
                     added_node->setAttribute(3, integer_rating); //  "intelligent" order
-					 }
+                     }
             }
             if(it->getValue() < 0)
             {
@@ -1385,7 +1404,7 @@
                 level_down->computeSize(child_MB, child_sec);
                 size_in_MB += child_MB;
                 size_in_sec += child_sec;
-	    }
+        }
         }
     }
 }
Index: mythmusic/playlist.h
===================================================================
RCS file: /var/lib/mythcvs/mythplugins/mythmusic/mythmusic/playlist.h,v
retrieving revision 1.12
diff -u -d -r1.12 playlist.h
--- mythmusic/playlist.h	23 Feb 2005 20:41:08 -0000	1.12
+++ mythmusic/playlist.h	15 May 2005 10:12:22 -0000
@@ -75,7 +75,7 @@
 
     void describeYourself(void); //  debugging
 
-    void fillSongsFromSonglist();
+    void fillSongsFromSonglist(bool filter);
     void fillSonglistFromSongs();
     void fillSonglistFromQuery(QString whereClause);
     void fillSonglistFromSmartPlaylist(QString category, QString name);
