Fix previous patch a bit better.
git-svn-id: svn://localhost/ardour2/branches/3.0@8959 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e5c6071235
commit
eb8de01f42
@ -284,7 +284,6 @@ class AudioDiskstream : public Diskstream
|
||||
int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
|
||||
int remove_channel_from (boost::shared_ptr<ChannelList>, uint32_t how_many);
|
||||
|
||||
framecnt_t playback_distance;
|
||||
};
|
||||
|
||||
} // namespace ARDOUR
|
||||
|
@ -288,6 +288,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
|
||||
|
||||
framepos_t file_frame;
|
||||
framepos_t playback_sample;
|
||||
framecnt_t playback_distance;
|
||||
|
||||
uint32_t _read_data_count;
|
||||
uint32_t _write_data_count;
|
||||
|
@ -76,7 +76,6 @@ AudioDiskstream::AudioDiskstream (Session &sess, const string &name, Diskstream:
|
||||
: Diskstream(sess, name, flag)
|
||||
, deprecated_io_node(NULL)
|
||||
, channels (new ChannelList)
|
||||
, playback_distance (0)
|
||||
{
|
||||
/* prevent any write sources from being created */
|
||||
|
||||
@ -89,7 +88,6 @@ AudioDiskstream::AudioDiskstream (Session& sess, const XMLNode& node)
|
||||
: Diskstream(sess, node)
|
||||
, deprecated_io_node(NULL)
|
||||
, channels (new ChannelList)
|
||||
, playback_distance (0)
|
||||
{
|
||||
in_set_state = true;
|
||||
init ();
|
||||
|
@ -106,6 +106,7 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
|
||||
, _target_speed (_speed)
|
||||
, file_frame (0)
|
||||
, playback_sample (0)
|
||||
, playback_distance (0)
|
||||
, _read_data_count (0)
|
||||
, _write_data_count (0)
|
||||
, in_set_state (false)
|
||||
@ -149,6 +150,7 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
|
||||
, _target_speed (_speed)
|
||||
, file_frame (0)
|
||||
, playback_sample (0)
|
||||
, playback_distance (0)
|
||||
, _read_data_count (0)
|
||||
, _write_data_count (0)
|
||||
, in_set_state (false)
|
||||
|
@ -496,6 +496,8 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can
|
||||
bool nominally_recording;
|
||||
bool re = record_enabled ();
|
||||
|
||||
playback_distance = 0;
|
||||
|
||||
check_record_status (transport_frame, can_record);
|
||||
|
||||
nominally_recording = (can_record && re);
|
||||
@ -557,8 +559,29 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can
|
||||
}
|
||||
|
||||
if (rec_nframes) {
|
||||
|
||||
/* data will be written to disk */
|
||||
|
||||
if (rec_nframes == nframes && rec_offset == 0) {
|
||||
playback_distance = nframes;
|
||||
}
|
||||
|
||||
adjust_capture_position = rec_nframes;
|
||||
|
||||
} else if (nominally_recording) {
|
||||
|
||||
/* XXXX do this for MIDI !!!
|
||||
can't do actual capture yet - waiting for latency effects to finish before we start
|
||||
*/
|
||||
|
||||
playback_distance = nframes;
|
||||
|
||||
} else {
|
||||
|
||||
/* XXX: should be doing varispeed stuff here, similar to the code in AudioDiskstream::process */
|
||||
|
||||
playback_distance = nframes;
|
||||
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
@ -576,9 +599,9 @@ MidiDiskstream::commit (framecnt_t nframes)
|
||||
bool need_butler = false;
|
||||
|
||||
if (_actual_speed < 0.0) {
|
||||
playback_sample -= nframes;
|
||||
playback_sample -= playback_distance;
|
||||
} else {
|
||||
playback_sample += nframes;
|
||||
playback_sample += playback_distance;
|
||||
}
|
||||
|
||||
if (adjust_capture_position != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user