/[svn]/linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceCoreAudio.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceCoreAudio.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2183 - (show annotations) (download)
Sat Jun 11 17:53:32 2011 UTC (7 years, 11 months ago) by persson
File size: 22523 byte(s)
* Mac OS X fixes: support the new dir for Core Audio SDK, fixed name
  collision of enum in EffectControl, fixed building outside source
  directory, fixed wrong name of destructor in
  AudioOutputDeviceCoreAudio.cpp
* made sure all source files for hostplugins are included when doing
  "make dist"
* removed empty directories left from the cvs to svn migration

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2009 Grigor Iliev *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 #include "AudioOutputDeviceCoreAudio.h"
24
25 #include "../../common/global_private.h"
26
27 namespace LinuxSampler {
28
29 void AudioOutputDeviceCoreAudio::AudioQueueListener (
30 void *inUserData, AudioQueueRef inAQ, AudioQueuePropertyID inID
31 ) {
32 switch(inID) {
33 case kAudioQueueProperty_IsRunning:
34
35 break;
36 case kAudioQueueProperty_CurrentDevice:
37
38 break;
39 }
40 }
41
42 void AudioOutputDeviceCoreAudio::HandleOutputBuffer (
43 void *aqData,
44 AudioQueueRef inAQ,
45 AudioQueueBufferRef inBuffer
46 ) {
47 AQPlayerState* pAqData = (AQPlayerState*) aqData;
48 if (atomic_read(&(pAqData->mIsRunning)) == 0) {
49 AudioQueueFlush(pAqData->mQueue);
50 AudioQueueStop (pAqData->mQueue, true);
51 return;
52 }
53
54 if(atomic_read(&(pAqData->pDevice->restartQueue))) return;
55
56 uint bufferSize = pAqData->pDevice->uiBufferSize;
57
58 // let all connected engines render 'fragmentSize' sample points
59 pAqData->pDevice->RenderAudio(bufferSize);
60
61 Float32* pDataBuf = (Float32*)(inBuffer->mAudioData);
62
63 uint uiCoreAudioChannels = pAqData->pDevice->uiCoreAudioChannels;
64 for (int c = 0; c < uiCoreAudioChannels; c++) {
65 float* in = pAqData->pDevice->Channels[c]->Buffer();
66 for (int i = 0, o = c; i < bufferSize; i++ , o += uiCoreAudioChannels) {
67 pDataBuf[o] = in[i];
68 }
69 }
70
71 inBuffer->mAudioDataByteSize = (uiCoreAudioChannels * 4) * bufferSize;
72
73 OSStatus res = AudioQueueEnqueueBuffer(pAqData->mQueue, inBuffer, 0, NULL);
74 if(res) std::cerr << "AudioQueueEnqueueBuffer: Error " << res << std::endl;
75 }
76
77 void AudioOutputDeviceCoreAudio::DeviceChanged() {
78 dmsg(1,("Restarting audio queue..."));
79 atomic_set(&restartQueue, 1);
80 }
81
82 AudioOutputDeviceCoreAudio::AudioOutputDeviceCoreAudio (
83 std::map<String,DeviceCreationParameter*> Parameters
84 ) : AudioOutputDevice(Parameters), Thread(true, true, 1, 0), CurrentDevice(0) {
85
86 dmsg(2,("AudioOutputDeviceCoreAudio::AudioOutputDeviceCoreAudio()\n"));
87 if(CAAudioDeviceListModel::GetModel()->GetOutputDeviceCount() < 1) {
88 throw Exception("No audio output device found");
89 }
90 atomic_set(&pausedNew, 0);
91 pausedOld = 0;
92 atomic_set(&restartQueue, 0);
93
94 uiCoreAudioChannels = ((DeviceCreationParameterInt*)Parameters["CHANNELS"])->ValueAsInt();
95 uint samplerate = ((DeviceCreationParameterInt*)Parameters["SAMPLERATE"])->ValueAsInt();
96 uiBufferNumber = ((DeviceCreationParameterInt*)Parameters["BUFFERS"])->ValueAsInt();
97 uiBufferSize = ((DeviceCreationParameterInt*)Parameters["BUFFERSIZE"])->ValueAsInt();
98 int device = 0;
99 try { device = ((ParameterDevice*)Parameters["DEVICE"])->GetDeviceIndex(); }
100 catch(Exception x) { }
101
102 CurrentDevice = CAAudioDeviceListModel::GetModel()->GetOutputDevice(device);
103 CurrentDevice.AddListener(this);
104
105 memset (&aqPlayerState.mDataFormat, 0, sizeof(AudioStreamBasicDescription));
106
107 aqPlayerState.mDataFormat.mSampleRate = samplerate;
108 aqPlayerState.mDataFormat.mFormatID = kAudioFormatLinearPCM;
109
110 aqPlayerState.mDataFormat.mFormatFlags =
111 kLinearPCMFormatFlagIsFloat | kLinearPCMFormatFlagIsPacked;
112
113 int samplesize = 4;
114 aqPlayerState.mDataFormat.mBytesPerPacket = uiCoreAudioChannels * samplesize;
115 aqPlayerState.mDataFormat.mFramesPerPacket = 1;
116 aqPlayerState.mDataFormat.mBytesPerFrame = uiCoreAudioChannels * samplesize;
117 aqPlayerState.mDataFormat.mChannelsPerFrame = uiCoreAudioChannels;
118 aqPlayerState.mDataFormat.mBitsPerChannel = 8 * samplesize;
119 aqPlayerState.mDataFormat.mReserved = 0;
120
121 aqPlayerState.mBuffers = new AudioQueueBufferRef[uiBufferNumber];
122
123 aqPlayerState.bufferByteSize =
124 MaxSamplesPerCycle() * aqPlayerState.mDataFormat.mBytesPerFrame;
125
126 aqPlayerState.mNumPacketsToRead = MaxSamplesPerCycle();
127
128 aqPlayerState.pDevice = this;
129 aqPlayerState.mQueue = NULL;
130
131 uint fragmentSize = MaxSamplesPerCycle();
132 // create audio channels for this audio device to which the sampler engines can write to
133 for (int i = 0; i < uiCoreAudioChannels; i++) {
134 this->Channels.push_back(new AudioChannel(i, fragmentSize));
135 }
136
137 StartThread();
138
139 if (!((DeviceCreationParameterBool*)Parameters["ACTIVE"])->ValueAsBool()) {
140 Stop();
141 }
142 }
143
144 AudioOutputDeviceCoreAudio::~AudioOutputDeviceCoreAudio() {
145 atomic_set(&(aqPlayerState.mIsRunning), 0);
146 destroyMutex.Lock();
147 AudioQueueDispose(aqPlayerState.mQueue, true);
148 destroyMutex.Unlock();
149 delete [] aqPlayerState.mBuffers;
150
151 CurrentDevice.RemoveListener(this);
152 }
153
154 String AudioOutputDeviceCoreAudio::Name() {
155 return "COREAUDIO";
156 }
157
158 String AudioOutputDeviceCoreAudio::Description() {
159 return "Apple CoreAudio";
160 }
161
162 String AudioOutputDeviceCoreAudio::Version() {
163 String s = "$Revision: 1.5 $";
164 return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
165 }
166
167 void AudioOutputDeviceCoreAudio::Play() {
168 atomic_set(&pausedNew, 0);
169 }
170
171 bool AudioOutputDeviceCoreAudio::IsPlaying() {
172 return !atomic_read(&pausedNew);
173 }
174
175 void AudioOutputDeviceCoreAudio::Stop() {
176 atomic_set(&pausedNew, 1);
177 }
178
179 uint AudioOutputDeviceCoreAudio::MaxSamplesPerCycle() {
180 return uiBufferSize;
181 }
182
183 uint AudioOutputDeviceCoreAudio::SampleRate() {
184 return aqPlayerState.mDataFormat.mSampleRate;
185 }
186
187 String AudioOutputDeviceCoreAudio::Driver() {
188 return Name();
189 }
190
191 AudioChannel* AudioOutputDeviceCoreAudio::CreateChannel(uint ChannelNr) {
192 // just create a mix channel
193 return new AudioChannel(ChannelNr, Channel(ChannelNr % uiCoreAudioChannels));
194 }
195
196 void AudioOutputDeviceCoreAudio::FillBuffers() {
197 for (int i = 0; i < uiBufferNumber; ++i) {
198 HandleOutputBuffer (
199 &aqPlayerState,
200 aqPlayerState.mQueue,
201 aqPlayerState.mBuffers[i]
202 );
203 }
204 }
205
206 void AudioOutputDeviceCoreAudio::PrimeAudioQueue() {
207 OSStatus res = AudioQueuePrime(aqPlayerState.mQueue, 0, NULL);
208 if(res) {
209 String s = String("AudioQueuePrime: Error ") + ToString(res);
210 throw Exception(s);
211 }
212 }
213
214 void AudioOutputDeviceCoreAudio::CreateAndStartAudioQueue() throw(Exception) {
215 OSStatus res = AudioQueueNewOutput (
216 &aqPlayerState.mDataFormat,
217 HandleOutputBuffer,
218 &aqPlayerState,
219 CFRunLoopGetCurrent(),
220 kCFRunLoopCommonModes,
221 0,
222 &aqPlayerState.mQueue
223 );
224
225 if(res) {
226 String s = String("AudioQueueNewOutput: Error ") + ToString(res);
227 throw Exception(s);
228 }
229
230 CFStringRef devUID = CFStringCreateWithCString (
231 NULL, CurrentDevice.GetUID().c_str(), kCFStringEncodingASCII
232 );
233 res = AudioQueueSetProperty (
234 aqPlayerState.mQueue,
235 kAudioQueueProperty_CurrentDevice,
236 &devUID, sizeof(CFStringRef)
237 );
238 CFRelease(devUID);
239
240 if(res) {
241 String s = String("Failed to set audio device: ") + ToString(res);
242 throw Exception(s);
243 }
244
245 for (int i = 0; i < uiBufferNumber; ++i) {
246 res = AudioQueueAllocateBuffer (
247 aqPlayerState.mQueue,
248 aqPlayerState.bufferByteSize,
249 &aqPlayerState.mBuffers[i]
250 );
251
252 if(res) {
253 String s = String("AudioQueueAllocateBuffer: Error ");
254 throw Exception(s + ToString(res));
255 }
256 }
257
258 res = AudioQueueAddPropertyListener (
259 aqPlayerState.mQueue,
260 kAudioQueueProperty_CurrentDevice,
261 AudioQueueListener,
262 NULL
263 );
264 if(res) std::cerr << "Failed to register device change listener: " << res << std::endl;
265
266 res = AudioQueueAddPropertyListener (
267 aqPlayerState.mQueue,
268 kAudioQueueProperty_IsRunning,
269 AudioQueueListener,
270 NULL
271 );
272 if(res) std::cerr << "Failed to register running listener: " << res << std::endl;
273
274 Float32 gain = 1.0;
275
276 res = AudioQueueSetParameter (
277 aqPlayerState.mQueue,
278 kAudioQueueParam_Volume,
279 gain
280 );
281
282 if(res) std::cerr << "AudioQueueSetParameter: Error " << res << std::endl;
283
284 atomic_set(&(aqPlayerState.mIsRunning), 1);
285 FillBuffers();
286 PrimeAudioQueue();
287
288 res = AudioQueueStart(aqPlayerState.mQueue, NULL);
289 if(res) {
290 String s = String("AudioQueueStart: Error ") + ToString(res);
291 throw Exception(s);
292 }
293 }
294
295 void AudioOutputDeviceCoreAudio::DestroyAudioQueue() {
296 AudioQueueFlush(aqPlayerState.mQueue);
297 AudioQueueStop (aqPlayerState.mQueue, true);
298 AudioQueueDispose(aqPlayerState.mQueue, true);
299 aqPlayerState.mQueue = NULL;
300 }
301
302 /**
303 * Entry point for the thread.
304 */
305 int AudioOutputDeviceCoreAudio::Main() {
306 dmsg(1,("CoreAudio thread started\n"));
307 OSStatus res;
308 if(aqPlayerState.mQueue == NULL) {
309 /*
310 * Need to be run from this thread because of CFRunLoopGetCurrent()
311 * which returns the CFRunLoop object for the current thread.
312 */
313 try { CreateAndStartAudioQueue(); }
314 catch(Exception e) {
315 std::cerr << "Failed to star audio queue: " + e.Message() << std::endl;
316 return 0;
317 }
318 }
319
320 destroyMutex.Lock();
321 do {
322 if(atomic_read(&pausedNew) != pausedOld) {
323 pausedOld = atomic_read(&pausedNew);
324
325 if(pausedOld) {
326 res = AudioQueuePause(aqPlayerState.mQueue);
327 if(res) std::cerr << "AudioQueuePause: Error " << res << std::endl;
328 } else {
329 res = AudioQueuePrime(aqPlayerState.mQueue, 0, NULL);
330 if(res) std::cerr << "AudioQueuePrime: Error " << res << std::endl;
331 res = AudioQueueStart(aqPlayerState.mQueue, NULL);
332 if(res) std::cerr << "AudioQueueStart: Error " << res << std::endl;
333 }
334 }
335
336 if(atomic_read(&restartQueue)) {
337 DestroyAudioQueue();
338 try { CreateAndStartAudioQueue(); }
339 catch(Exception e) {
340 destroyMutex.Unlock();
341 throw e;
342 }
343 atomic_set(&restartQueue, 0);
344 dmsg(1,("Audio queue restarted"));
345 }
346
347 CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.2, false);
348 } while (atomic_read(&(aqPlayerState.mIsRunning)));
349 destroyMutex.Unlock();
350
351 dmsg(2,("CoreAudio thread stopped\n"));
352
353 pthread_exit(NULL);
354 return 0;
355 }
356
357
358 // *************** ParameterDevice ***************
359 // *
360
361 AudioOutputDeviceCoreAudio::ParameterDevice::ParameterDevice() : DeviceCreationParameterString() {
362 InitWithDefault(); // use default device
363 }
364
365 AudioOutputDeviceCoreAudio::ParameterDevice::ParameterDevice(String s)
366 throw (Exception) : DeviceCreationParameterString(s) {
367 }
368
369 String AudioOutputDeviceCoreAudio::ParameterDevice::Description() {
370 return "Output device to be used";
371 }
372
373 bool AudioOutputDeviceCoreAudio::ParameterDevice::Fix() {
374 return true;
375 }
376
377 bool AudioOutputDeviceCoreAudio::ParameterDevice::Mandatory() {
378 return false;
379 }
380
381 std::map<String,DeviceCreationParameter*>
382 AudioOutputDeviceCoreAudio::ParameterDevice::DependsAsParameters() {
383 return std::map<String,DeviceCreationParameter*>(); // no dependencies
384 }
385
386 optional<String>
387 AudioOutputDeviceCoreAudio::ParameterDevice::DefaultAsString(std::map<String,String> Parameters) {
388 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
389 if (devs->GetOutputDeviceCount() < 1) {
390 throw Exception("AudioOutputDeviceCoreAudio: Can't find any output device");
391 }
392 UInt32 idx = devs->GetOutputDeviceIndex(devs->GetDefaultOutputDeviceID());
393 return CreateDeviceName(idx);
394 }
395
396 std::vector<String>
397 AudioOutputDeviceCoreAudio::ParameterDevice::PossibilitiesAsString(std::map<String,String> Parameters) {
398 std::vector<String> deviceNames;
399
400 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
401 for(int i = 0; i < devs->GetOutputDeviceCount(); i++) {
402 if(devs->GetOutputDevice(i).GetChannelNumber() < 1) continue;
403
404 deviceNames.push_back(CreateDeviceName(i));
405 }
406
407 return deviceNames;
408 }
409
410 String AudioOutputDeviceCoreAudio::ParameterDevice::CreateDeviceName(int devIndex) {
411 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
412 // Note that the space " " is used as delimiter to obtain the
413 // device index. See GetDeviceIndex()
414 return ToString(devIndex + 1) + " " + devs->GetOutputDevice(devIndex).GetName();
415 }
416
417 void AudioOutputDeviceCoreAudio::ParameterDevice::OnSetValue(String s) throw (Exception) {
418 // not posssible, as parameter is fix
419 }
420
421 String AudioOutputDeviceCoreAudio::ParameterDevice::Name() {
422 return "DEVICE";
423 }
424
425 int AudioOutputDeviceCoreAudio::ParameterDevice::GetDeviceIndex() {
426 String s = ValueAsString();
427 if(s.empty()) return -1;
428 int n = s.find(' ');
429 s = s.substr(0, n);
430 return ToInt(s) - 1;
431 }
432
433 // *************** ParameterSampleRate ***************
434 // *
435
436 AudioOutputDeviceCoreAudio::ParameterSampleRate::ParameterSampleRate() :
437 AudioOutputDevice::ParameterSampleRate::ParameterSampleRate() {
438
439 }
440
441 AudioOutputDeviceCoreAudio::ParameterSampleRate::ParameterSampleRate(String s) :
442 AudioOutputDevice::ParameterSampleRate::ParameterSampleRate(s) {
443
444 }
445
446 std::map<String,DeviceCreationParameter*>
447 AudioOutputDeviceCoreAudio::ParameterSampleRate::DependsAsParameters() {
448 static ParameterDevice device;
449 std::map<String,DeviceCreationParameter*> dependencies;
450 dependencies[device.Name()] = &device;
451 return dependencies;
452 }
453
454 optional<int>
455 AudioOutputDeviceCoreAudio::ParameterSampleRate::DefaultAsInt(std::map<String,String> Parameters) {
456 dmsg(2,("AudioOutputDeviceCoreAudio::ParameterSampleRate::DefaultAsInt()\n"));
457 ParameterDevice dev(Parameters["DEVICE"]);
458 int samplerate = 44100;
459
460 try {
461 int idx = dev.GetDeviceIndex();
462
463 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
464 samplerate = devs->GetOutputDevice(idx).GetDefaultSamplerate();
465 } catch(Exception e) { }
466
467 return samplerate;
468 }
469
470 std::vector<int>
471 AudioOutputDeviceCoreAudio::ParameterSampleRate::PossibilitiesAsInt(std::map<String,String> Parameters) {
472 ParameterDevice dev(Parameters["DEVICE"]);
473 std::vector<int> srates;
474
475 try {
476 int idx = dev.GetDeviceIndex();
477 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
478 srates = devs->GetOutputDevice(idx).GetNominalSamplerates();
479 } catch(Exception x) { }
480
481 return srates;
482 }
483
484
485 // *************** ParameterChannels ***************
486 // *
487
488 AudioOutputDeviceCoreAudio::ParameterChannels::ParameterChannels() :
489 AudioOutputDevice::ParameterChannels::ParameterChannels() {
490
491 }
492
493 AudioOutputDeviceCoreAudio::ParameterChannels::ParameterChannels(String s) :
494 AudioOutputDevice::ParameterChannels::ParameterChannels(s) {
495
496 }
497
498 optional<int>
499 AudioOutputDeviceCoreAudio::ParameterChannels::DefaultAsInt(std::map<String,String> Parameters) {
500 dmsg(2,("AudioOutputDeviceCoreAudio::ParameterChannels::DefaultAsInt()\n"));
501 ParameterDevice dev(Parameters["DEVICE"]);
502 int chns = 2;
503
504 try {
505 int idx = dev.GetDeviceIndex();
506 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
507 chns = devs->GetOutputDevice(idx).GetChannelNumber();
508 } catch(Exception e) { }
509
510 return chns;
511 }
512
513 std::vector<int>
514 AudioOutputDeviceCoreAudio::ParameterChannels::PossibilitiesAsInt(std::map<String,String> Parameters) {
515 ParameterDevice dev(Parameters["DEVICE"]);
516 std::vector<int> chns;
517
518 try {
519 int idx = dev.GetDeviceIndex();
520 CAAudioDeviceListModel* devs = CAAudioDeviceListModel::GetModel();
521 for(int i = 1; i <= devs->GetOutputDevice(idx).GetChannelNumber(); i++) {
522 chns.push_back(i);
523 }
524 } catch(Exception x) { }
525
526 return chns;
527 }
528
529 // *************** ParameterBuffers ***************
530 // *
531
532 AudioOutputDeviceCoreAudio::ParameterBuffers::ParameterBuffers() : DeviceCreationParameterInt() {
533 InitWithDefault();
534 }
535
536 AudioOutputDeviceCoreAudio::ParameterBuffers::ParameterBuffers(String s)
537 throw (Exception) : DeviceCreationParameterInt(s) {
538 }
539
540 String AudioOutputDeviceCoreAudio::ParameterBuffers::Description() {
541 return "Number of audio buffer";
542 }
543
544 bool AudioOutputDeviceCoreAudio::ParameterBuffers::Fix() {
545 return true;
546 }
547
548 bool AudioOutputDeviceCoreAudio::ParameterBuffers::Mandatory() {
549 return false;
550 }
551
552 std::map<String,DeviceCreationParameter*>
553 AudioOutputDeviceCoreAudio::ParameterBuffers::DependsAsParameters() {
554 return std::map<String,DeviceCreationParameter*>();
555 }
556
557 optional<int>
558 AudioOutputDeviceCoreAudio::ParameterBuffers::DefaultAsInt(std::map<String,String> Parameters) {
559 return 3;
560 }
561
562 optional<int>
563 AudioOutputDeviceCoreAudio::ParameterBuffers::RangeMinAsInt(std::map<String,String> Parameters) {
564 return 2;
565 }
566
567 optional<int>
568 AudioOutputDeviceCoreAudio::ParameterBuffers::RangeMaxAsInt(std::map<String,String> Parameters) {
569 return 16;
570 }
571
572 std::vector<int>
573 AudioOutputDeviceCoreAudio::ParameterBuffers::PossibilitiesAsInt(std::map<String,String> Parameters) {
574 return std::vector<int>();
575 }
576
577 void AudioOutputDeviceCoreAudio::ParameterBuffers::OnSetValue(int i) throw (Exception) {
578 // not posssible, as parameter is fix
579 }
580
581 String AudioOutputDeviceCoreAudio::ParameterBuffers::Name() {
582 return "BUFFERS";
583 }
584
585 // *************** ParameterBufferSize ***************
586 // *
587
588 AudioOutputDeviceCoreAudio::ParameterBufferSize::ParameterBufferSize() : DeviceCreationParameterInt() {
589 InitWithDefault();
590 }
591
592 AudioOutputDeviceCoreAudio::ParameterBufferSize::ParameterBufferSize(String s)
593 throw (Exception) : DeviceCreationParameterInt(s) {
594 }
595
596 String AudioOutputDeviceCoreAudio::ParameterBufferSize::Description() {
597 return "Size of the audio buffer in sample frames";
598 }
599
600 bool AudioOutputDeviceCoreAudio::ParameterBufferSize::Fix() {
601 return true;
602 }
603
604 bool AudioOutputDeviceCoreAudio::ParameterBufferSize::Mandatory() {
605 return false;
606 }
607
608 std::map<String,DeviceCreationParameter*>
609 AudioOutputDeviceCoreAudio::ParameterBufferSize::DependsAsParameters() {
610 return std::map<String,DeviceCreationParameter*>();
611 }
612
613 optional<int>
614 AudioOutputDeviceCoreAudio::ParameterBufferSize::DefaultAsInt(std::map<String,String> Parameters) {
615 return 256;
616 }
617
618 optional<int>
619 AudioOutputDeviceCoreAudio::ParameterBufferSize::RangeMinAsInt(std::map<String,String> Parameters) {
620 return 32;
621 }
622
623 optional<int>
624 AudioOutputDeviceCoreAudio::ParameterBufferSize::RangeMaxAsInt(std::map<String,String> Parameters) {
625 return 4096;
626 }
627
628 std::vector<int>
629 AudioOutputDeviceCoreAudio::ParameterBufferSize::PossibilitiesAsInt(std::map<String,String> Parameters) {
630 return std::vector<int>();
631 }
632
633 void AudioOutputDeviceCoreAudio::ParameterBufferSize::OnSetValue(int i) throw (Exception) {
634 // not posssible, as parameter is fix
635 }
636
637 String AudioOutputDeviceCoreAudio::ParameterBufferSize::Name() {
638 return "BUFFERSIZE";
639 }
640 } // namespace LinuxSampler

  ViewVC Help
Powered by ViewVC