wip: filter gui

This commit is contained in:
2023-09-08 03:56:17 +04:00
parent 307660d83a
commit 28ceaec23a
6 changed files with 68 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
#pragma once
#include "Filter.h"
#include "ADSR.h"
#include "Synth.h"
#include "SynthGuiState.h"
@@ -19,7 +20,8 @@ class Renderer {
void draw_signal(Synth& synth, SynthGuiState& synth_gui);
void draw_adsr_panel(ADSR* adsr, ADSRGuiState& gui_adsr,
const Rectangle& panel_bounds, float panel_y_offset);
void draw_second_panel(Rectangle& bounds);
float draw_filter_panel(Filter* filter, FilterGuiState& gui_filter, const Rectangle& panel_bounds);
public:
Renderer(/* args */);
~Renderer();

View File

@@ -1,6 +1,7 @@
#pragma once
#include "ADSR.h"
#include "Filter.h"
#include "Adder.h"
#include "Effect.h"
#include "Note.h"
@@ -32,4 +33,5 @@ class Synth {
const std::vector<Oscillator*>& GetOscillators() { return m_oscillators; }
const bool& GetIsNoteTriggered() { return is_note_triggered; }
ADSR* GetADSR() { return (ADSR*)m_effects[0]; }
Filter* GetFilter() { return (Filter*)m_effects[1]; }
};

View File

@@ -18,7 +18,14 @@ struct ADSRGuiState {
float release;
};
struct FilterGuiState {
float freq;
float res;
//todo: type
};
struct SynthGuiState {
std::vector<OscillatorGuiState*> oscillators;
ADSRGuiState adsr;
FilterGuiState filter;
};