/* 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 __WaveSampler_modified_H__ #define __WaveSampler_modified_H__ #ifdef __cplusplus extern "C" { #endif typedef struct WaveSampler_modified WaveSampler_modified; #define WaveSampler_modified_superclass WaveSampler #include "audiosynth/WaveModifier.h" #include "audiosynth/WaveSampler.h" #define WaveSampler_modified_ivars \ WaveSampler_ivars \ \ WaveSampler * sampler; \ unsigned int modifierCount; \ WaveModifier ** modifiers; \ WaveSampler * entryPoint; #define WaveSampler_modified_vtable(self_type) \ WaveSampler_vtable(self_type) stemobject_declare(WaveSampler_modified) // Take ownership of all contents of modifiers WaveSampler_modified * WaveSampler_modified_create(compat_type(WaveSampler *) sampler, unsigned int modifierCount, compat_type(WaveModifier **) modifiers); bool WaveSampler_modified_init(WaveSampler_modified * self, compat_type(WaveSampler *) sampler, unsigned int modifierCount, compat_type(WaveModifier **) modifiers); void WaveSampler_modified_dispose(WaveSampler_modified * self); WaveSampler_modified * WaveSampler_modified_copy(WaveSampler_modified * self); bool WaveSampler_modified_isEqual(WaveSampler_modified * self, compat_type(WaveSampler_modified *) compare); uint32_t WaveSampler_modified_hash(WaveSampler_modified * self, uint32_t initval); void WaveSampler_modified_initCopy(WaveSampler_modified * self, WaveSampler_modified * original); // Modifier list must not be mutated between initializing and disposing state SamplerObject_state * WaveSampler_modified_initState(WaveSampler_modified * self); void WaveSampler_modified_disposeState(WaveSampler_modified * self, SamplerObject_state * state); unsigned int WaveSampler_modified_getPropertyCount(WaveSampler_modified * self); SynthProperty WaveSampler_modified_getPropertyAtIndex(WaveSampler_modified * self, unsigned int index); float WaveSampler_modified_getPropertyValueStateless(WaveSampler_modified * self, SynthPropertyIdentifier propertyIdentifier); void WaveSampler_modified_setPropertyValue(WaveSampler_modified * self, SamplerObject_state * state, SynthPropertyIdentifier propertyIdentifier, float value); float WaveSampler_modified_sample(WaveSampler_modified * self, SamplerObject_state * state, float phase, float phaseDelta, float time, float timeDelta); // Takes ownership of modifier void WaveSampler_modified_addModifier(WaveSampler_modified * self, compat_type(WaveModifier *) modifier); void WaveSampler_modified_reorderModifier(WaveSampler_modified * self, unsigned int modifierIndex, int offset); void WaveSampler_modified_removeModifier(WaveSampler_modified * self, unsigned int modifierIndex); // Call when changing modifier list directly, or updating mute/solo on any modifier void WaveSampler_modified_modifiersUpdated(WaveSampler_modified * self); #ifdef __cplusplus } #endif #endif