summaryrefslogtreecommitdiff
path: root/libs/ardour/export_format_specification.cc
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 13:57:20 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 13:57:20 +0000
commit0925abbc92bab66224b8886dcc21e6f2d4641afa (patch)
treef6628aba8a8fed3b2709bdcba95998dca7cce877 /libs/ardour/export_format_specification.cc
parent958fc23ed1d35318990b19685e715748181c06be (diff)
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
Diffstat (limited to 'libs/ardour/export_format_specification.cc')
-rw-r--r--libs/ardour/export_format_specification.cc64
1 files changed, 36 insertions, 28 deletions
diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc
index 9e57b7c406..66deabc623 100644
--- a/libs/ardour/export_format_specification.cc
+++ b/libs/ardour/export_format_specification.cc
@@ -38,6 +38,7 @@ namespace ARDOUR
using namespace PBD;
using std::string;
+using std::list;
ExportFormatSpecification::Time &
ExportFormatSpecification::Time::operator= (AnyTime const & other)
@@ -526,64 +527,71 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
string
ExportFormatSpecification::description (bool include_name)
{
- string desc;
-
- if (include_name) {
- desc = _name + ": ";
- }
+ list<string> components;
if (_normalize) {
- desc += _("normalize, ");
+ components.push_back (_("normalize, "));
}
if (_trim_beginning && _trim_end) {
- desc += _("trim, ");
+ components.push_back ( _("trim, "));
} else if (_trim_beginning) {
- desc += _("trim start, ");
+ components.push_back (_("trim start, "));
} 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) {
- desc += HasSampleFormat::get_sample_format_name (sample_format()) + ", ";
+ components.push_back (HasSampleFormat::get_sample_format_name (sample_format()));
}
switch (sample_rate()) {
- case SR_22_05:
- desc += "22,5 kHz";
+ case SR_22_05:
+ components.push_back ("22,5 kHz");
break;
- case SR_44_1:
- desc += "44,1 kHz";
+ case SR_44_1:
+ components.push_back ("44,1 kHz");
break;
- case SR_48:
- desc += "48 kHz";
+ case SR_48:
+ components.push_back ("48 kHz");
break;
- case SR_88_2:
- desc += "88,2 kHz";
+ case SR_88_2:
+ components.push_back ("88,2 kHz");
break;
- case SR_96:
- desc += "96 kHz";
+ case SR_96:
+ components.push_back ("96 kHz");
break;
- case SR_192:
- desc += "192 kHz";
+ case SR_192:
+ components.push_back ("192 kHz");
break;
- case SR_Session:
- desc += _("Session rate");
+ case SR_Session:
+ components.push_back (_("Session rate"));
break;
- case SR_None:
+ case SR_None:
break;
}
if (_with_toc) {
- desc += ", TOC";
+ components.push_back ("TOC");
}
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;
}