X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fio_selector.h;h=c3500f1a1da66c8372c75e221e717e517889d351;hb=70d246fbe30d24197781384fa4825f32fb0f4235;hp=abc902ba4c1c4a1968e5ad5e9212edb45259f3ce;hpb=f5091b8db024c3499c72cac8694cde678e8f73bb;p=ardour.git diff --git a/gtk2_ardour/io_selector.h b/gtk2_ardour/io_selector.h index abc902ba4c..c3500f1a1d 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,168 +15,73 @@ 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__ +#ifndef __gtkardour_io_selector_h__ +#define __gtkardour_io_selector_h__ -#if __GNUC__ >= 3 -#include -using __gnu_cxx::slist; -#else -#include -#endif +#include "port_matrix.h" -#include -#include - -#include - -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&, ARDOUR::IO&, bool for_input); - ~IOSelector (); - - void redisplay (); - - enum Result { - Cancelled, - Accepted - }; - - sigc::signal Finished; - - protected: - ARDOUR::Session& session; - - private: - ARDOUR::IO& io; - bool for_input; - ARDOUR::Port *selected_port; - - Gtk::VBox main_box; - Gtk::HBox port_and_selector_box; - - /* client/port selection */ + IOSelector (Gtk::Window*, ARDOUR::Session *, boost::shared_ptr); - Gtk::Notebook notebook; - Gtk::Frame selector_frame; - Gtk::VBox selector_box; - Gtk::HBox selector_button_box; + void set_state (ARDOUR::BundleChannel c[2], bool); + PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const; - /* ports */ + std::string disassociation_verb () const; + std::string channel_noun () 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; + ARDOUR::Session* session() const { return _session; } - PBD::Lock port_display_lock; - slist port_displays; - void display_ports (); + uint32_t n_io_ports () const; + boost::shared_ptr const io () { return _io; } + void setup_ports (int); + bool list_is_global (int) const; - void rescan (); - void clear_connections (); + bool find_inputs_for_io_outputs () const { + return _find_inputs_for_io_outputs; + } - void port_selection_changed(); + int ours () const { + return _ours; + } - void ports_changed (ARDOUR::IOChange, void *); - void name_changed (void*); + int other () const { + return _other; + } - void add_port (); - void remove_port (); - gint remove_port_when_idle (ARDOUR::Port *); + private: - gint port_column_button_release (GdkEventButton*, Gtk::TreeView*); - gint connection_click (GdkEventButton *, Gtk::TreeView*); + void setup_type (); + void io_changed (); + void io_changed_proxy (); - void select_clist(Gtk::TreeView*); - void select_next_clist (); + 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&, ARDOUR::IO&, bool for_input, bool can_cancel=false); - ~IOSelectorWindow (); + IOSelectorWindow (ARDOUR::Session *, boost::shared_ptr, bool can_cancel = false); IOSelector& selector() { return _selector; } protected: - bool on_map (GdkEventAny *); - - private: - IOSelector _selector; - - Gtk::VBox vbox; - - /* overall operation buttons */ - - Gtk::Button ok_button; - Gtk::Button cancel_button; - Gtk::Button rescan_button; - Gtk::HBox button_box; + void on_map (); + void on_show (); - void rescan (); - void cancel (); - void accept (); -}; - - -class PortInsertUI : public Gtk::VBox -{ - public: - PortInsertUI (ARDOUR::Session&, ARDOUR::PortInsert&); - - void redisplay (); - void finished (IOSelector::Result); - - private: - - Gtk::HBox hbox; - IOSelector input_selector; - IOSelector output_selector; - -}; - -class PortInsertWindow : public ArdourDialog -{ - public: - PortInsertWindow (ARDOUR::Session&, ARDOUR::PortInsert&, bool can_cancel=false); - - protected: - bool on_map (GdkEventAny *); - 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 (); + IOSelector _selector; - void plugin_going_away (ARDOUR::Redirect*); + void io_name_changed (void *src); + bool wm_delete (GdkEventAny*); }; - -#endif /* __ardour_ui_io_selector_h__ */ +#endif /* __gtkardour_io_selector_h__ */