Change logic for compiling export format descriptions from incomplete formats

git-svn-id: svn://localhost/ardour2/branches/3.0@12917 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Sakari Bergen 2012-06-24 13:57:20 +00:00
parent 958fc23ed1
commit 0925abbc92
2 changed files with 37 additions and 32 deletions

View file

@ -720,10 +720,7 @@ ExportFormatDialog::update_with_toc ()
void void
ExportFormatDialog::update_description() ExportFormatDialog::update_description()
{ {
std::string text; std::string text = ": " + format->description(false);
if (format->is_complete()) {
text = ": " + format->description(false);
}
name_generated_part.set_text(text); name_generated_part.set_text(text);
} }

View file

@ -38,6 +38,7 @@ namespace ARDOUR
using namespace PBD; using namespace PBD;
using std::string; using std::string;
using std::list;
ExportFormatSpecification::Time & ExportFormatSpecification::Time &
ExportFormatSpecification::Time::operator= (AnyTime const & other) ExportFormatSpecification::Time::operator= (AnyTime const & other)
@ -526,64 +527,71 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
string string
ExportFormatSpecification::description (bool include_name) ExportFormatSpecification::description (bool include_name)
{ {
string desc; list<string> components;
if (include_name) {
desc = _name + ": ";
}
if (_normalize) { if (_normalize) {
desc += _("normalize, "); components.push_back (_("normalize, "));
} }
if (_trim_beginning && _trim_end) { if (_trim_beginning && _trim_end) {
desc += _("trim, "); components.push_back ( _("trim, "));
} else if (_trim_beginning) { } else if (_trim_beginning) {
desc += _("trim start, "); components.push_back (_("trim start, "));
} else if (_trim_end) { } else if (_trim_end) {
desc += _("trim end, "); components.push_back (_("trim end, "));
} }
desc += _format_name + ", "; if (_format_name != "") {
components.push_back (_format_name);
}
if (has_sample_format) { if (has_sample_format) {
desc += HasSampleFormat::get_sample_format_name (sample_format()) + ", "; components.push_back (HasSampleFormat::get_sample_format_name (sample_format()));
} }
switch (sample_rate()) { switch (sample_rate()) {
case SR_22_05: case SR_22_05:
desc += "22,5 kHz"; components.push_back ("22,5 kHz");
break; break;
case SR_44_1: case SR_44_1:
desc += "44,1 kHz"; components.push_back ("44,1 kHz");
break; break;
case SR_48: case SR_48:
desc += "48 kHz"; components.push_back ("48 kHz");
break; break;
case SR_88_2: case SR_88_2:
desc += "88,2 kHz"; components.push_back ("88,2 kHz");
break; break;
case SR_96: case SR_96:
desc += "96 kHz"; components.push_back ("96 kHz");
break; break;
case SR_192: case SR_192:
desc += "192 kHz"; components.push_back ("192 kHz");
break; break;
case SR_Session: case SR_Session:
desc += _("Session rate"); components.push_back (_("Session rate"));
break; break;
case SR_None: case SR_None:
break; break;
} }
if (_with_toc) { if (_with_toc) {
desc += ", TOC"; components.push_back ("TOC");
} }
if (_with_cue) { if (_with_cue) {
desc += ", CUE"; components.push_back ("CUE");
} }
string desc;
if (include_name) {
desc = _name + ": ";
}
for (list<string>::const_iterator it = components.begin(); it != components.end(); ++it) {
if (it != components.begin()) { desc += ", "; }
desc += *it;
}
return desc; return desc;
} }