X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fio_selector.h;h=32946fb1b7718c4687eddd126ef0e005d104ee1b;hb=d936bdb3a8e55d26a238376d4b99f56ebeb582b1;hp=957db11a2b2cc8d6c5a6cbf0c73604989f2ebf71;hpb=aacf71589f8b586528235c488868f8fab9fe6ead;p=ardour.git diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index 957db11a2b..32946fb1b7 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,186 +20,121 @@ #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 (); + IOSelector (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr); - void redisplay (); - - enum Result { - Cancelled, - Accepted - }; - - sigc::signal Finished; + void set_state (ARDOUR::BundleChannel c[2], bool); + PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const; - protected: - ARDOUR::Session& session; - - private: - boost::shared_ptr io; - bool for_input; - ARDOUR::Port *selected_port; - sigc::connection page_selection_connection; + std::string disassociation_verb () const; + std::string channel_noun () const; - Gtk::VBox main_box; - Gtk::HBox port_and_selector_box; + uint32_t n_io_ports () const; + boost::shared_ptr const io () { return _io; } + void setup_ports (int); + bool list_is_global (int) const; - /* column model */ + bool find_inputs_for_io_outputs () const { + return _find_inputs_for_io_outputs; + } - struct PortDisplayModelColumns : public Gtk::TreeModel::ColumnRecord { + int ours () const { + return _ours; + } - PortDisplayModelColumns() { - add (displayed_name); - add (full_name); - } + int other () const { + return _other; + } - Gtk::TreeModelColumn displayed_name; - Gtk::TreeModelColumn full_name; - }; - - PortDisplayModelColumns port_display_columns; - - /* client/port selection */ - - 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 (); + private: - gint connection_button_release (GdkEventButton *, Gtk::TreeView*); + void setup_type (); + void io_changed (); + void io_changed_proxy (); - 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; + PBD::ScopedConnection _io_connection; }; -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; + boost::shared_ptr _pi; + + Gtk::ToggleButton latency_button; IOSelector input_selector; IOSelector output_selector; - + Gtk::Label latency_display; + Gtk::Frame latency_frame; + Gtk::HBox latency_hbox; + sigc::connection latency_timeout; + + bool check_latency_measurement (); + void latency_button_toggled (); }; 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 (); - sigc::connection going_away_connection; + PBD::ScopedConnection going_away_connection; + + bool wm_delete (GdkEventAny*); }; -#endif /* __ardour_ui_io_selector_h__ */ +#endif