Index: mythmusic/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/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	10 Apr 2005 20:56:31 -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/mythmusic/mythmusic/metadata.cpp,v
retrieving revision 1.34
diff -u -d -r1.34 metadata.cpp
--- mythmusic/metadata.cpp	10 Apr 2005 05:17:15 -0000	1.34
+++ mythmusic/metadata.cpp	10 Apr 2005 20:56:31 -0000
@@ -829,19 +829,20 @@
     //  build a tree (nodes, leafs, and all)
     //  that reflects the desired structure
     //  of the metadata. This is a structure
-    //  that makes it easy (and QUICK) to 
+    //  that makes it easy (and QUICK) to
     //  display metadata on (for example) a
     //  Select Music screen
     //
-    
+
     top_nodes.clear();
     root_node->clearTracks();
-    
+
     QPtrListIterator<Metadata> an_iterator( all_music );
     Metadata *inserter;
     while ( (inserter = an_iterator.current()) != 0 )
     {
-        intoTree(inserter);
+        if (inserter->isVisible())
+            intoTree(inserter);
         ++an_iterator;
     }
 }
@@ -1141,14 +1142,25 @@
     {
         if( *it != "genre"  &&
             *it != "artist" &&
-            *it != "splitartist" && 
+            *it != "splitartist" &&
             *it != "album"  &&
             *it != "title")
         {
-            cerr << "metadata.o: I don't understand the expression \"" << *it 
-                 << "\" as a tree level in a music hierarchy " << endl ; 
+            cerr << "metadata.o: I don't understand the expression \"" << *it
+                 << "\" as a tree level in a music hierarchy " << endl ;
         }
-            
+
+    }
+}
+
+void AllMusic::setAllVisible(bool visible)
+{
+    QPtrListIterator<Metadata> an_iterator( all_music );
+    Metadata *md;
+    while ( (md = an_iterator.current()) != 0 )
+    {
+        md->setVisible(visible);
+        ++an_iterator;
     }
 }
 
Index: mythmusic/metadata.h
===================================================================
RCS file: /var/lib/mythcvs/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	10 Apr 2005 20:56:31 -0000
@@ -38,9 +38,10 @@
                 lastplay = llastplay;
                 compilation = lcompilation;
                 changed = false;
+                show = true;
             }
 
-    Metadata(const Metadata &other) 
+    Metadata(const Metadata &other)
             {
                 filename = other.filename;
                 artist = other.artist;
@@ -58,6 +59,7 @@
                 lastplay = other.lastplay;
                 playcount = other.playcount;
                 compilation = other.compilation;
+                show = other.show;
                 changed = false;
             }
 
@@ -110,11 +112,14 @@
     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 = ""; }
     bool determineIfCompilation(bool cd = false);
-    
+
     bool isInDatabase(QString startdir);
     void dumpToDatabase(QString startdir);
     void updateDatabase(QString startdir);
@@ -148,11 +153,13 @@
     QString lastplay;
     int playcount;
     bool compilation;
-     
+
     unsigned int id;
     QString filename;
     bool    changed;
 
+    bool    show;
+
     static QString m_startdir;
 
     // Various formatting strings
@@ -264,14 +271,14 @@
     bool        cleanOutThreads();
     int         getCDTrackCount(){return cd_data.count();}
     void        resetListings(){last_listed = -1;}
-    
+    void        setAllVisible(bool visible);
   private:
-  
+
     QPtrList<Metadata>  all_music;
     QPtrList<MusicNode> top_nodes;
     MusicNode           *root_node;
-    
-    
+
+
 
     //  NB: While a QMap is VALUE BASED the
     //  values we are copying here are pointers,
Index: mythmusic/playbackbox.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/playbackbox.cpp,v
retrieving revision 1.84
diff -u -d -r1.84 playbackbox.cpp
--- mythmusic/playbackbox.cpp	26 Mar 2005 21:08:26 -0000	1.84
+++ mythmusic/playbackbox.cpp	10 Apr 2005 20:56:31 -0000
@@ -50,7 +50,9 @@
     curMeta = NULL;
     curSmartPlaylistCategory = "";
     curSmartPlaylistName = "";
-    
+
+    menufilters = gContext->GetNumSetting("MusicMenuFilters", 0);
+
     // Set our pointers the playlists and the metadata containers
 
     all_playlists = the_playlists;
@@ -302,14 +304,22 @@
             CycleVisualizer();
         else if (action == "BLANKSCR")
             toggleFullBlankVisualizer();
-        else if (action == "VOLUMEDOWN") 
+        else if (action == "VOLUMEDOWN")
             changeVolume(false);
         else if (action == "VOLUMEUP")
             changeVolume(true);
         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
@@ -540,50 +550,55 @@
 void PlaybackBoxMusic::updatePlaylistFromQuickPlaylist(QString whereClause)
 {
     QValueList <int> branches_to_current_node;
-    
+
     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();
 }
 
 void PlaybackBoxMusic::updatePlaylistFromSmartPlaylist(QString category, QString name)
 {
     QValueList <int> branches_to_current_node;
-    
+
     visual_mode_timer->stop();
 
     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)
         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
Index: mythmusic/playbackbox.h
===================================================================
RCS file: /var/lib/mythcvs/mythmusic/mythmusic/playbackbox.h,v
retrieving revision 1.35
diff -u -d -r1.35 playbackbox.h
--- mythmusic/playbackbox.h	6 Feb 2005 06:53:58 -0000	1.35
+++ mythmusic/playbackbox.h	10 Apr 2005 20:56:31 -0000
@@ -128,6 +128,8 @@
     bool isplaying;
     bool lcd_volume_visible;
 
+    bool menufilters;
+
     MainVisual *mainvisual;
 
     QString visual_mode;
Index: mythmusic/playlist.cpp
===================================================================
RCS file: /var/lib/mythcvs/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	10 Apr 2005 20:56:31 -0000
@@ -309,20 +309,20 @@
     done_loading = false;
     active_playlist = new Playlist(all_available_music);
     active_playlist->setParent(this);
-    
+
     backup_playlist = new Playlist(all_available_music);
     backup_playlist->setParent(this);
-    
+
     all_other_playlists = new QPtrList<Playlist>;
     all_other_playlists->setAutoDelete(true);
-    
+
     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,12 +342,12 @@
             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
         }
     }
     postLoad();
-   
+
     pending_writeback_index = 0;
 
     int x = gContext->GetNumSetting("LastMusicPlaylistPush");
@@ -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()
Index: mythmusic/playlist.h
===================================================================
RCS file: /var/lib/mythcvs/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	10 Apr 2005 20:56:31 -0000
@@ -75,11 +75,11 @@
 
     void describeYourself(void); //  debugging
 
-    void fillSongsFromSonglist();
+    void fillSongsFromSonglist(bool filter);
     void fillSonglistFromSongs();
     void fillSonglistFromQuery(QString whereClause);
     void fillSonglistFromSmartPlaylist(QString category, QString name);
-    
+
     void moveTrackUpDown(bool flag, Track *the_track);
 
     bool checkTrack(int a_track_id, bool cd_flag);
