this repo has no description
1/*
2This file is part of Darling.
3
4Copyright (C) 2020 Lubos Dolezel
5
6Darling is free software: you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11Darling is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with Darling. If not, see <http://www.gnu.org/licenses/>.
18*/
19#include "DefaultOutputAU.h"
20
21#pragma GCC visibility push(default)
22AUDIOCOMPONENT_ENTRY(AUOutputBaseFactory, DefaultOutputAU);
23#pragma GCC visibility pop
24
25enum {
26 kOutputBus = 0,
27 kInputBus
28};
29
30DefaultOutputAU::DefaultOutputAU(AudioComponentInstance inInstance)
31: AUHAL(inInstance)
32{
33}
34
35OSStatus DefaultOutputAU::GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32& outDataSize, Boolean& outWritable)
36{
37 OSStatus status = AUHAL::GetPropertyInfo(inID, inScope, inElement, outDataSize, outWritable);
38
39 if (inID == kAudioOutputUnitProperty_CurrentDevice)
40 outWritable = false;
41
42 return status;
43}
44
45OSStatus DefaultOutputAU::SetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope,
46 AudioUnitElement inElement, const void* inData, UInt32 inDataSize)
47{
48 switch (inID)
49 {
50 case kAudioOutputUnitProperty_CurrentDevice:
51 return kAudioUnitErr_InvalidProperty;
52 }
53 return AUHAL::SetProperty(inID, inScope, inElement, inData, inDataSize);
54}