This commit is contained in:
2023-08-08 17:05:08 +04:00
parent cadeeb323d
commit a1fef25838
6 changed files with 63 additions and 16 deletions

View File

@@ -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;

View File

@@ -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);
};

View File

@@ -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
View 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;
};