summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-07-06 03:11:52 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-07-06 03:11:52 +0000
commit1516d52ffab61cb0e117f1829ede387e2d2eb021 (patch)
tree964442d73efa1774798501936ff9aaab8a370234
parent65438f0fe4abb11ce0d039f6bbd7cd74696cae9c (diff)
new automation interval configuration variable, to control automation snapshot time resolution (for oofus to test); patch for cancellingmulti-file import; minor code cleanups; use boost::fast_pool_allocator for automation lists (may revert later)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2117 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor_audio_import.cc4
-rw-r--r--libs/ardour/ardour/automation_event.h18
-rw-r--r--libs/ardour/ardour/configuration_vars.h1
-rw-r--r--libs/ardour/io.cc1
-rw-r--r--libs/ardour/panner.cc4
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/pbd/pool.cc32
7 files changed, 38 insertions, 24 deletions
diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc
index 2f63de340e..5a70425480 100644
--- a/gtk2_ardour/editor_audio_import.cc
+++ b/gtk2_ardour/editor_audio_import.cc
@@ -350,7 +350,9 @@ Editor::embed_sndfile (vector<Glib::ustring> paths, bool split, bool multiple_fi
switch (resx) {
case 0: /* stop a multi-file import */
- case 1: /* don't import this one */
+ ret = -2;
+ goto out;
+ case 1: /* don't embed this one */
ret = -1;
goto out;
case 2: /* do it, and the rest without asking */
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h
index 007bad7259..7db5e3f459 100644
--- a/libs/ardour/ardour/automation_event.h
+++ b/libs/ardour/ardour/automation_event.h
@@ -24,6 +24,9 @@
#include <list>
#include <cmath>
+#include <boost/pool/pool.hpp>
+#include <boost/pool/pool_alloc.hpp>
+
#include <sigc++/signal.h>
#include <glibmm/thread.h>
@@ -35,7 +38,8 @@
namespace ARDOUR {
-struct ControlEvent {
+class ControlEvent {
+ public:
double when;
double value;
@@ -49,13 +53,21 @@ struct ControlEvent {
// bool operator==(const ControlEvent& other) {
// return value == other.value && when == other.when;
// }
-
};
+/* automation lists use a pool allocator that does not use a lock and
+ allocates 8k of new pointers at a time
+*/
+
+typedef boost::fast_pool_allocator<ControlEvent,
+ boost::default_user_allocator_new_delete,
+ boost::details::pool::null_mutex,
+ 8192> ControlEventAllocator;
+
class AutomationList : public PBD::StatefulDestructible
{
public:
- typedef std::list<ControlEvent*> AutomationEventList;
+ typedef std::list<ControlEvent*,ControlEventAllocator> AutomationEventList;
typedef AutomationEventList::iterator iterator;
typedef AutomationEventList::const_iterator const_iterator;
diff --git a/libs/ardour/ardour/configuration_vars.h b/libs/ardour/ardour/configuration_vars.h
index 61dc1bd225..f532056b85 100644
--- a/libs/ardour/ardour/configuration_vars.h
+++ b/libs/ardour/ardour/configuration_vars.h
@@ -141,6 +141,7 @@ CONFIG_VARIABLE (uint32_t, saved_history_depth, "save-history-depth", 100)
CONFIG_VARIABLE (bool, use_overlap_equivalency, "use-overlap-equivalency", false)
CONFIG_VARIABLE (bool, periodic_safety_backups, "periodic-safety-backups", true)
CONFIG_VARIABLE (uint32_t, periodic_safety_backup_interval, "periodic-safety-backup-interval", 120)
+CONFIG_VARIABLE (float, automation_interval, "automation-interval", 50)
/* denormal management */
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc
index 4e09061845..cb66830409 100644
--- a/libs/ardour/io.cc
+++ b/libs/ardour/io.cc
@@ -2589,7 +2589,6 @@ IO::set_gain (gain_t val, void *src)
if (_session.transport_stopped() && src != 0 && src != this && gain_automation_recording()) {
_gain_automation_curve.add (_session.transport_frame(), val);
-
}
_session.set_dirty();
diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc
index 563d4e90d4..eb9547edff 100644
--- a/libs/ardour/panner.cc
+++ b/libs/ardour/panner.cc
@@ -205,11 +205,11 @@ BaseStereoPanner::snapshot (nframes_t now)
void
BaseStereoPanner::transport_stopped (nframes_t frame)
{
- _automation.reposition_for_rt_add (frame);
-
if (_automation.automation_state() != Off) {
set_position (_automation.eval (frame));
}
+
+ _automation.reposition_for_rt_add (frame);
}
void
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 7c23ae6286..687fad4fec 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -1402,7 +1402,7 @@ Session::set_frame_rate (nframes_t frames_per_second)
sync_time_vars();
- Route::set_automation_interval ((jack_nframes_t) ceil ((double) frames_per_second * 0.25));
+ IO::set_automation_interval ((jack_nframes_t) ceil ((double) frames_per_second * (0.001 * Config->get_automation_interval())));
// XXX we need some equivalent to this, somehow
// SndFileSource::setup_standard_crossfades (frames_per_second);
diff --git a/libs/pbd/pool.cc b/libs/pbd/pool.cc
index be8032b7b6..6230073652 100644
--- a/libs/pbd/pool.cc
+++ b/libs/pbd/pool.cc
@@ -83,37 +83,37 @@ Pool::release (void *ptr)
MultiAllocSingleReleasePool::MultiAllocSingleReleasePool (string n, unsigned long isize, unsigned long nitems)
: Pool (n, isize, nitems),
- m_lock(0)
+ m_lock(0)
{
}
MultiAllocSingleReleasePool::~MultiAllocSingleReleasePool ()
{
- if(m_lock) delete m_lock;
+ if (m_lock) delete m_lock;
}
SingleAllocMultiReleasePool::SingleAllocMultiReleasePool (string n, unsigned long isize, unsigned long nitems)
: Pool (n, isize, nitems),
- m_lock(0)
+ m_lock(0)
{
}
SingleAllocMultiReleasePool::~SingleAllocMultiReleasePool ()
{
- if(m_lock) delete m_lock;
+ if (m_lock) delete m_lock;
}
void*
MultiAllocSingleReleasePool::alloc ()
{
void *ptr;
- if(!m_lock) {
- m_lock = new Glib::Mutex();
- // umm, I'm not sure that this doesn't also allocate memory.
- if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
- }
+
+ if (!m_lock && (m_lock = new Glib::Mutex()) == 0) {
+ fatal << "cannot create Glib::Mutex in pool.cc" << endmsg;
+ /*NOTREACHED*/
+ }
- Glib::Mutex::Lock guard(*m_lock);
+ Glib::Mutex::Lock guard(*m_lock);
ptr = Pool::alloc ();
return ptr;
}
@@ -133,12 +133,12 @@ SingleAllocMultiReleasePool::alloc ()
void
SingleAllocMultiReleasePool::release (void* ptr)
{
- if(!m_lock) {
- m_lock = new Glib::Mutex();
- // umm, I'm not sure that this doesn't also allocate memory.
- if(!m_lock) error << "cannot create Glib::Mutex in pool.cc" << endmsg;
- }
- Glib::Mutex::Lock guard(*m_lock);
+ if (!m_lock && (m_lock = new Glib::Mutex()) == 0) {
+ fatal << "cannot create Glib::Mutex in pool.cc" << endmsg;
+ /*NOTREACHED*/
+ }
+
+ Glib::Mutex::Lock guard(*m_lock);
Pool::release (ptr);
}