add new Session::Dialog signal for generic dialog interactions with unknown GUI; made auto-analyse-audio FALSE by default, with dialog warning about this when necessary; fixed #2134 (loop/punch stuff not updated on undo/redo)

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3182 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-03-25 15:32:24 +00:00
parent 39e6afb582
commit 9b25804516
10 changed files with 61 additions and 13 deletions

View file

@ -215,6 +215,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[])
ARDOUR::Diskstream::DiskOverrun.connect (mem_fun(*this, &ARDOUR_UI::disk_overrun_handler));
ARDOUR::Diskstream::DiskUnderrun.connect (mem_fun(*this, &ARDOUR_UI::disk_underrun_handler));
/* handle dialog requests */
ARDOUR::Session::Dialog.connect (mem_fun(*this, &ARDOUR_UI::session_dialog));
/* handle pending state with a dialog */
ARDOUR::Session::AskAboutPendingState.connect (mem_fun(*this, &ARDOUR_UI::pending_state_dialog));
@ -3010,6 +3014,24 @@ ARDOUR_UI::disk_speed_dialog_gone (int ignored_response, MessageDialog* msg)
delete msg;
}
void
ARDOUR_UI::session_dialog (std::string msg)
{
ENSURE_GUI_THREAD (bind (mem_fun(*this, &ARDOUR_UI::session_dialog), msg));
MessageDialog* d;
if (editor) {
d = new MessageDialog (*editor, msg, false, MESSAGE_INFO, BUTTONS_OK, true);
} else {
d = new MessageDialog (msg, false, MESSAGE_INFO, BUTTONS_OK, true);
}
d->show_all ();
d->run ();
delete d;
}
int
ARDOUR_UI::pending_state_dialog ()
{

View file

@ -670,6 +670,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI
void disk_overrun_handler ();
void disk_underrun_handler ();
void session_dialog (std::string);
int pending_state_dialog ();
int sr_mismatch_dialog (nframes_t, nframes_t);

View file

@ -328,7 +328,9 @@ Editor::refresh_location_display_internal (Locations::LocationList& locations)
i = tmp;
}
update_punch_range_view (false);
update_loop_range_view (false);
}
void

View file

@ -53,7 +53,7 @@ CONFIG_VARIABLE (float, track_buffer_seconds, "track-buffer-seconds", 5.0)
CONFIG_VARIABLE (uint32_t, disk_choice_space_threshold, "disk-choice-space-threshold", 57600000)
CONFIG_VARIABLE (SampleFormat, native_file_data_format, "native-file-data-format", ARDOUR::FormatFloat)
CONFIG_VARIABLE (HeaderFormat, native_file_header_format, "native-file-header-format", ARDOUR::WAVE)
CONFIG_VARIABLE (bool, auto_analyse_audio, "auto-analyse-audio", true)
CONFIG_VARIABLE (bool, auto_analyse_audio, "auto-analyse-audio", false)
/* OSC */

View file

@ -252,6 +252,8 @@ class Session : public PBD::StatefulDestructible
static sigc::signal<void> AutoBindingOn;
static sigc::signal<void> AutoBindingOff;
static sigc::signal<void,std::string> Dialog;
std::string sound_dir (bool with_path = true) const;
std::string peak_dir () const;
std::string dead_sound_dir () const;

View file

@ -1598,7 +1598,9 @@ AudioDiskstream::transport_stopped (struct tm& when, time_t twhen, bool abort_ca
s->update_header (capture_info.front()->start, when, twhen);
s->set_captured_for (_name);
s->mark_immutable ();
Analyser::queue_source_for_analysis (s, true);
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (s, true);
}
}
}

View file

@ -108,7 +108,9 @@ AudioFilter::finish (boost::shared_ptr<AudioRegion> region, SourceList& nsrcs, s
/* now that there is data there, requeue the file for analysis */
Analyser::queue_source_for_analysis (*si, false);
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (*si, false);
}
}
/* create a new region */

View file

@ -1590,7 +1590,17 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
return 0;
}
cerr << "startup analysis of " << _name << endl;
/* no existing/complete transient info */
if (!Config->get_auto_analyse_audio()) {
pl->session().Dialog (_("\
You have requested an operation that requires audio analysis.\n\n\
You currently have \"auto-analyse-audio\" disabled, which means\n\
that transient data must be generated every time it is required.\n\n\
If you are doing work that will require transient data on a\n\
regular basis, you should probably enable \"auto-analyse-audio\"\n\
then quit ardour and restart."));
}
TransientDetector t (pl->session().frame_rate());
bool existing_results = !results.empty();
@ -1604,14 +1614,10 @@ AudioRegion::get_transients (AnalysisFeatureList& results, bool force_new)
t.reset ();
cerr << "working on channel " << i << endl;
if (t.run ("", this, i, these_results)) {
return -1;
}
cerr << "done\n";
/* translate all transients to give absolute position */
for (AnalysisFeatureList::iterator i = these_results.begin(); i != these_results.end(); ++i) {

View file

@ -365,7 +365,9 @@ Session::import_audiofiles (import_status& status)
/* now that there is data there, requeue the file for analysis */
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
if (Config->get_auto_analyse_audio()) {
Analyser::queue_source_for_analysis (boost::static_pointer_cast<Source>(*x), false);
}
}
/* save state so that we don't lose these new Sources */

View file

@ -105,6 +105,7 @@ Session::apply_gain_to_buffer_t Session::apply_gain_to_buffer = 0;
Session::mix_buffers_with_gain_t Session::mix_buffers_with_gain = 0;
Session::mix_buffers_no_gain_t Session::mix_buffers_no_gain = 0;
sigc::signal<void,std::string> Session::Dialog;
sigc::signal<int> Session::AskAboutPendingState;
sigc::signal<int,nframes_t,nframes_t> Session::AskAboutSampleRateMismatch;
sigc::signal<void> Session::SendFeedback;
@ -1125,7 +1126,6 @@ Session::auto_loop_changed (Location* location)
}
last_loopend = location->end();
}
void
@ -1163,6 +1163,10 @@ Session::set_auto_punch_location (Location* location)
auto_punch_changed_connection = location->changed.connect (mem_fun (this, &Session::auto_punch_changed));
location->set_auto_punch (true, this);
auto_punch_changed (location);
auto_punch_location_changed (location);
}
@ -1202,6 +1206,13 @@ Session::set_auto_loop_location (Location* location)
auto_loop_changed_connection = location->changed.connect (mem_fun (this, &Session::auto_loop_changed));
location->set_auto_loop (true, this);
/* take care of our stuff first */
auto_loop_changed (location);
/* now tell everyone else */
auto_loop_location_changed (location);
}
@ -2895,8 +2906,6 @@ Session::remove_source (boost::weak_ptr<Source> src)
return;
}
cerr << "remove source for " << source->name() << endl;
{
Glib::Mutex::Lock lm (audio_source_lock);