X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gtk2_ardour%2Fsfdb_ui.cc;h=d8a88438490ddff9608bca0fafedc854df9fe721;hb=331d9f7154267ee7efea0f51fb140828d308fd9a;hp=c2bd388d6cb5f83014cb445916473c2214650bc7;hpb=696b89b71a895dff732c734cdaa30a2e119292c8;p=ardour.git diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index c2bd388d6c..d8a8843849 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -560,18 +560,18 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi , gm (0) { -#ifdef GTKOSX +#ifdef __APPLE__ try { /* add_shortcut_folder throws an exception if the folder being added already has a shortcut */ 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 @@ -597,7 +597,7 @@ SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persi chooser.signal_update_preview().connect(sigc::mem_fun(*this, &SoundFileBrowser::update_preview)); chooser.signal_file_activated().connect (sigc::mem_fun (*this, &SoundFileBrowser::chooser_file_activated)); -#ifdef GTKOSX +#ifdef __APPLE__ /* some broken redraw behaviour - this is a bandaid */ chooser.signal_selection_changed().connect (mem_fun (chooser, &Widget::queue_draw)); #endif @@ -832,7 +832,7 @@ SoundFileBrowser::add_gain_meter () boost::shared_ptr r = _session->the_auditioner (); - gm->set_controls (r, r->shared_peak_meter(), r->amp()); + gm->set_controls (r, r->shared_peak_meter(), r->amp(), r->gain_control()); gm->set_fader_name (X_("GainFader")); meter_packer.set_border_width (12); @@ -1091,7 +1091,7 @@ SoundFileBrowser::freesound_search() std::string theString = mootcher.searchText( search_string, freesound_page, -#ifdef GTKOSX +#ifdef __APPLE__ "", // OSX eats anything incl mp3 #else "type:wav OR type:aiff OR type:flac OR type:aif OR type:ogg OR type:oga", @@ -1293,6 +1293,11 @@ SoundFileOmega::reset_options_noret () bool SoundFileOmega::reset_options () { + if (_import_active) { + _reset_post_import = true; + return true; + } + vector 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 (); + } }