Fix generic plugin UI for plugins with only properties
[ardour.git] / gtk2_ardour / playlist_selector.h
index 5c36d6b0a38c08bf38a3cc611b9bad063c0ed658..d0b71a6265e1adc3b0b96bff90e65c6a84e4a8c6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2004 Paul Davis 
+    Copyright (C) 2004 Paul Davis
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
 #ifndef __ardour_playlist_selector_h__
 #define __ardour_playlist_selector_h__
 
-#include <gtk--.h>
-#include <gtk--/ctree.h>
-#include <gtkmmext/selector.h>
+#include <boost/shared_ptr.hpp>
 
-#include <ardour_dialog.h>
+#include <gtkmm/box.h>
+#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/button.h>
+#include <gtkmm/treeview.h>
+#include <gtkmm/treestore.h>
+
+#include "ardour_dialog.h"
+#include "ardour/session_handle.h"
 
 namespace ARDOUR {
        class Session;
@@ -34,32 +39,44 @@ namespace ARDOUR {
 
 class RouteUI;
 
-class PlaylistSelector : public ArdourDialog 
+class PlaylistSelector : public ArdourDialog
 {
-  public:
+public:
        PlaylistSelector ();
        ~PlaylistSelector ();
 
-       void set_session (ARDOUR::Session*);
        void show_for (RouteUI*);
 
-  private:
-       typedef std::map<ARDOUR::id_t,std::list<ARDOUR::Playlist*>*> DSPL_Map;
+protected:
+       bool on_unmap_event (GdkEventAny*);
+
+private:
+       typedef std::map<PBD::ID,std::list<boost::shared_ptr<ARDOUR::Playlist> >*> TrackPlaylistMap;
 
-       ARDOUR::Session* session;
-       Gtk::VBox vpacker;
        Gtk::ScrolledWindow scroller;
-       Gtk::CTree tree;
-       Gtk::Button close_button;
-       DSPL_Map dspl_map;
+       TrackPlaylistMap trpl_map;
        RouteUI* rui;
 
-       SigC::Connection select_connection;
+       sigc::connection select_connection;
 
-       void add_playlist_to_map (ARDOUR::Playlist*);
+       void add_playlist_to_map (boost::shared_ptr<ARDOUR::Playlist>);
        void clear_map ();
        void close_button_click ();
-       void row_selected (Gtk::CTree::Row, int32_t col);
+       void selection_changed ();
+
+       struct ModelColumns : public Gtk::TreeModel::ColumnRecord
+       {
+               ModelColumns () {
+                       add (text);
+                       add (playlist);
+               }
+               Gtk::TreeModelColumn<std::string> text;
+               Gtk::TreeModelColumn<boost::shared_ptr<ARDOUR::Playlist> >   playlist;
+       };
+
+       ModelColumns columns;
+       Glib::RefPtr<Gtk::TreeStore> model;
+       Gtk::TreeView tree;
 };
 
 #endif // __ardour_playlist_selector_h__