#include <algorithm>
-#include <pbd/convert.h>
+#include "pbd/convert.h"
-#include <ardour/audio_port.h>
-#include <ardour/audio_track.h>
-#include <ardour/audioengine.h>
-#include <ardour/export_channel_configuration.h>
-#include <ardour/export_handler.h>
-#include <ardour/io.h>
-#include <ardour/route.h>
-#include <ardour/session.h>
+#include "ardour/audio_port.h"
+#include "ardour/audio_track.h"
+#include "ardour/audioengine.h"
+#include "ardour/export_channel_configuration.h"
+#include "ardour/export_handler.h"
+#include "ardour/io.h"
+#include "ardour/route.h"
+#include "ardour/session.h"
#include <sstream>
#include "i18n.h"
+using namespace std;
+using namespace Glib;
using namespace ARDOUR;
using namespace PBD;
-PortExportChannelSelector::PortExportChannelSelector () :
+PortExportChannelSelector::PortExportChannelSelector (ARDOUR::Session * session, ProfileManagerPtr manager) :
+ ExportChannelSelector (session, manager),
channels_label (_("Channels:"), Gtk::ALIGN_LEFT),
split_checkbox (_("Split to mono files")),
max_channels (20),
channel_view (max_channels)
{
-
channels_hbox.pack_start (channels_label, false, false, 0);
channels_hbox.pack_end (channels_spinbutton, false, false, 0);
/* Finalize */
+ sync_with_manager();
show_all_children ();
}
}
void
-PortExportChannelSelector::set_state (ARDOUR::ExportProfileManager::ChannelConfigStatePtr const state_, ARDOUR::Session * session_)
+PortExportChannelSelector::sync_with_manager ()
{
- state = state_;
- session = session_;
+ state = manager->get_channel_configs().front();
split_checkbox.set_active (state->config->get_split());
channels_spinbutton.set_value (state->config->get_n_chans());
/* Add master bus and then everything else */
- ARDOUR::IO * master = session->master_out().get();
+ ARDOUR::IO* master = session->master_out()->output().get();
channel_view.add_route (master);
for (RouteList::iterator it = routes.begin(); it != routes.end(); ++it) {
- if (it->get() == master) {
+ if ((*it)->output().get() == master) {
continue;
}
- channel_view.add_route (it->get());
+ channel_view.add_route ((*it)->output().get());
}
update_channel_count ();
}
void
-PortExportChannelSelector::ChannelTreeView::add_route (ARDOUR::IO * route)
+PortExportChannelSelector::ChannelTreeView::add_route (ARDOUR::IO * io)
{
Gtk::TreeModel::iterator iter = route_list->append();
Gtk::TreeModel::Row row = *iter;
row[route_cols.selected] = false;
- row[route_cols.name] = route->name();
- row[route_cols.io] = route;
+ row[route_cols.name] = io->name();
+ row[route_cols.io] = io;
/* Initialize port list */
Glib::RefPtr<Gtk::ListStore> port_list = Gtk::ListStore::create (route_cols.port_cols);
row[route_cols.port_list_col] = port_list;
- uint32_t outs = route->n_outputs().n_audio();
+ uint32_t outs = io->n_ports().n_audio();
for (uint32_t i = 0; i < outs; ++i) {
iter = port_list->append();
row = *iter;
row[route_cols.port_cols.selected] = false;
- row[route_cols.port_cols.port] = route->audio_output (i);
+ row[route_cols.port_cols.port] = io->audio (i);
std::ostringstream oss;
oss << "Out-" << (i + 1);
update_config ();
}
-RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::AudioRegion const & region, ARDOUR::AudioTrack & track) :
- session (0),
+RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::Session * session,
+ ProfileManagerPtr manager,
+ ARDOUR::AudioRegion const & region,
+ ARDOUR::AudioTrack & track) :
+ ExportChannelSelector (session, manager),
region (region),
track (track),
region_chans (region.n_channels()),
processed_button.signal_toggled ().connect (sigc::mem_fun (*this, &RegionExportChannelSelector::handle_selection));
vbox.pack_start (processed_button);
+ sync_with_manager();
vbox.show_all_children ();
show_all_children ();
}
void
-RegionExportChannelSelector::set_state (ARDOUR::ExportProfileManager::ChannelConfigStatePtr const state_, ARDOUR::Session * session_)
+RegionExportChannelSelector::sync_with_manager ()
{
- state = state_;
- session = session_;
-
+ state = manager->get_channel_configs().front();
handle_selection ();
}