mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-11 00:56:33 +01:00
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
5 changed files with 29 additions and 6 deletions
|
|
@ -284,7 +284,6 @@ class AudioDiskstream : public Diskstream
|
||||||
int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
|
int add_channel_to (boost::shared_ptr<ChannelList>, uint32_t how_many);
|
||||||
int remove_channel_from (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
|
} // namespace ARDOUR
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,7 @@ class Diskstream : public SessionObject, public PublicDiskstream
|
||||||
|
|
||||||
framepos_t file_frame;
|
framepos_t file_frame;
|
||||||
framepos_t playback_sample;
|
framepos_t playback_sample;
|
||||||
|
framecnt_t playback_distance;
|
||||||
|
|
||||||
uint32_t _read_data_count;
|
uint32_t _read_data_count;
|
||||||
uint32_t _write_data_count;
|
uint32_t _write_data_count;
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,6 @@ AudioDiskstream::AudioDiskstream (Session &sess, const string &name, Diskstream:
|
||||||
: Diskstream(sess, name, flag)
|
: Diskstream(sess, name, flag)
|
||||||
, deprecated_io_node(NULL)
|
, deprecated_io_node(NULL)
|
||||||
, channels (new ChannelList)
|
, channels (new ChannelList)
|
||||||
, playback_distance (0)
|
|
||||||
{
|
{
|
||||||
/* prevent any write sources from being created */
|
/* prevent any write sources from being created */
|
||||||
|
|
||||||
|
|
@ -89,7 +88,6 @@ AudioDiskstream::AudioDiskstream (Session& sess, const XMLNode& node)
|
||||||
: Diskstream(sess, node)
|
: Diskstream(sess, node)
|
||||||
, deprecated_io_node(NULL)
|
, deprecated_io_node(NULL)
|
||||||
, channels (new ChannelList)
|
, channels (new ChannelList)
|
||||||
, playback_distance (0)
|
|
||||||
{
|
{
|
||||||
in_set_state = true;
|
in_set_state = true;
|
||||||
init ();
|
init ();
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ Diskstream::Diskstream (Session &sess, const string &name, Flag flag)
|
||||||
, _target_speed (_speed)
|
, _target_speed (_speed)
|
||||||
, file_frame (0)
|
, file_frame (0)
|
||||||
, playback_sample (0)
|
, playback_sample (0)
|
||||||
|
, playback_distance (0)
|
||||||
, _read_data_count (0)
|
, _read_data_count (0)
|
||||||
, _write_data_count (0)
|
, _write_data_count (0)
|
||||||
, in_set_state (false)
|
, in_set_state (false)
|
||||||
|
|
@ -149,6 +150,7 @@ Diskstream::Diskstream (Session& sess, const XMLNode& /*node*/)
|
||||||
, _target_speed (_speed)
|
, _target_speed (_speed)
|
||||||
, file_frame (0)
|
, file_frame (0)
|
||||||
, playback_sample (0)
|
, playback_sample (0)
|
||||||
|
, playback_distance (0)
|
||||||
, _read_data_count (0)
|
, _read_data_count (0)
|
||||||
, _write_data_count (0)
|
, _write_data_count (0)
|
||||||
, in_set_state (false)
|
, in_set_state (false)
|
||||||
|
|
|
||||||
|
|
@ -496,6 +496,8 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can
|
||||||
bool nominally_recording;
|
bool nominally_recording;
|
||||||
bool re = record_enabled ();
|
bool re = record_enabled ();
|
||||||
|
|
||||||
|
playback_distance = 0;
|
||||||
|
|
||||||
check_record_status (transport_frame, can_record);
|
check_record_status (transport_frame, can_record);
|
||||||
|
|
||||||
nominally_recording = (can_record && re);
|
nominally_recording = (can_record && re);
|
||||||
|
|
@ -557,10 +559,31 @@ MidiDiskstream::process (framepos_t transport_frame, pframes_t nframes, bool can
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec_nframes) {
|
if (rec_nframes) {
|
||||||
|
|
||||||
/* data will be written to disk */
|
/* data will be written to disk */
|
||||||
|
|
||||||
|
if (rec_nframes == nframes && rec_offset == 0) {
|
||||||
|
playback_distance = nframes;
|
||||||
|
}
|
||||||
|
|
||||||
adjust_capture_position = rec_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;
|
ret = 0;
|
||||||
|
|
||||||
if (commit (nframes)) {
|
if (commit (nframes)) {
|
||||||
|
|
@ -576,9 +599,9 @@ MidiDiskstream::commit (framecnt_t nframes)
|
||||||
bool need_butler = false;
|
bool need_butler = false;
|
||||||
|
|
||||||
if (_actual_speed < 0.0) {
|
if (_actual_speed < 0.0) {
|
||||||
playback_sample -= nframes;
|
playback_sample -= playback_distance;
|
||||||
} else {
|
} else {
|
||||||
playback_sample += nframes;
|
playback_sample += playback_distance;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (adjust_capture_position != 0) {
|
if (adjust_capture_position != 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue