submodule checkpoint
This commit is contained in:
15
.gitmodules
vendored
15
.gitmodules
vendored
@@ -1,9 +1,10 @@
|
|||||||
[submodule "rtmidi"]
|
[submodule "lib/rtaudio"]
|
||||||
path = lib/rtmidi
|
|
||||||
url = https://github.com/thestk/rtmidi.git
|
|
||||||
[submodule "rtaudio"]
|
|
||||||
path = lib/rtaudio
|
path = lib/rtaudio
|
||||||
url = https://github.com/thestk/rtaudio.git
|
url = https://github.com/thestk/rtaudio.git
|
||||||
[submodule "qtbase"]
|
[submodule "lib/rtmidi"]
|
||||||
path = lib/qtbase
|
path = lib/rtmidi
|
||||||
url = https://github.com/qt/qtbase.git
|
url = https://github.com/thestk/rtmidi.git
|
||||||
|
[submodule "lib/qt5"]
|
||||||
|
path = lib/qt5
|
||||||
|
url = https://github.com/qt/qt5.git
|
||||||
|
branch = 6.11
|
||||||
|
|||||||
1
lib/qt5
Submodule
1
lib/qt5
Submodule
Submodule lib/qt5 added at f5f14e7b58
Submodule lib/qtbase deleted from dcad7c6d6f
@@ -1,58 +0,0 @@
|
|||||||
@echo off
|
|
||||||
setlocal
|
|
||||||
|
|
||||||
REM config
|
|
||||||
|
|
||||||
set BUILD_DIR=build
|
|
||||||
set CONFIG=Release
|
|
||||||
|
|
||||||
set QT_ROOT=C:\Qt\6.10.1\msvc2022_64
|
|
||||||
set RTAUDIO_ROOT=C:\rtaudio
|
|
||||||
set RTMIDI_ROOT=C:\rtmidi
|
|
||||||
|
|
||||||
REM setup
|
|
||||||
|
|
||||||
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
|
|
||||||
|
|
||||||
set PATH=%QT_ROOT%\bin;%PATH%
|
|
||||||
|
|
||||||
if not exist %BUILD_DIR% (
|
|
||||||
mkdir %BUILD_DIR%
|
|
||||||
)
|
|
||||||
|
|
||||||
REM configure
|
|
||||||
|
|
||||||
cmake -S . -B %BUILD_DIR% ^
|
|
||||||
-G Ninja ^
|
|
||||||
-DCMAKE_BUILD_TYPE=%CONFIG% ^
|
|
||||||
-DRTAUDIO_ROOT=%RTAUDIO_ROOT% ^
|
|
||||||
-DRTMIDI_ROOT=%RTMIDI_ROOT%
|
|
||||||
|
|
||||||
if errorlevel 1 goto error
|
|
||||||
|
|
||||||
REM build
|
|
||||||
cmake --build %BUILD_DIR%
|
|
||||||
|
|
||||||
if errorlevel 1 goto error
|
|
||||||
|
|
||||||
REM link dlls
|
|
||||||
|
|
||||||
cd %BUILD_DIR%
|
|
||||||
|
|
||||||
windeployqt metabolus.exe
|
|
||||||
|
|
||||||
copy "%RTAUDIO_ROOT%\bin\rtaudio.dll" .
|
|
||||||
copy "%RTMIDI_ROOT%\bin\rtmidi.dll" .
|
|
||||||
|
|
||||||
echo.
|
|
||||||
echo Build successful
|
|
||||||
goto end
|
|
||||||
|
|
||||||
:error
|
|
||||||
echo.
|
|
||||||
echo Build failed
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:end
|
|
||||||
endlocal
|
|
||||||
pause
|
|
||||||
77
scripts/build.ps1
Normal file
77
scripts/build.ps1
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
|
||||||
|
# config
|
||||||
|
|
||||||
|
$BUILD_DIR = "build"
|
||||||
|
$CONFIG = "Release"
|
||||||
|
|
||||||
|
# change these to the build libs
|
||||||
|
$QT_ROOT = "C:\Qt\6.10.1\msvc2022_64"
|
||||||
|
$RTAUDIO_ROOT = "C:\rtaudio"
|
||||||
|
$RTMIDI_ROOT = "C:\rtmidi"
|
||||||
|
|
||||||
|
# setup
|
||||||
|
|
||||||
|
& "$Env:Programfiles\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
|
||||||
|
|
||||||
|
$PATH="$QT_ROOT\bin;$PATH"
|
||||||
|
|
||||||
|
if (-not (Test-Path -Path $BUILD_DIR)) {
|
||||||
|
mkdir $BUILD_DIR
|
||||||
|
}
|
||||||
|
|
||||||
|
# detect dependencies
|
||||||
|
|
||||||
|
$libraries = @("qt", "rtaudio", "rtmidi", "yaml-cpp")
|
||||||
|
$dependencies_found = 0
|
||||||
|
foreach ($lib in $libraries) {
|
||||||
|
if (Test-Path -Path ".\build\lib\$lib") {
|
||||||
|
Write-Host "found $lib"
|
||||||
|
$dependencies_found++
|
||||||
|
} else {
|
||||||
|
Write-Host "did not find $lib"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-not ($dependencies_found -eq $libraries.Count)) {
|
||||||
|
& "scripts\install_dependencies.ps1"
|
||||||
|
}
|
||||||
|
|
||||||
|
# configure
|
||||||
|
|
||||||
|
<#
|
||||||
|
cmake -S . -B $BUILD_DIR ^
|
||||||
|
-G Ninja ^
|
||||||
|
-DCMAKE_BUILD_TYPE=$CONFIG ^
|
||||||
|
-DRTAUDIO_ROOT=$RTAUDIO_ROOT ^
|
||||||
|
-DRTMIDI_ROOT=$RTMIDI_ROOT
|
||||||
|
|
||||||
|
|
||||||
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
|
# build
|
||||||
|
cmake --build $BUILD_DIR
|
||||||
|
|
||||||
|
if errorlevel 1 goto error
|
||||||
|
|
||||||
|
# link dlls
|
||||||
|
|
||||||
|
cd %BUILD_DIR%
|
||||||
|
|
||||||
|
windeployqt metabolus.exe
|
||||||
|
|
||||||
|
copy "%RTAUDIO_ROOT%\bin\rtaudio.dll" .
|
||||||
|
copy "%RTMIDI_ROOT%\bin\rtmidi.dll" .
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Build successful
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:error
|
||||||
|
echo.
|
||||||
|
echo Build failed
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:end
|
||||||
|
endlocal
|
||||||
|
pause
|
||||||
|
#>
|
||||||
34
scripts/install_dependencies.ps1
Normal file
34
scripts/install_dependencies.ps1
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
echo "Installing dependencies ... "
|
||||||
|
|
||||||
|
$project_root = $PWD
|
||||||
|
$build_lib_dir = "$PWD\build\lib"
|
||||||
|
|
||||||
|
|
||||||
|
# qt
|
||||||
|
mkdir "$build_lib_dir\qt"
|
||||||
|
cd $project_root\lib\qtbase
|
||||||
|
|
||||||
|
|
||||||
|
# rtaudio
|
||||||
|
mkdir "$build_lib_dir\rtaudio" -Force
|
||||||
|
cd $project_root\lib\rtaudio
|
||||||
|
cmake -S . -B build -DRTDUIO_API_WASAPI=ON -DRTAUDIO_API_DS=OFF -DRT_AUDIO_API_ASIO=OFF -DRTAUDIO_BUILD_SHARED_LIBS=ON
|
||||||
|
cmake --build build --config Release
|
||||||
|
cmake --install build --prefix "$build_lib_dir\rtaudio"
|
||||||
|
|
||||||
|
|
||||||
|
# rtmidi
|
||||||
|
mkdir "$build_lib_dir\rtmidi" -Force
|
||||||
|
cd $project_root\lib\rtmidi
|
||||||
|
cmake -S . -B build -DRT_MIDI_API_WINMM=ON -DRTMIDI_BUILD_SHARED_LIBS=ON
|
||||||
|
cmake --build build --config Release
|
||||||
|
cmake --install build --prefix "$build_lib_dir\rtmidi"
|
||||||
|
|
||||||
|
# yaml-cpp
|
||||||
|
<#
|
||||||
|
cd $project_root\lib\qtbase
|
||||||
|
|
||||||
|
#>
|
||||||
|
|
||||||
|
cd $project_root
|
||||||
0
scripts/install_dependencies.sh
Normal file
0
scripts/install_dependencies.sh
Normal file
@@ -46,11 +46,13 @@ void AudioEngine::stop() {
|
|||||||
if(audio_.isStreamOpen()) audio_.closeStream();
|
if(audio_.isStreamOpen()) audio_.closeStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t AudioEngine::audioCallback( void* outputBuffer, void*, uint32_t nFrames, double, RtAudioStreamStatus status, void* userData) {
|
// called by RtAudio continuously, sends outputBuffer to audio drivers
|
||||||
|
int32_t AudioEngine::audioCallback(void* outputBuffer, void*, uint32_t nFrames, double, RtAudioStreamStatus status, void* userData) {
|
||||||
|
|
||||||
// error if process is too slow for the callback. If this is consistent, then need to optimize synth.process() or whatever cascades from it
|
// error if process is too slow for the callback. If this is consistent, then need to optimize synth.process() or whatever cascades from it
|
||||||
if (status) std::cerr << "Stream underflow" << std::endl;
|
if (status) std::cerr << "Stream underflow" << std::endl;
|
||||||
|
|
||||||
|
// populate audio buffer
|
||||||
return static_cast<AudioEngine*>(userData)->process(static_cast<float*>(outputBuffer), nFrames);
|
return static_cast<AudioEngine*>(userData)->process(static_cast<float*>(outputBuffer), nFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user