105 |
} |
} |
106 |
|
|
107 |
String AudioOutputDeviceAlsa::ParameterCard::Name() { |
String AudioOutputDeviceAlsa::ParameterCard::Name() { |
108 |
return "card"; |
return "CARD"; |
109 |
} |
} |
110 |
|
|
111 |
|
|
160 |
} |
} |
161 |
|
|
162 |
String AudioOutputDeviceAlsa::ParameterFragments::Name() { |
String AudioOutputDeviceAlsa::ParameterFragments::Name() { |
163 |
return "fragments"; |
return "FRAGMENTS"; |
164 |
} |
} |
165 |
|
|
166 |
|
|
215 |
} |
} |
216 |
|
|
217 |
String AudioOutputDeviceAlsa::ParameterFragmentSize::Name() { |
String AudioOutputDeviceAlsa::ParameterFragmentSize::Name() { |
218 |
return "fragmentsize"; |
return "FRAGMENTSIZE"; |
219 |
} |
} |
220 |
|
|
221 |
|
|
232 |
AudioOutputDeviceAlsa::AudioOutputDeviceAlsa(std::map<String,DeviceCreationParameter*> Parameters) : AudioOutputDevice(Parameters), Thread(true, 1, 0) { |
AudioOutputDeviceAlsa::AudioOutputDeviceAlsa(std::map<String,DeviceCreationParameter*> Parameters) : AudioOutputDevice(Parameters), Thread(true, 1, 0) { |
233 |
pcm_handle = NULL; |
pcm_handle = NULL; |
234 |
stream = SND_PCM_STREAM_PLAYBACK; |
stream = SND_PCM_STREAM_PLAYBACK; |
235 |
this->uiAlsaChannels = ((DeviceCreationParameterInt*)Parameters["channels"])->ValueAsInt(); |
this->uiAlsaChannels = ((DeviceCreationParameterInt*)Parameters["CHANNELS"])->ValueAsInt(); |
236 |
this->uiSamplerate = ((DeviceCreationParameterInt*)Parameters["samplerate"])->ValueAsInt(); |
this->uiSamplerate = ((DeviceCreationParameterInt*)Parameters["SAMPLERATE"])->ValueAsInt(); |
237 |
this->FragmentSize = ((DeviceCreationParameterInt*)Parameters["fragmentsize"])->ValueAsInt(); |
this->FragmentSize = ((DeviceCreationParameterInt*)Parameters["FRAGMENTSIZE"])->ValueAsInt(); |
238 |
uint Fragments = ((DeviceCreationParameterInt*)Parameters["fragments"])->ValueAsInt(); |
uint Fragments = ((DeviceCreationParameterInt*)Parameters["FRAGMENTS"])->ValueAsInt(); |
239 |
String Card = ((DeviceCreationParameterString*)Parameters["card"])->ValueAsString(); |
String Card = ((DeviceCreationParameterString*)Parameters["CARD"])->ValueAsString(); |
240 |
|
|
241 |
dmsg(1,("Checking if hw parameters supported...\n")); |
dmsg(1,("Checking if hw parameters supported...\n")); |
242 |
if (HardwareParametersSupported(Card, uiAlsaChannels, uiSamplerate, Fragments, FragmentSize)) { |
if (HardwareParametersSupported(Card, uiAlsaChannels, uiSamplerate, Fragments, FragmentSize)) { |
346 |
// create audio channels for this audio device to which the sampler engines can write to |
// create audio channels for this audio device to which the sampler engines can write to |
347 |
for (int i = 0; i < uiAlsaChannels; i++) this->Channels.push_back(new AudioChannel(FragmentSize)); |
for (int i = 0; i < uiAlsaChannels; i++) this->Channels.push_back(new AudioChannel(FragmentSize)); |
348 |
|
|
349 |
if (((DeviceCreationParameterBool*)Parameters["active"])->ValueAsBool()) { |
if (((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) { |
350 |
Play(); |
Play(); |
351 |
} |
} |
352 |
} |
} |
447 |
} |
} |
448 |
|
|
449 |
String AudioOutputDeviceAlsa::Name() { |
String AudioOutputDeviceAlsa::Name() { |
450 |
return "Alsa"; |
return "ALSA"; |
451 |
} |
} |
452 |
|
|
453 |
String AudioOutputDeviceAlsa::Driver() { |
String AudioOutputDeviceAlsa::Driver() { |
459 |
} |
} |
460 |
|
|
461 |
String AudioOutputDeviceAlsa::Version() { |
String AudioOutputDeviceAlsa::Version() { |
462 |
String s = "$Revision: 1.12 $"; |
String s = "$Revision: 1.13 $"; |
463 |
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 |
464 |
} |
} |
465 |
|
|
510 |
} |
} |
511 |
|
|
512 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |
|
|
|