#include "pbd/convert.h"
-#include "ardour/audio_port.h"
#include "ardour/audio_track.h"
-#include "ardour/audioengine.h"
#include "ardour/audioregion.h"
#include "ardour/export_channel_configuration.h"
-#include "ardour/export_handler.h"
#include "ardour/io.h"
#include "ardour/route.h"
#include "ardour/session.h"
{
pack_start (vbox);
+ /* make fades+region gain be the default */
+
+ fades_button.set_active ();
+
raw_button.set_label (string_compose (_("Region contents without fades nor region gain (channels: %1)"), region_chans));
raw_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (raw_button);
RegionExportChannelSelector::sync_with_manager ()
{
state = manager->get_channel_configs().front();
+
+ if (!state) { return; }
+
+ switch (state->config->region_processing_type()) {
+ case RegionExportChannelFactory::None:
+ // Do nothing
+ break;
+ case RegionExportChannelFactory::Raw:
+ raw_button.set_active (true);
+ break;
+ case RegionExportChannelFactory::Fades:
+ fades_button.set_active (true);
+ break;
+ case RegionExportChannelFactory::Processed:
+ processed_button.set_active (true);
+ break;
+ }
+
handle_selection ();
}
state->config->clear_channels ();
+ RegionExportChannelFactory::Type type = RegionExportChannelFactory::None;
if (raw_button.get_active ()) {
- factory.reset (new RegionExportChannelFactory (_session, region, track, RegionExportChannelFactory::Raw));
+ type = RegionExportChannelFactory::Raw;
} else if (fades_button.get_active ()) {
- factory.reset (new RegionExportChannelFactory (_session, region, track, RegionExportChannelFactory::Fades));
+ type = RegionExportChannelFactory::Fades;
} else if (processed_button.get_active ()) {
- factory.reset (new RegionExportChannelFactory(_session, region, track, RegionExportChannelFactory::Processed));
+ type = RegionExportChannelFactory::Processed;
} else {
CriticalSelectionChanged ();
return;
}
+ factory.reset (new RegionExportChannelFactory (_session, region, track, type));
+ state->config->set_region_processing_type (type);
+
for (size_t chan = 0; chan < region_chans; ++chan) {
state->config->register_channel (factory->create (chan));
}
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);
RouteList routes = *_session->get_routes();
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
- Route * route = it->get();
- if(dynamic_cast<AudioTrack *>(route)) {
- add_track(route);
+ if (!boost::dynamic_pointer_cast<Track>(*it)) {
+ // not a track, must be a bus
+ if ((*it)->is_master () || (*it)->is_monitor ()) {
+ continue;
+ }
+ // not monitor or master bus
+ add_track (*it);
+ }
+ }
+ for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
+ if (boost::dynamic_pointer_cast<AudioTrack>(*it)) {
+ add_track (*it);
}
}
}
void
-TrackExportChannelSelector::add_track(Route * route)
+TrackExportChannelSelector::add_track (boost::shared_ptr<Route> route)
{
Gtk::TreeModel::iterator iter = track_list->append();
Gtk::TreeModel::Row row = *iter;
row[track_cols.selected] = true;
row[track_cols.label] = route->name();
- row[track_cols.track] = route;
+ row[track_cols.route] = route;
}
void
ExportProfileManager::ChannelConfigStatePtr state = manager->add_channel_config();
- Route * track = row[track_cols.track];
-
- /* Output of track code. TODO make this an option also
- uint32_t outs = track->n_ports().n_audio();
- for (uint32_t i = 0; i < outs; ++i) {
- AudioPort * port = track->audio (i);
- if(port) {
- ExportChannelPtr channel (new PortExportChannel ());
- PortExportChannel * pec = static_cast<PortExportChannel *> (channel.get());
- pec->add_port(port);
- state->config->register_channel(channel);
+ boost::shared_ptr<Route> route = row[track_cols.route];
+
+ 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<AudioPort> port = route->output()->audio (i);
+ if (port) {
+ ExportChannelPtr channel (new PortExportChannel ());
+ PortExportChannel * pec = static_cast<PortExportChannel *> (channel.get());
+ pec->add_port(port);
+ state->config->register_channel(channel);
+ }
}
+ } else {
+ std::list<ExportChannelPtr> list;
+ RouteExportChannel::create_from_route (list, route);
+ state->config->register_channels (list);
}
- */
- std::list<ExportChannelPtr> list;
- RouteExportChannel::create_from_route (list, *track);
- state->config->register_channels (list);
- state->config->set_name(track->name());
+ state->config->set_name (route->name());
}
CriticalSelectionChanged ();