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
This commit is contained in:
Paul Davis
2006-01-05 03:18:44 +00:00
parent f020b4e1e6
commit 2fcdf14e2b
14 changed files with 248 additions and 398 deletions

View File

@@ -13,7 +13,7 @@ namespace ARDOUR {
typedef uint32_t state_id_t;
class StateManager : virtual public sigc::trackable
class StateManager : public sigc::trackable
{
public:
struct State {

View File

@@ -398,8 +398,6 @@ void
AudioEngine::set_session (Session *s)
{
if (!session) {
s->set_block_size (jack_get_buffer_size (_jack));
s->set_frame_rate (jack_get_sample_rate (_jack));
session = s;
}
}

View File

@@ -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;
}