From 989fe385de68a528bbafa5adc93c2f79e83ee8b7 Mon Sep 17 00:00:00 2001 From: Bliblank Date: Sat, 6 Jun 2026 00:45:21 -0500 Subject: [PATCH] project scaffolding --- CMakeLists.txt | 5 ++++- src/CMakeLists.txt | 2 ++ src/main.cpp | 3 ++- src/synth/AudioEngine.cpp | 2 ++ src/synth/AudioEngine.hpp | 2 ++ src/synth/KeyboardController.cpp | 2 ++ src/synth/KeyboardController.hpp | 2 ++ src/synth/MidiController.cpp | 2 ++ src/synth/MidiController.hpp | 2 ++ src/synth/NoteQueue.cpp | 2 ++ src/synth/NoteQueue.hpp | 2 ++ ui/CMakeLists.txt | 2 ++ {src => ui}/Main.qml | 0 ui/components/.gitkeep | 0 14 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 src/CMakeLists.txt create mode 100644 src/synth/AudioEngine.cpp create mode 100644 src/synth/AudioEngine.hpp create mode 100644 src/synth/KeyboardController.cpp create mode 100644 src/synth/KeyboardController.hpp create mode 100644 src/synth/MidiController.cpp create mode 100644 src/synth/MidiController.hpp create mode 100644 src/synth/NoteQueue.cpp create mode 100644 src/synth/NoteQueue.hpp create mode 100644 ui/CMakeLists.txt rename {src => ui}/Main.qml (100%) create mode 100644 ui/components/.gitkeep diff --git a/CMakeLists.txt b/CMakeLists.txt index 61857a9..8d3f24c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,7 +27,7 @@ qt_add_executable(sonobulus qt_add_qml_module(sonobulus URI sonobulus VERSION 1.0 - QML_FILES src/Main.qml + QML_FILES ui/Main.qml ) target_link_libraries(sonobulus PRIVATE @@ -46,3 +46,6 @@ if (WIN32) VERBATIM ) endif() + +# add_subdirectory(src) +# add_subdirectory(ui) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..2903334 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ + +# empty diff --git a/src/main.cpp b/src/main.cpp index 140d724..ca0e934 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,11 +15,12 @@ int main(int argc, char* argv[]) { // attach backend gui components qmlRegisterType("AppDemo", 1, 0, "TimerComponent"); + // adds the TimerComponent type (exposed in qml as "TimerComponent") to the module named"AppDemo" (numbers mean version 1.0) // load qml //engine.loadFromModule("sonobulus", "Main"); //engine.load(QUrl("qrc:/Main.qml")); - engine.load(QUrl::fromLocalFile("src/Main.qml")); // ugh + engine.load(QUrl::fromLocalFile("ui/Main.qml")); // ugh if(engine.rootObjects().isEmpty()) { std::cout << "engine is empty" << std::endl; diff --git a/src/synth/AudioEngine.cpp b/src/synth/AudioEngine.cpp new file mode 100644 index 0000000..b017b09 --- /dev/null +++ b/src/synth/AudioEngine.cpp @@ -0,0 +1,2 @@ + +#include "AudioEngine.hpp" diff --git a/src/synth/AudioEngine.hpp b/src/synth/AudioEngine.hpp new file mode 100644 index 0000000..eea431f --- /dev/null +++ b/src/synth/AudioEngine.hpp @@ -0,0 +1,2 @@ + +// The audio engine handles the RtAudio implementation of outputing samples to audio. the audio callback fills a buffer of audio samples and submits it for playback diff --git a/src/synth/KeyboardController.cpp b/src/synth/KeyboardController.cpp new file mode 100644 index 0000000..87aa5c0 --- /dev/null +++ b/src/synth/KeyboardController.cpp @@ -0,0 +1,2 @@ + +#include "KeyboardController.hpp" \ No newline at end of file diff --git a/src/synth/KeyboardController.hpp b/src/synth/KeyboardController.hpp new file mode 100644 index 0000000..1fd8ce1 --- /dev/null +++ b/src/synth/KeyboardController.hpp @@ -0,0 +1,2 @@ + +// the keyboard controller acts as an instrument input device for creating note events from a computer keyboard diff --git a/src/synth/MidiController.cpp b/src/synth/MidiController.cpp new file mode 100644 index 0000000..a71fd44 --- /dev/null +++ b/src/synth/MidiController.cpp @@ -0,0 +1,2 @@ + +#include "MidiController.hpp" diff --git a/src/synth/MidiController.hpp b/src/synth/MidiController.hpp new file mode 100644 index 0000000..747ba7c --- /dev/null +++ b/src/synth/MidiController.hpp @@ -0,0 +1,2 @@ + +// the midi controller handles interfacing a stream from a midi input device and processing them into note events for the synthesizer diff --git a/src/synth/NoteQueue.cpp b/src/synth/NoteQueue.cpp new file mode 100644 index 0000000..b58814c --- /dev/null +++ b/src/synth/NoteQueue.cpp @@ -0,0 +1,2 @@ + +#include "NoteQueue.hpp" diff --git a/src/synth/NoteQueue.hpp b/src/synth/NoteQueue.hpp new file mode 100644 index 0000000..bec4d74 --- /dev/null +++ b/src/synth/NoteQueue.hpp @@ -0,0 +1,2 @@ + +// the note queue is a wrapper for a FIFO array to which the midi/keyboard controller enters note events into and the synthesizer consumes from diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt new file mode 100644 index 0000000..2903334 --- /dev/null +++ b/ui/CMakeLists.txt @@ -0,0 +1,2 @@ + +# empty diff --git a/src/Main.qml b/ui/Main.qml similarity index 100% rename from src/Main.qml rename to ui/Main.qml diff --git a/ui/components/.gitkeep b/ui/components/.gitkeep new file mode 100644 index 0000000..e69de29