X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fdiskstream.cc;h=9e83c5e21a1243edbb9c755b97c7ed6f74cb9c91;hb=1bd4c5b3a212460eed1773f6b049d18c89625565;hp=a9a5c6ce075ec9825d2655fd0fd001fa0a21d655;hpb=ae95684d225bb5725211656859e3d801045e05f3;p=ardour.git diff --git a/libs/ardour/diskstream.cc b/libs/ardour/diskstream.cc index a9a5c6ce07..9e83c5e21a 100644 --- a/libs/ardour/diskstream.cc +++ b/libs/ardour/diskstream.cc @@ -32,6 +32,8 @@ #include #include +#include + #include #include #include @@ -56,10 +58,13 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -jack_nframes_t Diskstream::disk_io_chunk_frames = 0; +/* XXX This goes uninitialized when there is no ~/.ardour2 directory. + * I can't figure out why, so this will do for now (just stole the + * default from configuration_vars.h). 0 is not a good value for + * allocating buffer sizes.. + */ +nframes_t Diskstream::disk_io_chunk_frames = 1024 * 256; -sigc::signal Diskstream::DiskstreamCreated; -sigc::signal*> Diskstream::DeleteSources; sigc::signal Diskstream::DiskOverrun; sigc::signal Diskstream::DiskUnderrun; @@ -81,7 +86,6 @@ Diskstream::Diskstream (Session& sess, const XMLNode& node) void Diskstream::init (Flag f) { - _refcnt = 0; _flags = f; _io = 0; _alignment_style = ExistingMaterial; @@ -163,7 +167,7 @@ Diskstream::non_realtime_set_speed () if (_seek_required) { if (speed() != 1.0f || speed() != -1.0f) { - seek ((jack_nframes_t) (_session.transport_frame() * (double) speed()), true); + seek ((nframes_t) (_session.transport_frame() * (double) speed()), true); } else { seek (_session.transport_frame(), true); @@ -186,7 +190,7 @@ Diskstream::realtime_set_speed (double sp, bool global) if (new_speed != _actual_speed) { - jack_nframes_t required_wrap_size = (jack_nframes_t) floor (_session.get_block_size() * + nframes_t required_wrap_size = (nframes_t) floor (_session.get_block_size() * fabs (new_speed)) + 1; if (required_wrap_size > wrap_buffer_size) { @@ -261,7 +265,7 @@ Diskstream::set_loop (Location *location) return 0; } -jack_nframes_t +nframes_t Diskstream::get_capture_start_frame (uint32_t n) { Glib::Mutex::Lock lm (capture_info_lock); @@ -274,7 +278,7 @@ Diskstream::get_capture_start_frame (uint32_t n) } } -jack_nframes_t +nframes_t Diskstream::get_captured_frames (uint32_t n) { Glib::Mutex::Lock lm (capture_info_lock); @@ -288,7 +292,7 @@ Diskstream::get_captured_frames (uint32_t n) } void -Diskstream::set_roll_delay (jack_nframes_t nframes) +Diskstream::set_roll_delay (nframes_t nframes) { _roll_delay = nframes; } @@ -327,9 +331,8 @@ Diskstream::use_playlist (Playlist* playlist) reset_write_sources (false); } - plstate_connection = _playlist->StateChanged.connect (mem_fun (*this, &Diskstream::playlist_changed)); plmod_connection = _playlist->Modified.connect (mem_fun (*this, &Diskstream::playlist_modified)); - plgone_connection = _playlist->GoingAway.connect (mem_fun (*this, &Diskstream::playlist_deleted)); + plgone_connection = _playlist->GoingAway.connect (bind (mem_fun (*this, &Diskstream::playlist_deleted), _playlist)); } if (!overwrite_queued) {