Add warning if export truncates the channel-count
This commit is contained in:
parent
82d7d85192
commit
c1b72a289f
|
@ -114,6 +114,12 @@ PortExportChannelSelector::sync_with_manager ()
|
|||
channel_view.set_config (state->config);
|
||||
}
|
||||
|
||||
bool
|
||||
PortExportChannelSelector::channel_limit_reached () const
|
||||
{
|
||||
return channel_view.max_route_channel_count () > channel_view.channel_count ();
|
||||
}
|
||||
|
||||
void
|
||||
PortExportChannelSelector::fill_route_list ()
|
||||
{
|
||||
|
@ -457,6 +463,22 @@ PortExportChannelSelector::ChannelTreeView::update_selection_text (std::string c
|
|||
update_config ();
|
||||
}
|
||||
|
||||
uint32_t
|
||||
PortExportChannelSelector::ChannelTreeView::max_route_channel_count () const
|
||||
{
|
||||
uint32_t rv = 0;
|
||||
for (Gtk::ListStore::Children::const_iterator it = route_list->children().begin(); it != route_list->children().end(); ++it) {
|
||||
Gtk::TreeModel::Row row = *it;
|
||||
if (!row[route_cols.selected]) {
|
||||
continue;
|
||||
}
|
||||
ARDOUR::IO* io = row[route_cols.io];
|
||||
uint32_t outs = io->n_ports().n_audio();
|
||||
rv = std::max (rv, outs);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
RegionExportChannelSelector::RegionExportChannelSelector (ARDOUR::Session * _session,
|
||||
ProfileManagerPtr manager,
|
||||
ARDOUR::AudioRegion const & region,
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
virtual ~ExportChannelSelector () {}
|
||||
|
||||
virtual void sync_with_manager () = 0;
|
||||
virtual bool channel_limit_reached () const = 0;
|
||||
|
||||
sigc::signal<void> CriticalSelectionChanged;
|
||||
};
|
||||
|
@ -90,6 +91,7 @@ public:
|
|||
~PortExportChannelSelector ();
|
||||
|
||||
void sync_with_manager ();
|
||||
bool channel_limit_reached () const;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -183,6 +185,8 @@ private:
|
|||
void clear_routes () { route_list->clear (); }
|
||||
void add_route (ARDOUR::IO * route);
|
||||
void set_channel_count (uint32_t channels);
|
||||
uint32_t channel_count () const { return n_channels; }
|
||||
uint32_t max_route_channel_count () const;
|
||||
|
||||
sigc::signal<void> CriticalSelectionChanged;
|
||||
|
||||
|
@ -220,6 +224,7 @@ public:
|
|||
ARDOUR::AudioTrack & track);
|
||||
|
||||
virtual void sync_with_manager ();
|
||||
bool channel_limit_reached () const { return false; }
|
||||
|
||||
private:
|
||||
|
||||
|
@ -250,6 +255,7 @@ class TrackExportChannelSelector : public ExportChannelSelector
|
|||
virtual void sync_with_manager ();
|
||||
|
||||
bool track_output () const { return track_output_button.get_active(); }
|
||||
bool channel_limit_reached () const { return false; }
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -274,6 +274,11 @@ ExportDialog::update_warnings_and_example_filename ()
|
|||
add_warning (*it);
|
||||
}
|
||||
|
||||
/* add channel count warning */
|
||||
if (channel_selector && channel_selector->channel_limit_reached ()) {
|
||||
add_warning (_("A track or bus has more channels than the target."));
|
||||
}
|
||||
|
||||
if (!warnings->conflicting_filenames.empty()) {
|
||||
list_files_hbox.show ();
|
||||
for (std::list<string>::iterator it = warnings->conflicting_filenames.begin(); it != warnings->conflicting_filenames.end(); ++it) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user