wip: application class
This commit is contained in:
27
inc/Application.h
Normal file
27
inc/Application.h
Normal 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
21
inc/Renderer.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
class Renderer
|
||||
{
|
||||
private:
|
||||
/* data */
|
||||
public:
|
||||
Renderer(/* args */);
|
||||
~Renderer();
|
||||
void Draw();
|
||||
};
|
||||
|
||||
Renderer::Renderer(/* args */)
|
||||
{
|
||||
}
|
||||
|
||||
Renderer::~Renderer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user