diff --git a/Makefile b/Makefile index f6943f0..18ac04b 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ EXES = ### Common settings -CEXTRA = -g -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith +CEXTRA = -g -O2 -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith CXXEXTRA = -D__WINESRC__ -D_REENTRANT -fPIC -Wall -pipe -fno-strict-aliasing -Wdeclaration-after-statement -Wwrite-strings -Wpointer-arith RCEXTRA = INCLUDE_PATH = -I. -I/usr/include -I$(PREFIX)/include -I$(PREFIX)/include/wine -I$(PREFIX)/include/wine/windows diff --git a/README.TXT b/README.TXT index bb720ad..20b6c4f 100644 --- a/README.TXT +++ b/README.TXT @@ -33,3 +33,8 @@ modified by: Ralf Beck (musical_snake@gmx.de) todo: - make timecode sync to jack transport + + +changelog: +0.3: +30-APR-2007: corrected connection of in/outputs diff --git a/asio.c b/asio.c index a1ac0ad..0c767fc 100644 --- a/asio.c +++ b/asio.c @@ -208,14 +208,14 @@ typedef struct IWineASIOImpl IWineASIOImpl; static ULONG WINAPI IWineASIOImpl_AddRef(LPWINEASIO iface) { ULONG ref = InterlockedIncrement(&(This.ref)); - TRACE("(%p) ref was %ld\n", This, ref - 1); + TRACE("(%p) ref was %x\n", &This, ref - 1); return ref; } static ULONG WINAPI IWineASIOImpl_Release(LPWINEASIO iface) { ULONG ref = InterlockedDecrement(&(This.ref)); - TRACE("(%p) ref was %ld\n", &This, ref + 1); + TRACE("(%p) ref was %x\n", &This, ref + 1); if (!ref) { fp_jack_client_close(This.client); @@ -259,6 +259,7 @@ WRAP_THISCALL( ASIOBool __stdcall, IWineASIOImpl_init, (LPWINEASIO iface, void * jack_status_t status; int i,j; char *envi; + char name[32]; This.sample_rate = 48000.0; This.block_frames = 1024; @@ -346,15 +347,13 @@ WRAP_THISCALL( ASIOBool __stdcall, IWineASIOImpl_init, (LPWINEASIO iface, void * for (i = 0; i < MAX_INPUTS; i++) { - char name[32]; - snprintf(name, sizeof(name), "Input%d", i); + sprintf(name, "Input%d", i); This.input[i].port = fp_jack_port_register(This.client, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, i); } for (i = 0; i < MAX_OUTPUTS; i++) { - char name[32]; - snprintf(name, sizeof(name), "Output%d", i); + sprintf(name, "Output%d", i); This.output[i].port = fp_jack_port_register(This.client, name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, i); } @@ -398,9 +397,9 @@ WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_start, (LPWINEASIO iface)) if (ports) { - for (i = 0; i < MAX_INPUTS; i++) + for (i = 0; i < MAX_INPUTS && ports[i]; i++) { - if ((This.input[i].active == ASIOTrue) && ports[i]) + if (This.input[i].active == ASIOTrue) if (fp_jack_connect(This.client, ports[i], fp_jack_port_name(This.input[i].port))) { WARN("input %d connect failed\n", i); @@ -415,9 +414,10 @@ WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_start, (LPWINEASIO iface)) if (ports) { - for (i = 0; i < MAX_OUTPUTS; i++) + for (i = 0; (i < MAX_OUTPUTS) && ports[i]; i++) { - if ((This.output[i].active == ASIOTrue) && ports[i]) + + if (This.output[i].active == ASIOTrue) if (fp_jack_connect(This.client, fp_jack_port_name(This.output[i].port), ports[i])) { WARN("output %d connect failed\n", i); @@ -572,7 +572,6 @@ WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_getSamplePosition, (LPWINEASIO WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_getChannelInfo, (LPWINEASIO iface, ASIOChannelInfo *info)) { - int i; char name[32]; if (info->channel < 0 || (info->isInput ? info->channel >= MAX_INPUTS : info->channel >= MAX_OUTPUTS)) @@ -585,12 +584,12 @@ WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_getChannelInfo, (LPWINEASIO if if (info->isInput) { info->isActive = This.input[info->channel].active; - snprintf(name, sizeof(name), "Input %ld", info->channel); + sprintf(name, "Input %ld", info->channel); } else { - info->isActive = This.input[info->channel].active; - snprintf(name, sizeof(name), "Output %ld", info->channel); + info->isActive = This.output[info->channel].active; + sprintf(name, "Output %ld", info->channel); } strcpy(info->name, name); @@ -688,11 +687,6 @@ WRAP_THISCALL( ASIOError __stdcall, IWineASIOImpl_createBuffers, (LPWINEASIO ifa return ASE_OK; -ERROR_MEM: - __wrapped_IWineASIOImpl_disposeBuffers(iface); - WARN("no memory\n"); - return ASE_NoMemory; - ERROR_PARAM: __wrapped_IWineASIOImpl_disposeBuffers(iface); WARN("invalid parameter\n"); @@ -828,7 +822,7 @@ static int jack_process(jack_nframes_t nframes, void * arg) { int i, j; jack_default_audio_sample_t *in, *out; - jack_transport_state_t ts; +// jack_transport_state_t ts; int *buffer; // ts = fp_jack_transport_query(This.client, NULL); @@ -910,7 +904,7 @@ static DWORD CALLBACK win32_callback(LPVOID arg) TRACE("terminated\n"); return 0; } - // getNanoSeconds(&This.system_time); + getNanoSeconds(&This.system_time); /* make sure we are in the run state */ diff --git a/main.c b/main.c index a00dfa7..0bb753e 100644 --- a/main.c +++ b/main.c @@ -57,7 +57,7 @@ static ULONG WINAPI CF_AddRef(LPCLASSFACTORY iface) { IClassFactoryImpl *This = (IClassFactoryImpl *)iface; ULONG ref = InterlockedIncrement(&(This->ref)); - TRACE("(%p) ref was %ld\n", This, ref - 1); + TRACE("(%p) ref was %x\n", This, ref - 1); return ref; } @@ -65,7 +65,7 @@ static ULONG WINAPI CF_Release(LPCLASSFACTORY iface) { IClassFactoryImpl *This = (IClassFactoryImpl *)iface; ULONG ref = InterlockedDecrement(&(This->ref)); - TRACE("(%p) ref was %ld\n", This, ref + 1); + TRACE("(%p) ref was %x\n", This, ref + 1); /* static class, won't be freed */ return ref; } @@ -171,7 +171,7 @@ HRESULT WINAPI DllCanUnloadNow(void) */ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { - TRACE("(%p %ld %p)\n", hInstDLL, fdwReason, lpvReserved); + TRACE("(%p %x %p)\n", hInstDLL, fdwReason, lpvReserved); switch (fdwReason) { case DLL_PROCESS_ATTACH: diff --git a/regsvr.c b/regsvr.c index 6634ac8..6dc7871 100644 --- a/regsvr.c +++ b/regsvr.c @@ -542,10 +542,10 @@ static HRESULT register_driver(void) if (rc == ERROR_SUCCESS) { - rc = RegSetValueExA(key, clsid, 0, REG_SZ, wine_clsid, strlen(wine_clsid) + 1); + rc = RegSetValueExA(key, clsid, 0, REG_SZ, (CONST BYTE *)wine_clsid, strlen(wine_clsid) + 1); if (rc == ERROR_SUCCESS) - rc = RegSetValueExA(key, desc, 0, REG_SZ, wine_desc, strlen(wine_desc) + 1); + rc = RegSetValueExA(key, desc, 0, REG_SZ, (CONST BYTE *)wine_desc, strlen(wine_desc) + 1); RegCloseKey(key); }