Skip to content

Commit 5f2d665

Browse files
committed
Major update, including some already released updates.
1 parent 322f8c4 commit 5f2d665

11 files changed

+49
-24
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
/driver/out
1717
/driver/*.dll
1818
/driver/*.exe
19+
/driver/.vs
1920
/drivercfg/*.opensdf
2021
/drivercfg/*.sdf
2122
/drivercfg/*.vcxproj.user
@@ -27,6 +28,7 @@
2728
/drivercfg/*.dll
2829
/drivercfg/*.exe
2930
/drivercfg/x64
31+
/drivercfg/.vs
3032
/vsthost/*.opensdf
3133
/vsthost/*.sdf
3234
/vsthost/*.vcxproj.user

driver/MidiSynth.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static class WaveOutWin32 {
178178
lstrcat(basspath, _T("\\bass.dll"));
179179
if (!(bass=LoadLibrary(basspath))) {
180180
OutputDebugString(_T("Failed to load BASS.dll.\n"));
181-
return 1;
181+
return -1;
182182
}
183183

184184
lstrcat(basswasapipath, installpath);
@@ -208,10 +208,10 @@ static class WaveOutWin32 {
208208
if (basswasapi) {
209209
BASS_WASAPI_INFO winfo;
210210
if (!BASS_WASAPI_Init(-1, 0, 2, BASS_WASAPI_EVENT, (float)bufferSize * 0.001f, (float)chunkSize * 0.001f, WasapiProc, this))
211-
return 2;
211+
return -2;
212212
if (!BASS_WASAPI_GetInfo(&winfo)) {
213213
BASS_WASAPI_Free();
214-
return 3;
214+
return -3;
215215
}
216216
sampleRate = winfo.freq;
217217
soundOutFloat = false;
@@ -239,11 +239,11 @@ static class WaveOutWin32 {
239239
}
240240
else {
241241
hStOutput = BASS_StreamCreate(sampleRate, 2, ( soundOutFloat ? BASS_SAMPLE_FLOAT : 0 ), StreamProc, this);
242-
if (!hStOutput) return 2;
242+
if (!hStOutput) return -2;
243243
}
244244
}
245245

246-
return 0;
246+
return sampleRate;
247247
}
248248

249249
int Close() {
@@ -454,16 +454,17 @@ int MidiSynth::Init() {
454454
return 1;
455455
}
456456

457+
INT wResult = waveOut.Init(bufferSizeMS, chunkSizeMS, sampleRate);
458+
if (wResult < 0) return -wResult;
459+
sampleRate = wResult;
460+
457461
vstDriver = new VSTDriver;
458-
if (!vstDriver->OpenVSTDriver()) {
462+
if (!vstDriver->OpenVSTDriver(NULL, sampleRate)) {
459463
delete vstDriver;
460464
vstDriver = NULL;
461465
return 1;
462466
}
463467

464-
UINT wResult = waveOut.Init(bufferSizeMS, chunkSizeMS, sampleRate);
465-
if (wResult) return wResult;
466-
467468
wResult = waveOut.Start();
468469
return wResult;
469470
}

driver/VSTDriver.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -507,15 +507,15 @@ void VSTDriver::CloseVSTDriver() {
507507
}
508508
}
509509

510-
BOOL VSTDriver::OpenVSTDriver(TCHAR * szPath) {
510+
BOOL VSTDriver::OpenVSTDriver(TCHAR * szPath, int sampleRate) {
511511
CloseVSTDriver();
512512

513513
load_settings(szPath);
514514

515515
if ( process_create() ) {
516516
process_write_code( 5 );
517517
process_write_code( sizeof(uint32_t ) );
518-
process_write_code( 44100 );
518+
process_write_code( sampleRate );
519519

520520
uint32_t code = process_read_code();
521521
if ( code != 0 ) {

driver/VSTDriver.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class VSTDriver {
6767
VSTDriver();
6868
~VSTDriver();
6969
void CloseVSTDriver();
70-
BOOL OpenVSTDriver(TCHAR * szPath = NULL);
70+
BOOL OpenVSTDriver(TCHAR * szPath = NULL, int sampleRate = 44100);
7171
void ResetDriver();
7272
void ProcessMIDIMessage(DWORD dwPort, DWORD dwParam1);
7373
void ProcessSysEx(DWORD dwPort, const unsigned char *sysexbuffer, int exlen);

driver/vstmididrv.vcxproj

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup Label="ProjectConfigurations">
44
<ProjectConfiguration Include="Debug|Win32">
55
<Configuration>Debug</Configuration>
@@ -38,6 +38,7 @@
3838
<ProjectGuid>{4666F6D4-704E-4223-B3A0-D27A4486C6A0}</ProjectGuid>
3939
<RootNamespace>vstmidi_win32drv</RootNamespace>
4040
<Keyword>AtlProj</Keyword>
41+
<WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion>
4142
</PropertyGroup>
4243
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4344
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
@@ -46,29 +47,29 @@
4647
<UseOfAtl>Static</UseOfAtl>
4748
<CharacterSet>Unicode</CharacterSet>
4849
<WholeProgramOptimization>true</WholeProgramOptimization>
49-
<PlatformToolset>v120</PlatformToolset>
50+
<PlatformToolset>v141_xp</PlatformToolset>
5051
</PropertyGroup>
5152
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5253
<ConfigurationType>DynamicLibrary</ConfigurationType>
5354
<UseOfMfc>Static</UseOfMfc>
5455
<UseOfAtl>Static</UseOfAtl>
5556
<CharacterSet>Unicode</CharacterSet>
5657
<WholeProgramOptimization>true</WholeProgramOptimization>
57-
<PlatformToolset>v120</PlatformToolset>
58+
<PlatformToolset>v141</PlatformToolset>
5859
</PropertyGroup>
5960
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
6061
<ConfigurationType>DynamicLibrary</ConfigurationType>
6162
<UseOfMfc>false</UseOfMfc>
6263
<UseOfAtl>Static</UseOfAtl>
6364
<CharacterSet>Unicode</CharacterSet>
64-
<PlatformToolset>v120</PlatformToolset>
65+
<PlatformToolset>v141_xp</PlatformToolset>
6566
</PropertyGroup>
6667
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
6768
<ConfigurationType>DynamicLibrary</ConfigurationType>
6869
<UseOfMfc>false</UseOfMfc>
6970
<UseOfAtl>Static</UseOfAtl>
7071
<CharacterSet>Unicode</CharacterSet>
71-
<PlatformToolset>v120</PlatformToolset>
72+
<PlatformToolset>v141</PlatformToolset>
7273
</PropertyGroup>
7374
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
7475
<ImportGroup Label="ExtensionSettings">

drivercfg/Views.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include <iostream>
55
#include <fstream>
66
#include "utf8conv.h"
7-
#include "../driver/mmddk.h"
7+
#include "../external_packages/mmddk.h"
88
using namespace std;
99
using namespace utf8util;
1010
#include "../driver/VSTDriver.h"

drivercfg/drivercfg.vcxproj

+9-3
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@
2020
</ItemGroup>
2121
<PropertyGroup Label="Globals">
2222
<ProjectGuid>{AF13E822-617D-4B1E-A092-C9C9B07C1E05}</ProjectGuid>
23+
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
2324
</PropertyGroup>
2425
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
2526
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2627
<ConfigurationType>Application</ConfigurationType>
2728
<UseDebugLibraries>true</UseDebugLibraries>
2829
<CharacterSet>Unicode</CharacterSet>
29-
<PlatformToolset>v120_xp</PlatformToolset>
30+
<PlatformToolset>v141_xp</PlatformToolset>
3031
</PropertyGroup>
3132
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3233
<ConfigurationType>Application</ConfigurationType>
3334
<UseDebugLibraries>false</UseDebugLibraries>
3435
<CharacterSet>Unicode</CharacterSet>
35-
<PlatformToolset>v120_xp</PlatformToolset>
36+
<PlatformToolset>v141_xp</PlatformToolset>
3637
</PropertyGroup>
3738
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
3839
<ConfigurationType>Application</ConfigurationType>
@@ -122,6 +123,9 @@
122123
<DebugInformationFormat>
123124
</DebugInformationFormat>
124125
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
126+
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
127+
<FloatingPointModel>Fast</FloatingPointModel>
128+
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
125129
</ClCompile>
126130
<Link>
127131
<SubSystem>Windows</SubSystem>
@@ -183,7 +187,9 @@
183187
</Midl>
184188
</ItemDefinitionGroup>
185189
<ItemGroup>
186-
<ClCompile Include="..\driver\VSTDriver.cpp" />
190+
<ClCompile Include="..\driver\VSTDriver.cpp">
191+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
192+
</ClCompile>
187193
<ClCompile Include="drivercfg.cpp" />
188194
<ClCompile Include="stdafx.cpp">
189195
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>

vsthost/vsthost.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ int CALLBACK _tWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpC
397397
pEffect[ 0 ]->dispatcher( pEffect[ 0 ], effOpen, 0, 0, 0, 0 );
398398

399399
if ( pEffect[ 0 ]->dispatcher( pEffect[ 0 ], effGetPlugCategory, 0, 0, 0, 0 ) != kPlugCategSynth ||
400-
pEffect[ 0 ]->dispatcher( pEffect[ 0 ], effCanDo, 0, 0, "receiveVstMidiEvent", 0 ) == 0 )
400+
pEffect[ 0 ]->dispatcher( pEffect[ 0 ], effCanDo, 0, 0, "receiveVstMidiEvent", 0 ) < 1 )
401401
{
402402
code = 9;
403403
goto exit;

vsthost/vsthost.rc

-8 Bytes
Binary file not shown.

vsthost/vsthost.vcxproj

+5-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<ConfigurationType>Application</ConfigurationType>
3737
<UseDebugLibraries>true</UseDebugLibraries>
3838
<CharacterSet>Unicode</CharacterSet>
39-
<PlatformToolset>v100</PlatformToolset>
39+
<PlatformToolset>v141_xp</PlatformToolset>
4040
</PropertyGroup>
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4242
<ConfigurationType>Application</ConfigurationType>
@@ -49,7 +49,7 @@
4949
<UseDebugLibraries>false</UseDebugLibraries>
5050
<WholeProgramOptimization>true</WholeProgramOptimization>
5151
<CharacterSet>Unicode</CharacterSet>
52-
<PlatformToolset>v100</PlatformToolset>
52+
<PlatformToolset>v141_xp</PlatformToolset>
5353
</PropertyGroup>
5454
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
5555
<ConfigurationType>Application</ConfigurationType>
@@ -93,6 +93,7 @@
9393
<Optimization>Disabled</Optimization>
9494
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9595
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
96+
<AdditionalOptions>/zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
9697
</ClCompile>
9798
<Link>
9899
<SubSystem>Windows</SubSystem>
@@ -126,6 +127,8 @@
126127
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
127128
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
128129
<FloatingPointModel>Fast</FloatingPointModel>
130+
<EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet>
131+
<AdditionalOptions>/zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
129132
</ClCompile>
130133
<Link>
131134
<SubSystem>Windows</SubSystem>

vstmididrv.nsi

+12
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ Section "Needed (required)"
9999
!ifndef INNER
100100
File $%TEMP%\vstmididrvuninstall.exe
101101
!endif
102+
SetOutPath "$WINDIR\SysNative\vstmididrv"
103+
File output\64\vstmididrv.dll
104+
File output\64\bass.dll
105+
File output\64\basswasapi.dll
106+
File output\vsthost32.exe
107+
File output\64\vsthost64.exe
102108
;check if already installed
103109
StrCpy $1 "0"
104110
LOOP1:
@@ -215,6 +221,7 @@ ${EndIf}
215221
${If} ${RunningX64}
216222
${If} ${AtLeastWinVista}
217223
RMDir /r "$WINDIR\SysWow64\vstmididrv"
224+
RMDir /r "$WINDIR\SysNative\vstmididrv"
218225
${Else}
219226
MessageBox MB_OK "Note: The uninstaller will reboot your system to remove drivers."
220227
${DeleteOnReboot} $WINDIR\SysWow64\vstmididrv\vstmididrv.dll
@@ -224,6 +231,11 @@ ${Else}
224231
${DeleteOnReboot} $WINDIR\SysWow64\vstmididrv\vstmididrvcfg.exe
225232
${DeleteOnReboot} $WINDIR\SysWow64\vstmididrv\vsthost32.exe
226233
${DeleteOnReboot} $WINDIR\SysWow64\vstmididrv\vsthost64.exe
234+
${DeleteOnReboot} $WINDIR\SysNative\vstmididrv\vstmididrv.dll
235+
${DeleteOnReboot} $WINDIR\SysNative\vstmididrv\bass.dll
236+
${DeleteOnReboot} $WINDIR\SysNative\vstmididrv\basswasapi.dll
237+
${DeleteOnReboot} $WINDIR\SysNative\vstmididrv\vsthost32.exe
238+
${DeleteOnReboot} $WINDIR\SysNative\vstmididrv\vsthost64.exe
227239
Reboot
228240
${Endif}
229241
${Else}

0 commit comments

Comments
 (0)