/* 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 __WaveShapeView_H__ #define __WaveShapeView_H__ typedef struct WaveShapeView WaveShapeView; #define WaveShapeView_superclass SamplerObjectGraphView #include "audiolab/SamplerObjectGraphView.h" #define WaveShapeView_ivars \ SamplerObjectGraphView_ivars \ \ float frequencyOffset; \ float phaseOffset; #define WaveShapeView_vtable(self_type) \ SamplerObjectGraphView_vtable(self_type) stemobject_declare(WaveShapeView) WaveShapeView * WaveShapeView_create(Vector2f position, Vector2f relativeOrigin, Vector2f size, compat_type(WaveSampler *) sampler, UIAppearance appearance); bool WaveShapeView_init(WaveShapeView * self, Vector2f position, Vector2f relativeOrigin, Vector2f size, compat_type(WaveSampler *) sampler, UIAppearance appearance); void WaveShapeView_dispose(WaveShapeView * self); void WaveShapeView_drawOverlay(WaveShapeView * self, SamplerObject_state * samplerState, Rect4f bounds, UIDrawingInterface * drawingInterface, VertexIO * vertexIO); Color4f WaveShapeView_getBackgroundColor(WaveShapeView * self); Color4f WaveShapeView_getSampleColor(WaveShapeView * self); float WaveShapeView_getSamplePhaseMin(WaveShapeView * self); float WaveShapeView_getSamplePhaseMax(WaveShapeView * self); float WaveShapeView_getSampleTimeMin(WaveShapeView * self); float WaveShapeView_getSampleTimeMax(WaveShapeView * self); float WaveShapeView_getSampleValueMin(WaveShapeView * self); float WaveShapeView_getSampleValueMax(WaveShapeView * self); void WaveShapeView_formatSampleText(WaveShapeView * self, char * text, size_t textSize, float phase, float time, float sample); #endif