OSStatus AUBase::DispatchRemovePropertyValue()

in Source/AUBase.cpp [886:943]


OSStatus AUBase::DispatchRemovePropertyValue(
	AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement)
{
	OSStatus result = noErr;
	switch (inID) {
	case kAudioUnitProperty_AudioChannelLayout: {
		result = RemoveAudioChannelLayout(inScope, inElement);
		if (result == noErr) {
			PropertyChanged(inID, inScope, inElement);
		}
		break;
	}

	case kAudioUnitProperty_HostCallbacks: {
		AUSDK_Require(inScope == kAudioUnitScope_Global, kAudioUnitErr_InvalidScope);
		bool hasValue = false;
		const void* const ptr = &mHostCallbackInfo;
		for (size_t i = 0; i < sizeof(HostCallbackInfo); ++i) {
			if (static_cast<const char*>(ptr)[i] != 0) { // NOLINT
				hasValue = true;
				break;
			}
		}
		if (hasValue) {
			mHostCallbackInfo = {};
			PropertyChanged(inID, inScope, inElement);
		}
		break;
	}

	case kAudioUnitProperty_ContextName:
		mContextName = nullptr;
		result = noErr;
		break;

	case kAudioUnitProperty_NickName: {
		AUSDK_Require(inScope == kAudioUnitScope_Global, kAudioUnitErr_InvalidScope);
		mNickName = nullptr;
		PropertyChanged(inID, inScope, inElement);
		break;
	}

#if AUSDK_MIDI2_AVAILABLE
	case kAudioUnitProperty_HostMIDIProtocol: {
		AUSDK_Require(inScope == kAudioUnitScope_Global, kAudioUnitErr_InvalidScope);
		mHostMIDIProtocol = {};
		PropertyChanged(inID, inScope, inElement);
		break;
	}
#endif

	default:
		result = RemovePropertyValue(inID, inScope, inElement);
		break;
	}

	return result;
}