Move panner bypass state up to the PannerShell so that it is preserved even when...
[ardour.git] / gtk2_ardour / export_format_dialog.cc
index cd34104d860deb9a05bd735c5be49246e3b53162..c8e139acceeca59fc01e567f05d1f813b4fa4824 100644 (file)
@@ -57,7 +57,7 @@ ExportFormatDialog::ExportFormatDialog (FormatPtr format, bool new_dialog) :
   sample_rate_label (_("Sample rate"), Gtk::ALIGN_LEFT),
   src_quality_label (_("Sample rate conversion quality:"), Gtk::ALIGN_RIGHT),
 
-  encoding_options_label (_(""), Gtk::ALIGN_LEFT),
+  encoding_options_label ("", Gtk::ALIGN_LEFT),
 
   /* Changing encoding options from here on */
 
@@ -210,7 +210,7 @@ ExportFormatDialog::set_session (ARDOUR::Session* s)
        if (sample_rate_view.get_selection()->count_selected_rows() == 0) {
                Gtk::ListStore::Children::iterator it;
                for (it = sample_rate_list->children().begin(); it != sample_rate_list->children().end(); ++it) {
-                       if ((nframes_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_frame_rate()) {
+                       if ((framecnt_t) (*it)->get_value (sample_rate_cols.ptr)->rate == _session->nominal_frame_rate()) {
                                sample_rate_view.get_selection()->select (it);
                                break;
                        }
@@ -228,11 +228,11 @@ ExportFormatDialog::load_state (FormatPtr spec)
 
        trim_start_checkbox.set_active (spec->trim_beginning());
        silence_start = spec->silence_beginning_time();
-       silence_start_checkbox.set_active (spec->silence_beginning() > 0);
+       silence_start_checkbox.set_active (spec->silence_beginning_time().not_zero());
 
        trim_end_checkbox.set_active (spec->trim_end());
        silence_end = spec->silence_end_time();
-       silence_end_checkbox.set_active (spec->silence_end() > 0);
+       silence_end_checkbox.set_active (spec->silence_end_time().not_zero());
 
        for (Gtk::ListStore::Children::iterator it = src_quality_list->children().begin(); it != src_quality_list->children().end(); ++it) {
                if (it->get_value (src_quality_cols.id) == spec->src_quality()) {
@@ -242,8 +242,12 @@ ExportFormatDialog::load_state (FormatPtr spec)
        }
 
        for (Gtk::ListStore::Children::iterator it = format_list->children().begin(); it != format_list->children().end(); ++it) {
-               if (it->get_value (format_cols.ptr)->get_format_id() == spec->format_id()) {
-                       it->get_value (format_cols.ptr)->set_selected (true);
+               boost::shared_ptr<ARDOUR::ExportFormat> format_in_list = it->get_value (format_cols.ptr);
+               if (format_in_list->get_format_id() == spec->format_id() &&
+                   // BWF has the same format id with wav, so we need to check this.
+                   format_in_list->has_broadcast_info() == spec->has_broadcast_info()) {
+
+                       format_in_list->set_selected (true);
                        break;
                }
        }
@@ -401,7 +405,7 @@ ExportFormatDialog::init_format_table ()
                row[sample_rate_cols.ptr] = *it;
                row[sample_rate_cols.color] = "white";
                row[sample_rate_cols.label] = (*it)->name();
-               
+
                WeakSampleRatePtr ptr (*it);
                (*it)->SelectChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_selection, this, _1, ptr), gui_context());
                (*it)->CompatibleChanged.connect (*this, invalidator (*this), ui_bind (&ExportFormatDialog::change_sample_rate_compatibility, this, _1, ptr), gui_context());
@@ -485,11 +489,11 @@ ExportFormatDialog::init_encoding_option_widgets ()
 }
 
 void
-ExportFormatDialog::update_compatibility_selection (Glib::ustring const & path)
+ExportFormatDialog::update_compatibility_selection (std::string const & path)
 {
 
        Gtk::TreeModel::iterator iter = compatibility_view.get_model ()->get_iter (path);
-       ExportFormatManager::CompatPtr ptr = iter->get_value (compatibility_cols.ptr);
+       ExportFormatCompatibilityPtr ptr = iter->get_value (compatibility_cols.ptr);
        bool state = iter->get_value (compatibility_cols.selected);
 
        iter->set_value (compatibility_cols.selected, state);
@@ -549,7 +553,7 @@ ExportFormatDialog::change_compatibility_selection (bool select, WeakCompatPtr c
 {
        ++applying_changes_from_engine;
 
-       ExportFormatManager::CompatPtr ptr = compat.lock();
+       ExportFormatCompatibilityPtr ptr = compat.lock();
 
        for (Gtk::ListStore::Children::iterator it = compatibility_list->children().begin(); it != compatibility_list->children().end(); ++it) {
                if (it->get_value (compatibility_cols.ptr) == ptr) {
@@ -572,7 +576,7 @@ ExportFormatDialog::change_format_selection (bool select, WeakFormatPtr format)
 {
        change_selection<ExportFormat, FormatCols> (select, format, format_list, format_view, format_cols);
 
-       ExportFormatManager::FormatPtr ptr = format.lock();
+       ExportFormatPtr ptr = format.lock();
 
        if (select && ptr) {
                change_encoding_options (ptr);
@@ -668,7 +672,7 @@ ExportFormatDialog::change_dither_type_compatibility (bool compatibility, WeakDi
 template<typename T, typename ColsT>
 void
 ExportFormatDialog::change_compatibility (bool compatibility, boost::weak_ptr<T> w_ptr, Glib::RefPtr<Gtk::ListStore> & list, ColsT & cols,
-                                          Glib::ustring const & c_incompatible, Glib::ustring const & c_compatible)
+                                          std::string const & c_incompatible, std::string const & c_compatible)
 {
        boost::shared_ptr<T> ptr = w_ptr.lock();
 
@@ -728,7 +732,7 @@ void
 ExportFormatDialog::update_clock (AudioClock & clock, ARDOUR::AnyTime const & time)
 {
        // TODO position
-       clock.set (_session->convert_to_frames_at (0, time), true);
+       clock.set (_session->convert_to_frames (time), true);
 
        AudioClock::Mode mode(AudioClock::Timecode);
 
@@ -757,7 +761,7 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock)
                return;
        }
 
-       nframes_t frames = clock.current_duration();
+       framecnt_t frames = clock.current_duration();
 
        switch (clock.mode()) {
          case AudioClock::Timecode:
@@ -776,9 +780,6 @@ ExportFormatDialog::update_time (AnyTime & time, AudioClock const & clock)
                time.type = AnyTime::Frames;
                time.frames = frames;
                break;
-         case AudioClock::Off:
-               silence_end_checkbox.set_active (false);
-               return;
        }
 }
 
@@ -797,7 +798,7 @@ ExportFormatDialog::update_tagging_selection ()
 }
 
 void
-ExportFormatDialog::change_encoding_options (ExportFormatManager::FormatPtr ptr)
+ExportFormatDialog::change_encoding_options (ExportFormatPtr ptr)
 {
        empty_encoding_option_table ();