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 */
#include <list>
#include <cmath>
+#include <boost/pool/pool.hpp>
+#include <boost/pool/pool_alloc.hpp>
+
#include <sigc++/signal.h>
#include <glibmm/thread.h>
namespace ARDOUR {
-struct ControlEvent {
+class ControlEvent {
+ public:
double when;
double value;
// 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;
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 */
if (_session.transport_stopped() && src != 0 && src != this && gain_automation_recording()) {
_gain_automation_curve.add (_session.transport_frame(), val);
-
}
_session.set_dirty();
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
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);
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;
}
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);
}