Fix uninitialized variable
[ardour.git] / gtk2_ardour / sfdb_ui.cc
index 61905e209b2376412fb78ea2fe6a65e836852465..37a9126a8ca6916f419639bf1f683f992982740e 100644 (file)
@@ -21,8 +21,6 @@
 #include "gtk2ardour-config.h"
 #endif
 
-#include "pbd/i18n.h"
-
 #include <map>
 #include <cerrno>
 #include <sstream>
@@ -73,6 +71,8 @@
 
 #include "sfdb_freesound_mootcher.h"
 
+#include "pbd/i18n.h"
+
 using namespace ARDOUR;
 using namespace PBD;
 using namespace std;
@@ -153,10 +153,10 @@ SoundFileBox::SoundFileBox (bool /*persistent*/)
 
        preview_label.set_markup (_("<b>Sound File Information</b>"));
 
-       border_sample.set_label_widget (preview_label);
-       border_sample.add (main_box);
+       border_frame.set_label_widget (preview_label);
+       border_frame.add (main_box);
 
-       pack_start (border_sample, true, true);
+       pack_start (border_frame, true, true);
        set_border_width (6);
 
        main_box.set_border_width (6);
@@ -199,7 +199,7 @@ SoundFileBox::SoundFileBox (bool /*persistent*/)
        table.attach (timecode_clock, 1, 2, 5, 6, FILL, FILL);
        table.attach (tempomap_value, 1, 2, 6, 7, FILL, FILL);
 
-       length_clock.set_mode (ARDOUR_UI::instance()->secondary_clock->mode());
+       length_clock.set_mode (ARDOUR_UI::instance()->primary_clock->mode());
        timecode_clock.set_mode (AudioClock::Timecode);
 
        main_box.pack_start (table, false, false);
@@ -855,6 +855,7 @@ void
 SoundFileBrowser::on_show ()
 {
        ArdourWindow::on_show ();
+       reset_options ();
        start_metering ();
 }
 
@@ -2028,13 +2029,15 @@ SoundFileOmega::reset (uint32_t selected_audio_tracks, uint32_t selected_midi_tr
                chooser.set_filter (audio_and_midi_filter);
        }
 
-       reset_options ();
+       if (is_visible()) {
+               reset_options ();
+       }
 }
 
 void
 SoundFileOmega::file_selection_changed ()
 {
-       if (resetting_ourselves) {
+       if (resetting_ourselves || !is_visible ()) {
                return;
        }
 
@@ -2054,7 +2057,7 @@ SoundFileOmega::do_something (int action)
 {
        SoundFileBrowser::do_something (action);
 
-       if (action == RESPONSE_CLOSE) {
+       if (action == RESPONSE_CLOSE || !ARDOUR_UI_UTILS::engine_is_running ()) {
                hide ();
                return;
        }