···11+/*
22+This file is part of Darling.
33+44+Copyright (C) 2020 Lubos Dolezel
55+66+Darling is free software: you can redistribute it and/or modify
77+it under the terms of the GNU General Public License as published by
88+the Free Software Foundation, either version 3 of the License, or
99+(at your option) any later version.
1010+1111+Darling is distributed in the hope that it will be useful,
1212+but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+GNU General Public License for more details.
1515+1616+You should have received a copy of the GNU General Public License
1717+along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+#include "DefaultOutputAU.h"
2020+2121+#pragma GCC visibility push(default)
2222+AUDIOCOMPONENT_ENTRY(AUOutputBaseFactory, DefaultOutputAU);
2323+#pragma GCC visibility pop
2424+2525+enum {
2626+ kOutputBus = 0,
2727+ kInputBus
2828+};
2929+3030+DefaultOutputAU::DefaultOutputAU(AudioComponentInstance inInstance)
3131+: AUHAL(inInstance)
3232+{
3333+}
3434+3535+OSStatus DefaultOutputAU::GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32& outDataSize, Boolean& outWritable)
3636+{
3737+ OSStatus status = AUHAL::GetPropertyInfo(inID, inScope, inElement, outDataSize, outWritable);
3838+3939+ if (inID == kAudioOutputUnitProperty_CurrentDevice)
4040+ outWritable = false;
4141+4242+ return status;
4343+}
4444+4545+OSStatus DefaultOutputAU::SetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope,
4646+ AudioUnitElement inElement, const void* inData, UInt32 inDataSize)
4747+{
4848+ switch (inID)
4949+ {
5050+ case kAudioOutputUnitProperty_CurrentDevice:
5151+ return kAudioUnitErr_InvalidProperty;
5252+ }
5353+ return AUHAL::SetProperty(inID, inScope, inElement, inData, inDataSize);
5454+}
···11+/*
22+This file is part of Darling.
33+44+Copyright (C) 2020 Lubos Dolezel
55+66+Darling is free software: you can redistribute it and/or modify
77+it under the terms of the GNU General Public License as published by
88+the Free Software Foundation, either version 3 of the License, or
99+(at your option) any later version.
1010+1111+Darling is distributed in the hope that it will be useful,
1212+but WITHOUT ANY WARRANTY; without even the implied warranty of
1313+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1414+GNU General Public License for more details.
1515+1616+You should have received a copy of the GNU General Public License
1717+along with Darling. If not, see <http://www.gnu.org/licenses/>.
1818+*/
1919+2020+#ifndef _CA_DEFAULT_OUTPUT_AU_H
2121+#define _CA_DEFAULT_OUTPUT_AU_H
2222+#include "AUHAL.h"
2323+2424+class DefaultOutputAU : public AUHAL
2525+{
2626+public:
2727+ DefaultOutputAU(AudioComponentInstance inInstance);
2828+ OSStatus GetPropertyInfo(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32& outDataSize, Boolean& outWritable) override;
2929+ OSStatus SetProperty(AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void* inData, UInt32 inDataSize) override;
3030+};
3131+3232+#endif