mirror of
https://github.com/thestk/stk
synced 2026-01-13 04:51:53 +00:00
Updates to eguitar, ragamatic and examples project files for new RtAudio API.
This commit is contained in:
@@ -56,11 +56,8 @@ int main()
|
||||
parameters.nChannels = 1;
|
||||
RtAudioFormat format = ( sizeof(StkFloat) == 8 ) ? RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;
|
||||
unsigned int bufferFrames = RT_BUFFER_SIZE;
|
||||
try {
|
||||
dac.openStream( ¶meters, NULL, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&data );
|
||||
}
|
||||
catch ( RtAudioError& error ) {
|
||||
error.printMessage();
|
||||
if ( dac.openStream( ¶meters, NULL, format, (unsigned int)Stk::sampleRate(), &bufferFrames, &tick, (void *)&data ) ) {
|
||||
std::cout << dac.getErrorText() << std::endl;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -75,11 +72,8 @@ int main()
|
||||
data.frequency = 220.0;
|
||||
data.instrument->noteOn( data.frequency, 0.5 );
|
||||
|
||||
try {
|
||||
dac.startStream();
|
||||
}
|
||||
catch ( RtAudioError &error ) {
|
||||
error.printMessage();
|
||||
if ( dac.startStream() ) {
|
||||
std::cout << dac.getErrorText() << std::endl;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
@@ -88,12 +82,7 @@ int main()
|
||||
Stk::sleep( 100 );
|
||||
|
||||
// Shut down the callback and output stream.
|
||||
try {
|
||||
dac.closeStream();
|
||||
}
|
||||
catch ( RtAudioError &error ) {
|
||||
error.printMessage();
|
||||
}
|
||||
dac.closeStream();
|
||||
|
||||
cleanup:
|
||||
delete data.instrument;
|
||||
|
||||
Reference in New Issue
Block a user