summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-03-25 15:32:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-03-25 15:32:24 +0000
commit9b258045167a2e9a645d9451b435bd5dafe4b2ad (patch)
treeab08b7b7d3ea3a71c75f36c8240c1e4524a48bb6
parent39e6afb58230610e4b2df60668ff226ebd9374b1 (diff)
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
-rw-r--r--gtk2_ardour/ardour_ui.cc22
-rw-r--r--gtk2_ardour/ardour_ui.h1
-rw-r--r--gtk2_ardour/editor_markers.cc4
-rw-r--r--libs/ardour/ardour/configuration_vars.h2
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/audio_diskstream.cc4
-rw-r--r--libs/ardour/audiofilter.cc4
-rw-r--r--libs/ardour/audioregion.cc16
-rw-r--r--libs/ardour/import.cc4
-rw-r--r--libs/ardour/session.cc15
10 files changed, 61 insertions, 13 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 180b4701f6..a3ac097a5a 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -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 ()
{
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 7de4c1e28b..d8a4109923 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -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);
diff --git a/gtk2_ardour/editor_markers.cc b/gtk2_ardour/editor_markers.cc
index 3d2976602e..9e8bd7f1c2 100644
--- a/gtk2_ardour/editor_markers.cc
+++ b/gtk2_ardour/editor_markers.cc
@@ -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
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index e2fd95edd0..64ce8239ee 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -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 */
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index fa50212f3a..ea9ab014a8 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -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;
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 82ffb96155..33e7c373cd 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -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);
+ }
}
}
diff --git a/libs/ardour/audiofilter.cc b/libs/ardour/audiofilter.cc
index 6560cb892e..102e2024e0 100644
--- a/libs/ardour/audiofilter.cc
+++ b/libs/ardour/audiofilter.cc
@@ -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 */
diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc
index 497c41c7c5..be7c1fbb0d 100644
--- a/libs/ardour/audioregion.cc
+++ b/libs/ardour/audioregion.cc
@@ -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) {
diff --git a/libs/ardour/import.cc b/libs/ardour/import.cc
index c71d162dd3..2694acd9ab 100644
--- a/libs/ardour/import.cc
+++ b/libs/ardour/import.cc
@@ -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 */
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index d7c3c95d9d..56291e941e 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -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);