From 010a75d389fe0d7c42d93733af6d02d985d039ec Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Sun, 24 Mar 2013 21:53:34 +0200 Subject: [PATCH] Add option to export track output to stem export dialog --- gtk2_ardour/export_channel_selector.cc | 41 +++++++++++++++++--------- gtk2_ardour/export_channel_selector.h | 10 +++++-- 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/gtk2_ardour/export_channel_selector.cc b/gtk2_ardour/export_channel_selector.cc index 6b90f7a36c..6f32ae783e 100644 --- a/gtk2_ardour/export_channel_selector.cc +++ b/gtk2_ardour/export_channel_selector.cc @@ -527,13 +527,25 @@ RegionExportChannelSelector::handle_selection () CriticalSelectionChanged (); } +/* Track export channel selector */ + TrackExportChannelSelector::TrackExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) : ExportChannelSelector(session, manager) + , region_contents_button(source_group, _("Export region contents")) + , track_output_button(source_group, _("Export track output")) { + pack_start(main_layout); + + // Options + options_box.pack_start(region_contents_button); + options_box.pack_start(track_output_button); + main_layout.pack_start(options_box); + + // Track scroller track_scroller.add (track_view); track_scroller.set_size_request (-1, 130); track_scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - pack_start(track_scroller); + main_layout.pack_start(track_scroller); // Track list track_list = Gtk::ListStore::create (track_cols); @@ -613,22 +625,23 @@ TrackExportChannelSelector::update_config() boost::shared_ptr route = row[track_cols.route]; - /* Output of track code. TODO make this an option also - uint32_t outs = route->n_ports().n_audio(); - for (uint32_t i = 0; i < outs; ++i) { - AudioPort * port = route->audio (i); - if (port) { - ExportChannelPtr channel (new PortExportChannel ()); - PortExportChannel * pec = static_cast (channel.get()); - pec->add_port(port); - state->config->register_channel(channel); + if (track_output_button.get_active()) { + uint32_t outs = route->n_outputs().n_audio(); + for (uint32_t i = 0; i < outs; ++i) { + boost::shared_ptr port = route->output()->audio (i); + if (port) { + ExportChannelPtr channel (new PortExportChannel ()); + PortExportChannel * pec = static_cast (channel.get()); + pec->add_port(port); + state->config->register_channel(channel); + } } + } else { + std::list list; + RouteExportChannel::create_from_route (list, route); + state->config->register_channels (list); } - */ - std::list list; - RouteExportChannel::create_from_route (list, route); - state->config->register_channels (list); state->config->set_name (route->name()); } diff --git a/gtk2_ardour/export_channel_selector.h b/gtk2_ardour/export_channel_selector.h index 79e943a569..984026a748 100644 --- a/gtk2_ardour/export_channel_selector.h +++ b/gtk2_ardour/export_channel_selector.h @@ -235,15 +235,17 @@ class TrackExportChannelSelector : public ExportChannelSelector private: void fill_list(); - void add_track (boost::shared_ptr route); + 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 > route; Gtk::TreeModelColumn label; Gtk::TreeModelColumn selected; @@ -256,6 +258,10 @@ class TrackExportChannelSelector : public ExportChannelSelector Gtk::ScrolledWindow track_scroller; + Gtk::HBox options_box; + Gtk::RadioButton::Group source_group; + Gtk::RadioButton region_contents_button; + Gtk::RadioButton track_output_button; }; #endif /* __export_channel_selector_h__ */