+2007-01-28 Keishi Suenaga <skeishi@yahoo.co.jp>
+\r
+ * interface/rtsyn_common.c: fix sysex check \r
+ * timidity/portaudio_a.c small fix for compiling\r
+ * timidity/timidity.c w32 cfg file sequence changed
+ option > exe dir > win dir\r
+ * timidity/w32_a.c small fix for compiling\r
+ * windrv/Makefile.am re-add add timidity.idl\r
+ * windrv/timiditydrv.c re-add MIDIOUTCAPS2A(W)\r
+ * windrv/timiditydrv.idl re-add
+
2007-01-14 Keishi Suenaga <skeishi@yahoo.co.jp>
* timidity/flac_a.c
event_time = event_time + rtsyn_latency;
- if(sysexbuffer[exlen-1] == '\xf7'){ // I don't konw why this need
- for(i=0;i<EX_RESET_NO;i++){
- chk=0;
- for(j=0;(j<exlen)&&(j<11);j++){
- if(chk==0 && sysex_resets[i][j]!=sysexbuffer[j]){
- chk=~0;
- }
- }
- if(chk==0){
- rtsyn_server_reset();
+ if( ((sysexbuffer[0] != '\xf0') && (sysexbuffer[0] != '\xf7')) ||
+ ((sysexbuffer[0] == '\xf0') && (sysexbuffer[exlen-1] != '\xf7')) ) return ;
+
+ for(i=0;i<EX_RESET_NO;i++){
+ chk=0;
+ for(j=0;(j<exlen)&&(j<11);j++){
+ if(chk==0 && sysex_resets[i][j]!=sysexbuffer[j]){
+ chk=~0;
}
}
+ if(chk==0){
+ rtsyn_server_reset();
+ }
+ }
/*
printf("SyeEx length=%x bytes \n", exlen);
}
printf("\n");
*/
- if(parse_sysex_event(sysexbuffer+1,exlen-1,&ev)){
- if(ev.type==ME_RESET && rtsyn_system_mode!=DEFAULT_SYSTEM_MODE){
- ev.a=rtsyn_system_mode;
- change_system_mode(rtsyn_system_mode);
- rtsyn_play_event_time(&ev, event_time);
- }else{
- rtsyn_play_event_time(&ev, event_time);
- }
+ if(parse_sysex_event(sysexbuffer+1,exlen-1,&ev)){
+ if(ev.type==ME_RESET && rtsyn_system_mode!=DEFAULT_SYSTEM_MODE){
+ ev.a=rtsyn_system_mode;
+ change_system_mode(rtsyn_system_mode);
+ rtsyn_play_event_time(&ev, event_time);
+ }else{
+ rtsyn_play_event_time(&ev, event_time);
}
- if(ne=parse_sysex_event_multi(sysexbuffer+1,exlen-1, evm)){
- for (i = 0; i < ne; i++){
- rtsyn_play_event_time(&evm[i], event_time);
- }
+ }
+ if(ne=parse_sysex_event_multi(sysexbuffer+1,exlen-1, evm)){
+ for (i = 0; i < ne; i++){
+ rtsyn_play_event_time(&evm[i], event_time);
}
}
+
}
}
#ifdef PORTAUDIO_V19
#ifdef AU_PORTAUDIO_DLL
- PaHostApiIndex i, ApiCount;
+ {
+ PaHostApiIndex i, ApiCount;
i = 0;
ApiCount = Pa_GetHostApiCount();
do{
DeviceIndex = HostApiInfo->defaultOutputDevice;
if(DeviceIndex==paNoDevice) goto error;
+ }
#else
DeviceIndex = Pa_GetDefaultOutputDevice();
if(DeviceIndex==paNoDevice) goto error;
strcat(ConfigFile, "\\TIMIDITY.CFG");
}
strncpy(local, ConfigFile, sizeof(local) - 1);
-#else
- /* !IA_W32GUI */
- GetWindowsDirectory(local, 1023 - 13);
- strcat(local, "\\TIMIDITY.CFG");
-#endif
-
- /* First, try read system configuration file.
- * Default is C:\WINDOWS\TIMIDITY.CFG
- */
if((check = open(local, 0)) >= 0)
{
close(check);
return 0;
}
}
+#endif
- /* Next, try read configuration file which is in the
+ /* First, try read configuration file which is in the
* TiMidity directory.
*/
if(GetModuleFileName(NULL, local, 1023))
}
}
}
+#if !defined ( IA_W32GUI ) && !defined ( IA_W32G_SYN )
+ /* Next, try read system configuration file.
+ * Default is C:\WINDOWS\TIMIDITY.CFG
+ */
+ GetWindowsDirectory(local, 1023 - 13);
+ strcat(local, "\\TIMIDITY.CFG");
+ if((check = open(local, 0)) >= 0)
+ {
+ close(check);
+ if(!read_config_file(local, 0)) {
+ got_a_configuration = 1;
+ return 0;
+ }
+ }
+#endif
+
}
#else
argv[c] = p;
}
#endif /* IA_W32GUI || IA_W32G_SYN */
-#if defined(IA_WINSYN) || defined(IA_PORTMIDISYN) || defined(IA_W32G_SYN)
+#ifdef __WIN32__
opt_sf_close_each_file = 0;
#else
if ((err = timidity_pre_load_configuration()) != 0)
while ((c = getopt_long(argc, argv, optcommands, longopts, &longind)) > 0)
if ((err = set_tim_opt_long(c, optarg, longind)) != 0)
break;
-#if defined(IA_WINSYN) || defined(IA_PORTMIDISYN) || defined(IA_W32G_SYN)
+#ifdef __WIN32__
if (got_a_configuration != 1)
if ((err = timidity_pre_load_configuration()) != 0)
return err;
int opt_wmme_device_id = -1;
+UINT uDeviceID;
+
/*****************************************************************************************************************************/
#if defined(__CYGWIN32__) || defined(__MINGW32__)
hDevice = 0;
- UINT uDeviceID;
if (opt_wmme_device_id == -1){
uDeviceID = WAVE_MAPPER;
}else{
SYSEXTRAS: timiditydrv.h
EXTRA_DIST = \
- timiditydrv.inf
+ timiditydrv.inf \
+ timiditydrv.idl
#include <windows.h>
#include "mmddk.h"
#include <mmsystem.h>
+#if defined(__DMC__) || defined(__MINGW32__)
+//following codes are from wine's mmsystem.h
+typedef struct tagMIDIOUTCAPS2A {
+ WORD wMid;
+ WORD wPid;
+ MMVERSION vDriverVersion;
+ CHAR szPname[MAXPNAMELEN];
+ WORD wTechnology;
+ WORD wVoices;
+ WORD wNotes;
+ WORD wChannelMask;
+ DWORD dwSupport;
+ GUID ManufacturerGuid;
+ GUID ProductGuid;
+ GUID NameGuid;
+} MIDIOUTCAPS2A, *LPMIDIOUTCAPS2A;
+
+typedef struct tagMIDIOUTCAPS2W {
+ WORD wMid;
+ WORD wPid;
+ MMVERSION vDriverVersion;
+ WCHAR szPname[MAXPNAMELEN];
+ WORD wTechnology;
+ WORD wVoices;
+ WORD wNotes;
+ WORD wChannelMask;
+ DWORD dwSupport;
+ GUID ManufacturerGuid;
+ GUID ProductGuid;
+ GUID NameGuid;
+} MIDIOUTCAPS2W, *LPMIDIOUTCAPS2W;
+
+//DECL_WINELIB_TYPE_AW(MIDIOUTCAPS2)
+//DECL_WINELIB_TYPE_AW(LPMIDIOUTCAPS2)
+#endif
+
+#include <process.h>
+// GUID definitions from wine's guiddef.h
+#ifndef GUID_DEFINED
+#define GUID_DEFINED
+typedef struct _GUID
+{
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[ 8 ];
+} GUID;
+
+#endif
+//GUID numbers are generated by timiditydrv.idl
+const GUID CLSID_tim_synth = {0x0FEC4C35,0xA705,0x41d7,{0xA3,0xBB,0xD5,0x87,0xA2,0x31,0x04,0x5A}};
#include "config.h"
#include "sysdep.h"
HRESULT modGetCaps(PVOID capsPtr, DWORD capsSize) {
MIDIOUTCAPSA * myCapsA;
MIDIOUTCAPSW * myCapsW;
+ MIDIOUTCAPS2A * myCaps2A;
+ MIDIOUTCAPS2W * myCaps2W;
+
CHAR synthName[] = "Timidity++ Driver\0";
WCHAR synthNameW[] = L"Timidity++ Driver\0";
return MMSYSERR_NOERROR;
break;
+ case (sizeof(MIDIOUTCAPS2A)):
+ myCaps2A = (MIDIOUTCAPS2A *)capsPtr;
+ myCaps2A->wMid = 0xffff;
+ myCaps2A->wPid = 0xffff;
+ memcpy(myCaps2A->szPname, synthName, sizeof(synthName));
+ myCaps2A->wTechnology = MOD_MIDIPORT;
+ myCaps2A->vDriverVersion = 0x0090;
+ myCaps2A->wVoices = 0;
+ myCaps2A->wNotes = 0;
+ myCaps2A->wChannelMask = 0xffff;
+ myCaps2A->dwSupport = 0;
+ myCaps2A->ManufacturerGuid = CLSID_tim_synth;
+ myCaps2A->ProductGuid = CLSID_tim_synth;
+ myCaps2A->NameGuid = CLSID_tim_synth;
+ return MMSYSERR_NOERROR;
+
+ case (sizeof(MIDIOUTCAPS2W)):
+ myCaps2W = (MIDIOUTCAPS2W *)capsPtr;
+ myCaps2W->wMid = 0xffff;
+ myCaps2W->wPid = 0xffff;
+ memcpy(myCaps2W->szPname, synthNameW, sizeof(synthNameW));
+ myCaps2W->wTechnology = MOD_MIDIPORT;
+ myCaps2W->vDriverVersion = 0x0090;
+ myCaps2W->wVoices = 0;
+ myCaps2W->wNotes = 0;
+ myCaps2W->wChannelMask = 0xffff;
+ myCaps2W->dwSupport = 0;
+ myCaps2W->ManufacturerGuid = CLSID_tim_synth;
+ myCaps2W->ProductGuid = CLSID_tim_synth;
+ myCaps2W->NameGuid = CLSID_tim_synth;
+ return MMSYSERR_NOERROR;
+
default:
return MMSYSERR_ERROR;
IIMidiHdr = (MIDIHDR *) dwParam1;
exlen=(int)IIMidiHdr->dwBufferLength;
if( NULL == (sysexbuffer = (char *)malloc(exlen * sizeof(char)))){
- exlen = 0;
+ return MMSYSERR_NOMEM;
}else{
memcpy(sysexbuffer,IIMidiHdr->lpData,exlen);
#ifdef DEBUG
case MODM_CLOSE:
if ( stop_rtthread != 0 || stop_thread != 0 ) return MIDIERR_STILLPLAYING;
--OpenCount;
- if( OpenCount == 1){
+ if( OpenCount == 0){
int maxloop=1000;
stop_thread = 1;
--- /dev/null
+/*
+ TiMidity++ -- MIDI to WAVE converter and player
+ Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
+ Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ aRts_a.c by Peter L Jones <peter@drealm.org.uk>
+ based on esd_a.c
+
+ Functions to play sound through aRts
+*/\r
+
+// This file will be processed by the MIDL tool to\r
+// produce the type library (timiditydrv.tlb) and marshalling code.\r
+\r
+//import "oaidl.idl";\r
+//import "ocidl.idl";\r
+ \r
+ [\r
+ object,\r
+ uuid(D908258C-4B41-41f0-AAD9-684FDAA84C75),\r
+ dual,\r
+ helpstring("Itim_synth Interface"),\r
+ pointer_default(unique)\r
+ ]\r
+ interface Itim_synth : IDispatch\r
+ {\r
+ };
+\r
+[\r
+ uuid(6D98B569-D56A-4fff-870A-F2E27052A0DE),\r
+ version(1.0),\r
+ helpstring("timiditydrv 1.0 Type Library")\r
+]\r
+library TIM_DRVLib\r
+{\r
+ importlib("stdole32.tlb");\r
+ importlib("stdole2.tlb");\r
+\r
+ \r
+ [\r
+ uuid(0FEC4C35-A705-41d7-A3BB-D587A231045A),\r
+ helpstring("tim_synth Class")\r
+ ]\r
+ coclass tim_synth\r
+ {\r
+ [default] interface Itim_synth;\r
+ };\r
+};\r