27 |
|
|
28 |
namespace LinuxSampler { |
namespace LinuxSampler { |
29 |
|
|
30 |
REGISTER_AUDIO_OUTPUT_DRIVER("Jack",AudioOutputDeviceJack); |
REGISTER_AUDIO_OUTPUT_DRIVER(AudioOutputDeviceJack); |
31 |
|
|
32 |
|
/* Common parameters for now they'll have to be registered here. */ |
33 |
|
REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceJack, ParameterActive); |
34 |
|
REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceJack, ParameterSampleRate); |
35 |
|
REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceJack, ParameterChannels); |
36 |
|
|
37 |
/** |
/** |
38 |
* Open and initialize connection to the JACK system. |
* Open and initialize connection to the JACK system. |
41 |
* @throws AudioOutputException on error |
* @throws AudioOutputException on error |
42 |
* @see AcquireChannels() |
* @see AcquireChannels() |
43 |
*/ |
*/ |
44 |
AudioOutputDeviceJack::AudioOutputDeviceJack(std::map<String,String> Parameters) : AudioOutputDevice(std::map<String,DeviceCreationParameter*>()) { |
AudioOutputDeviceJack::AudioOutputDeviceJack(std::map<String,DeviceCreationParameter*> Parameters) : AudioOutputDevice(std::map<String,DeviceCreationParameter*>()) { |
45 |
if ((hJackClient = jack_client_new("LinuxSampler")) == 0) |
if ((hJackClient = jack_client_new("LinuxSampler")) == 0) |
46 |
throw AudioOutputException("Seems Jack server not running."); |
throw AudioOutputException("Seems Jack server not running."); |
47 |
|
|
136 |
return jack_get_sample_rate(hJackClient); |
return jack_get_sample_rate(hJackClient); |
137 |
} |
} |
138 |
|
|
139 |
|
String AudioOutputDeviceJack::Name() { |
140 |
|
return "Jack"; |
141 |
|
} |
142 |
|
|
143 |
String AudioOutputDeviceJack::Driver() { |
String AudioOutputDeviceJack::Driver() { |
144 |
return "Jack"; |
return Name(); |
145 |
} |
} |
146 |
|
|
147 |
String AudioOutputDeviceJack::Description() { |
String AudioOutputDeviceJack::Description() { |
149 |
} |
} |
150 |
|
|
151 |
String AudioOutputDeviceJack::Version() { |
String AudioOutputDeviceJack::Version() { |
152 |
String s = "$Revision: 1.7 $"; |
String s = "$Revision: 1.8 $"; |
153 |
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 |
154 |
} |
} |
155 |
|
|
|
std::map<String,DeviceCreationParameter*> AudioOutputDeviceJack::AvailableParameters() { |
|
|
// FIXME: not a good solution to get the commot parameters (ACTIVE,SAMPERATE,CHANNELS which have to be offered by all audio output drivers) |
|
|
std::map<String,DeviceCreationParameter*> available_parameters = AudioOutputDevice::AvailableParameters(); |
|
|
return available_parameters; // this driver currently does not have additional, individual device parameters |
|
|
} |
|
|
|
|
|
|
|
156 |
// libjack callback functions |
// libjack callback functions |
157 |
|
|
158 |
int __libjack_process_callback(jack_nframes_t nframes, void* arg) { |
int __libjack_process_callback(jack_nframes_t nframes, void* arg) { |