diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-03-31 17:28:14 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 11:40:52 -0400 |
commit | a4a87f56e9dc8e2351101439aeea7a87064fa146 (patch) | |
tree | 940715c29eb1fcdd478b1998a9e0caad5032c9df /libs/ardour/disk_io.cc | |
parent | 94604c6979be790a072c9d76566250a3aadf6e79 (diff) |
mega-commit to save state of first "it compilesand links" state for separated disk i/o changes.
THIS WILL NOT RUN. THIS REQUIRES MANY CHANGES
Diffstat (limited to 'libs/ardour/disk_io.cc')
-rw-r--r-- | libs/ardour/disk_io.cc | 85 |
1 files changed, 23 insertions, 62 deletions
diff --git a/libs/ardour/disk_io.cc b/libs/ardour/disk_io.cc index 1516933e32..89aba80322 100644 --- a/libs/ardour/disk_io.cc +++ b/libs/ardour/disk_io.cc @@ -56,6 +56,8 @@ DiskIOProcessor::DiskIOProcessor (Session& s, string const & str, Flag f) , _slaved (false) , loop_location (0) , in_set_state (false) + , file_frame (0) + , playback_sample (0) , wrap_buffer_size (0) , speed_buffer_size (0) , _need_butler (false) @@ -394,68 +396,6 @@ DiskIOProcessor::use_playlist (DataType dt, boost::shared_ptr<Playlist> playlist return 0; } -int -DiskIOProcessor::find_and_use_playlist (DataType dt, const string& name) -{ - boost::shared_ptr<Playlist> playlist; - - if ((playlist = _session.playlists->by_name (name)) == 0) { - playlist = PlaylistFactory::create (dt, _session, name); - } - - if (!playlist) { - error << string_compose(_("DiskIOProcessor: \"%1\" isn't an playlist"), name) << endmsg; - return -1; - } - - return use_playlist (dt, playlist); -} - -int -DiskIOProcessor::use_new_playlist (DataType dt) -{ - string newname; - boost::shared_ptr<Playlist> playlist = _playlists[dt]; - - if (playlist) { - newname = Playlist::bump_name (playlist->name(), _session); - } else { - newname = Playlist::bump_name (_name, _session); - } - - playlist = boost::dynamic_pointer_cast<AudioPlaylist> (PlaylistFactory::create (dt, _session, newname, hidden())); - - if (!playlist) { - return -1; - } - - return use_playlist (dt, playlist); -} - -int -DiskIOProcessor::use_copy_playlist (DataType dt) -{ - assert (_playlists[dt]); - - if (_playlists[dt] == 0) { - error << string_compose(_("DiskIOProcessor %1: there is no existing playlist to make a copy of!"), _name) << endmsg; - return -1; - } - - string newname; - boost::shared_ptr<Playlist> playlist; - - newname = Playlist::bump_name (_playlists[dt]->name(), _session); - - if ((playlist = PlaylistFactory::create (_playlists[dt], newname)) == 0) { - return -1; - } - - playlist->reset_shares(); - - return use_playlist (dt, playlist); -} - DiskIOProcessor::ChannelInfo::ChannelInfo (framecnt_t bufsize) { buf = new RingBufferNPT<Sample> (bufsize); @@ -492,3 +432,24 @@ DiskIOProcessor::set_route (boost::shared_ptr<Route> r) { _route = r; } + +/** Get the start, end, and length of a location "atomically". + * + * Note: Locations don't get deleted, so all we care about when I say "atomic" + * is that we are always pointing to the same one and using start/length values + * obtained just once. Use this function to achieve this since location being + * a parameter achieves this. + */ +void +DiskIOProcessor::get_location_times(const Location* location, + framepos_t* start, + framepos_t* end, + framepos_t* length) +{ + if (location) { + *start = location->start(); + *end = location->end(); + *length = *end - *start; + } +} + |