summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 11:36:33 +0000
committerSakari Bergen <sakari.bergen@beatwaves.net>2012-06-24 11:36:33 +0000
commit04416e2d1df3cc8d9f014765e5ca5ce818b7b4d7 (patch)
tree91db5e6aad9cee2eb624ccd6d8507c62f8f6a5cc /libs/ardour
parente58e614f2046bf6275a99c24c74a5795b6680a1f (diff)
In export format dialog, show preview of generated part of description. Fix to #0004941
git-svn-id: svn://localhost/ardour2/branches/3.0@12911 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/export_format_manager.h6
-rw-r--r--libs/ardour/ardour/export_format_specification.h2
-rw-r--r--libs/ardour/export_format_manager.cc26
-rw-r--r--libs/ardour/export_format_specification.cc6
4 files changed, 35 insertions, 5 deletions
diff --git a/libs/ardour/ardour/export_format_manager.h b/libs/ardour/ardour/export_format_manager.h
index 33a5553203..2b5d0ad804 100644
--- a/libs/ardour/ardour/export_format_manager.h
+++ b/libs/ardour/ardour/export_format_manager.h
@@ -85,6 +85,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
/* Signals */
PBD::Signal1<void,bool> CompleteChanged;
+ PBD::Signal0<void> DescriptionChanged;
/* Access to lists */
@@ -142,6 +143,7 @@ class ExportFormatManager : public PBD::ScopedConnectionList
bool pending_selection_change;
void selection_changed ();
+ void check_for_description_change ();
/* Formats and compatibilities */
@@ -154,13 +156,15 @@ class ExportFormatManager : public PBD::ScopedConnectionList
ExportFormatBasePtr get_compatibility_intersection ();
ExportFormatBasePtr universal_set;
- ExportFormatSpecPtr current_selection;
+ ExportFormatSpecPtr current_selection;
CompatList compatibilities;
QualityList qualities;
FormatList formats;
SampleRateList sample_rates;
+ std::string prev_description;
+
};
} // namespace ARDOUR
diff --git a/libs/ardour/ardour/export_format_specification.h b/libs/ardour/ardour/export_format_specification.h
index 4bf3ed4013..286aa58353 100644
--- a/libs/ardour/ardour/export_format_specification.h
+++ b/libs/ardour/ardour/export_format_specification.h
@@ -103,7 +103,7 @@ class ExportFormatSpecification : public ExportFormatBase {
PBD::UUID const & id () { return _id; }
std::string const & name () const { return _name; }
- std::string description ();
+ std::string description (bool include_name = true);
bool has_broadcast_info () const { return _has_broadcast_info; }
uint32_t channel_limit () const { return _channel_limit; }
diff --git a/libs/ardour/export_format_manager.cc b/libs/ardour/export_format_manager.cc
index ff115d4447..5bb04696b9 100644
--- a/libs/ardour/export_format_manager.cc
+++ b/libs/ardour/export_format_manager.cc
@@ -40,6 +40,8 @@ ExportFormatManager::ExportFormatManager (ExportFormatSpecPtr specification) :
init_qualities ();
init_formats ();
init_sample_rates ();
+
+ prev_description = current_selection->description();
}
ExportFormatManager::~ExportFormatManager ()
@@ -255,66 +257,77 @@ void
ExportFormatManager::set_name (string name)
{
current_selection->set_name (name);
+ check_for_description_change ();
}
void
ExportFormatManager::select_src_quality (ExportFormatBase::SRCQuality value)
{
current_selection->set_src_quality (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_with_cue (bool value)
{
current_selection->set_with_cue (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_with_toc (bool value)
{
current_selection->set_with_toc (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_trim_beginning (bool value)
{
current_selection->set_trim_beginning (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_silence_beginning (AnyTime const & time)
{
current_selection->set_silence_beginning (time);
+ check_for_description_change ();
}
void
ExportFormatManager::select_trim_end (bool value)
{
current_selection->set_trim_end (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_silence_end (AnyTime const & time)
{
current_selection->set_silence_end (time);
+ check_for_description_change ();
}
void
ExportFormatManager::select_normalize (bool value)
{
current_selection->set_normalize (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_normalize_target (float value)
{
current_selection->set_normalize_target (value);
+ check_for_description_change ();
}
void
ExportFormatManager::select_tagging (bool tag)
{
current_selection->set_tag (tag);
+ check_for_description_change ();
}
void
@@ -694,15 +707,26 @@ ExportFormatManager::selection_changed ()
}
- /* Signal completeness */
+ /* Signal completeness and possible description change */
CompleteChanged (current_selection->is_complete());
+ check_for_description_change ();
/* Reset pending state */
pending_selection_change = false;
}
+void
+ExportFormatManager::check_for_description_change ()
+{
+ std::string new_description = current_selection->description();
+ if (new_description == prev_description) { return; }
+
+ prev_description = new_description;
+ DescriptionChanged();
+}
+
ExportFormatManager::QualityPtr
ExportFormatManager::get_selected_quality ()
{
diff --git a/libs/ardour/export_format_specification.cc b/libs/ardour/export_format_specification.cc
index 763f507de4..9e57b7c406 100644
--- a/libs/ardour/export_format_specification.cc
+++ b/libs/ardour/export_format_specification.cc
@@ -524,11 +524,13 @@ ExportFormatSpecification::set_format (boost::shared_ptr<ExportFormat> format)
}
string
-ExportFormatSpecification::description ()
+ExportFormatSpecification::description (bool include_name)
{
string desc;
- desc = _name + ": ";
+ if (include_name) {
+ desc = _name + ": ";
+ }
if (_normalize) {
desc += _("normalize, ");