202 |
* libjack to demand transmission of further sample points. |
* libjack to demand transmission of further sample points. |
203 |
*/ |
*/ |
204 |
int AudioOutputDeviceJack::Process(uint Samples) { |
int AudioOutputDeviceJack::Process(uint Samples) { |
205 |
|
int res; |
206 |
if (csIsPlaying.Pop()) { |
if (csIsPlaying.Pop()) { |
207 |
// let all connected engines render 'Samples' sample points |
// let all connected engines render 'Samples' sample points |
208 |
return RenderAudio(Samples); |
res = RenderAudio(Samples); |
209 |
} |
} |
210 |
else { |
else { |
211 |
// playback stop by zeroing output buffer(s) and not calling connected sampler engines to render audio |
// playback stop by zeroing output buffer(s) and not calling connected sampler engines to render audio |
212 |
return RenderSilence(Samples); |
res = RenderSilence(Samples); |
213 |
} |
} |
214 |
|
csIsPlaying.RttDone(); |
215 |
|
return res; |
216 |
} |
} |
217 |
|
|
218 |
void AudioOutputDeviceJack::Play() { |
void AudioOutputDeviceJack::Play() { |
252 |
} |
} |
253 |
|
|
254 |
String AudioOutputDeviceJack::Version() { |
String AudioOutputDeviceJack::Version() { |
255 |
String s = "$Revision: 1.23 $"; |
String s = "$Revision: 1.25 $"; |
256 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
257 |
} |
} |
258 |
|
|
308 |
audio = midi = false; |
audio = midi = false; |
309 |
if (Name.size() >= jack_client_name_size()) |
if (Name.size() >= jack_client_name_size()) |
310 |
throw Exception("JACK client name too long"); |
throw Exception("JACK client name too long"); |
311 |
if ((hJackClient = jack_client_new(Name.c_str())) == 0) |
#if HAVE_JACK_CLIENT_OPEN |
312 |
|
hJackClient = jack_client_open(Name.c_str(), JackNullOption, NULL); |
313 |
|
#else |
314 |
|
hJackClient = jack_client_new(Name.c_str()); |
315 |
|
#endif |
316 |
|
if (!hJackClient) |
317 |
throw Exception("Seems Jack server is not running."); |
throw Exception("Seems Jack server is not running."); |
318 |
jack_set_process_callback(hJackClient, linuxsampler_libjack_process_callback, this); |
jack_set_process_callback(hJackClient, linuxsampler_libjack_process_callback, this); |
319 |
jack_on_shutdown(hJackClient, linuxsampler_libjack_shutdown_callback, this); |
jack_on_shutdown(hJackClient, linuxsampler_libjack_shutdown_callback, this); |