wip: gui
This commit is contained in:
@@ -4,10 +4,13 @@
|
||||
#include "raylib.h"
|
||||
#include "RingBuffer.h"
|
||||
#include "Renderer.h"
|
||||
#include "SynthGuiState.h"
|
||||
|
||||
class Application
|
||||
{
|
||||
private:
|
||||
Synth m_synth;
|
||||
SynthGuiState m_synth_gui_state;
|
||||
RingBuffer<float>* m_ring_buffer;
|
||||
AudioStream m_synth_stream;
|
||||
int m_sound_played_count;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "Synth.h"
|
||||
#include "SynthGuiState.h"
|
||||
class Renderer
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
void DrawUi(Synth & synth, const SynthGuiState & synthGui);
|
||||
void DrawSignal(Synth & synth, const SynthGuiState & synthGui);
|
||||
public:
|
||||
Renderer(/* args */);
|
||||
~Renderer();
|
||||
void Draw();
|
||||
void Draw(Synth& synth, const SynthGuiState & synthGui);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -21,4 +21,5 @@ public:
|
||||
~Synth();
|
||||
void ProduceNoteSound(Note input);
|
||||
const std::vector<float> & GetOutSignal() { return m_out_signal; }
|
||||
const std::vector<Oscillator*>& GetOscillators() { return m_oscillators; }
|
||||
};
|
||||
16
inc/SynthGuiState.h
Normal file
16
inc/SynthGuiState.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "OscillatorType.h"
|
||||
#include "raygui.h"
|
||||
#include <vector>
|
||||
|
||||
struct OscillatorGuiState {
|
||||
float volume;
|
||||
float freq;//todo: remove or change to pitch shift
|
||||
OscillatorType waveshape;
|
||||
bool is_dropdown_open;
|
||||
Rectangle shape_dropdown_rect;
|
||||
};
|
||||
|
||||
struct SynthGuiState {
|
||||
std::vector<OscillatorGuiState> oscillators;
|
||||
};
|
||||
Reference in New Issue
Block a user