/*
- 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 <gtkmm2ext/selector.h>
+
+#include "ardour_dialog.h"
+#include "ardour/session_handle.h"
namespace ARDOUR {
class Session;
class RouteUI;
-class PlaylistSelector : public ArdourDialog
+class PlaylistSelector : public ArdourDialog
{
public:
PlaylistSelector ();
~PlaylistSelector ();
- void set_session (ARDOUR::Session*);
void show_for (RouteUI*);
+ protected:
+ bool on_unmap_event (GdkEventAny*);
+
private:
- typedef std::map<ARDOUR::id_t,std::list<ARDOUR::Playlist*>*> DSPL_Map;
+ 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__