/* 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 */ #include "audiosynth/SamplerObject.h" #define stemobject_implementation SamplerObject stemobject_vtable_begin(); stemobject_vtable_entry(dispose); stemobject_vtable_entry(copy); stemobject_vtable_entry(isEqual); stemobject_vtable_entry(hash); stemobject_vtable_entry(initState); stemobject_vtable_entry(disposeState); stemobject_vtable_entry(getPropertyCount); stemobject_vtable_entry(getPropertyAtIndex); stemobject_vtable_entry(getPropertyValueStateless); stemobject_vtable_entry(setPropertyValue); stemobject_vtable_entry(getLength); stemobject_vtable_entry(sample); stemobject_vtable_end(); bool SamplerObject_init(SamplerObject * self) { call_super(init, self); static unsigned int nextUniqueID; self->runtimeUniqueID = nextUniqueID++; return true; } void SamplerObject_dispose(SamplerObject * self) { call_super_virtual(dispose, self); } SamplerObject * SamplerObject_copy(SamplerObject * self) { stemobject_copy_implementation(initCopy) } void SamplerObject_initCopy(SamplerObject * self, SamplerObject * original) { call_super(init, self); } bool SamplerObject_isEqual(SamplerObject * self, compat_type(SamplerObject *) compareUntyped) { SamplerObject * compare = compareUntyped; return StemObject_isExactClass(compare, self->vtable); } uint32_t SamplerObject_hash(SamplerObject * self, uint32_t initval) { return initval; } SamplerObject_state * SamplerObject_initState(SamplerObject * self) { return NULL; } void SamplerObject_disposeState(SamplerObject * self, SamplerObject_state * state) { free(state); } unsigned int SamplerObject_getPropertyCount(SamplerObject * self) { return 0; } SynthProperty SamplerObject_getPropertyAtIndex(SamplerObject * self, unsigned int index) { return SynthProperty_undefined; } float SamplerObject_getPropertyValueStateless(SamplerObject * self, SynthPropertyIdentifier propertyIdentifier) { return 0.0f; } void SamplerObject_setPropertyValue(SamplerObject * self, SamplerObject_state * state, SynthPropertyIdentifier propertyIdentifier, float value) { } float SamplerObject_getLength(SamplerObject * self) { return 1.0f; } float SamplerObject_sample(SamplerObject * self, SamplerObject_state * state, float phase, float phaseDelta, float time, float timeDelta) { return 0.0f; }