• R/O
  • HTTP
  • SSH
  • HTTPS

timidity41: 提交


Commit MetaInfo

修订版4c26ea0cf7f452f1a0ab20b8e15191a09f6216e6 (tree)
时间2018-01-11 10:05:11
作者Starg <starg@user...>
CommiterStarg

Log Message

Import UnkoTim213

更改概述

差异

--- a/config.h
+++ b/config.h
@@ -405,6 +405,7 @@
405405 #define DEFAULT_AUDIO_BUFFER_NUM 32 /* 370ms over */
406406 #define DEFAULT_COMPUTE_BUFFER_BITS 6 /* ratio 1.45ms (44.1kHz) */
407407 #define TWSYNG32INI 1 // use twsyng32.ini or timpp32g.ini ??
408+#define USE_TWSYN_BRIDGE 1
408409 #undef ANOTHER_MAIN
409410 //#undef __W32G__ /* for Win32 GUI */
410411 #undef IA_W32GUI /* for Win32 GUI */
@@ -442,6 +443,7 @@
442443 #define DEFAULT_AUDIO_BUFFER_BITS 9 /* 512sample 11ms (44.1kHz) */
443444 #define DEFAULT_AUDIO_BUFFER_NUM 32 /* 370ms over */
444445 #define DEFAULT_COMPUTE_BUFFER_BITS 6 /* ratio 1.45ms (44.1kHz) */
446+#undef USE_TWSYN_BRIDGE
445447 /* #undef AU_NPIPE */
446448 #undef AU_VORBIS
447449 #undef AU_VORBIS_DLL
@@ -478,6 +480,7 @@
478480 #define DEFAULT_COMPUTE_BUFFER_BITS 6 /* ratio 1.45ms (44.1kHz) */
479481 #define TIMDRVINI 1 // use timdrv.ini or twsyng32.ini or timpp32g.ini ??
480482 #define IA_WINSYN
483+#undef USE_TWSYN_BRIDGE
481484 //#undef AU_WASAPI
482485 #undef AU_VORBIS
483486 #undef AU_VORBIS_DLL
@@ -623,6 +626,7 @@
623626 #define DEFAULT_COMPUTE_BUFFER_BITS 6 /* ratio 1.45ms (44.1kHz) */
624627 #define TIMDRVINI 1 // use timdrv.ini or twsyng32.ini or timpp32g.ini ??
625628 #define IA_WINSYN
629+#undef USE_TWSYN_BRIDGE
626630 #define WINDRV 1
627631 #define AU_W32 1
628632 #define AU_WASAPI 1
--- a/interface/interface.vcxproj
+++ b/interface/interface.vcxproj
@@ -71,13 +71,14 @@
7171 <PropertyGroup>
7272 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7373 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
74- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
74+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7575 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
76- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
76+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7777 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7878 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7979 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
8080 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
81+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8182 </PropertyGroup>
8283 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8384 <ClCompile>
--- a/interface/rtsyn_winmm.c
+++ b/interface/rtsyn_winmm.c
@@ -74,6 +74,10 @@
7474 #include "timer.h"
7575
7676 #include "rtsyn.h"
77+#ifdef USE_TWSYN_BRIDGE
78+#include "twsyn_bridge_common.h"
79+#include "twsyn_bridge_host.h"
80+#endif
7781
7882 int rtsyn_portnumber=1;
7983 unsigned int portID[MAX_PORT];
@@ -108,17 +112,29 @@ CRITICAL_SECTION mim_section;
108112
109113 double mim_start_time;
110114
111-void CALLBACK MidiInProc(HMIDIIN,UINT,DWORD,DWORD,DWORD);
115+void CALLBACK MidiInProc(HMIDIIN hMidiInL, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
112116
113117 void rtsyn_get_port_list(){
114118 int i;
115119 MIDIINCAPS InCaps;
116- InNum = midiInGetNumDevs();
117- for (i=1;i <=InNum && i<=32;i++){
118- midiInGetDevCaps(i-1,(LPMIDIINCAPSA) &InCaps,sizeof(InCaps));
119- sprintf(rtsyn_portlist[i-1],"%d:%s",i,(LPSTR)InCaps.szPname);
120+
121+#ifdef USE_TWSYN_BRIDGE
122+ if(opt_use_twsyn_bridge){
123+ InNum = get_bridge_midi_devs();
124+ for (i=1;i <=InNum && i<=32;i++){
125+ sprintf(rtsyn_portlist[i-1],"%d:%s",i,(LPSTR)get_bridge_midi_dev_name(i));
126+ }
127+ rtsyn_nportlist=i-1;
128+ }else
129+#endif
130+ {
131+ InNum = midiInGetNumDevs();
132+ for (i=1;i <=InNum && i<=32;i++){
133+ midiInGetDevCaps(i-1,(LPMIDIINCAPSA) &InCaps,sizeof(InCaps));
134+ sprintf(rtsyn_portlist[i-1],"%d:%s",i,(LPSTR)InCaps.szPname);
135+ }
136+ rtsyn_nportlist=i-1;
120137 }
121- rtsyn_nportlist=i-1;
122138 }
123139
124140 int rtsyn_synth_start(){
@@ -132,42 +148,49 @@ int rtsyn_synth_start(){
132148
133149
134150 port=0;
135- sleep(2);
136- for(port=0;port<rtsyn_portnumber;port++){
137- for (i=0;i<MAX_EXBUF;i++){
138- IMidiHdr[port][i] = (MIDIHDR *)sIMidiHdr[port][i];
139- memset(IMidiHdr[port][i],0,sizeof(MIDIHDR));
140- IMidiHdr[port][i]->lpData = sImidiHdr_data[port][i];
141- memset((IMidiHdr[port][i]->lpData),0,BUFF_SIZE);
142- IMidiHdr[port][i]->dwBufferLength = BUFF_SIZE;
143- }
144- }
145151 evbwpoint=0;
146152 evbrpoint=0;
147153 mvbuse=0;
154+ sleep(1);
155+#ifdef USE_TWSYN_BRIDGE
156+ if(opt_use_twsyn_bridge){
157+ open_bridge_midi_dev(rtsyn_portnumber, portID);
158+ }else
159+#endif
160+ {
161+ for(port=0;port<rtsyn_portnumber;port++){
162+ for (i=0;i<MAX_EXBUF;i++){
163+ IMidiHdr[port][i] = (MIDIHDR *)sIMidiHdr[port][i];
164+ memset(IMidiHdr[port][i],0,sizeof(MIDIHDR));
165+ IMidiHdr[port][i]->lpData = sImidiHdr_data[port][i];
166+ memset((IMidiHdr[port][i]->lpData),0,BUFF_SIZE);
167+ IMidiHdr[port][i]->dwBufferLength = BUFF_SIZE;
168+ }
169+ }
148170
149- for(port=0;port<rtsyn_portnumber;port++){
150- midiInOpen(&hMidiIn[port],portID[port],(DWORD_PTR)MidiInProc,(DWORD_PTR)port,CALLBACK_FUNCTION);
151- for (i=0;i<MAX_EXBUF;i++){
152- midiInUnprepareHeader(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
153- midiInPrepareHeader(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
154- midiInAddBuffer(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
171+ for(port=0;port<rtsyn_portnumber;port++){
172+ midiInOpen(&hMidiIn[port],portID[port],(DWORD_PTR)MidiInProc,(DWORD_PTR)port,CALLBACK_FUNCTION);
173+ for (i=0;i<MAX_EXBUF;i++){
174+ midiInUnprepareHeader(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
175+ midiInPrepareHeader(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
176+ midiInAddBuffer(hMidiIn[port],IMidiHdr[port][i],sizeof(MIDIHDR));
177+ }
155178 }
156- }
157179
158180 #ifdef __W32__
159- // HACK:midiInOpen()でリセットされてしまうため、再設定
160- SetPriorityClass(GetCurrentProcess(), processPriority);
181+ // HACK:midiInOpen()でリセットされてしまうため、再設定
182+ SetPriorityClass(GetCurrentProcess(), processPriority);
161183 #endif
162- for(port=0;port<rtsyn_portnumber;port++){
163- if(MMSYSERR_NOERROR !=midiInStart(hMidiIn[port])){
164- int i;
165- for(i=0;i<port;i++){
166- midiInStop(hMidiIn[i]);
167- midiInReset(hMidiIn[i]);
168- midiInClose(hMidiIn[i]);
184+ for(port=0;port<rtsyn_portnumber;port++){
185+ if(MMSYSERR_NOERROR !=midiInStart(hMidiIn[port])){
186+ int i;
187+ for(i=0;i<port;i++){
188+ midiInStop(hMidiIn[i]);
189+ midiInReset(hMidiIn[i]);
190+ midiInClose(hMidiIn[i]);
191+ }
192+ goto winmmerror;
169193 }
170- goto winmmerror;
171194 }
172195 }
173196 mim_start_time = get_current_calender_time();
@@ -181,15 +204,19 @@ winmmerror:
181204
182205 void rtsyn_synth_stop(){
183206 rtsyn_stop_playing();
184- // play_mode->close_output();
207+ // play_mode->close_output();
185208 rtsyn_midiports_close();
186209 DeleteCriticalSection(&mim_section);
187-
188210 return;
189211 }
190212 void rtsyn_midiports_close(void){
191213 UINT port;
192-
214+
215+#ifdef USE_TWSYN_BRIDGE
216+ if(opt_use_twsyn_bridge)
217+ close_bridge_midi_dev();
218+ else
219+#endif
193220 for(port=0;port<rtsyn_portnumber;port++){
194221 if( MMSYSERR_NOERROR!=midiInStop(hMidiIn[port]) )
195222 ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"MIDI Stop Error\n");
@@ -246,19 +273,28 @@ int rtsyn_play_some_data(void){
246273 rtsyn_play_one_data (port, dwParam1, mim_start_time+(double)dwParam2 * DIV_1000);
247274 break;
248275 case MIM_LONGDATA:
249- IIMidiHdr = (MIDIHDR *) dwParam1;
250- exlen=(int)IIMidiHdr->dwBytesRecorded;
251- sysexbuffer=IIMidiHdr->lpData;
252- rtsyn_play_one_sysex (sysexbuffer,exlen, mim_start_time+(double)dwParam2 * DIV_1000);
253- if (MMSYSERR_NOERROR != midiInUnprepareHeader(
254- hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
255- ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error1\n");
256- if (MMSYSERR_NOERROR != midiInPrepareHeader(
257- hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
258- ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error5\n");
259- if (MMSYSERR_NOERROR != midiInAddBuffer(
260- hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
261- ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error6\n");
276+#ifdef USE_TWSYN_BRIDGE
277+ if(opt_use_twsyn_bridge){
278+ exlen = get_bridge_mim_databytes((int)dwParam1);
279+ sysexbuffer = get_bridge_mim_longdata((int)dwParam1);
280+ rtsyn_play_one_sysex(sysexbuffer, exlen, mim_start_time + (double)dwParam2 * DIV_1000);
281+ }else
282+#endif
283+ {
284+ IIMidiHdr = (MIDIHDR *) dwParam1;
285+ exlen=(int)IIMidiHdr->dwBytesRecorded;
286+ sysexbuffer=IIMidiHdr->lpData;
287+ rtsyn_play_one_sysex (sysexbuffer,exlen, mim_start_time+(double)dwParam2 * DIV_1000);
288+ if (MMSYSERR_NOERROR != midiInUnprepareHeader(
289+ hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
290+ ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error1\n");
291+ if (MMSYSERR_NOERROR != midiInPrepareHeader(
292+ hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
293+ ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error5\n");
294+ if (MMSYSERR_NOERROR != midiInAddBuffer(
295+ hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR)))
296+ ctl->cmsg( CMSG_ERROR, VERB_NORMAL,"error6\n");
297+ }
262298 break;
263299 }
264300 }while(rtsyn_buf_check());
@@ -302,3 +338,4 @@ void CALLBACK MidiInProc(HMIDIIN hMidiInL, UINT wMsg, DWORD_PTR dwInstance,
302338 break;
303339 }
304340 }
341+
--- a/interface/w32g_ini.c
+++ b/interface/w32g_ini.c
@@ -529,7 +529,8 @@ void LoadIniFile(SETTING_PLAYER *sp, SETTING_TIMIDITY *st)
529529 IniGetKeyInt(INI_SEC_TIMIDITY,"opt_rtsyn_latency",&(st->opt_rtsyn_latency));
530530 if ( st->opt_rtsyn_latency < 1 ) st->opt_rtsyn_latency = 1;
531531 if ( st->opt_rtsyn_latency > 1000 ) st->opt_rtsyn_latency = 1000;
532- IniGetKeyInt(INI_SEC_TIMIDITY,"opt_rtsyn_skip_aq",&(st->opt_rtsyn_skip_aq));
532+ IniGetKeyInt(INI_SEC_TIMIDITY,"opt_rtsyn_skip_aq",&(st->opt_rtsyn_skip_aq));
533+ IniGetKeyInt(INI_SEC_TIMIDITY,"opt_use_twsyn_bridge",&(st->opt_use_twsyn_bridge));
533534 #else
534535 IniGetKeyInt(INI_SEC_TIMIDITY,"processPriority",&(st->processPriority));
535536 #endif
@@ -765,6 +766,7 @@ SaveIniFile(SETTING_PLAYER *sp, SETTING_TIMIDITY *st)
765766 IniPutKeyInt(INI_SEC_TIMIDITY,"SynShTime",&(st->SynShTime));
766767 IniPutKeyInt(INI_SEC_TIMIDITY,"opt_rtsyn_latency",&(st->opt_rtsyn_latency));
767768 IniPutKeyInt(INI_SEC_TIMIDITY,"opt_rtsyn_skip_aq",&(st->opt_rtsyn_skip_aq));
769+ IniPutKeyInt(INI_SEC_TIMIDITY,"opt_use_twsyn_bridge",&(st->opt_use_twsyn_bridge));
768770 #else
769771 IniPutKeyInt(INI_SEC_TIMIDITY,"processPriority",&(st->processPriority));
770772 #endif
--- a/interface/w32g_pref.c
+++ b/interface/w32g_pref.c
@@ -1386,37 +1386,67 @@ PrefPlayerDialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
13861386 return FALSE;
13871387 }
13881388 #else
1389+
1390+#if defined(TWSYNG32) && !defined(TWSYNSRV) && defined(USE_TWSYN_BRIDGE)
1391+#include "twsyn_bridge_common.h"
1392+#include "twsyn_bridge_host.h"
1393+#endif
1394+
13891395 extern int syn_ThreadPriority;
13901396 static TCHAR **MidiINDrivers = NULL;
1397+static int midi_in_max = 0;
13911398 // 0 MIDI Mapper -1
13921399 // 1 MIDI IN Driver 0
13931400 // 2 MIDI IN Driver 1
13941401 static TCHAR **GetMidiINDrivers( void )
13951402 {
13961403 int i;
1397- int max = midiInGetNumDevs ();
1398- if ( MidiINDrivers != NULL ) {
1399- for ( i = 0; MidiINDrivers[i] != NULL; i ++ ) {
1400- safe_free ( MidiINDrivers[i] );
1404+
1405+#if defined(TWSYNG32) && !defined(TWSYNSRV) && defined(USE_TWSYN_BRIDGE)
1406+ if(st_temp->opt_use_twsyn_bridge){
1407+ midi_in_max = get_bridge_midi_devs();
1408+ if ( MidiINDrivers != NULL ) {
1409+ for ( i = 0; MidiINDrivers[i] != NULL; i ++ ) {
1410+ safe_free ( MidiINDrivers[i] );
1411+ }
1412+ safe_free ( MidiINDrivers );
1413+ MidiINDrivers = NULL;
14011414 }
1402- safe_free ( MidiINDrivers );
1403- MidiINDrivers = NULL;
1404- }
1405- MidiINDrivers = ( TCHAR ** ) malloc ( sizeof ( TCHAR * ) * ( max + 2 ) );
1406- if ( MidiINDrivers == NULL ) return MidiINDrivers;
1407- MidiINDrivers[0] = safe_strdup ( "MIDI Mapper" );
1408- for ( i = 1; i <= max; i ++ ) {
1409- MIDIINCAPS mic;
1410- if ( midiInGetDevCaps ( i - 1, &mic, sizeof ( MIDIINCAPS ) ) == 0 ) {
1411- MidiINDrivers[i] = strdup ( mic.szPname );
1415+ MidiINDrivers = ( TCHAR ** ) malloc ( sizeof ( TCHAR * ) * ( midi_in_max + 2 ) );
1416+ if ( MidiINDrivers == NULL ) return MidiINDrivers;
1417+ for (i = 0; i <= midi_in_max; i ++ ) {
1418+ MidiINDrivers[i] = strdup (get_bridge_midi_dev_name(i));
14121419 if ( MidiINDrivers[i] == NULL )
14131420 break;
1414- } else {
1415- MidiINDrivers[i] = NULL;
1416- break;
14171421 }
1422+ MidiINDrivers[midi_in_max+1] = NULL;
1423+ }else
1424+#endif
1425+ {
1426+ midi_in_max = midiInGetNumDevs ();
1427+ if ( MidiINDrivers != NULL ) {
1428+ for ( i = 0; MidiINDrivers[i] != NULL; i ++ ) {
1429+ safe_free ( MidiINDrivers[i] );
1430+ }
1431+ safe_free ( MidiINDrivers );
1432+ MidiINDrivers = NULL;
1433+ }
1434+ MidiINDrivers = ( TCHAR ** ) malloc ( sizeof ( TCHAR * ) * ( midi_in_max + 2 ) );
1435+ if ( MidiINDrivers == NULL ) return MidiINDrivers;
1436+ MidiINDrivers[0] = safe_strdup ( "MIDI Mapper" );
1437+ for ( i = 1; i <= midi_in_max; i ++ ) {
1438+ MIDIINCAPS mic;
1439+ if ( midiInGetDevCaps ( i - 1, &mic, sizeof ( MIDIINCAPS ) ) == 0 ) {
1440+ MidiINDrivers[i] = strdup ( mic.szPname );
1441+ if ( MidiINDrivers[i] == NULL )
1442+ break;
1443+ } else {
1444+ MidiINDrivers[i] = NULL;
1445+ break;
1446+ }
1447+ }
1448+ MidiINDrivers[midi_in_max+1] = NULL;
14181449 }
1419- MidiINDrivers[max+1] = NULL;
14201450 return MidiINDrivers;
14211451 }
14221452
@@ -1477,7 +1507,13 @@ PrefSyn1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
14771507 DI_DISABLE(IDC_COMBO_IDPORT1);
14781508 DI_DISABLE(IDC_COMBO_IDPORT2);
14791509 DI_DISABLE(IDC_COMBO_IDPORT3);
1510+ DI_DISABLE(IDC_CHECK_USE_TWSYN_BRIDGE);
14801511 #else
1512+#if defined(TWSYNG32) && !defined(TWSYNSRV) && defined(USE_TWSYN_BRIDGE)
1513+ DLG_FLAG_TO_CHECKBUTTON(hwnd, IDC_CHECK_USE_TWSYN_BRIDGE, st_temp->opt_use_twsyn_bridge);
1514+#else
1515+ DI_DISABLE(IDC_CHECK_USE_TWSYN_BRIDGE);
1516+#endif
14811517 GetMidiINDrivers();
14821518
14831519 for ( i = 0; i <= MAX_PORT; i ++ ) {
@@ -1500,18 +1536,20 @@ PrefSyn1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
15001536 }
15011537 safe_free ( MidiINDrivers );
15021538 MidiINDrivers = NULL;
1503- }
1504-
1505- SendDlgItemMessage(hwnd, IDC_COMBO_PORT_NUM,
1506- CB_SETCURSEL, (WPARAM) st_temp->SynPortNum, (LPARAM) 0 );
1507- SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT0,
1508- CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[0], (LPARAM) 0 );
1509- SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT1,
1510- CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[1], (LPARAM) 0 );
1511- SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT2,
1512- CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[2], (LPARAM) 0 );
1513- SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT3,
1514- CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[3], (LPARAM) 0 );
1539+ }
1540+ if(st_temp->SynIDPort[0] > midi_in_max)
1541+ st_temp->SynIDPort[0] = 0; // reset
1542+ if(st_temp->SynIDPort[1] > midi_in_max)
1543+ st_temp->SynIDPort[1] = 0; // reset
1544+ if(st_temp->SynIDPort[2] > midi_in_max)
1545+ st_temp->SynIDPort[2] = 0; // reset
1546+ if(st_temp->SynIDPort[3] > midi_in_max)
1547+ st_temp->SynIDPort[3] = 0; // reset
1548+ SendDlgItemMessage(hwnd, IDC_COMBO_PORT_NUM, CB_SETCURSEL, (WPARAM) st_temp->SynPortNum, (LPARAM) 0 );
1549+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT0, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[0], (LPARAM) 0 );
1550+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT1, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[1], (LPARAM) 0 );
1551+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT2, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[2], (LPARAM) 0 );
1552+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT3, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[3], (LPARAM) 0 );
15151553 #endif
15161554
15171555 #if defined(WINDRV_SETUP)
@@ -1560,6 +1598,44 @@ PrefSyn1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
15601598 break;
15611599 case WM_COMMAND:
15621600 switch (LOWORD(wParam)) {
1601+
1602+#if defined(TWSYNG32) && !defined(TWSYNSRV) && defined(USE_TWSYN_BRIDGE)
1603+ case IDC_CHECK_USE_TWSYN_BRIDGE:
1604+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT0, CB_RESETCONTENT, 0,0);
1605+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT1, CB_RESETCONTENT, 0,0);
1606+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT2, CB_RESETCONTENT, 0,0);
1607+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT3, CB_RESETCONTENT, 0,0);
1608+
1609+ DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHECK_USE_TWSYN_BRIDGE, st_temp->opt_use_twsyn_bridge);
1610+ tmp = SendDlgItemMessage ( hwnd, IDC_COMBO_PORT_NUM, CB_GETCURSEL, 0, 0 );
1611+ if ( tmp != CB_ERR ) st_temp->SynPortNum = tmp;
1612+ GetMidiINDrivers();
1613+
1614+ if ( MidiINDrivers != NULL ) {
1615+ for ( i = 0; MidiINDrivers[i] != NULL; i ++ ) {
1616+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT0,
1617+ CB_INSERTSTRING, (WPARAM) -1, (LPARAM) MidiINDrivers[i] );
1618+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT1,
1619+ CB_INSERTSTRING, (WPARAM) -1, (LPARAM) MidiINDrivers[i] );
1620+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT2,
1621+ CB_INSERTSTRING, (WPARAM) -1, (LPARAM) MidiINDrivers[i] );
1622+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT3,
1623+ CB_INSERTSTRING, (WPARAM) -1, (LPARAM) MidiINDrivers[i] );
1624+ safe_free ( MidiINDrivers[i] );
1625+ }
1626+ safe_free ( MidiINDrivers );
1627+ MidiINDrivers = NULL;
1628+ }
1629+ st_temp->SynIDPort[0] = 0; // reset
1630+ st_temp->SynIDPort[1] = 0; // reset
1631+ st_temp->SynIDPort[2] = 0; // reset
1632+ st_temp->SynIDPort[3] = 0; // reset
1633+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT0, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[0], (LPARAM) 0 );
1634+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT1, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[1], (LPARAM) 0 );
1635+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT2, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[2], (LPARAM) 0 );
1636+ SendDlgItemMessage(hwnd, IDC_COMBO_IDPORT3, CB_SETCURSEL, (WPARAM) st_temp->SynIDPort[3], (LPARAM) 0 );
1637+ break;
1638+#endif
15631639 case IDC_BUTTON_CONFIG_FILE:
15641640 {
15651641 TCHAR filename[FILEPATH_MAX];
@@ -1613,7 +1689,10 @@ PrefSyn1DialogProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
16131689 sp_temp->PlayerLanguage = LANGUAGE_JAPANESE;
16141690 }
16151691
1616-#if !defined(WINDRV_SETUP)
1692+#if !defined(WINDRV_SETUP)
1693+#if defined(TWSYNG32) && !defined(TWSYNSRV) && defined(USE_TWSYN_BRIDGE)
1694+ DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHECK_USE_TWSYN_BRIDGE, st_temp->opt_use_twsyn_bridge);
1695+#endif
16171696 DLG_CHECKBUTTON_TO_FLAG(hwnd, IDC_CHECK_SYN_AUTOSTART, st_temp->syn_AutoStart);
16181697 tmp = SendDlgItemMessage ( hwnd, IDC_COMBO_PORT_NUM, CB_GETCURSEL, 0, 0 );
16191698 if ( tmp != CB_ERR ) st_temp->SynPortNum = tmp;
--- a/interface/w32g_res.h
+++ b/interface/w32g_res.h
@@ -18,6 +18,7 @@
1818 #define IDD_DIALOG_PREF_EN 114
1919 #define IDD_DIALOG_PLAYLIST_EN 115
2020 #define IDD_DIALOG_PLAYLIST 116
21+#define IDD_DIALOG_TWSYN_BRIDGE 117
2122
2223 #define IDD_PREF_PLAYER_EN 121
2324 #define IDD_PREF_TIMIDITY1_EN 122
@@ -197,13 +198,14 @@
197198 #define IDC_COMBO_IDPORT1 3952
198199 #define IDC_COMBO_IDPORT2 3953
199200 #define IDC_COMBO_IDPORT3 3954
201+#define IDC_CHECK_USE_TWSYN_BRIDGE 3955
200202 // syn
201-#define IDC_CHECK_SYN_AUTOSTART 3955
202-#define IDC_EDIT_SYN_SH_TIME 3956
203-#define IDC_EDIT_RTSYN_LATENCY 3957
204-#define IDC_CHECK_RTSYN_SKIP_AQ 3958
203+#define IDC_CHECK_SYN_AUTOSTART 3965
204+#define IDC_EDIT_SYN_SH_TIME 3966
205+#define IDC_EDIT_RTSYN_LATENCY 3967
206+#define IDC_CHECK_RTSYN_SKIP_AQ 3968
205207 // priority
206-#define IDC_COMBO_SYN_THREAD_PRIORITY 3970
208+#define IDC_COMBO_SYN_THREAD_PRIORITY 3980
207209
208210 //// effect
209211 // midi
--- a/interface/w32g_res.rc
+++ b/interface/w32g_res.rc
@@ -187,7 +187,15 @@ FONT 8, "Tahoma"
187187 EDITTEXT IDC_EDIT, 0, 0, 240, 160, WS_HSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_MULTILINE | ES_NOHIDESEL | ES_READONLY | ES_WANTRETURN
188188 }
189189
190-
190+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
191+IDD_DIALOG_TWSYN_BRIDGE DIALOGEX 0, 0, 115, 25
192+STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU
193+CAPTION "TWSYN Bridge (host)"
194+FONT 8, "Tahoma"
195+{
196+ DEFPUSHBUTTON "OK", IDOK, 5, 5, 50, 15
197+ PUSHBUTTON "Cancel", IDCANCEL, 60, 5, 50, 15
198+}
191199
192200 LANGUAGE LANG_JAPANESE, SUBLANG_JAPANESE_JAPAN
193201 IDD_DIALOG_DOC DIALOGEX 0, 0, 300, 251
@@ -769,7 +777,7 @@ FONT 9, "MS UI Gothic", 0, 0, 1
769777 GROUPBOX "Flags", IDC_STATIC, 5, 85, 50, 45, WS_GROUP
770778 AUTORADIOBUTTON "Event", IDC_RADIOBUTTON_WASAPI_EVENT, 10, 100, 33, 8, WS_GROUP | WS_TABSTOP
771779 AUTORADIOBUTTON "Polling", IDC_RADIOBUTTON_WASAPI_POLLING, 10, 115, 40, 8, WS_TABSTOP
772- LTEXT "-", IDC_STATIC, 133, 115, 4, 8, SS_LEFT
780+ LTEXT "-", IDC_STATIC, 133, 115, 8, 8, SS_LEFT
773781 }
774782
775783
@@ -3092,6 +3100,7 @@ FONT 9, "MS UI Gothic", 0, 0, 1
30923100 GROUPBOX "コンソール", IDC_STATIC, 235, 110, 110, 35, WS_GROUP
30933101 COMBOBOX IDC_COMBO_CTL_VEBOSITY, 268, 123, 70, 146, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT
30943102 AUTOCHECKBOX "オーディオキューをスキップ", IDC_CHECK_RTSYN_SKIP_AQ, 10, 190, 83, 8
3103+ AUTOCHECKBOX "Use TWSYN Bridge", IDC_CHECK_USE_TWSYN_BRIDGE, 130, 40, 80, 8
30953104 }
30963105
30973106
@@ -3140,6 +3149,7 @@ FONT 8, "Tahoma", 400, 0, 0
31403149 LTEXT "Level", IDC_STATIC, 240, 125, 18, 8, SS_LEFT
31413150 COMBOBOX IDC_COMBO_CTL_VEBOSITY, 270, 123, 70, 146, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT
31423151 AUTOCHECKBOX "Skip Audio Queue", IDC_CHECK_RTSYN_SKIP_AQ, 10, 190, 72, 8
3152+ AUTOCHECKBOX "Use TWSYNG Bridge", IDC_CHECK_USE_TWSYN_BRIDGE, 130, 40, 80, 8
31433153 }
31443154
31453155
--- a/interface/w32g_syn.c
+++ b/interface/w32g_syn.c
@@ -96,6 +96,11 @@ WINAPI void InitCommonControls(void);
9696
9797 #ifdef IA_W32G_SYN
9898
99+#ifdef USE_TWSYN_BRIDGE
100+#include "twsyn_bridge_common.h"
101+#include "twsyn_bridge_host.h"
102+#endif
103+
99104 typedef struct w32g_syn_t_ {
100105 UINT nid_uID;
101106 #ifndef TWSYNSRV
@@ -169,7 +174,7 @@ char *w32g_output_dir = NULL;
169174 int playlist_max = 1;
170175 int playlist_max_ini = 1;
171176 int ConsoleClearFlag = 0;
172-
177+int opt_use_twsyn_bridge = 0;
173178 extern void CmdLineToArgv(LPSTR lpCmdLine, int *argc, CHAR ***argv);
174179
175180 static int start_syn_thread(void);
@@ -471,7 +476,7 @@ static int w32g_syn_main(void)
471476 while (w32g_syn.quit_state < 2) {
472477 Sleep(300);
473478 }
474-
479+
475480 return 0;
476481 }
477482
@@ -664,6 +669,9 @@ SynWinProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
664669 PostQuitMessage(0);
665670 return -1;
666671 }
672+#ifdef USE_TWSYN_BRIDGE
673+ init_bridge();
674+#endif
667675 #ifdef VST_LOADER_ENABLE
668676 if (!hVSTHost) {
669677 #ifdef _WIN64
@@ -699,6 +707,9 @@ SynWinProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
699707 hVSTHost = NULL;
700708 }
701709 #endif
710+#ifdef USE_TWSYN_BRIDGE
711+ close_bridge();
712+#endif
702713 DeleteTasktrayIcon(hwnd);
703714 PostQuitMessage(0);
704715 break;
--- a/interface/w32g_utl.c
+++ b/interface/w32g_utl.c
@@ -568,6 +568,7 @@ extern int w32g_syn_port_num;
568568 #elif defined(IA_W32G_SYN)
569569 extern int w32g_syn_id_port[];
570570 extern int syn_AutoStart;
571+extern int opt_use_twsyn_bridge;
571572 //extern DWORD processPriority;
572573 extern DWORD syn_ThreadPriority;
573574 extern int w32g_syn_port_num;
@@ -795,6 +796,7 @@ ApplySettingTiMidity(SETTING_TIMIDITY *st)
795796 rtsyn_set_latency((double)opt_rtsyn_latency * 0.001);
796797 opt_rtsyn_skip_aq = st->opt_rtsyn_skip_aq;
797798 rtsyn_set_skip_aq(opt_rtsyn_skip_aq);
799+ opt_use_twsyn_bridge = st->opt_use_twsyn_bridge;
798800 #endif
799801 ///r
800802 processPriority = st->processPriority;
@@ -1050,6 +1052,7 @@ SaveSettingTiMidity(SETTING_TIMIDITY *st)
10501052 st->SynShTime = stream_max_compute;
10511053 st->opt_rtsyn_latency = opt_rtsyn_latency;
10521054 st->opt_rtsyn_skip_aq = opt_rtsyn_skip_aq;
1055+ st->opt_use_twsyn_bridge = opt_use_twsyn_bridge;
10531056 #endif
10541057 ///r
10551058 st->processPriority = processPriority;
--- a/interface/w32g_utl.h
+++ b/interface/w32g_utl.h
@@ -250,6 +250,7 @@ typedef struct SETTING_TIMIDITY_ {
250250 int SynShTime;
251251 uint32 opt_rtsyn_latency; // --rtsyn-latency
252252 int opt_rtsyn_skip_aq; // --rtsyn-skip-aq
253+ int opt_use_twsyn_bridge;
253254 #endif
254255 int processPriority; // --process-priority
255256 int compute_thread_num;
--- a/libarc/libarc.vcxproj
+++ b/libarc/libarc.vcxproj
@@ -70,13 +70,14 @@
7070 <PropertyGroup>
7171 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7272 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
73- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
73+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7474 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
75- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
75+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7676 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7777 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7878 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
7979 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
80+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8081 </PropertyGroup>
8182 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8283 <ClCompile>
--- a/libunimod/libunimod.vcxproj
+++ b/libunimod/libunimod.vcxproj
@@ -70,13 +70,14 @@
7070 <PropertyGroup>
7171 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7272 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
73- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
73+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7474 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
75- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
75+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7676 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7777 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7878 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
7979 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
80+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8081 </PropertyGroup>
8182 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8283 <ClCompile>
--- a/pdcurses/pdcurses.vcproj
+++ b/pdcurses/pdcurses.vcproj
@@ -93,7 +93,7 @@
9393 />
9494 <Tool
9595 Name="VCPostBuildEventTool"
96- CommandLine="cp ../Debug\pdcurses.lib ../Debug\panel.lib"
96+ CommandLine=""
9797 />
9898 </Configuration>
9999 <Configuration
@@ -175,7 +175,7 @@
175175 />
176176 <Tool
177177 Name="VCPostBuildEventTool"
178- CommandLine="cp ../Release\pdcurses.lib ../Release\panel.lib"
178+ CommandLine=""
179179 />
180180 </Configuration>
181181 </Configurations>
--- a/pdcurses/pdcurses.vcxproj
+++ b/pdcurses/pdcurses.vcxproj
@@ -47,6 +47,7 @@
4747 <ConfigurationType>StaticLibrary</ConfigurationType>
4848 <UseOfMfc>false</UseOfMfc>
4949 <CharacterSet>MultiByte</CharacterSet>
50+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
5051 </PropertyGroup>
5152 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5253 <ImportGroup Label="ExtensionSettings">
@@ -72,15 +73,17 @@
7273 <PropertyGroup>
7374 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7475 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
75- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
76+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7677 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
77- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
78+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7879 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7980 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
8081 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
8182 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
8283 <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</PostBuildEventUseInBuild>
8384 <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</PostBuildEventUseInBuild>
85+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
86+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8487 </PropertyGroup>
8588 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8689 <ClCompile>
--- a/portmidi/portmidi.vcxproj
+++ b/portmidi/portmidi.vcxproj
@@ -47,6 +47,7 @@
4747 <ConfigurationType>StaticLibrary</ConfigurationType>
4848 <UseOfMfc>false</UseOfMfc>
4949 <CharacterSet>MultiByte</CharacterSet>
50+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
5051 </PropertyGroup>
5152 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5253 <ImportGroup Label="ExtensionSettings">
@@ -71,13 +72,15 @@
7172 <PropertyGroup>
7273 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7374 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
74- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
75+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7576 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
76- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
77+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7778 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7879 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7980 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
8081 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
82+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
83+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8184 </PropertyGroup>
8285 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8386 <ClCompile>
--- a/speex/libspeex.vcxproj
+++ b/speex/libspeex.vcxproj
@@ -39,6 +39,7 @@
3939 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
4040 <ConfigurationType>StaticLibrary</ConfigurationType>
4141 <CharacterSet>MultiByte</CharacterSet>
42+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
4243 </PropertyGroup>
4344 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4445 <ConfigurationType>StaticLibrary</ConfigurationType>
@@ -69,11 +70,12 @@
6970 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7071 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7172 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
72- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Debug\</IntDir>
73+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7374 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7475 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7576 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
7677 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
78+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
7779 </PropertyGroup>
7880 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
7981 <ClCompile>
@@ -152,7 +154,7 @@
152154 <DisableSpecificWarnings>4244;4305;4311;4100;4127;%(DisableSpecificWarnings)</DisableSpecificWarnings>
153155 <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
154156 <FloatingPointModel>Fast</FloatingPointModel>
155- <MultiProcessorCompilation>false</MultiProcessorCompilation>
157+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
156158 </ClCompile>
157159 <Lib>
158160 <OutputFile>../Release\libspeex.lib</OutputFile>
--- a/tim_cui/tim_cui.vcxproj
+++ b/tim_cui/tim_cui.vcxproj
@@ -47,6 +47,7 @@
4747 <ConfigurationType>Application</ConfigurationType>
4848 <UseOfMfc>false</UseOfMfc>
4949 <CharacterSet>MultiByte</CharacterSet>
50+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
5051 </PropertyGroup>
5152 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5253 <ImportGroup Label="ExtensionSettings">
@@ -86,7 +87,8 @@
8687 <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">timidity</TargetName>
8788 <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">timidity_x64</TargetName>
8889 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
89- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_x64</TargetName>
90+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">timidity_x64</TargetName>
91+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
9092 </PropertyGroup>
9193 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9294 <Midl>
@@ -184,9 +186,8 @@
184186 <AdditionalIncludeDirectories>..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
185187 </ResourceCompile>
186188 <Link>
187- <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
188189 <AdditionalDependencies>comctl32.lib;winmm.lib;wsock32.lib;%(AdditionalDependencies)</AdditionalDependencies>
189- <OutputFile>./Debug/tim_cui.exe</OutputFile>
190+ <OutputFile>$(TargetPath)</OutputFile>
190191 <SuppressStartupBanner>true</SuppressStartupBanner>
191192 <IgnoreSpecificDefaultLibraries>libcd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
192193 <GenerateDebugInformation>true</GenerateDebugInformation>
--- a/timdrvsetup/timdrvsetup.vcxproj
+++ b/timdrvsetup/timdrvsetup.vcxproj
@@ -33,6 +33,7 @@
3333 <ConfigurationType>Application</ConfigurationType>
3434 <UseDebugLibraries>true</UseDebugLibraries>
3535 <CharacterSet>MultiByte</CharacterSet>
36+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
3637 </PropertyGroup>
3738 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3839 <ConfigurationType>Application</ConfigurationType>
@@ -86,6 +87,7 @@
8687 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
8788 <LinkIncremental>true</LinkIncremental>
8889 <TargetName>$(ProjectName)_x64</TargetName>
90+ <LibraryPath>$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8991 </PropertyGroup>
9092 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9193 <ClCompile>
@@ -146,7 +148,7 @@
146148 </ClCompile>
147149 <Link>
148150 <GenerateDebugInformation>true</GenerateDebugInformation>
149- <OutputFile>../Debug/timdrvsetup.exe</OutputFile>
151+ <OutputFile>$(TargetPath)</OutputFile>
150152 <RandomizedBaseAddress>false</RandomizedBaseAddress>
151153 <DataExecutionPrevention>
152154 </DataExecutionPrevention>
--- a/timidity/timidity.vcxproj
+++ b/timidity/timidity.vcxproj
@@ -46,6 +46,7 @@
4646 <ConfigurationType>StaticLibrary</ConfigurationType>
4747 <UseOfMfc>false</UseOfMfc>
4848 <CharacterSet>MultiByte</CharacterSet>
49+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
4950 </PropertyGroup>
5051 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5152 <ImportGroup Label="ExtensionSettings">
@@ -70,9 +71,9 @@
7071 <PropertyGroup>
7172 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7273 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
73- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
74+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7475 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
75- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
76+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7677 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7778 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7879 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
@@ -84,7 +85,7 @@
8485 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(DXSDK_DIR)Lib\x86;C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86;</LibraryPath>
8586 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)atlmfc\lib\amd64;$(VCInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;$(FrameworkSDKDir)\lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
8687 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(DXSDK_DIR)\Lib\x86;</LibraryPath>
87- <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(DXSDK_DIR)\ILib\x86;</LibraryPath>
88+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib\x64;$(FrameworkSDKDir)\lib;$(DXSDK_DIR)\ILib\x86;</LibraryPath>
8889 </PropertyGroup>
8990 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
9091 <ClCompile>
--- a/timidity_vs2008.sln
+++ b/timidity_vs2008.sln
@@ -84,6 +84,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "timdrvsetup", "timdrvsetup\
8484 {8DC8ADE3-145A-4C63-80DD-0C93B6587B80} = {8DC8ADE3-145A-4C63-80DD-0C93B6587B80}
8585 EndProjectSection
8686 EndProject
87+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "twsyn_bridge", "twsyn_bridge\twsyn_bridge.vcproj", "{4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}"
88+EndProject
8789 Global
8890 GlobalSection(SolutionConfigurationPlatforms) = preSolution
8991 Debug|Win32 = Debug|Win32
@@ -166,6 +168,10 @@ Global
166168 {DB5B22F9-4721-460B-9770-2855CA33E232}.Debug|Win32.Build.0 = Debug|Win32
167169 {DB5B22F9-4721-460B-9770-2855CA33E232}.Release|Win32.ActiveCfg = Release|Win32
168170 {DB5B22F9-4721-460B-9770-2855CA33E232}.Release|Win32.Build.0 = Release|Win32
171+ {4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}.Debug|Win32.ActiveCfg = Debug|Win32
172+ {4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}.Debug|Win32.Build.0 = Debug|Win32
173+ {4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}.Release|Win32.ActiveCfg = Release|Win32
174+ {4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}.Release|Win32.Build.0 = Release|Win32
169175 EndGlobalSection
170176 GlobalSection(SolutionProperties) = preSolution
171177 HideSolutionNode = FALSE
--- a/timidity_vs2010.sln
+++ b/timidity_vs2010.sln
@@ -48,6 +48,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tim_cui", "tim_cui\tim_cui.
4848 EndProject
4949 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "timdrvsetup", "timdrvsetup\timdrvsetup.vcxproj", "{1A91001F-E3EF-4FC1-925B-C00013BB6C98}"
5050 EndProject
51+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "twsyn_bridge", "twsyn_bridge\twsyn_bridge.vcxproj", "{D6D9295A-4A29-4753-88E9-A9D8B589A3D0}"
52+EndProject
5153 Global
5254 GlobalSection(SolutionConfigurationPlatforms) = preSolution
5355 Debug|Win32 = Debug|Win32
@@ -224,6 +226,14 @@ Global
224226 {1A91001F-E3EF-4FC1-925B-C00013BB6C98}.Release|Win32.Build.0 = Release|Win32
225227 {1A91001F-E3EF-4FC1-925B-C00013BB6C98}.Release|x64.ActiveCfg = Release|x64
226228 {1A91001F-E3EF-4FC1-925B-C00013BB6C98}.Release|x64.Build.0 = Release|x64
229+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Debug|Win32.ActiveCfg = Debug|Win32
230+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Debug|Win32.Build.0 = Debug|Win32
231+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Debug|x64.ActiveCfg = Debug|x64
232+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Debug|x64.Build.0 = Debug|x64
233+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Release|Win32.ActiveCfg = Release|Win32
234+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Release|Win32.Build.0 = Release|Win32
235+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Release|x64.ActiveCfg = Release|x64
236+ {D6D9295A-4A29-4753-88E9-A9D8B589A3D0}.Release|x64.Build.0 = Release|x64
227237 EndGlobalSection
228238 GlobalSection(SolutionProperties) = preSolution
229239 HideSolutionNode = FALSE
--- a/timw32g/timw32g.vcxproj
+++ b/timw32g/timw32g.vcxproj
@@ -90,8 +90,8 @@
9090 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)atlmfc\lib\amd64;$(VCInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;$(FrameworkSDKDir)\lib\x64;$(WindowsSdkDir)\lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
9191 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSdkDir)lib;$(FrameworkSDKDir)\lib;$(DXSDK_DIR)\ILib\x86;</LibraryPath>
9292 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(VCInstallDir)atlmfc\lib\amd64;$(VCInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;$(FrameworkSDKDir)\lib\x64;$(WindowsSdkDir)\lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
93- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">timw32g_c212</TargetName>
94- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">timw32g_x64_c212</TargetName>
93+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">timw32g_c213</TargetName>
94+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">timw32g_x64_c213</TargetName>
9595 <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_x64</TargetName>
9696 </PropertyGroup>
9797 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
Binary files /dev/null and b/twsyn_bridge/bridge-16.ico differ
Binary files /dev/null and b/twsyn_bridge/bridge-32.ico differ
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge.vcproj
@@ -0,0 +1,198 @@
1+<?xml version="1.0" encoding="shift_jis"?>
2+<VisualStudioProject
3+ ProjectType="Visual C++"
4+ Version="9.00"
5+ Name="twsyng_bridge"
6+ ProjectGUID="{4D6B6788-F7B8-4FFB-B15F-DC5C665ABB5C}"
7+ RootNamespace="twsyng_bridge"
8+ TargetFrameworkVersion="196613"
9+ >
10+ <Platforms>
11+ <Platform
12+ Name="Win32"
13+ />
14+ </Platforms>
15+ <ToolFiles>
16+ </ToolFiles>
17+ <Configurations>
18+ <Configuration
19+ Name="Debug|Win32"
20+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
21+ IntermediateDirectory="$(ConfigurationName)"
22+ ConfigurationType="1"
23+ CharacterSet="2"
24+ >
25+ <Tool
26+ Name="VCPreBuildEventTool"
27+ />
28+ <Tool
29+ Name="VCCustomBuildTool"
30+ />
31+ <Tool
32+ Name="VCXMLDataGeneratorTool"
33+ />
34+ <Tool
35+ Name="VCWebServiceProxyGeneratorTool"
36+ />
37+ <Tool
38+ Name="VCMIDLTool"
39+ />
40+ <Tool
41+ Name="VCCLCompilerTool"
42+ Optimization="0"
43+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
44+ MinimalRebuild="true"
45+ BasicRuntimeChecks="3"
46+ RuntimeLibrary="3"
47+ WarningLevel="3"
48+ DebugInformationFormat="4"
49+ />
50+ <Tool
51+ Name="VCManagedResourceCompilerTool"
52+ />
53+ <Tool
54+ Name="VCResourceCompilerTool"
55+ />
56+ <Tool
57+ Name="VCPreLinkEventTool"
58+ />
59+ <Tool
60+ Name="VCLinkerTool"
61+ AdditionalDependencies="winmm.lib"
62+ OutputFile="$(OutDir)\$(ProjectName)_x86.exe"
63+ GenerateDebugInformation="true"
64+ TargetMachine="1"
65+ />
66+ <Tool
67+ Name="VCALinkTool"
68+ />
69+ <Tool
70+ Name="VCManifestTool"
71+ />
72+ <Tool
73+ Name="VCXDCMakeTool"
74+ />
75+ <Tool
76+ Name="VCBscMakeTool"
77+ />
78+ <Tool
79+ Name="VCFxCopTool"
80+ />
81+ <Tool
82+ Name="VCAppVerifierTool"
83+ />
84+ <Tool
85+ Name="VCPostBuildEventTool"
86+ />
87+ </Configuration>
88+ <Configuration
89+ Name="Release|Win32"
90+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
91+ IntermediateDirectory="$(ConfigurationName)"
92+ ConfigurationType="1"
93+ CharacterSet="2"
94+ WholeProgramOptimization="1"
95+ >
96+ <Tool
97+ Name="VCPreBuildEventTool"
98+ />
99+ <Tool
100+ Name="VCCustomBuildTool"
101+ />
102+ <Tool
103+ Name="VCXMLDataGeneratorTool"
104+ />
105+ <Tool
106+ Name="VCWebServiceProxyGeneratorTool"
107+ />
108+ <Tool
109+ Name="VCMIDLTool"
110+ />
111+ <Tool
112+ Name="VCCLCompilerTool"
113+ Optimization="3"
114+ InlineFunctionExpansion="2"
115+ EnableIntrinsicFunctions="true"
116+ FavorSizeOrSpeed="1"
117+ OmitFramePointers="true"
118+ EnableFiberSafeOptimizations="true"
119+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOW"
120+ RuntimeLibrary="2"
121+ StructMemberAlignment="5"
122+ EnableFunctionLevelLinking="true"
123+ EnableEnhancedInstructionSet="2"
124+ FloatingPointModel="2"
125+ WarningLevel="3"
126+ DebugInformationFormat="3"
127+ />
128+ <Tool
129+ Name="VCManagedResourceCompilerTool"
130+ />
131+ <Tool
132+ Name="VCResourceCompilerTool"
133+ />
134+ <Tool
135+ Name="VCPreLinkEventTool"
136+ />
137+ <Tool
138+ Name="VCLinkerTool"
139+ AdditionalDependencies="winmm.lib"
140+ OutputFile="$(OutDir)\$(ProjectName)_x86.exe"
141+ LinkIncremental="2"
142+ GenerateDebugInformation="false"
143+ SubSystem="2"
144+ LargeAddressAware="2"
145+ OptimizeReferences="2"
146+ EnableCOMDATFolding="2"
147+ TargetMachine="1"
148+ />
149+ <Tool
150+ Name="VCALinkTool"
151+ />
152+ <Tool
153+ Name="VCManifestTool"
154+ />
155+ <Tool
156+ Name="VCXDCMakeTool"
157+ />
158+ <Tool
159+ Name="VCBscMakeTool"
160+ />
161+ <Tool
162+ Name="VCFxCopTool"
163+ />
164+ <Tool
165+ Name="VCAppVerifierTool"
166+ />
167+ <Tool
168+ Name="VCPostBuildEventTool"
169+ />
170+ </Configuration>
171+ </Configurations>
172+ <References>
173+ </References>
174+ <Files>
175+ <File
176+ RelativePath=".\twsyng_bridge_common.h"
177+ >
178+ </File>
179+ <File
180+ RelativePath=".\twsyng_bridge_exe.c"
181+ >
182+ </File>
183+ <File
184+ RelativePath=".\twsyng_bridge_exe.h"
185+ >
186+ </File>
187+ <File
188+ RelativePath=".\twsyng_bridge_exe.rc"
189+ >
190+ </File>
191+ <File
192+ RelativePath=".\twsyng_bridge_exe_res.h"
193+ >
194+ </File>
195+ </Files>
196+ <Globals>
197+ </Globals>
198+</VisualStudioProject>
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge.vcxproj
@@ -0,0 +1,188 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup Label="ProjectConfigurations">
4+ <ProjectConfiguration Include="Debug|Win32">
5+ <Configuration>Debug</Configuration>
6+ <Platform>Win32</Platform>
7+ </ProjectConfiguration>
8+ <ProjectConfiguration Include="Debug|x64">
9+ <Configuration>Debug</Configuration>
10+ <Platform>x64</Platform>
11+ </ProjectConfiguration>
12+ <ProjectConfiguration Include="Release|Win32">
13+ <Configuration>Release</Configuration>
14+ <Platform>Win32</Platform>
15+ </ProjectConfiguration>
16+ <ProjectConfiguration Include="Release|x64">
17+ <Configuration>Release</Configuration>
18+ <Platform>x64</Platform>
19+ </ProjectConfiguration>
20+ </ItemGroup>
21+ <PropertyGroup Label="Globals">
22+ <ProjectGuid>{D6D9295A-4A29-4753-88E9-A9D8B589A3D0}</ProjectGuid>
23+ <Keyword>Win32Proj</Keyword>
24+ <RootNamespace>twsyng_run</RootNamespace>
25+ <ProjectName>twsyn_bridge</ProjectName>
26+ </PropertyGroup>
27+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29+ <ConfigurationType>Application</ConfigurationType>
30+ <UseDebugLibraries>true</UseDebugLibraries>
31+ <CharacterSet>MultiByte</CharacterSet>
32+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
33+ </PropertyGroup>
34+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
35+ <ConfigurationType>Application</ConfigurationType>
36+ <UseDebugLibraries>true</UseDebugLibraries>
37+ <CharacterSet>MultiByte</CharacterSet>
38+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
39+ </PropertyGroup>
40+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
41+ <ConfigurationType>Application</ConfigurationType>
42+ <UseDebugLibraries>false</UseDebugLibraries>
43+ <WholeProgramOptimization>true</WholeProgramOptimization>
44+ <CharacterSet>MultiByte</CharacterSet>
45+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
46+ </PropertyGroup>
47+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
48+ <ConfigurationType>Application</ConfigurationType>
49+ <UseDebugLibraries>false</UseDebugLibraries>
50+ <WholeProgramOptimization>true</WholeProgramOptimization>
51+ <CharacterSet>MultiByte</CharacterSet>
52+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
53+ </PropertyGroup>
54+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55+ <ImportGroup Label="ExtensionSettings">
56+ </ImportGroup>
57+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
58+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
59+ </ImportGroup>
60+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
61+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
62+ </ImportGroup>
63+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
64+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
65+ </ImportGroup>
66+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
67+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
68+ </ImportGroup>
69+ <PropertyGroup Label="UserMacros" />
70+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
71+ <LinkIncremental>true</LinkIncremental>
72+ <TargetName>$(ProjectName)_x86</TargetName>
73+ </PropertyGroup>
74+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
75+ <LinkIncremental>true</LinkIncremental>
76+ <TargetName>$(ProjectName)_x64</TargetName>
77+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
78+ <IntDir>$(Platform)$(Configuration)\</IntDir>
79+ <LibraryPath>$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
80+ </PropertyGroup>
81+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
82+ <LinkIncremental>false</LinkIncremental>
83+ <TargetName>$(ProjectName)_x86</TargetName>
84+ </PropertyGroup>
85+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
86+ <LinkIncremental>false</LinkIncremental>
87+ <TargetName>$(ProjectName)_x64</TargetName>
88+ <OutDir>$(SolutionDir)$(Configuration)\</OutDir>
89+ <LibraryPath>$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
90+ </PropertyGroup>
91+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
92+ <ClCompile>
93+ <PrecompiledHeader>
94+ </PrecompiledHeader>
95+ <WarningLevel>Level3</WarningLevel>
96+ <Optimization>Disabled</Optimization>
97+ <PreprocessorDefinitions>WIN32;USE_BRIDGE;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
99+ </ClCompile>
100+ <Link>
101+ <SubSystem>Windows</SubSystem>
102+ <GenerateDebugInformation>true</GenerateDebugInformation>
103+ <OutputFile>$(TargetPath)</OutputFile>
104+ <LargeAddressAware>true</LargeAddressAware>
105+ <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
106+ </Link>
107+ </ItemDefinitionGroup>
108+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
109+ <ClCompile>
110+ <PrecompiledHeader>
111+ </PrecompiledHeader>
112+ <WarningLevel>Level3</WarningLevel>
113+ <Optimization>Disabled</Optimization>
114+ <PreprocessorDefinitions>_WIN64;WIN32;USE_BRIDGE;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
115+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
116+ </ClCompile>
117+ <Link>
118+ <SubSystem>Windows</SubSystem>
119+ <GenerateDebugInformation>true</GenerateDebugInformation>
120+ <OutputFile>$(TargetPath)</OutputFile>
121+ <LargeAddressAware>true</LargeAddressAware>
122+ <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
123+ </Link>
124+ </ItemDefinitionGroup>
125+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
126+ <ClCompile>
127+ <WarningLevel>Level3</WarningLevel>
128+ <PrecompiledHeader>
129+ </PrecompiledHeader>
130+ <Optimization>Full</Optimization>
131+ <FunctionLevelLinking>true</FunctionLevelLinking>
132+ <IntrinsicFunctions>true</IntrinsicFunctions>
133+ <PreprocessorDefinitions>WIN32;USE_BRIDGE;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
134+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
135+ <FloatingPointModel>Fast</FloatingPointModel>
136+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
137+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
138+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
139+ </ClCompile>
140+ <Link>
141+ <SubSystem>Windows</SubSystem>
142+ <GenerateDebugInformation>false</GenerateDebugInformation>
143+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
144+ <OptimizeReferences>true</OptimizeReferences>
145+ <OutputFile>$(TargetPath)</OutputFile>
146+ <LargeAddressAware>true</LargeAddressAware>
147+ <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
148+ </Link>
149+ </ItemDefinitionGroup>
150+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
151+ <ClCompile>
152+ <WarningLevel>Level3</WarningLevel>
153+ <PrecompiledHeader>
154+ </PrecompiledHeader>
155+ <Optimization>Full</Optimization>
156+ <FunctionLevelLinking>true</FunctionLevelLinking>
157+ <IntrinsicFunctions>true</IntrinsicFunctions>
158+ <PreprocessorDefinitions>_WIN64;WIN32;USE_BRIDGE;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
159+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
160+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
161+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
162+ <FloatingPointModel>Fast</FloatingPointModel>
163+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
164+ </ClCompile>
165+ <Link>
166+ <SubSystem>Windows</SubSystem>
167+ <GenerateDebugInformation>true</GenerateDebugInformation>
168+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
169+ <OptimizeReferences>true</OptimizeReferences>
170+ <OutputFile>$(TargetPath)</OutputFile>
171+ <LargeAddressAware>true</LargeAddressAware>
172+ <AdditionalDependencies>winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
173+ </Link>
174+ </ItemDefinitionGroup>
175+ <ItemGroup>
176+ <ClInclude Include="twsyn_bridge_common.h" />
177+ <ClInclude Include="twsyn_bridge_exe_res.h" />
178+ </ItemGroup>
179+ <ItemGroup>
180+ <ClCompile Include="twsyn_bridge_exe.c" />
181+ </ItemGroup>
182+ <ItemGroup>
183+ <ResourceCompile Include="twsyn_bridge_exe.rc" />
184+ </ItemGroup>
185+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
186+ <ImportGroup Label="ExtensionTargets">
187+ </ImportGroup>
188+</Project>
\ No newline at end of file
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_common.h
@@ -0,0 +1,51 @@
1+
2+#pragma once
3+
4+
5+
6+
7+
8+#define COMMON_FM_NAME "twsyn_bridge_file_mapping"
9+#define COMMON_MUTEX_NAME "twsyn_bridge_mutex"
10+
11+#define BRIDGE_MAX_PORT 4 // see rtsyn.h MAX_PORT
12+#define BRIDGE_MAX_EXBUF 32
13+#define BRIDGE_TOTAL_EXBUF (BRIDGE_MAX_PORT * BRIDGE_MAX_EXBUF)
14+#define BRIDGE_BUFF_SIZE 512
15+
16+typedef struct _fm_bridge_t {
17+ // exit flag
18+ long exit;
19+ // host
20+ long PrcsIdHost; // processID
21+ long PrcsVerHost; // processVersion
22+ unsigned long long hControlWndHost; // window handle
23+ unsigned long uControlMessHost; // window message number
24+ // bridge
25+ long PrcsId; // processID
26+ long PrcsVer; // processVersion
27+ unsigned long long hControlWnd; // window handle
28+ unsigned long uControlMess; // window message number
29+ // midi in
30+ unsigned long long hMidiWnd[BRIDGE_MAX_PORT]; // window handle
31+ long midi_dev_num;
32+ char midi_devs[33][256];
33+ long portnumber;
34+ unsigned int portID[BRIDGE_MAX_PORT];
35+ long open_midi_dev;
36+ unsigned long wMsg;
37+ unsigned long long dwInstance;
38+ unsigned long long dwParam1;
39+ unsigned long long dwParam2;
40+ unsigned long dwBytes[BRIDGE_TOTAL_EXBUF];
41+ char lpData[BRIDGE_TOTAL_EXBUF][BRIDGE_BUFF_SIZE];
42+} fm_bridge_t;
43+
44+enum {
45+ WMC_CLOSE_BRIDGE = 4096, // 0でもいいけど
46+ WMC_GET_MIDI_DEVS,
47+ WMC_OPEN_MIDI_DEVS,
48+ WMC_CLOSE_MIDI_DEVS,
49+ WMC_MIM_DATA,
50+ WMC_MIM_LONGDATA,
51+};
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_exe.c
@@ -0,0 +1,371 @@
1+
2+
3+
4+#include <stdlib.h>
5+#include <io.h>
6+#include <windows.h>
7+#include <process.h>
8+#include <windows.h>
9+#include <windowsx.h>
10+#include <winuser.h>
11+#include <windef.h>
12+#include <stdio.h>
13+#include <string.h>
14+#include <fcntl.h>
15+#include <tchar.h>
16+#include <mmsystem.h>
17+
18+#include "twsyn_bridge_common.h"
19+#include "twsyn_bridge_exe_res.h"
20+
21+#define FILEPATH_MAX 32000
22+
23+#ifdef _WIN64
24+const char WinTitle[] = "twsyn bridge x64";
25+#else
26+const char WinTitle[] = "twsyn bridge x86";
27+#endif
28+
29+// host
30+static DWORD PrcsIdHost = 0;
31+static DWORD PrcsVerHost = 0;
32+static HWND hControlWndHost = NULL;
33+static UINT uControlMessHost = 0;
34+// bridge
35+static HWND hControlWnd = NULL;
36+static UINT uControlMess = 0;
37+static HANDLE hMutex = NULL;
38+static HANDLE hFileMap = NULL;
39+static fm_bridge_t *shared_data = NULL;
40+static int thread_exit = 0;
41+static HANDLE hThread = NULL;
42+// midi in
43+HMIDIIN hMidiIn[BRIDGE_MAX_PORT];
44+MIDIHDR *IMidiHdr[BRIDGE_MAX_PORT][BRIDGE_MAX_EXBUF];
45+char sIMidiHdr[BRIDGE_MAX_PORT][BRIDGE_MAX_EXBUF][sizeof(MIDIHDR)];
46+char sImidiHdr_data[BRIDGE_MAX_PORT][BRIDGE_MAX_EXBUF][BRIDGE_BUFF_SIZE];
47+static int exbuf_count = 0;
48+
49+static void ErrorMessageBox(const char *text)
50+{
51+ const char title[] = "twsyn_bridge(exe)";
52+ char buf[0x800];
53+
54+ wsprintfA(buf,"%s", text);
55+ MessageBox(NULL, buf, title, MB_OK | MB_ICONEXCLAMATION);
56+}
57+
58+static void uninit_bridge(void)
59+{
60+ thread_exit = 1;
61+ if(hThread){
62+ switch(WaitForSingleObject(hThread, 500)) {
63+ case WAIT_OBJECT_0:
64+ break;
65+ default:
66+ TerminateThread(hThread, 0);
67+ break;
68+ }
69+ CloseHandle(hThread);
70+ hThread = NULL;
71+ }
72+ if(shared_data) {
73+ UnmapViewOfFile(shared_data);
74+ shared_data = NULL;
75+ }
76+ if(hFileMap) {
77+ CloseHandle(hFileMap);
78+ hFileMap = NULL;
79+ }
80+ if(hMutex){
81+ CloseHandle(hMutex);
82+ hMutex = NULL;
83+ }
84+}
85+
86+static void get_midi_devs(void)
87+{
88+ int i, max;
89+
90+ if(shared_data == NULL)
91+ return;
92+ memset(shared_data->midi_devs, 0, sizeof(shared_data->midi_devs));
93+ max = midiInGetNumDevs();
94+ if(max > 32)
95+ max = 32;
96+ shared_data->midi_dev_num = max;
97+#ifdef _WIN64
98+ _snprintf(shared_data->midi_devs[0], 255, "MIDI Mapper (x64)");
99+#else
100+ _snprintf(shared_data->midi_devs[0], 255, "MIDI Mapper (x86)");
101+#endif
102+ for(i = 1; i <= max; i++){
103+ MIDIINCAPS mic;
104+ if(midiInGetDevCaps(i - 1, &mic, sizeof(MIDIINCAPS)) == 0){
105+#ifdef _WIN64
106+ _snprintf(shared_data->midi_devs[i], 255, "%s (x64)", mic.szPname);
107+#else
108+ _snprintf(shared_data->midi_devs[i], 255, "%s (x86)", mic.szPname);
109+#endif
110+ } else {
111+#ifdef _WIN64
112+ _snprintf(shared_data->midi_devs[i], 255, "MIDI IN dev:%d (x64)", i - 1);
113+#else
114+ _snprintf(shared_data->midi_devs[i], 255, "MIDI IN dev:%d (x86)", i - 1);
115+#endif
116+ }
117+ }
118+}
119+
120+void CALLBACK MidiInProc(HMIDIIN hMidiIn_, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
121+{
122+ MIDIHDR *IIMidiHdr;
123+ unsigned int port, bytes;
124+ const int total_exbuf = BRIDGE_TOTAL_EXBUF;
125+
126+ if(shared_data == NULL)
127+ return;
128+ switch(wMsg){
129+ case MIM_DATA:
130+ shared_data->wMsg = wMsg;
131+ shared_data->dwInstance = dwInstance;
132+ shared_data->dwParam1 = dwParam1;
133+ shared_data->dwParam2 = dwParam2;
134+ SendMessage(hControlWndHost, uControlMessHost, WMC_MIM_DATA, (LPARAM)NULL);
135+ break;
136+ case MIM_LONGDATA:
137+ IIMidiHdr = (MIDIHDR *) dwParam1;
138+ shared_data->wMsg = wMsg;
139+ shared_data->dwInstance = dwInstance;
140+ shared_data->dwParam1 = exbuf_count;
141+ shared_data->dwParam2 = dwParam2;
142+ bytes = (UINT)IIMidiHdr->dwBytesRecorded;
143+ shared_data->dwBytes[exbuf_count] = bytes;
144+ memcpy(shared_data->lpData[exbuf_count], IIMidiHdr->lpData, bytes);
145+ if(++exbuf_count >= total_exbuf)
146+ exbuf_count -= total_exbuf;
147+ port = (UINT)dwInstance;
148+ midiInUnprepareHeader(hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR));
149+ midiInPrepareHeader(hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR));
150+ midiInAddBuffer(hMidiIn[port], IIMidiHdr, sizeof(MIDIHDR));
151+ SendMessage(hControlWndHost, uControlMessHost, WMC_MIM_LONGDATA, (LPARAM)NULL);
152+ break;
153+ case MIM_OPEN:
154+ case MIM_CLOSE:
155+ case MIM_LONGERROR:
156+ case MIM_ERROR:
157+ case MIM_MOREDATA:
158+ break;
159+ }
160+}
161+
162+static void close_midi_devs(void)
163+{
164+ int i;
165+
166+ for(i = 0; i < shared_data->portnumber; i++){
167+ midiInStop(hMidiIn[i]);
168+ midiInReset(hMidiIn[i]);
169+ midiInClose(hMidiIn[i]);
170+ }
171+ shared_data->open_midi_dev = 0;
172+}
173+
174+static void open_midi_devs(void)
175+{
176+ int i, port;
177+
178+ if(shared_data == NULL)
179+ return;
180+ exbuf_count = 0;
181+ shared_data->wMsg;
182+ shared_data->dwInstance;
183+ shared_data->dwParam1;
184+ shared_data->dwParam2;
185+ memset(shared_data->dwBytes, 0, sizeof(shared_data->dwBytes));
186+ memset(shared_data->lpData, 0, sizeof(shared_data->lpData));
187+ for(port = 0; port < shared_data->portnumber; port++){
188+ for(i = 0; i < BRIDGE_MAX_EXBUF; i++){
189+ IMidiHdr[port][i] = (MIDIHDR *)sIMidiHdr[port][i];
190+ memset(IMidiHdr[port][i], 0, sizeof(MIDIHDR));
191+ IMidiHdr[port][i]->lpData = sImidiHdr_data[port][i];
192+ memset(IMidiHdr[port][i]->lpData, 0, BRIDGE_BUFF_SIZE);
193+ IMidiHdr[port][i]->dwBufferLength = BRIDGE_BUFF_SIZE;
194+ }
195+ }
196+ for(port = 0; port < shared_data->portnumber; port++){
197+ midiInOpen(&hMidiIn[port], shared_data->portID[port], (DWORD_PTR)MidiInProc, (DWORD_PTR)port, CALLBACK_FUNCTION);
198+ for (i = 0; i < BRIDGE_MAX_EXBUF; i++){
199+ midiInUnprepareHeader(hMidiIn[port], IMidiHdr[port][i], sizeof(MIDIHDR));
200+ midiInPrepareHeader(hMidiIn[port], IMidiHdr[port][i], sizeof(MIDIHDR));
201+ midiInAddBuffer(hMidiIn[port], IMidiHdr[port][i], sizeof(MIDIHDR));
202+ }
203+ }
204+ for(port = 0; port < shared_data->portnumber; port++){
205+ if(midiInStart(hMidiIn[port]) != MMSYSERR_NOERROR)
206+ goto winmmerror;
207+ }
208+ shared_data->open_midi_dev = 1;
209+ return;
210+winmmerror:
211+ close_midi_devs();
212+ return;
213+}
214+
215+LRESULT APIENTRY CALLBACK CtrlWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
216+{
217+ if(uMess == uControlMess){
218+ switch(wParam){
219+ case WMC_CLOSE_BRIDGE:
220+ uninit_bridge();
221+ EndDialog(hwnd, FALSE);
222+ PostQuitMessage(0);
223+ return TRUE;
224+ case WMC_GET_MIDI_DEVS:
225+ get_midi_devs();
226+ return TRUE;
227+ case WMC_OPEN_MIDI_DEVS:
228+ open_midi_devs();
229+ return TRUE;
230+ case WMC_CLOSE_MIDI_DEVS:
231+ close_midi_devs();
232+ return TRUE;
233+ }
234+ }else switch (uMess){
235+ case WM_COMMAND:
236+ switch(LOWORD(wParam)){
237+ case IDOK:
238+ return TRUE;
239+ case IDCANCEL:
240+ return TRUE;
241+ }
242+ break;
243+ case WM_INITDIALOG:
244+ return TRUE;
245+ default:
246+ break;
247+ }
248+ return FALSE;
249+}
250+
251+static unsigned int WINAPI CheckProcessThread(void *args)
252+{
253+ for(;;){
254+ DWORD ver = 0;
255+ Sleep(500);
256+ if(thread_exit) break;
257+ if(shared_data->exit){
258+ // ErrorMessageBox("recieve exit process.");
259+ PostMessage(hControlWnd, uControlMess, WMC_CLOSE_BRIDGE, (LPARAM)NULL);
260+ break;
261+ }
262+ else if(GetProcessVersion(PrcsIdHost) != PrcsVerHost){
263+ // ErrorMessageBox("lost host process.");
264+ PostMessage(hControlWnd, uControlMess, WMC_CLOSE_BRIDGE, (LPARAM)NULL);
265+ break;
266+ }
267+ }
268+ _endthread();
269+ return 0;
270+}
271+
272+// Create Window & init bridge
273+BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
274+{
275+ char buffer[FILEPATH_MAX] = {0};
276+ char *errortext;
277+ HICON hIcon;
278+ unsigned int dwThreadID = 0;
279+
280+ // resister ctrl message
281+ uControlMess = RegisterWindowMessage("twsyn_bridge_exe");
282+ if(!uControlMess){
283+ errortext = "bridge.exe error : RegisterWindowMessage.";
284+ goto error;
285+ }
286+ // create window
287+ hControlWnd = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG_DUMMY), NULL, (DLGPROC)CtrlWndProc);
288+ if(!hControlWnd){
289+ errortext = "bridge.exe error : CreateDialog.";
290+ goto error;
291+ }
292+ // create mutex
293+ hMutex = CreateMutex(NULL, TRUE, COMMON_MUTEX_NAME);
294+ if(!hMutex){
295+ errortext = "bridge.exe error : CreateMutex.";
296+ goto error;
297+ }
298+ if(GetLastError() == ERROR_ALREADY_EXISTS){ // 二重起動防止 この時点で古いブリッジは終了しているかも?
299+ errortext = "bridge.exe error : CreateMutex ALREADY_EXISTS.";
300+ goto error;
301+ }
302+ // set icon
303+ hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_ICON_BRIDGE16), IMAGE_ICON, 16, 16, 0);
304+ if(hIcon != NULL)
305+ SendMessage(hControlWnd, WM_SETICON, FALSE, (LPARAM)hIcon);
306+ ShowWindow(hControlWnd, SW_HIDE);
307+// ShowWindow(hControlWnd, SW_SHOW);
308+ // open file mapping
309+ hFileMap = OpenFileMapping(FILE_MAP_ALL_ACCESS, TRUE, COMMON_FM_NAME);
310+ if(!hFileMap){
311+ errortext = "bridge.exe error : OpenFileMapping.";
312+ goto error;
313+ }
314+ // open shared_data
315+ shared_data = (fm_bridge_t *)MapViewOfFile(hFileMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
316+ if(!shared_data){
317+ errortext = "bridge.exe error : MapViewOfFile.";
318+ goto error;
319+ }
320+ // open shared_data
321+ if(shared_data->PrcsIdHost == 0){
322+ errortext = "bridge.exe error : recieve processID.";
323+ goto error;
324+ }
325+ //
326+ PrcsIdHost = shared_data->PrcsIdHost;
327+ PrcsVerHost = shared_data->PrcsVerHost;
328+ hControlWndHost = (HWND)shared_data->hControlWndHost;
329+ uControlMessHost = shared_data->uControlMessHost;
330+ // create thread
331+ shared_data->exit = 0; // 解除 (ロードで時間かかるのでSleepは不要
332+ thread_exit = 0;
333+ hThread = (HANDLE)_beginthreadex(NULL, 0, CheckProcessThread, (void *)0, 0, &dwThreadID);
334+ if(!hThread){
335+ errortext = "bridge.exe error : CreateThread.";
336+ goto error;
337+ }
338+ // send processID
339+ shared_data->PrcsId = GetCurrentProcessId();
340+ // send process Version
341+ shared_data->PrcsVer = GetProcessVersion(shared_data->PrcsId);
342+ // send ctrl message
343+ shared_data->uControlMess = uControlMess;
344+ // send win handle
345+ shared_data->hControlWnd = (unsigned long long)hControlWnd; // winhandleをhost側へ渡す 初期化完了フラグ
346+ return TRUE;
347+error:
348+ uninit_bridge();
349+ ErrorMessageBox(errortext);
350+ return FALSE;
351+}
352+
353+int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
354+{
355+ static int init = 0;
356+ MSG msg;
357+
358+ if(init++) return FALSE;
359+ if (!InitInstance(hInstance, nCmdShow)){
360+ return FALSE;
361+ }
362+ // PeekMessage(&msg, NULL, WM_COMMAND, WM_COMMAND, PM_NOREMOVE);
363+ while( GetMessage(&msg,NULL,0,0) ){ // message loop
364+ TranslateMessage(&msg);
365+ DispatchMessage(&msg);
366+ }
367+ uninit_bridge();
368+ return (int) msg.wParam;
369+}
370+
371+
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_exe.rc
@@ -0,0 +1,72 @@
1+// Generated by ResEdit 1.5.11
2+// Copyright (C) 2006-2012
3+// http://www.resedit.net
4+
5+#include <windows.h>
6+#include <commctrl.h>
7+#include <richedit.h>
8+#include "twsyn_bridge_exe_res.h"
9+
10+
11+
12+
13+
14+//
15+// Dialog resources
16+//
17+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
18+IDD_DIALOG_DUMMY DIALOG 0, 0, 115, 25
19+STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU
20+CAPTION "TWSYN Bridge"
21+FONT 8, "Tahoma"
22+{
23+ DEFPUSHBUTTON "OK", IDOK, 5, 5, 50, 15
24+ PUSHBUTTON "Cancel", IDCANCEL, 60, 5, 50, 15
25+}
26+
27+
28+
29+//
30+// Icon resources
31+//
32+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
33+IDI_ICON_BRIDGE16 ICON "bridge-16.ico"
34+
35+
36+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
37+IDI_ICON_BRIDGE32 ICON "bridge-32.ico"
38+
39+
40+
41+//
42+// Version Information resources
43+//
44+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
45+1 VERSIONINFO
46+ FILEVERSION 1,1,0,1
47+ PRODUCTVERSION 1,1,0,1
48+ FILEOS VOS__WINDOWS32
49+ FILETYPE VFT_APP
50+ FILESUBTYPE VFT2_UNKNOWN
51+ FILEFLAGSMASK 0x00000000
52+ FILEFLAGS 0x00000000
53+{
54+ BLOCK "StringFileInfo"
55+ {
56+ BLOCK "041104B0"
57+ {
58+ VALUE "CompanyName", "nullpo"
59+ VALUE "FileDescription", "TWSYN Bridge"
60+ VALUE "FileVersion", "1, 1, 0, 1"
61+ VALUE "InternalName", "twsyn_bridge"
62+ VALUE "LegalCopyright", "Copyright (C) 2018"
63+ VALUE "OriginalFilename", "twsyn_bridge_x86.exe twsyn_bridge_x64.exe"
64+ VALUE "ProductName", "TWSYN Bridge"
65+ VALUE "ProductVersion", "1, 1, 0, 1"
66+ }
67+ }
68+ BLOCK "VarFileInfo"
69+ {
70+ VALUE "Translation", 0x0411, 0x04B0
71+ }
72+}
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_exe_res.h
@@ -0,0 +1,6 @@
1+
2+
3+
4+#define IDD_DIALOG_DUMMY 101
5+#define IDI_ICON_BRIDGE16 900
6+#define IDI_ICON_BRIDGE32 901
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_host.c
@@ -0,0 +1,306 @@
1+
2+
3+#ifdef HAVE_CONFIG_H
4+#include "config.h"
5+#endif /* HAVE_CONFIG_H */
6+
7+#ifdef USE_TWSYN_BRIDGE
8+
9+#define _DLLC
10+#define STRICT
11+#include <stdlib.h>
12+#include <io.h>
13+#include <windows.h>
14+#include <process.h>
15+#include <windows.h>
16+#include <winuser.h>
17+#include <windef.h>
18+#include <stdio.h>
19+#include <string.h>
20+#include <fcntl.h>
21+#include <tchar.h>
22+#pragma comment(lib, "shlwapi.lib")
23+#include <shlwapi.h>
24+#include <mmsystem.h>
25+#include "w32g_res.h"
26+#include "twsyn_bridge_common.h"
27+#include "twsyn_bridge_host.h"
28+#pragma hdrstop
29+
30+// bridge
31+static DWORD PrcsId = 0;
32+static DWORD PrcsVer = 0;
33+static HWND hControlWnd = NULL;
34+static UINT uControlMess = 0;
35+// host
36+static HWND hControlWndHost = NULL;
37+static UINT uControlMessHost = 0;
38+static char ExePath[FILEPATH_MAX + 4] = "";
39+static HANDLE hFileMap = NULL;
40+static fm_bridge_t *shared_data = NULL;
41+static PROCESS_INFORMATION pi;
42+static int run_bridge = 0;
43+static int error_bridge = 0;
44+
45+static void ErrorMessageBox(const char *text,DWORD errorcode)
46+{
47+ const char title[] = "twsyn_bridge(host)";
48+ char buf[0x800];
49+
50+ wsprintfA(buf,"%s (code:%d)", text, errorcode);
51+ MessageBox(NULL, buf, title, MB_OK | MB_ICONEXCLAMATION);
52+}
53+
54+static void uninit_bridge(void)
55+{
56+ if(hControlWndHost){
57+ EndDialog(hControlWndHost, FALSE);
58+ hControlWndHost = NULL;
59+ }
60+ if(shared_data != NULL) {
61+ UnmapViewOfFile(shared_data);
62+ shared_data = NULL;
63+ }
64+ if(hFileMap != NULL) {
65+ CloseHandle(hFileMap);
66+ hFileMap = NULL;
67+ }
68+ if(pi.hProcess){
69+ WaitForInputIdle(pi.hProcess, 100);
70+ TerminateProcess(pi.hProcess, 0);
71+ CloseHandle(pi.hProcess);
72+ }
73+ run_bridge = 0;
74+ error_bridge = 0;
75+}
76+
77+static int check_bridge(void)
78+{
79+ if(!run_bridge)
80+ return 1;
81+ if(GetProcessVersion(PrcsId) == PrcsVer)
82+ return 0;
83+ ErrorMessageBox("bridge host error : lost twsyn bridge process.", 0);
84+ uninit_bridge();
85+ return 1;
86+}
87+
88+LRESULT APIENTRY CALLBACK CtrlWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam)
89+{
90+ if(!run_bridge)
91+ return FALSE;
92+ if(uMess == uControlMessHost){
93+ switch(wParam){
94+ case WMC_MIM_DATA:
95+ case WMC_MIM_LONGDATA:
96+ MidiInProc(NULL, shared_data->wMsg, shared_data->dwInstance, shared_data->dwParam1, shared_data->dwParam2);
97+ return TRUE;
98+ }
99+ }else switch (uMess){
100+ case WM_COMMAND:
101+ switch(LOWORD(wParam)){
102+ case IDOK:
103+ return TRUE;
104+ case IDCANCEL:
105+ return TRUE;
106+ }
107+ break;
108+ case WM_INITDIALOG:
109+ return TRUE;
110+ default:
111+ break;
112+ }
113+ return FALSE;
114+}
115+
116+int get_bridge_midi_devs(void)
117+{
118+ if(check_bridge())
119+ return 0;
120+ SendMessage(hControlWnd, uControlMess, WMC_GET_MIDI_DEVS, (LPARAM)NULL);
121+ return shared_data->midi_dev_num;
122+}
123+
124+char *get_bridge_midi_dev_name(int num)
125+{
126+ if(!run_bridge)
127+ return NULL;
128+ if(num < 0)
129+ num = 0;
130+ if(num > shared_data->midi_dev_num)
131+ num = shared_data->midi_dev_num;
132+ return shared_data->midi_devs[num];
133+}
134+
135+int get_bridge_mim_databytes(int num)
136+{
137+ if(!run_bridge)
138+ return 0;
139+ return shared_data->dwBytes[num];
140+}
141+
142+char *get_bridge_mim_longdata(int num)
143+{
144+ if(!run_bridge)
145+ return NULL;
146+ return shared_data->lpData[num];
147+}
148+
149+void open_bridge_midi_dev(int portnumber, unsigned int *portID)
150+{
151+ int i;
152+ if(check_bridge())
153+ return;
154+ shared_data->portnumber = portnumber;
155+ for(i = 0; i < BRIDGE_MAX_PORT; i++)
156+ shared_data->portID[i] = portID[i];
157+ SendMessage(hControlWnd, uControlMess, WMC_OPEN_MIDI_DEVS, (LPARAM)NULL);
158+}
159+
160+void close_bridge_midi_dev(void)
161+{
162+ int i;
163+ if(!run_bridge)
164+ return;
165+ SendMessage(hControlWnd, uControlMess, WMC_CLOSE_MIDI_DEVS, (LPARAM)NULL);
166+}
167+
168+void close_bridge(void)
169+{
170+ if(!run_bridge)
171+ return;
172+ SendMessage(hControlWnd, uControlMess, WMC_CLOSE_BRIDGE, (LPARAM)NULL); // close_bridge
173+ uninit_bridge();
174+}
175+
176+void init_bridge(void)
177+{
178+ STARTUPINFO si;
179+ WNDCLASSEX wc;
180+ HINSTANCE hInstance = NULL;
181+ HANDLE hfile = NULL;
182+ char *errortext;
183+ int result, count, error = 0;
184+
185+ if(run_bridge)
186+ return;
187+ if(error_bridge)
188+ return;
189+ // get instance
190+ hInstance = GetModuleHandle(0);
191+ // bridge exe path
192+ if(GetModuleFileName(hInstance, ExePath, FILEPATH_MAX - 1)){
193+ PathRemoveFileSpec(ExePath);
194+ strcat(ExePath,"\\");
195+ }else{
196+ ExePath[0] = '.';
197+ ExePath[1] = '\\';
198+ ExePath[2] = '\0';
199+ }
200+ strcat(ExePath, EXE_NAME);
201+ // check bridge exe
202+ hfile = CreateFile(ExePath, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
203+ if(hfile == INVALID_HANDLE_VALUE){
204+ // errortext = "host error : bridge.exe not exist.";
205+ // goto error;
206+ error_bridge = 1;
207+ return;
208+ }
209+ CloseHandle(hfile);
210+ hfile = NULL;
211+ // CreateFileMapping
212+ hFileMap = CreateFileMapping(FILE_HANDLE, NULL, PAGE_READWRITE, 0, sizeof(fm_bridge_t), COMMON_FM_NAME);
213+ if(hFileMap == NULL){
214+ errortext = "bridge host error : CreateFileMapping.";
215+ goto error;
216+ }
217+ if(GetLastError() == ERROR_ALREADY_EXISTS){ // 二重起動防止
218+ errortext = "bridge host error : CreateFileMapping ALREADY_EXISTS.";
219+ goto error;
220+ }
221+ // open FileMap
222+ shared_data = (fm_bridge_t *)MapViewOfFile(hFileMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
223+ if(shared_data == NULL){
224+ errortext = "bridge host error : MapViewOfFile.";
225+ goto error;
226+ }
227+ memset(shared_data, 0, sizeof(shared_data));
228+ // send exsit flag
229+ shared_data->exit = 1; // 二重起動防止 (古いブリッジを終了 ブリッジ側でスレッド起動前に解除
230+ // send processID
231+ shared_data->PrcsIdHost = GetCurrentProcessId();
232+ // send process Version
233+ shared_data->PrcsVerHost = GetProcessVersion(shared_data->PrcsIdHost);
234+ // resister ctrl message
235+ uControlMessHost = RegisterWindowMessage("twsyn_bridge_host");
236+ if(!uControlMessHost){
237+ errortext = "bridge host error : RegisterWindowMessage.";
238+ goto error;
239+ }
240+ // send ctrl message
241+ shared_data->uControlMessHost = uControlMessHost;
242+ // create window
243+ hControlWndHost = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_DIALOG_TWSYN_BRIDGE), NULL, (DLGPROC)CtrlWndProc);
244+ if(!hControlWndHost){
245+ errortext = "bridge host error : CreateDialog.";
246+ goto error;
247+ }
248+ ShowWindow(hControlWndHost, SW_HIDE);
249+// ShowWindow(hControlWndHost, SW_SHOW);
250+ // send win handle
251+ shared_data->hControlWndHost = hControlWndHost;
252+ // run bridge
253+ si.cb = sizeof(si);
254+ si.lpReserved = NULL;
255+ si.lpDesktop = NULL;
256+ si.lpTitle = NULL;
257+ si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
258+ si.cbReserved2 = 0;
259+ si.lpReserved2 = NULL;
260+ si.wShowWindow = SW_HIDE;
261+ si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
262+ if(CreateProcess(ExePath,NULL,NULL,NULL,TRUE,
263+ CREATE_DEFAULT_ERROR_MODE,NULL,NULL,&si,&pi) == FALSE ){
264+ errortext = "host error : run bridge.exe.";
265+ goto error;
266+ }
267+ // recieve bridge hControlWnd
268+ count = 0;
269+ while(!shared_data->hControlWnd){
270+ Sleep(100);
271+ if((count++) > 50){ // wait max 5sec
272+ errortext = "host error : hControlWnd timeout.";
273+ goto error;
274+ }
275+ }
276+ uControlMess = (UINT)shared_data->uControlMess;
277+ hControlWnd = (HWND)shared_data->hControlWnd;
278+ // recieve processID
279+ PrcsId = shared_data->PrcsId;
280+ // recieve process Version
281+ PrcsVer = shared_data->PrcsVer;
282+ run_bridge = 1;
283+ return;
284+error:
285+ result = GetLastError();
286+ CloseWindow(hControlWndHost);
287+ if(shared_data != NULL) {
288+ UnmapViewOfFile(shared_data);
289+ shared_data = NULL;
290+ }
291+ if(hFileMap != NULL) {
292+ CloseHandle(hFileMap);
293+ hFileMap = NULL;
294+ }
295+ if(pi.hProcess){
296+ WaitForInputIdle(pi.hProcess, 100);
297+ TerminateProcess(pi.hProcess, 0);
298+ CloseHandle(pi.hProcess);
299+ }
300+ ErrorMessageBox(errortext,result);
301+ run_bridge = 0;
302+ error_bridge = 1;
303+ return;
304+}
305+
306+#endif // USE_BRIDGE
\ No newline at end of file
--- /dev/null
+++ b/twsyn_bridge/twsyn_bridge_host.h
@@ -0,0 +1,43 @@
1+
2+#pragma once
3+
4+#ifdef HAVE_CONFIG_H
5+#include "config.h"
6+#endif /* HAVE_CONFIG_H */
7+
8+#ifdef USE_TWSYN_BRIDGE
9+
10+#define EXE_NAME32 "twsyn_bridge_x86.exe"
11+#define EXE_NAME64 "twsyn_bridge_x64.exe"
12+
13+#ifdef _WIN64
14+#define EXE_NAME EXE_NAME32
15+#define BRD_EXE_NAME EXE_NAME64
16+#define FILE_HANDLE ((HANDLE)0xffffffffffffffff)
17+#else
18+#define EXE_NAME EXE_NAME64
19+#define BRD_EXE_NAME EXE_NAME32
20+#define FILE_HANDLE ((HANDLE)0xffffffff)
21+#endif
22+
23+#define FILEPATH_MAX 32000
24+
25+
26+extern int opt_use_twsyn_bridge;
27+extern void close_bridge(void);
28+extern void init_bridge(void);
29+extern int get_bridge_midi_devs(void);
30+extern char *get_bridge_midi_dev_name(int num);
31+extern void open_bridge_midi_dev(int portnumber, unsigned int *portID);
32+extern void close_bridge_midi_dev(void);
33+extern int get_bridge_mim_databytes(int num);
34+extern char *get_bridge_mim_longdata(int num);
35+
36+extern void CALLBACK MidiInProc(HMIDIIN hMidiInL, UINT wMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2);
37+
38+#endif // USE_BRIDGE
39+
40+
41+
42+
43+
--- a/twsyng/twsyng.vcproj
+++ b/twsyng/twsyng.vcproj
@@ -51,7 +51,7 @@
5151 EnableIntrinsicFunctions="true"
5252 FavorSizeOrSpeed="1"
5353 OmitFramePointers="true"
54- AdditionalIncludeDirectories="..\interface,..\libarc,..\libunimod,..\timidity,..\utils,..,..\..\include,..\portaudio\pa_common"
54+ AdditionalIncludeDirectories="..\twsyn_bridge,..\interface,..\libarc,..\libunimod,..\timidity,..\utils,..,..\..\include,..\portaudio\pa_common"
5555 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32"
5656 StringPooling="true"
5757 ExceptionHandling="0"
@@ -151,7 +151,7 @@
151151 <Tool
152152 Name="VCCLCompilerTool"
153153 Optimization="0"
154- AdditionalIncludeDirectories="..\interface,..\libarc,..\libunimod,..\timidity,..\utils,..,..\..\include,..\portaudio\pa_common"
154+ AdditionalIncludeDirectories="..\twsyn_bridge,..\interface,..\libarc,..\libunimod,..\timidity,..\utils,..,..\..\include,..\portaudio\pa_common"
155155 PreprocessorDefinitions="WIN32;__DEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32"
156156 StringPooling="true"
157157 MinimalRebuild="true"
@@ -453,6 +453,10 @@
453453 >
454454 </File>
455455 <File
456+ RelativePath="..\twsyn_bridge\twsyn_bridge_host.c"
457+ >
458+ </File>
459+ <File
456460 RelativePath="..\timidity\version.c"
457461 >
458462 </File>
--- a/twsyng/twsyng.vcxproj
+++ b/twsyng/twsyng.vcxproj
@@ -31,6 +31,7 @@
3131 <ConfigurationType>Application</ConfigurationType>
3232 <UseOfMfc>false</UseOfMfc>
3333 <CharacterSet>MultiByte</CharacterSet>
34+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
3435 </PropertyGroup>
3536 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
3637 <ConfigurationType>Application</ConfigurationType>
@@ -80,10 +81,11 @@
8081 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
8182 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
8283 <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
83- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">twsyng_c212</TargetName>
84- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">twsyng_x64_c212</TargetName>
84+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">twsyng_c213</TargetName>
85+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">twsyng_x64_c213</TargetName>
8586 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
8687 <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_x64</TargetName>
88+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8789 </PropertyGroup>
8890 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
8991 <Midl>
@@ -98,7 +100,7 @@
98100 <IntrinsicFunctions>true</IntrinsicFunctions>
99101 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
100102 <OmitFramePointers>true</OmitFramePointers>
101- <AdditionalIncludeDirectories>..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
103+ <AdditionalIncludeDirectories>..\twsyn_bridge;..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
102104 <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
103105 <StringPooling>true</StringPooling>
104106 <ExceptionHandling>
@@ -154,7 +156,7 @@
154156 <IntrinsicFunctions>true</IntrinsicFunctions>
155157 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
156158 <OmitFramePointers>true</OmitFramePointers>
157- <AdditionalIncludeDirectories>..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
159+ <AdditionalIncludeDirectories>..\twsyn_bridge;..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
158160 <PreprocessorDefinitions>_WIN64;WIN32;NDEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
159161 <StringPooling>true</StringPooling>
160162 <ExceptionHandling>
@@ -168,7 +170,7 @@
168170 <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
169171 <ObjectFileName>.\Release/</ObjectFileName>
170172 <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
171- <WarningLevel>TurnOffAllWarnings</WarningLevel>
173+ <WarningLevel>Level1</WarningLevel>
172174 <SuppressStartupBanner>true</SuppressStartupBanner>
173175 <CompileAs>CompileAsC</CompileAs>
174176 <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
@@ -205,7 +207,7 @@
205207 </Midl>
206208 <ClCompile>
207209 <Optimization>Disabled</Optimization>
208- <AdditionalIncludeDirectories>..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
210+ <AdditionalIncludeDirectories>..\twsyn_bridge;..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
209211 <PreprocessorDefinitions>WIN32;__DEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
210212 <StringPooling>true</StringPooling>
211213 <MinimalRebuild>true</MinimalRebuild>
@@ -245,6 +247,7 @@
245247 <RandomizedBaseAddress>false</RandomizedBaseAddress>
246248 <DataExecutionPrevention>
247249 </DataExecutionPrevention>
250+ <LargeAddressAware>true</LargeAddressAware>
248251 </Link>
249252 </ItemDefinitionGroup>
250253 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -256,8 +259,8 @@
256259 </Midl>
257260 <ClCompile>
258261 <Optimization>Disabled</Optimization>
259- <AdditionalIncludeDirectories>..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
260- <PreprocessorDefinitions>_WIN64;WIN32;__DEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
262+ <AdditionalIncludeDirectories>..\twsyn_bridge;..\interface;..\libarc;..\libunimod;..\timidity;..\utils;..;..\..\include;..\portaudio\pa_common;..\libspeex;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
263+ <PreprocessorDefinitions>_WIN64;WIN32;_DEBUG;_WINDOWS;HAVE_CONFIG_H;_MT;TWSYNG32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
261264 <StringPooling>true</StringPooling>
262265 <ExceptionHandling>
263266 </ExceptionHandling>
@@ -285,9 +288,8 @@
285288 <Culture>0x0411</Culture>
286289 </ResourceCompile>
287290 <Link>
288- <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
289291 <AdditionalDependencies>odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
290- <OutputFile>./Debug/twsyng.exe</OutputFile>
292+ <OutputFile>$(TargetPath)</OutputFile>
291293 <SuppressStartupBanner>true</SuppressStartupBanner>
292294 <GenerateDebugInformation>true</GenerateDebugInformation>
293295 <ProgramDatabaseFile>.\Debug/twsyng.pdb</ProgramDatabaseFile>
@@ -295,6 +297,7 @@
295297 <RandomizedBaseAddress>false</RandomizedBaseAddress>
296298 <DataExecutionPrevention>
297299 </DataExecutionPrevention>
300+ <LargeAddressAware>true</LargeAddressAware>
298301 </Link>
299302 </ItemDefinitionGroup>
300303 <ItemGroup>
@@ -373,6 +376,7 @@
373376 <ClCompile Include="..\interface\winsyn_c.c" />
374377 <ClCompile Include="..\timidity\wrd_read.c" />
375378 <ClCompile Include="..\timidity\wrdt.c" />
379+ <ClCompile Include="..\twsyn_bridge\twsyn_bridge_host.c" />
376380 </ItemGroup>
377381 <ItemGroup>
378382 <ResourceCompile Include="..\interface\w32g_res.rc">
--- a/twsynsrv/twsynsrv.vcxproj
+++ b/twsynsrv/twsynsrv.vcxproj
@@ -43,6 +43,7 @@
4343 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4444 <ConfigurationType>Application</ConfigurationType>
4545 <CharacterSet>MultiByte</CharacterSet>
46+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
4647 </PropertyGroup>
4748 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4849 <ImportGroup Label="ExtensionSettings">
@@ -81,6 +82,7 @@
8182 <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">twsynsrv_x64</TargetName>
8283 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
8384 <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectName)_x64</TargetName>
85+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8486 </PropertyGroup>
8587 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8688 <ClCompile>
@@ -150,7 +152,7 @@
150152 </ClCompile>
151153 <Link>
152154 <AdditionalDependencies>odbc32.lib;odbccp32.lib;winmm.lib;wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
153- <OutputFile>../Debug/twsynsrv.exe</OutputFile>
155+ <OutputFile>$(TargetPath)</OutputFile>
154156 <GenerateDebugInformation>true</GenerateDebugInformation>
155157 <ProgramDatabaseFile>$(OutDir)twsynsrv.pdb</ProgramDatabaseFile>
156158 <SubSystem>Windows</SubSystem>
--- a/utils/utils.vcxproj
+++ b/utils/utils.vcxproj
@@ -46,6 +46,7 @@
4646 <ConfigurationType>StaticLibrary</ConfigurationType>
4747 <UseOfMfc>false</UseOfMfc>
4848 <CharacterSet>MultiByte</CharacterSet>
49+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
4950 </PropertyGroup>
5051 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5152 <ImportGroup Label="ExtensionSettings">
@@ -70,13 +71,14 @@
7071 <PropertyGroup>
7172 <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
7273 <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
73- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</OutDir>
74+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7475 <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
75- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\Debug\</IntDir>
76+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Configuration)\</IntDir>
7677 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
7778 <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)\</OutDir>
7879 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
7980 <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Configuration)\</IntDir>
81+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8082 </PropertyGroup>
8183 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8284 <ClCompile>
--- a/windrv/windrv.vcxproj
+++ b/windrv/windrv.vcxproj
@@ -44,6 +44,7 @@
4444 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
4545 <ConfigurationType>DynamicLibrary</ConfigurationType>
4646 <CharacterSet>MultiByte</CharacterSet>
47+ <PlatformToolset>Windows7.1SDK</PlatformToolset>
4748 </PropertyGroup>
4849 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
4950 <ImportGroup Label="ExtensionSettings">
@@ -84,6 +85,7 @@
8485 <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">timiditydrv</TargetName>
8586 <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(VCInstallDir)lib\amd64;$(VCInstallDir)atlmfc\lib\amd64;$(WindowsSdkDir)lib\x64;C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64;</LibraryPath>
8687 <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">timiditydrv</TargetName>
88+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath);$(VSInstallDir);$(VSInstallDir)lib\amd64;$(WindowsSdkDir)lib\x64;</LibraryPath>
8789 </PropertyGroup>
8890 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8991 <ClCompile>
@@ -160,7 +162,7 @@
160162 </ClCompile>
161163 <Link>
162164 <AdditionalDependencies>winmm.lib;wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
163- <OutputFile>..\Debug\timiditydrv.dll</OutputFile>
165+ <OutputFile>$(TargetPath)</OutputFile>
164166 <ModuleDefinitionFile>.\timiditydrv.def</ModuleDefinitionFile>
165167 <MergedIDLBaseFileName>timiditydrv.idl</MergedIDLBaseFileName>
166168 <GenerateDebugInformation>true</GenerateDebugInformation>
Show on old repository browser