new automation interval configuration variable, to control automation snapshot time...
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 6 Jul 2007 03:11:52 +0000 (03:11 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 6 Jul 2007 03:11:52 +0000 (03:11 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2117 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_audio_import.cc
libs/ardour/ardour/automation_event.h
libs/ardour/ardour/configuration_vars.h
libs/ardour/io.cc
libs/ardour/panner.cc
libs/ardour/session.cc
libs/pbd/pool.cc

index 2f63de340ec6d51ac6b5619877d12b005f547bbe..5a7042548086d973db1ac33166a394481967b140 100644 (file)
@@ -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 */
index 007bad7259052240f5d8019962c5de64859bd776..7db5e3f459cf204b4e4103b849f7c6acb3b84cae 100644 (file)
@@ -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;
 
index 61dc1bd225eaf4ed80c7e1de4b0b99417d975006..f532056b85e2a3ce20066e3a9c77b34b0b4c8f19 100644 (file)
@@ -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 */
 
index 4e0906184535d2d7a912a8b66386a323b4bbcdce..cb66830409a0686610a03b5bd19ca133daab4807 100644 (file)
@@ -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();
index 563d4e90d41da2ebca6584bfde602a4f85e4252f..eb9547edffa87d965c568c3170eff7cb89f82470 100644 (file)
@@ -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
index 7c23ae62866f2d92057dc7daabbdcd0c1439a41a..687fad4fece705231f9aa9ade0fa48674b4a318c 100644 (file)
@@ -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);
index be8032b7b63520d31d2a431694b2298f5a19634b..6230073652ec4c741c05aeeff683e4180da04553 100644 (file)
@@ -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);
 }