X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fexport_channel_selector.h;h=6a1c4252a47a4e2ec0e3099ff7fe2f07ada0b8a6;hb=faca3e5f5d666fc543b23f6ab7b93a14f6c8ff7f;hp=14b614d5a9a32059541ac799ca819f8cb01ed574;hpb=ab47be7b5a99e34b7f125b16556d2295e480553b;p=ardour.git diff --git a/gtk2_ardour/export_channel_selector.h b/gtk2_ardour/export_channel_selector.h index 14b614d5a9..6a1c4252a4 100644 --- a/gtk2_ardour/export_channel_selector.h +++ b/gtk2_ardour/export_channel_selector.h @@ -43,25 +43,24 @@ namespace ARDOUR { class XMLNode; -class ExportChannelSelector : public Gtk::HBox +class ExportChannelSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr { protected: typedef boost::shared_ptr ChannelConfigPtr; typedef boost::shared_ptr ProfileManagerPtr; - - ARDOUR::Session * session; + ProfileManagerPtr manager; public: ExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) - : session (session) - , manager (manager) + : SessionHandlePtr (session) + , manager (manager) {} virtual ~ExportChannelSelector () {} - + virtual void sync_with_manager () = 0; - + sigc::signal CriticalSelectionChanged; }; @@ -72,7 +71,7 @@ class PortExportChannelSelector : public ExportChannelSelector PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager); ~PortExportChannelSelector (); - + void sync_with_manager (); private: @@ -93,101 +92,101 @@ class PortExportChannelSelector : public ExportChannelSelector Gtk::Label channels_label; Gtk::SpinButton channels_spinbutton; Gtk::CheckButton split_checkbox; - + /* Column record for channel selector view */ - + class RouteCols : public Gtk::TreeModelColumnRecord { public: - + struct Channel; - + RouteCols () : n_channels (0) { add (selected); add (name); add (io); add (port_list_col); } - + void add_channels (uint32_t chans); uint32_t n_channels; - + /* Channel count starts from one! */ - + Channel & get_channel (uint32_t channel); - + /* Static columns */ - + Gtk::TreeModelColumn selected; Gtk::TreeModelColumn name; Gtk::TreeModelColumn io; - + /* Combo list column (shared by all channels) */ - + typedef Gtk::TreeModelColumn > ComboCol; ComboCol port_list_col; - + /* Channel struct, that represents the selected port and it's name */ - + struct Channel { public: Channel (RouteCols & cols) { cols.add (port); cols.add (label); } - + Gtk::TreeModelColumn port; Gtk::TreeModelColumn label; }; std::list channels; - + /* List of available ports * Note: We need only one list of selectable ports per route, * so the list is kept in the column record */ - + /* Column record for selecting ports for a channel from a route */ - + class PortCols : public Gtk::TreeModel::ColumnRecord { public: PortCols () { add (selected); add(port); add(label); } - + Gtk::TreeModelColumn selected; // not used ATM Gtk::TreeModelColumn port; Gtk::TreeModelColumn label; }; PortCols port_cols; }; - + /* Channels view */ - + class ChannelTreeView : public Gtk::TreeView { public: - + ChannelTreeView (uint32_t max_channels); void set_config (ChannelConfigPtr c); - + /* Routes have to be added before adding channels */ - + void clear_routes () { route_list->clear (); } void add_route (ARDOUR::IO * route); void set_channel_count (uint32_t channels); - + sigc::signal CriticalSelectionChanged; - + private: - + ChannelConfigPtr config; void update_config (); - + /* Signal handlers for selections changes in the view */ - + void update_toggle_selection (Glib::ustring const & path); void update_selection_text (Glib::ustring const & path, Glib::ustring const & new_text, uint32_t channel); - + RouteCols route_cols; Glib::RefPtr route_list; - + uint32_t static_columns; uint32_t n_channels; }; - + uint32_t max_channels; - + Gtk::ScrolledWindow channel_scroller; Gtk::Alignment channel_alignment; ChannelTreeView channel_view; @@ -201,7 +200,7 @@ class RegionExportChannelSelector : public ExportChannelSelector ProfileManagerPtr manager, ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track); - + virtual void sync_with_manager (); private: @@ -212,14 +211,14 @@ class RegionExportChannelSelector : public ExportChannelSelector boost::shared_ptr factory; ARDOUR::AudioRegion const & region; ARDOUR::AudioTrack & track; - + uint32_t region_chans; uint32_t track_chans; - + /*** GUI components ***/ - + Gtk::VBox vbox; - + Gtk::RadioButtonGroup type_group; Gtk::RadioButton raw_button; Gtk::RadioButton fades_button;