From 9c5ef496366076984edd5f87b4a85faeabb68792 Mon Sep 17 00:00:00 2001
From: ApfelTeeSaft <91074565+ApfelTeeSaft@users.noreply.github.com>
Date: Mon, 2 Dec 2024 08:21:59 +0100
Subject: [PATCH] Audio Handling and simple GUI
- Audio Playback crashes the App due to an access violation rn
- GUI will get a overhaul later, might switch to QT
- SDK later on
---
ApfelDAW.sln | 31 +++++++
ApfelDAW/ApfelDAW.vcxproj | 144 +++++++++++++++++++++++++++++
ApfelDAW/ApfelDAW.vcxproj.filters | 42 +++++++++
ApfelDAW/daw.cpp | 148 ++++++++++++++++++++++++++++++
ApfelDAW/daw.h | 33 +++++++
ApfelDAW/gui.cpp | 85 +++++++++++++++++
ApfelDAW/gui.h | 27 ++++++
ApfelDAW/main.cpp | 13 +++
ApfelDAW/trackeditor.cpp | 50 ++++++++++
ApfelDAW/trackeditor.h | 30 ++++++
10 files changed, 603 insertions(+)
create mode 100644 ApfelDAW.sln
create mode 100644 ApfelDAW/ApfelDAW.vcxproj
create mode 100644 ApfelDAW/ApfelDAW.vcxproj.filters
create mode 100644 ApfelDAW/daw.cpp
create mode 100644 ApfelDAW/daw.h
create mode 100644 ApfelDAW/gui.cpp
create mode 100644 ApfelDAW/gui.h
create mode 100644 ApfelDAW/main.cpp
create mode 100644 ApfelDAW/trackeditor.cpp
create mode 100644 ApfelDAW/trackeditor.h
diff --git a/ApfelDAW.sln b/ApfelDAW.sln
new file mode 100644
index 0000000..81300fc
--- /dev/null
+++ b/ApfelDAW.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.11.35431.28
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ApfelDAW", "ApfelDAW\ApfelDAW.vcxproj", "{2ECCB40B-E250-4F78-87B2-2BEB3D59E571}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Debug|x64.ActiveCfg = Debug|x64
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Debug|x64.Build.0 = Debug|x64
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Debug|x86.ActiveCfg = Debug|Win32
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Debug|x86.Build.0 = Debug|Win32
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Release|x64.ActiveCfg = Release|x64
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Release|x64.Build.0 = Release|x64
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Release|x86.ActiveCfg = Release|Win32
+ {2ECCB40B-E250-4F78-87B2-2BEB3D59E571}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3779F40C-D8D6-4877-8316-981E5772D63B}
+ EndGlobalSection
+EndGlobal
diff --git a/ApfelDAW/ApfelDAW.vcxproj b/ApfelDAW/ApfelDAW.vcxproj
new file mode 100644
index 0000000..4ad4ec1
--- /dev/null
+++ b/ApfelDAW/ApfelDAW.vcxproj
@@ -0,0 +1,144 @@
+
+
+
+
+ Debug
+ Win32
+
+
+ Release
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ 17.0
+ Win32Proj
+ {2eccb40b-e250-4f78-87b2-2beb3d59e571}
+ ApfelDAW
+ 10.0
+
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+ Application
+ true
+ v143
+ Unicode
+
+
+ Application
+ false
+ v143
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Level3
+ true
+ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+ true
+ true
+
+
+
+
+ Level3
+ true
+ _DEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+
+
+ Console
+ true
+
+
+
+
+ Level3
+ true
+ true
+ true
+ NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
+ true
+ stdcpplatest
+
+
+ Windows
+ true
+ true
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ApfelDAW/ApfelDAW.vcxproj.filters b/ApfelDAW/ApfelDAW.vcxproj.filters
new file mode 100644
index 0000000..f9748e2
--- /dev/null
+++ b/ApfelDAW/ApfelDAW.vcxproj.filters
@@ -0,0 +1,42 @@
+
+
+
+
+ {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
+ cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {93995380-89BD-4b04-88EB-625FBE52EBFB}
+ h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
+
+
+ {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
+
+
+
+
+ Header Files
+
+
+ Header Files
+
+
+ Header Files
+
+
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+ Source Files
+
+
+
\ No newline at end of file
diff --git a/ApfelDAW/daw.cpp b/ApfelDAW/daw.cpp
new file mode 100644
index 0000000..726dd3d
--- /dev/null
+++ b/ApfelDAW/daw.cpp
@@ -0,0 +1,148 @@
+#include "daw.h"
+#include
+#include
+#include
+#include
+#include
+#include
+
+static int audioCallback(const void* inputBuffer, void* outputBuffer,
+ unsigned long framesPerBuffer, const PaStreamCallbackTimeInfo* timeInfo,
+ PaStreamCallbackFlags statusFlags, void* userData) {
+ auto* track = reinterpret_cast