/* Copyright (c) 2021 Alex Diener This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Alex Diener alex@ludobloom.com */ #ifndef __WaveModifier_H__ #define __WaveModifier_H__ #ifdef __cplusplus extern "C" { #endif typedef struct WaveModifier WaveModifier; #define WaveModifier_superclass WaveSampler #include "audiosynth/WaveSampler.h" struct WaveModifier_state { SamplerObject_state * upstreamState; float properties[1]; }; #define WaveModifier_ivars \ WaveSampler_ivars \ \ WaveSampler * upstream; \ SynthProperty * ownProperties; \ float blend; \ bool mute; \ bool solo; #define WaveModifier_vtable(self_type) \ WaveSampler_vtable(self_type) \ \ void (* setUpstream)(self_type * self, compat_type(WaveSampler *) upstream); \ unsigned int (* getOwnPropertyCount)(self_type * self); \ SynthProperty * (* getOwnProperties)(self_type * self); stemobject_declare(WaveModifier) bool WaveModifier_init(WaveModifier * self); void WaveModifier_dispose(WaveModifier * self); bool WaveModifier_isEqual(WaveModifier * self, compat_type(WaveModifier *) compareUntyped); void WaveModifier_initCopy(WaveModifier * self, WaveModifier * original); SamplerObject_state * WaveModifier_initState(WaveModifier * self); void WaveModifier_disposeState(WaveModifier * self, SamplerObject_state * state); unsigned int WaveModifier_getPropertyCount(WaveModifier * self); SynthProperty WaveModifier_getPropertyAtIndex(WaveModifier * self, unsigned int index); float WaveModifier_getPropertyValueStateless(WaveModifier * self, SynthPropertyIdentifier propertyIdentifier); void WaveModifier_setPropertyValue(WaveModifier * self, SamplerObject_state * state, SynthPropertyIdentifier propertyIdentifier, float value); void WaveModifier_setUpstream(WaveModifier * self, compat_type(WaveSampler *) upstream); unsigned int WaveModifier_getOwnPropertyCount(WaveModifier * self); SynthProperty * WaveModifier_getOwnProperties(WaveModifier * self); #ifdef __cplusplus } #endif #endif