/* 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 __MusicInstrument_drumlike_H__ #define __MusicInstrument_drumlike_H__ #ifdef __cplusplus extern "C" { #endif typedef struct MusicInstrument_drumlike MusicInstrument_drumlike; #define MusicInstrument_drumlike_superclass MusicInstrument #include "audiosynth/AudioSamplerParameters_multitrack.h" #include "audiosynth/MusicInstrument.h" #include "audiosynth/Note.h" struct MusicInstrument_drumlike_entry { NoteValue note; AudioSamplerParameters_multitrack * audioSamplerParameters; }; #define MusicInstrument_drumlike_ivars \ MusicInstrument_ivars \ \ unsigned int entryCount; \ struct MusicInstrument_drumlike_entry * entries; #define MusicInstrument_drumlike_vtable(self_type) \ MusicInstrument_vtable(self_type) stemobject_declare(MusicInstrument_drumlike) MusicInstrument_drumlike * MusicInstrument_drumlike_create(void); bool MusicInstrument_drumlike_init(MusicInstrument_drumlike * self); void MusicInstrument_drumlike_dispose(MusicInstrument_drumlike * self); MusicInstrument_drumlike * MusicInstrument_drumlike_copy(MusicInstrument_drumlike * self); void MusicInstrument_drumlike_initCopy(MusicInstrument_drumlike * self, MusicInstrument_drumlike * original); AudioSamplerParameters * MusicInstrument_drumlike_createAudioSamplerParameters(MusicInstrument_drumlike * self, struct MusicPattern_note * note); // Takes ownership of parameters void MusicInstrument_drumlike_setEntry(MusicInstrument_drumlike * self, NoteValue note, AudioSamplerParameters_multitrack * parameters); void MusicInstrument_drumlike_removeEntry(MusicInstrument_drumlike * self, NoteValue note); #ifdef __cplusplus } #endif #endif