mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
Consolidate Export Format/Spec comparision
This commit is contained in:
parent
1005fc5716
commit
e28e079c9f
3 changed files with 15 additions and 6 deletions
|
|
@ -79,6 +79,7 @@ class LIBARDOUR_API ExportFormatSpecification : public ExportFormatBase {
|
||||||
/* Modifying functions */
|
/* Modifying functions */
|
||||||
|
|
||||||
void set_format (boost::shared_ptr<ExportFormat> format);
|
void set_format (boost::shared_ptr<ExportFormat> format);
|
||||||
|
bool is_format (boost::shared_ptr<ExportFormat> format) const;
|
||||||
|
|
||||||
void set_name (std::string const & name) { _name = name; }
|
void set_name (std::string const & name) { _name = name; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -480,11 +480,7 @@ ExportFormatManager::change_format_selection (bool select, WeakExportFormatPtr c
|
||||||
|
|
||||||
if (select) {
|
if (select) {
|
||||||
select_format (ptr);
|
select_format (ptr);
|
||||||
} else if (ptr->get_format_id() == current_selection->format_id() &&
|
} else if (current_selection->is_format (ptr)) {
|
||||||
// BWF has the same format id with wav, so we need to check this.
|
|
||||||
ptr->has_broadcast_info () == current_selection->has_broadcast_info () &&
|
|
||||||
// Ogg can be Vorbis or OPUS
|
|
||||||
(ptr->get_format_id () != ExportFormatBase::F_Ogg || (ptr->get_explicit_sample_format () == current_selection->sample_format ()))) {
|
|
||||||
ptr.reset();
|
ptr.reset();
|
||||||
select_format (ptr);
|
select_format (ptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -581,12 +581,24 @@ ExportFormatSpecification::is_complete () const
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
ExportFormatSpecification::is_format (boost::shared_ptr<ExportFormat> format) const
|
||||||
|
{
|
||||||
|
assert (format);
|
||||||
|
return (format_id () == format->get_format_id () &&
|
||||||
|
/* BWF has the same format id with wav, so we need to check this. */
|
||||||
|
has_broadcast_info () == format->has_broadcast_info () &&
|
||||||
|
/* F_Ogg can be Vorbis or OPUS */
|
||||||
|
(format_id () != ExportFormatBase::F_Ogg || (format->get_explicit_sample_format () == sample_format ())));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
|
ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
|
||||||
{
|
{
|
||||||
if (format) {
|
if (format) {
|
||||||
FormatId new_fmt = format->get_format_id ();
|
FormatId new_fmt = format->get_format_id ();
|
||||||
bool fmt_changed = format_id() != new_fmt;
|
bool fmt_changed = !is_format (format);
|
||||||
|
|
||||||
set_format_id (new_fmt);
|
set_format_id (new_fmt);
|
||||||
|
|
||||||
set_type (format->get_type());
|
set_type (format->get_type());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue