summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-02-23 14:13:25 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-02-23 14:13:25 +0000
commit770c39dce16598835ae4c9e970c11fb6edfde348 (patch)
tree13aa3fbe60d405db018ee070cf1f5a54c28edc89 /libs
parent33690d3e728d50335d0a0720020e15db29aa3815 (diff)
fix up meter thread management when JACK client starts/stops/is halted ; put focus in plugin search entry when plugin selector is shown ; add WINDOWS_KEY option to gtk2_ardour/SConscript, controlling what X modifier is used for LEVEL4 modifier/bindings ; fix up Keyboard object to properly support LEVEL4 bindings ; fix Playlist::partition_internal() to avoid acting on regions that should not be operated on given the range provided ; fix up more stuff relating to get_regions_for(), including cut/delete ops on edit range vs. regions
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3115 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/audioengine.cc15
-rw-r--r--libs/ardour/crossfade.cc2
-rw-r--r--libs/ardour/io.cc5
-rw-r--r--libs/ardour/playlist.cc21
4 files changed, 30 insertions, 13 deletions
diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc
index dfa456cdcc..d057a31cea 100644
--- a/libs/ardour/audioengine.cc
+++ b/libs/ardour/audioengine.cc
@@ -77,9 +77,6 @@ AudioEngine::AudioEngine (string client_name)
if (connect_to_jack (client_name)) {
throw NoBackendAvailable ();
}
-
- start_metering_thread();
-
}
AudioEngine::~AudioEngine ()
@@ -157,6 +154,8 @@ AudioEngine::start ()
} else {
// error << _("cannot activate JACK client") << endmsg;
}
+
+ start_metering_thread();
}
return _running ? 0 : -1;
@@ -167,11 +166,11 @@ AudioEngine::stop (bool forever)
{
if (_running) {
_running = false;
+ stop_metering_thread ();
if (forever) {
jack_client_t* foo = _jack;
_jack = 0;
jack_client_close (foo);
- stop_metering_thread ();
} else {
jack_deactivate (_jack);
}
@@ -421,8 +420,9 @@ void
AudioEngine::start_metering_thread ()
{
if (m_meter_thread == 0) {
+ g_atomic_int_set (&m_meter_exit, 0);
m_meter_thread = Glib::Thread::create (sigc::mem_fun(this, &AudioEngine::meter_thread),
- 500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
+ 500000, true, true, Glib::THREAD_PRIORITY_NORMAL);
}
}
@@ -801,6 +801,8 @@ AudioEngine::halted (void *arg)
AudioEngine* ae = static_cast<AudioEngine *> (arg);
bool was_running = ae->_running;
+ ae->stop_metering_thread ();
+
ae->_running = false;
ae->_buffer_size = 0;
ae->_frame_rate = 0;
@@ -1110,6 +1112,7 @@ AudioEngine::disconnect_from_jack ()
_frame_rate = 0;
if (_running) {
+ stop_metering_thread ();
_running = false;
Stopped(); /* EMIT SIGNAL */
}
@@ -1214,6 +1217,8 @@ AudioEngine::reconnect_to_jack ()
Running (); /* EMIT SIGNAL*/
+ start_metering_thread ();
+
return 0;
}
diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc
index e1df8228ce..f2641a43e2 100644
--- a/libs/ardour/crossfade.cc
+++ b/libs/ardour/crossfade.cc
@@ -81,7 +81,7 @@ Crossfade::Crossfade (boost::shared_ptr<AudioRegion> in, boost::shared_ptr<Audio
{
_in = in;
_out = out;
-
+
_length = length;
_position = position;
_anchor_point = ap;
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 7b2838d8fe..3f9a8b29e3 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -2446,9 +2446,8 @@ IO::setup_peak_meters ()
void
IO::update_meters()
{
- Glib::Mutex::Lock guard (m_meter_signal_lock);
-
- Meter();
+ Glib::Mutex::Lock guard (m_meter_signal_lock);
+ Meter();
}
void
diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc
index 55b30b6c70..3bee54babb 100644
--- a/libs/ardour/playlist.cc
+++ b/libs/ardour/playlist.cc
@@ -694,18 +694,27 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
++tmp;
current = *i;
-
- if (current->first_frame() == start && current->last_frame() == end) {
+
+ if (current->first_frame() >= start && current->last_frame() < end) {
if (cutting) {
remove_region_internal (current);
}
continue;
}
-
+
+ /* coverage will return OverlapStart if the start coincides
+ with the end point. we do not partition such a region,
+ so catch this special case.
+ */
+
+ if (current->first_frame() >= end) {
+ continue;
+ }
+
if ((overlap = current->coverage (start, end)) == OverlapNone) {
continue;
}
-
+
pos1 = current->position();
pos2 = start;
pos3 = end;
@@ -841,6 +850,10 @@ Playlist::partition_internal (nframes_t start, nframes_t end, bool cutting, Regi
new_regions.push_back (current);
}
}
+
+ if (current->first_frame() >= current->last_frame()) {
+ PBD::stacktrace (cerr);
+ }
in_partition = false;
}