X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fredirect_box.h;h=7ab7d03cac115cebc977d32676f8b008b0a61027;hb=b529cbc5dc0b92f01ff01d5f40786ff025fbb63b;hp=c5e274b017fe91c6e6e4da727c9523340a525b86;hpb=c74f6577e2466d24a74da3ba6a48e2a1957769c8;p=ardour.git diff --git a/gtk2_ardour/redirect_box.h b/gtk2_ardour/redirect_box.h index c5e274b017..7ab7d03cac 100644 --- a/gtk2_ardour/redirect_box.h +++ b/gtk2_ardour/redirect_box.h @@ -33,11 +33,12 @@ #include #include +#include + #include #include #include #include -#include #include #include @@ -48,30 +49,29 @@ class MotionController; class PluginSelector; +class PluginUIWindow; class RouteRedirectSelection; namespace ARDOUR { + class Connection; + class Insert; + class Plugin; + class PluginInsert; + class PortInsert; class Route; class Send; - class Insert; class Session; - class PortInsert; - class Connection; - class Plugin; } - class RedirectBox : public Gtk::HBox { public: - RedirectBox (ARDOUR::Placement, ARDOUR::Session&, ARDOUR::Route &, PluginSelector &, RouteRedirectSelection &, bool owner_is_mixer = false); + RedirectBox (ARDOUR::Placement, ARDOUR::Session&, + boost::shared_ptr, PluginSelector &, RouteRedirectSelection &, bool owner_is_mixer = false); ~RedirectBox (); void set_width (Width); - void set_title (const std::string & title); - void set_title_shown (bool flag); - void update(); void select_all_redirects (); @@ -80,14 +80,16 @@ class RedirectBox : public Gtk::HBox void select_all_inserts (); void select_all_sends (); - sigc::signal RedirectSelected; - sigc::signal RedirectUnselected; + sigc::signal > RedirectSelected; + sigc::signal > RedirectUnselected; + static void register_actions(); + protected: void set_stuff_from_route (); private: - ARDOUR::Route & _route; + boost::shared_ptr _route; ARDOUR::Session & _session; bool _owner_is_mixer; @@ -95,27 +97,35 @@ class RedirectBox : public Gtk::HBox PluginSelector & _plugin_selector; RouteRedirectSelection & _rr_selection; - + + void route_going_away (); + struct ModelColumns : public Gtk::TreeModel::ColumnRecord { - ModelColumns () { - add (text); + ModelColumns () { + add (text); add (redirect); - } - Gtk::TreeModelColumn text; - Gtk::TreeModelColumn redirect; + add (color); + } + Gtk::TreeModelColumn text; + Gtk::TreeModelColumn > redirect; + Gtk::TreeModelColumn color; }; ModelColumns columns; Glib::RefPtr model; void selection_changed (); + + static bool get_colors; + static Gdk::Color* active_redirect_color; + static Gdk::Color* inactive_redirect_color; Gtk::EventBox redirect_eventbox; Gtk::HBox redirect_hpacker; - Gtkmm2ext::DnDTreeView redirect_display; + Gtkmm2ext::DnDTreeView > redirect_display; Gtk::ScrolledWindow redirect_scroller; - void object_drop (std::string type, uint32_t cnt, void**); + void object_drop (std::string type, uint32_t cnt, const boost::shared_ptr*); Width _width; @@ -125,8 +135,6 @@ class RedirectBox : public Gtk::HBox void new_send (); void show_send_controls (); - Glib::RefPtr popup_ui_mgr; - Glib::RefPtr popup_act_grp; Gtk::Menu *redirect_menu; gint redirect_menu_map_handler (GdkEventAny *ev); Gtk::Menu * build_redirect_menu (); @@ -134,23 +142,28 @@ class RedirectBox : public Gtk::HBox void show_redirect_menu (gint arg); void choose_send (); - void send_io_finished (IOSelector::Result, ARDOUR::Redirect*, IOSelectorWindow*); + void send_io_finished (IOSelector::Result, boost::weak_ptr, IOSelectorWindow*); void choose_insert (); void choose_plugin (); - void insert_plugin_chosen (ARDOUR::Plugin *); + void insert_plugin_chosen (boost::shared_ptr); - gint redirect_button (GdkEventButton *); - void redirects_changed (void *); - void show_redirect_active (ARDOUR::Redirect *, void *); - void show_redirect_name (void*, ARDOUR::Redirect *); - void add_redirect_to_display (ARDOUR::Redirect *); + bool no_redirect_redisplay; + bool ignore_delete; - string redirect_name (ARDOUR::Redirect&); + bool redirect_button_press_event (GdkEventButton *); + bool redirect_button_release_event (GdkEventButton *); + void redisplay_redirects (void* src); + void add_redirect_to_display (boost::shared_ptr); + void row_deleted (const Gtk::TreeModel::Path& path); + void show_redirect_active_r (ARDOUR::Redirect*, void *, boost::weak_ptr); + void show_redirect_active (boost::weak_ptr); + void show_redirect_name (void* src, boost::weak_ptr); + string redirect_name (boost::weak_ptr); - void remove_redirect_gui (ARDOUR::Redirect *); + void remove_redirect_gui (boost::shared_ptr); void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*); - gint compute_redirect_sort_keys (); + void compute_redirect_sort_keys (); vector redirect_active_connections; vector redirect_name_connections; @@ -166,22 +179,46 @@ class RedirectBox : public Gtk::HBox void clone_redirects (); void rename_redirects (); - void for_selected_redirects (void (RedirectBox::*pmf)(ARDOUR::Redirect*)); - void get_selected_redirects (vector&); + void for_selected_redirects (void (RedirectBox::*pmf)(boost::shared_ptr)); + void get_selected_redirects (vector >&); + static Glib::RefPtr paste_action; + void paste_redirect_list (std::list >& redirects); - void activate_redirect (ARDOUR::Redirect*); - void deactivate_redirect (ARDOUR::Redirect*); - void cut_redirect (ARDOUR::Redirect*); - void copy_redirect (ARDOUR::Redirect*); - void edit_redirect (ARDOUR::Redirect*); - void hide_redirect_editor (ARDOUR::Redirect*); - void rename_redirect (ARDOUR::Redirect*); - - gint idle_delete_redirect (ARDOUR::Redirect *); - - void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, ARDOUR::IO& io); - + void activate_redirect (boost::shared_ptr); + void deactivate_redirect (boost::shared_ptr); + void cut_redirect (boost::shared_ptr); + void copy_redirect (boost::shared_ptr); + void edit_redirect (boost::shared_ptr); + void hide_redirect_editor (boost::shared_ptr); + void rename_redirect (boost::shared_ptr); + + gint idle_delete_redirect (boost::weak_ptr); + + void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, boost::shared_ptr io); + + static RedirectBox* _current_redirect_box; + static bool enter_box (GdkEventCrossing*, RedirectBox*); + static bool leave_box (GdkEventCrossing*, RedirectBox*); + + static void rb_choose_plugin (); + static void rb_choose_insert (); + static void rb_choose_send (); + static void rb_clear (); + static void rb_cut (); + static void rb_copy (); + static void rb_paste (); + static void rb_rename (); + static void rb_select_all (); + static void rb_deselect_all (); + static void rb_activate (); + static void rb_deactivate (); + static void rb_activate_all (); + static void rb_deactivate_all (); + static void rb_edit (); + + void route_name_changed (void* src, PluginUIWindow* plugin_ui, boost::weak_ptr pi); + std::string generate_redirect_title (boost::shared_ptr pi); }; #endif /* __ardour_gtk_redirect_box__ */