X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Fexport_channel_selector.h;h=1be8ec3547e3776c8277f7386b3da08c0be3ffba;hb=6c19a776f43b4a9869780e3312764d039a16cd39;hp=9f1217c53d9fb076454152e8d6c5832ad002f033;hpb=e0aaed6d65f160c328cb8b56d7c6552ee15d65e2;p=ardour.git diff --git a/gtk2_ardour/export_channel_selector.h b/gtk2_ardour/export_channel_selector.h index 9f1217c53d..1be8ec3547 100644 --- a/gtk2_ardour/export_channel_selector.h +++ b/gtk2_ardour/export_channel_selector.h @@ -24,12 +24,25 @@ #include #include "ardour/export_profile_manager.h" -#include "ardour/export_channel.h" -#include +#ifdef interface +#undef interface +#endif + #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + namespace ARDOUR { class Session; class ExportChannelConfiguration; @@ -43,30 +56,38 @@ namespace ARDOUR { class XMLNode; -class ExportChannelSelector : public Gtk::HBox +class ExportChannelSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr { - protected: +protected: typedef boost::shared_ptr ChannelConfigPtr; - typedef boost::shared_ptr HandlerPtr; + typedef std::list ChannelConfigList; + typedef boost::shared_ptr ProfileManagerPtr; + + ProfileManagerPtr manager; + +public: + ExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) + : SessionHandlePtr (session) + , manager (manager) + {} - public: virtual ~ExportChannelSelector () {} - - virtual void set_state (ARDOUR::ExportProfileManager::ChannelConfigStatePtr const state_, ARDOUR::Session * session_) = 0; + + virtual void sync_with_manager () = 0; + sigc::signal CriticalSelectionChanged; }; class PortExportChannelSelector : public ExportChannelSelector { +public: - public: - - PortExportChannelSelector (); + PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager); ~PortExportChannelSelector (); - - void set_state (ARDOUR::ExportProfileManager::ChannelConfigStatePtr const state_, ARDOUR::Session * session_); - private: + void sync_with_manager (); + +private: void fill_route_list (); void update_channel_count (); @@ -74,7 +95,6 @@ class PortExportChannelSelector : public ExportChannelSelector typedef std::list CahnnelList; - ARDOUR::Session * session; ARDOUR::ExportProfileManager::ChannelConfigStatePtr state; /*** GUI stuff ***/ @@ -85,101 +105,102 @@ 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: - + public: + struct Channel; - + RouteCols () : n_channels (0) - { add (selected); add (name); add (io); add (port_list_col); } - + { 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 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 */ - + + /* Channel struct, that represents the selected port and its name */ + struct Channel { - public: + public: Channel (RouteCols & cols) { cols.add (port); cols.add (label); } - - Gtk::TreeModelColumn port; - Gtk::TreeModelColumn 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; + 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: - + + 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: - + + 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); - + + void update_toggle_selection (std::string const & path); + void update_selection_text (std::string const & path, std::string 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; @@ -188,32 +209,81 @@ class PortExportChannelSelector : public ExportChannelSelector class RegionExportChannelSelector : public ExportChannelSelector { - public: - RegionExportChannelSelector (ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track); - - virtual void set_state (ARDOUR::ExportProfileManager::ChannelConfigStatePtr const state_, ARDOUR::Session * session_); +public: + RegionExportChannelSelector (ARDOUR::Session * session, + ProfileManagerPtr manager, + ARDOUR::AudioRegion const & region, + ARDOUR::AudioTrack & track); - private: + virtual void sync_with_manager (); + +private: void handle_selection (); - ARDOUR::Session * session; ARDOUR::ExportProfileManager::ChannelConfigStatePtr state; 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; Gtk::RadioButton processed_button; }; +class TrackExportChannelSelector : public ExportChannelSelector +{ + public: + TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager); + + virtual void sync_with_manager (); + + bool track_output () const { return track_output_button.get_active(); } + + private: + + void fill_list(); + void add_track (boost::shared_ptr route); + void update_config(); + ChannelConfigList configs; + + Gtk::VBox main_layout; + + struct TrackCols : public Gtk::TreeModelColumnRecord + { + public: + Gtk::TreeModelColumn > route; + Gtk::TreeModelColumn label; + Gtk::TreeModelColumn selected; + Gtk::TreeModelColumn order_key; + + TrackCols () { add (route); add(label); add(selected); add(order_key); } + }; + TrackCols track_cols; + + Glib::RefPtr track_list; + Gtk::TreeView track_view; + + Gtk::ScrolledWindow track_scroller; + + Gtk::HBox options_box; + Gtk::CheckButton track_output_button; + Gtk::Button select_tracks_button; + Gtk::Button select_busses_button; + Gtk::Button select_none_button; + void select_tracks (); + void select_busses (); + void select_none (); + + void track_outputs_selected (); +}; + #endif /* __export_channel_selector_h__ */