diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-05 03:18:44 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-01-05 03:18:44 +0000 |
commit | 2fcdf14e2b63753be7b9cd74a442fa5aefbfb401 (patch) | |
tree | 25c98b803239a87bfbf93a22d506bedef43b3e7c /libs/ardour/session.cc | |
parent | f020b4e1e66dedba8d150a646347ec2b02b8ac52 (diff) |
lots of small fixes for various irritations, return of snapshots, region list hiding stuff, etc etc etc
git-svn-id: svn://localhost/trunk/ardour2@241 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 021c2935d2..ab218e4804 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -375,6 +375,7 @@ Session::~Session () delete _click_io; } + if (auditioner) { delete auditioner; } @@ -562,6 +563,9 @@ Session::when_engine_running () first_time_running.disconnect (); + set_block_size (_engine.frames_per_cycle()); + set_frame_rate (_engine.frame_rate()); + /* every time we reconnect, recompute worst case output latencies */ _engine.Running.connect (sigc::bind (mem_fun (*this, &Session::set_worst_io_latencies), true)); @@ -1309,46 +1313,32 @@ Session::set_frame_rate (jack_nframes_t frames_per_second) void Session::set_block_size (jack_nframes_t nframes) { - /** \fn void Session::set_block_size(jack_nframes_t) - the AudioEngine object that calls this guarantees - that it will not be called while we are also in - ::process(). Its also fine to do things that block - here. + /* the AudioEngine guarantees + that it will not be called while we are also in + ::process(). It is therefore fine to do things that block + here. */ { LockMonitor lm (route_lock, __LINE__, __FILE__); - + vector<Sample*>::iterator i; + uint32_t np; + current_block_size = nframes; - - for (vector<Sample*>::iterator i = _passthru_buffers.begin(); i != _passthru_buffers.end(); ++i) { - free(*i); - - Sample *buf; -#ifdef NO_POSIX_MEMALIGN - buf = (Sample *) malloc(current_block_size * sizeof(Sample)); -#else - posix_memalign((void **)&buf,16,current_block_size * 4); -#endif - *i = buf; - - memset (*i, 0, sizeof (Sample) * current_block_size); + + for (np = 0, i = _passthru_buffers.begin(); i != _passthru_buffers.end(); ++i, ++np) { + free (*i); } for (vector<Sample*>::iterator i = _silent_buffers.begin(); i != _silent_buffers.end(); ++i) { - free(*i); - - Sample *buf; -#ifdef NO_POSIX_MEMALIGN - buf = (Sample *) malloc(current_block_size * sizeof(Sample)); -#else - posix_memalign((void **)&buf,16,current_block_size * 4); -#endif - *i = buf; - - memset (*i, 0, sizeof (Sample) * current_block_size); + free (*i); } + _passthru_buffers.clear (); + _silent_buffers.clear (); + + ensure_passthru_buffers (np); + if (_gain_automation_buffer) { delete [] _gain_automation_buffer; } |