X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_format_manager.cc;h=08238ff710bec09bbbaf59cc78143de2f9fca42e;hb=79db9422ac70605cb3b706c3a19cf1c4e00af2f1;hp=c77e301a23a4238985a57ffec5135151e514b4e6;hpb=7468fdb9ca9892cec9b298690bf0edf3655d6453;p=ardour.git diff --git a/libs/ardour/export_format_manager.cc b/libs/ardour/export_format_manager.cc index c77e301a23..08238ff710 100644 --- a/libs/ardour/export_format_manager.cc +++ b/libs/ardour/export_format_manager.cc @@ -20,7 +20,6 @@ #include "ardour/export_format_manager.h" -#include "ardour/types.h" #include "ardour/export_format_specification.h" #include "ardour/export_format_compatibility.h" @@ -41,6 +40,8 @@ ExportFormatManager::ExportFormatManager (ExportFormatSpecPtr specification) : init_qualities (); init_formats (); init_sample_rates (); + + prev_description = current_selection->description(); } ExportFormatManager::~ExportFormatManager () @@ -204,6 +205,7 @@ void ExportFormatManager::init_sample_rates () { add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_Session, _("Session rate")))); + add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_8, "8 kHz"))); add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_22_05, "22,05 kHz"))); add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_44_1, "44,1 kHz"))); add_sample_rate (SampleRatePtr (new SampleRateState (ExportFormatBase::SR_48, "48 kHz"))); @@ -239,7 +241,7 @@ ExportFormatManager::add_format (ExportFormatPtr ptr) boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (ptr)) { + if ((hsf = boost::dynamic_pointer_cast (ptr))) { hsf->SampleFormatSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_sample_format_selection, this, _1, _2)); hsf->DitherTypeSelectChanged.connect_same_thread (*this, boost::bind (&ExportFormatManager::change_dither_type_selection, this, _1, _2)); } @@ -256,54 +258,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 @@ -670,7 +695,7 @@ ExportFormatManager::selection_changed () } boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast (get_selected_format()))) { SampleFormatList sf_list = hsf->get_sample_formats(); for (SampleFormatList::iterator it = sf_list.begin(); it != sf_list.end(); ++it) { @@ -683,15 +708,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 () { @@ -735,7 +771,7 @@ ExportFormatManager::get_selected_sample_format () { boost::shared_ptr hsf; - if (hsf = boost::dynamic_pointer_cast (get_selected_format())) { + if ((hsf = boost::dynamic_pointer_cast (get_selected_format()))) { return hsf->get_selected_sample_format (); } else { return SampleFormatPtr ();