Refactoring of player management and integration with the main window rendering

This commit is contained in:
Sylvain Schneider
2026-07-27 23:49:09 +02:00
parent cbe165aa85
commit ee6981bda3
34 changed files with 1122 additions and 181 deletions

View File

@@ -1,4 +1,5 @@
#include "core/appContext.h"
#include "core/track/Track.h"
#include "gui/mainWindow/mainWindow.h"
#include <iostream>
@@ -20,8 +21,48 @@ int main(int argc, char *argv[])
// appContext.m_hServer->enable("127.0.0.1", 4000);
appContext.m_hTrack->loadFromFile("testFile.mid");
// appContext.m_hTrack->debug();
// track.loadFromFile(R"(c:\Users\sschn\dev\projects\gitea.hub.saturnux.com\volaTile\do4.mid)");
// track.loadFromFile(R"(c:\Users\sschn\dev\projects\gitea.hub.saturnux.com\volaTile\gameUP.mid)");
appContext.player->loadFile(R"(c:\Users\sschn\dev\projects\gitea.hub.saturnux.com\volaTile\export.mid)");
////track.debug();
//const auto trackDuration = track::Seconds(5);
//auto startTime = track::Seconds();
//constexpr auto stepInterval = chrono::milliseconds(100);
//track::ActiveNotes notes; // Instance to hold the active notes at each time step with limited memory allocation overhead
//while (startTime < trackDuration)
//{
// const auto notesProxy = appContext.player->getNotes();
// notesProxy.getActiveNotesAt(startTime, WindowDuration, notes);
// ostringstream notesDisplay;
// notesDisplay << "Time: " << startTime << "\n";
// // Display the active notes for the current time step
// notesDisplay << "Active Notes:\n";
// for (const auto &note : notes.playing)
// {
// notesDisplay << format("{}{} ",
// note.name,
// note.octave);
// }
// notesDisplay << "\n";
// // Display the upcoming notes for the current time step
// notesDisplay << "Upcoming Notes:\n";
// for (const auto &note : notes.upcoming)
// {
// notesDisplay << format("{}{} ",
// note.name,
// note.octave);
// }
// notesDisplay << "\n";
// cout << notesDisplay.str() << endl;
// // Increase the start time by the step interval for the next iteration
// startTime += stepInterval;
//}
// Create an instance of the GUI application class
quokka_gfx::Application app;