Lines 963-968
Link Here
|
963 |
}; |
963 |
}; |
964 |
#endif |
964 |
#endif |
965 |
|
965 |
|
|
|
966 |
#ifdef EXPERIMENTAL_MIDI_OUT |
966 |
// return the system time as a double |
967 |
// return the system time as a double |
967 |
static double streamStartTime = 0; // bias system time to small number |
968 |
static double streamStartTime = 0; // bias system time to small number |
968 |
|
969 |
|
Lines 982-987
Link Here
|
982 |
|
983 |
|
983 |
return PaUtil_GetTime() - streamStartTime; |
984 |
return PaUtil_GetTime() - streamStartTime; |
984 |
} |
985 |
} |
|
|
986 |
#endif |
985 |
|
987 |
|
986 |
const int AudioIO::StandardRates[] = { |
988 |
const int AudioIO::StandardRates[] = { |
987 |
8000, |
989 |
8000, |
Lines 1790-1795
Link Here
|
1790 |
} |
1792 |
} |
1791 |
#endif |
1793 |
#endif |
1792 |
|
1794 |
|
|
|
1795 |
#ifdef EXPERIMENTAL_MIDI_OUT |
1793 |
// We use audio latency to estimate how far ahead of DACS we are writing |
1796 |
// We use audio latency to estimate how far ahead of DACS we are writing |
1794 |
if (mPortStreamV19 != NULL && mLastPaError == paNoError) { |
1797 |
if (mPortStreamV19 != NULL && mLastPaError == paNoError) { |
1795 |
const PaStreamInfo* info = Pa_GetStreamInfo(mPortStreamV19); |
1798 |
const PaStreamInfo* info = Pa_GetStreamInfo(mPortStreamV19); |
Lines 1798-1803
Link Here
|
1798 |
mAudioOutLatency = info->outputLatency; |
1801 |
mAudioOutLatency = info->outputLatency; |
1799 |
mSystemMinusAudioTimePlusLatency += mAudioOutLatency; |
1802 |
mSystemMinusAudioTimePlusLatency += mAudioOutLatency; |
1800 |
} |
1803 |
} |
|
|
1804 |
#endif |
1801 |
|
1805 |
|
1802 |
return (mLastPaError == paNoError); |
1806 |
return (mLastPaError == paNoError); |
1803 |
} |
1807 |
} |
Lines 1925-1932
Link Here
|
1925 |
|
1929 |
|
1926 |
double playbackTime = 4.0; |
1930 |
double playbackTime = 4.0; |
1927 |
|
1931 |
|
|
|
1932 |
#ifdef EXPERIMENTAL_MIDI_OUT |
1928 |
streamStartTime = 0; |
1933 |
streamStartTime = 0; |
1929 |
streamStartTime = SystemTime(mUsingAlsa); |
1934 |
streamStartTime = SystemTime(mUsingAlsa); |
|
|
1935 |
#endif |
1930 |
|
1936 |
|
1931 |
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT |
1937 |
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT |
1932 |
bool scrubbing = (options.pScrubbingOptions != nullptr); |
1938 |
bool scrubbing = (options.pScrubbingOptions != nullptr); |
Lines 4619-4631
Link Here
|
4619 |
(float *)alloca(framesPerBuffer*numPlaybackChannels * sizeof(float)) : |
4625 |
(float *)alloca(framesPerBuffer*numPlaybackChannels * sizeof(float)) : |
4620 |
(float *)outputBuffer; |
4626 |
(float *)outputBuffer; |
4621 |
|
4627 |
|
|
|
4628 |
#ifdef EXPERIMENTAL_MIDI_OUT |
4622 |
if (gAudioIO->mCallbackCount++ == 0) { |
4629 |
if (gAudioIO->mCallbackCount++ == 0) { |
4623 |
// This is effectively mSystemMinusAudioTime when the buffer is empty: |
4630 |
// This is effectively mSystemMinusAudioTime when the buffer is empty: |
4624 |
gAudioIO->mStartTime = SystemTime(gAudioIO->mUsingAlsa) - gAudioIO->mT0; |
4631 |
gAudioIO->mStartTime = SystemTime(gAudioIO->mUsingAlsa) - gAudioIO->mT0; |
4625 |
// later, mStartTime - mSystemMinusAudioTime will tell us latency |
4632 |
// later, mStartTime - mSystemMinusAudioTime will tell us latency |
4626 |
} |
4633 |
} |
4627 |
|
4634 |
|
4628 |
#ifdef EXPERIMENTAL_MIDI_OUT |
|
|
4629 |
/* GSW: Save timeInfo in case MidiPlayback needs it */ |
4635 |
/* GSW: Save timeInfo in case MidiPlayback needs it */ |
4630 |
gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime(); |
4636 |
gAudioIO->mAudioCallbackClockTime = PaUtil_GetTime(); |
4631 |
|
4637 |
|
Lines 5001-5007
Link Here
|
5001 |
: gAudioIO->mTime >= gAudioIO->mT1)) |
5007 |
: gAudioIO->mTime >= gAudioIO->mT1)) |
5002 |
// PRL: singalling MIDI output complete is necessary if |
5008 |
// PRL: singalling MIDI output complete is necessary if |
5003 |
// not USE_MIDI_THREAD, otherwise it's harmlessly redundant |
5009 |
// not USE_MIDI_THREAD, otherwise it's harmlessly redundant |
|
|
5010 |
#ifdef EXPERIMENTAL_MIDI_OUT |
5004 |
gAudioIO->mMidiOutputComplete = true, |
5011 |
gAudioIO->mMidiOutputComplete = true, |
|
|
5012 |
#endif |
5005 |
callbackReturn = paComplete; |
5013 |
callbackReturn = paComplete; |
5006 |
} |
5014 |
} |
5007 |
|
5015 |
|
Lines 5064-5070
Link Here
|
5064 |
|
5072 |
|
5065 |
// PRL: singalling MIDI output complete is necessary if |
5073 |
// PRL: singalling MIDI output complete is necessary if |
5066 |
// not USE_MIDI_THREAD, otherwise it's harmlessly redundant |
5074 |
// not USE_MIDI_THREAD, otherwise it's harmlessly redundant |
|
|
5075 |
#ifdef EXPERIMENTAL_MIDI_OUT |
5067 |
gAudioIO->mMidiOutputComplete = true, |
5076 |
gAudioIO->mMidiOutputComplete = true, |
|
|
5077 |
#endif |
5068 |
callbackReturn = paComplete; |
5078 |
callbackReturn = paComplete; |
5069 |
} |
5079 |
} |
5070 |
} |
5080 |
} |