wip: application class

This commit is contained in:
2023-08-07 13:27:25 +04:00
parent 78c202a9d6
commit e3825b341d
5 changed files with 223 additions and 0 deletions

27
inc/Application.h Normal file
View File

@@ -0,0 +1,27 @@
#pragma once
#include "Note.h"
#include "Synth.h"
#include "raylib.h"
#include "RingBuffer.h"
#include "Renderer.h"
class Application
{
private:
Synth m_synth;
RingBuffer<float>* m_ring_buffer;
AudioStream m_synth_stream;
int m_sound_played_count;
float* m_temp_buffer;
Note* m_current_note;
Renderer m_renderer;
std::size_t detect_note_pressed(Note* note);
void init_gui();
void init_synth();
void init_audio();
public:
Application(/* args */);
~Application();
void Run();
};

21
inc/Renderer.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
class Renderer
{
private:
/* data */
public:
Renderer(/* args */);
~Renderer();
void Draw();
};
Renderer::Renderer(/* args */)
{
}
Renderer::~Renderer()
{
}

View File

@@ -18,6 +18,7 @@ public:
bool IsFull() { return m_is_full; }
bool IsEmpty() { return m_is_empty; }
std::size_t GetSize();
std::size_t GetCapacity() { return m_size; }
void Reset();
void Write(T* data, size_t count);
bool Read(T* output, size_t count);