Browse Source

WineASIO 0.3.0

tags/v1.0.0
Joakim B Hernberg 14 years ago
parent
commit
a50bad34c7
5 changed files with 26 additions and 27 deletions
  1. +1
    -1
      Makefile
  2. +5
    -0
      README.TXT
  3. +15
    -21
      asio.c
  4. +3
    -3
      main.c
  5. +2
    -2
      regsvr.c

+ 1
- 1
Makefile View File

@@ -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


+ 5
- 0
README.TXT View File

@@ -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

+ 15
- 21
asio.c View File

@@ -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 */



+ 3
- 3
main.c View File

@@ -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:


+ 2
- 2
regsvr.c View File

@@ -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);
}


Loading…
Cancel
Save