make link (rubberband) work
[ardour.git] / gtk2_ardour / sfdb_ui.cc
index 6fa74e986cc352fed6f297137f32a1e9d7a3885b..b0b6a577f78a02d27286fb079a8cf6093bcb343f 100644 (file)
@@ -266,8 +266,10 @@ SoundFileBox::setup_labels (const ustring& filename)
                samplerate.set_name ("NewSessionSR2Label");
        }
 
-       length_clock.set (sf_info.length, true);
-       timecode_clock.set (sf_info.timecode, true);
+       double src_coef = (double) _session->nominal_frame_rate() / sf_info.samplerate;
+
+       length_clock.set (sf_info.length * src_coef + 0.5, true);
+       timecode_clock.set (sf_info.timecode * src_coef + 0.5, true);
 
        // this is a hack that is fixed in trunk, i think (august 26th, 2007)
 
@@ -399,21 +401,24 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
          found_list (ListStore::create(found_list_columns)),
          freesound_list (ListStore::create(freesound_list_columns)),
          chooser (FILE_CHOOSER_ACTION_OPEN),
-         found_list_view (found_list),
-         freesound_list_view (freesound_list),
          preview (persistent),
          found_search_btn (_("Search")),
-         freesound_search_btn (_("Start Downloading"))
-
+         found_list_view (found_list),
+         freesound_search_btn (_("Start Downloading")),
+         freesound_list_view (freesound_list)
 {
        resetting_ourselves = false;
        gm = 0;
 
+       resetting_ourselves = false;
+       gm = 0;
+
        if (ARDOUR::Profile->get_sae()) {
                chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
                chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
        }
        
+
        //add the file chooser
        {
                chooser.set_border_width (12);
@@ -426,14 +431,14 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
                
                matchall_filter.add_pattern ("*.*");
                matchall_filter.set_name (_("All files"));
-               
+
                chooser.add_filter (audio_filter);
                chooser.add_filter (midi_filter);
                chooser.add_filter (matchall_filter);
                chooser.set_select_multiple (true);
                chooser.signal_update_preview().connect(mem_fun(*this, &SoundFileBrowser::update_preview));
                chooser.signal_file_activated().connect (mem_fun (*this, &SoundFileBrowser::chooser_file_activated));
-               
+
                if (!persistent_folder.empty()) {
                        chooser.set_current_folder (persistent_folder);
                }
@@ -445,11 +450,6 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
                VBox* vbox;
                HBox* hbox;
 
-               hpacker.set_spacing (6);
-               hpacker.pack_start (notebook, true, true);
-               hpacker.pack_start (preview, false, false);
-
-               get_vbox()->pack_start (hpacker, true, true);
 
                hbox = manage(new HBox);
                hbox->pack_start (found_entry);
@@ -474,7 +474,6 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
 
                notebook.append_page (*vbox, _("Search Tags"));
        }
-       
 
        //add freesound search
 #ifdef FREESOUND
@@ -483,12 +482,6 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
                HBox* passbox;
                Label* label;
 
-               hpacker.set_spacing (6);
-               hpacker.pack_start (notebook, true, true);
-               hpacker.pack_start (preview, false, false);
-
-               get_vbox()->pack_start (hpacker, true, true);
-
                passbox = manage(new HBox);
                passbox->set_border_width (12);
                passbox->set_spacing (6);
@@ -522,10 +515,8 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
                
                //freesound_list_view.get_selection()->set_mode (SELECTION_MULTIPLE);
                freesound_list_view.signal_row_activated().connect (mem_fun (*this, &SoundFileBrowser::freesound_list_view_activated));
-
                freesound_search_btn.signal_clicked().connect(mem_fun(*this, &SoundFileBrowser::freesound_search_clicked));
                freesound_entry.signal_activate().connect(mem_fun(*this, &SoundFileBrowser::freesound_search_clicked));
-
                notebook.append_page (*vbox, _("Search Freesound"));
        }
 #endif
@@ -1083,11 +1074,9 @@ SoundFileOmega::check_info (const vector<ustring>& paths, bool& same_size, bool&
        for (vector<ustring>::const_iterator i = paths.begin(); i != paths.end(); ++i) {
 
                if (AudioFileSource::get_soundfile_info (*i, info, errmsg)) {
-               
                        if (info.channels > 1) {
                                multichannel = true;
                        }
-                       
                        if (sz == 0) {
                                sz = info.length;
                        } else {