X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fio_selector.h;h=a4545dbfc43c34133ce4757d8bdab5c277539a4f;hb=285e4c648a794a1bf311621029883b1adbb32c8d;hp=b0175644a4114426f6c11692ee98868feee47806;hpb=ce234f363e95c38fc92728e520bf5ba240a89aa7;p=ardour.git diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index b0175644a4..a4545dbfc4 100644 --- a/gtk2_ardour/io_selector.h +++ b/gtk2_ardour/io_selector.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002 Paul Davis + Copyright (C) 2002-2007 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 @@ -15,191 +15,117 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_ui_io_selector_h__ #define __ardour_ui_io_selector_h__ -#if __GNUC__ >= 3 -#include -using __gnu_cxx::slist; -#else -#include -#endif - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - +#include "ardour_dialog.h" +#include "port_matrix.h" +#include "i18n.h" namespace ARDOUR { - class IO; - class Session; class PortInsert; - class Port; - class Redirect; } -class IOSelector : public Gtk::VBox { +class IOSelector : public PortMatrix +{ public: - IOSelector (ARDOUR::Session&, boost::shared_ptr, bool for_input); - ~IOSelector (); - - void redisplay (); - - enum Result { - Cancelled, - Accepted - }; - - sigc::signal Finished; - - protected: - ARDOUR::Session& session; - - private: - boost::shared_ptr io; - bool for_input; - ARDOUR::Port *selected_port; - - Gtk::VBox main_box; - Gtk::HBox port_and_selector_box; - - /* column model */ - - struct PortDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { - - PortDisplayModelColumns() { - add (displayed_name); - add (full_name); - } - - Gtk::TreeModelColumn displayed_name; - Gtk::TreeModelColumn full_name; - }; + IOSelector (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr); - PortDisplayModelColumns port_display_columns; + void set_state (ARDOUR::BundleChannel c[2], bool); + PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const; - /* client/port selection */ + std::string disassociation_verb () const { + return _("Disconnect"); + } - Gtk::Notebook notebook; - Gtk::Frame selector_frame; - Gtk::VBox selector_box; - Gtk::HBox selector_button_box; + std::string channel_noun () const { + return _("port"); + } - /* ports */ + uint32_t n_io_ports () const; + boost::shared_ptr const io () { return _io; } + void setup_ports (int); + bool list_is_global (int) const; - Gtk::VBox port_box; - Gtk::HBox port_button_box; - Gtk::VBox port_and_button_box; - Gtk::Frame port_frame; - Gtk::Button add_port_button; - Gtk::Button remove_port_button; - Gtk::Button clear_connections_button; - Gtk::ScrolledWindow port_display_scroller; + bool find_inputs_for_io_outputs () const { + return _find_inputs_for_io_outputs; + } - Glib::Mutex port_display_lock; - slist port_displays; - void display_ports (); + int ours () const { + return _ours; + } - void rescan (); - void clear_connections (); + int other () const { + return _other; + } - bool port_selection_changed(GdkEventButton *, Gtk::TreeView*); - - void ports_changed (ARDOUR::IOChange, void *); - void name_changed (void*); - - void add_port (); - void remove_port (); - gint remove_port_when_idle (ARDOUR::Port *); + private: - gint port_column_button_release (GdkEventButton *, Gtk::TreeView*); - gint connection_button_release (GdkEventButton *, Gtk::TreeView*); - - void select_treeview(Gtk::TreeView*); - void select_next_treeview (); + int _other; + int _ours; + boost::shared_ptr _io; + boost::shared_ptr _port_group; + bool _find_inputs_for_io_outputs; }; -class IOSelectorWindow : public ArdourDialog +class IOSelectorWindow : public Gtk::Window { public: - IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr, bool for_input, bool can_cancel=false); - ~IOSelectorWindow (); + IOSelectorWindow (ARDOUR::Session *, boost::shared_ptr, bool can_cancel = false); IOSelector& selector() { return _selector; } protected: void on_map (); - + void on_show (); + private: IOSelector _selector; - /* overall operation buttons */ - - Gtk::Button ok_button; - Gtk::Button cancel_button; - Gtk::Button rescan_button; - Gtk::HBox button_box; - - void rescan (); - void cancel (); - void accept (); + void io_name_changed (void *src); + bool wm_delete (GdkEventAny*); }; -class PortInsertUI : public Gtk::VBox +class PortInsertUI : public Gtk::HBox { - public: - PortInsertUI (ARDOUR::Session&, boost::shared_ptr); - + public: + PortInsertUI (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr); + void redisplay (); void finished (IOSelector::Result); private: - - Gtk::HBox hbox; IOSelector input_selector; IOSelector output_selector; - }; class PortInsertWindow : public ArdourDialog { - public: - PortInsertWindow (ARDOUR::Session&, boost::shared_ptr, bool can_cancel=false); - + public: + PortInsertWindow (ARDOUR::Session *, boost::shared_ptr, bool can_cancel = false); + protected: void on_map (); - + private: - PortInsertUI _portinsertui; Gtk::VBox vbox; - + Gtk::Button ok_button; Gtk::Button cancel_button; - Gtk::Button rescan_button; Gtk::Frame button_frame; - Gtk::HBox button_box; - - void rescan (); + void cancel (); void accept (); void plugin_going_away (); + PBD::ScopedConnection going_away_connection; + + bool wm_delete (GdkEventAny*); }; -#endif /* __ardour_ui_io_selector_h__ */ +#endif