Modify our MSVC project to accommodate newly introduced source files (libardour)
[ardour.git] / gtk2_ardour / sfdb_ui.cc
index 231498cda29d1bc5c37588d468e56596354a367d..4c96172f1625526ce2f6cb061c42c202406aed9c 100644 (file)
@@ -336,7 +336,7 @@ SoundFileBox::setup_labels (const string& filename)
                return false;
        }
 
-       preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename)).c_str()));
+       preview_label.set_markup (string_compose ("<b>%1</b>", Glib::Markup::escape_text (Glib::path_get_basename (filename))));
        std::string n = sf_info.format_name;
        if (n.substr (0, 8) == X_("Format: ")) {
                n = n.substr (8);
@@ -566,12 +566,12 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi
                chooser.add_shortcut_folder_uri("file:///Library/GarageBand/Apple Loops");
                chooser.add_shortcut_folder_uri("file:///Library/Audio/Apple Loops");
                chooser.add_shortcut_folder_uri("file:///Library/Application Support/GarageBand/Instrument Library/Sampler/Sampler Files");
-               chooser.add_shortcut_folder_uri("file:///Volumes");
        }
        catch (Glib::Error & e) {
                std::cerr << "sfdb.add_shortcut_folder() threw Glib::Error " << e.what() << std::endl;
        }
 #endif
+       Gtkmm2ext::add_volume_shortcuts (chooser);
 
        //add the file chooser
 
@@ -1293,6 +1293,11 @@ SoundFileOmega::reset_options_noret ()
 bool
 SoundFileOmega::reset_options ()
 {
+       if (_import_active) {
+               _reset_post_import = true;
+               return true;
+       }
+
        vector<string> paths = get_paths ();
 
        if (paths.empty()) {
@@ -1664,6 +1669,8 @@ SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s,
        , copy_files_btn ( _("Copy files to session"))
        , selected_audio_track_cnt (selected_audio_tracks)
        , selected_midi_track_cnt (selected_midi_tracks)
+       , _import_active (false)
+       , _reset_post_import (false)
 {
        VBox* vbox;
        HBox* hbox;
@@ -1977,10 +1984,19 @@ SoundFileOmega::do_something (int action)
 
        SrcQuality quality = get_src_quality();
 
+       _import_active = true;
+
        if (copy_files_btn.get_active()) {
                PublicEditor::instance().do_import (paths, chns, mode, quality, where, instrument);
        } else {
                PublicEditor::instance().do_embed (paths, chns, mode, where, instrument);
        }
+
+       _import_active = false;
+
+       if (_reset_post_import) {
+               _reset_post_import = false;
+               reset_options ();
+       }
 }