X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fio_selector.h;h=9125a418caf45d88bbeb76243e454d8dff31893e;hb=b857756f6034f1d9baf4181e824a5166dfd1acc8;hp=957db11a2b2cc8d6c5a6cbf0c73604989f2ebf71;hpb=aacf71589f8b586528235c488868f8fab9fe6ead;p=ardour.git diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index 957db11a2b..9125a418ca 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 @@ -20,122 +20,63 @@ #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" 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; + IOSelector (ARDOUR::Session&, boost::shared_ptr, bool); + + void set_state (ARDOUR::BundleChannel c[2], bool); + State get_state (ARDOUR::BundleChannel c[2]) const; + + void add_channel (boost::shared_ptr); + bool can_remove_channels (int d) const { + return d == _ours; + } + void remove_channel (ARDOUR::BundleChannel); + bool can_rename_channels (int d) const { + return false; + } - private: - boost::shared_ptr io; - bool for_input; - ARDOUR::Port *selected_port; - sigc::connection page_selection_connection; - - 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); - } + uint32_t n_io_ports () const; + uint32_t maximum_io_ports () const; + uint32_t minimum_io_ports () const; + boost::shared_ptr const io () { return _io; } + void setup_ports (int); + bool list_is_global (int) const; - Gtk::TreeModelColumn displayed_name; - Gtk::TreeModelColumn full_name; - }; + bool find_inputs_for_io_outputs () const { + return _find_inputs_for_io_outputs; + } - PortDisplayModelColumns port_display_columns; + int ours () const { + return _ours; + } - /* client/port selection */ + int other () const { + return _other; + } - Gtk::Notebook notebook; - Gtk::Frame selector_frame; - Gtk::VBox selector_box; - Gtk::HBox selector_button_box; - /* ports */ - - 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; - - Glib::Mutex port_display_lock; - slist port_displays; - void display_ports (); - - void rescan (); - void clear_connections (); - - bool port_selection_changed(GdkEventButton *, Gtk::TreeView*); - - void ports_changed (ARDOUR::IOChange, void *); - void name_changed (void*); - - void add_port (); - void remove_port (); - void set_button_sensitivity (); - - gint connection_button_release (GdkEventButton *, Gtk::TreeView*); + private: - 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 { public: - IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr, bool for_input, bool can_cancel=false); - ~IOSelectorWindow (); + IOSelectorWindow (ARDOUR::Session&, boost::shared_ptr, bool for_input, bool can_cancel = false); IOSelector& selector() { return _selector; } @@ -147,14 +88,18 @@ class IOSelectorWindow : public ArdourDialog /* overall operation buttons */ + Gtk::Button add_button; + Gtk::Button disconnect_button; Gtk::Button ok_button; Gtk::Button cancel_button; Gtk::Button rescan_button; - Gtk::HBox button_box; - void rescan (); void cancel (); void accept (); + void rescan (); + + void ports_changed (); + void io_name_changed (void *src); }; @@ -167,23 +112,19 @@ class PortInsertUI : public Gtk::VBox 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); + PortInsertWindow (ARDOUR::Session&, boost::shared_ptr, bool can_cancel = false); protected: void on_map (); private: - PortInsertUI _portinsertui; Gtk::VBox vbox; @@ -191,9 +132,7 @@ class PortInsertWindow : public ArdourDialog Gtk::Button cancel_button; Gtk::Button rescan_button; Gtk::Frame button_frame; - Gtk::HBox button_box; - void rescan (); void cancel (); void accept (); @@ -202,4 +141,4 @@ class PortInsertWindow : public ArdourDialog }; -#endif /* __ardour_ui_io_selector_h__ */ +#endif