mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 20:00:24 +00:00
wineoss: Add a temporary midi_out_fm_patch syscall.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Andrew Eikum <aeikum@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e37bf4e991
commit
bbe19f20a9
|
@ -723,40 +723,18 @@ typedef struct sFMextra {
|
|||
*/
|
||||
} sFMextra;
|
||||
|
||||
extern const unsigned char midiFMInstrumentPatches[16 * 128];
|
||||
extern const unsigned char midiFMDrumsPatches [16 * 128];
|
||||
|
||||
/**************************************************************************
|
||||
* modFMLoad [internal]
|
||||
*/
|
||||
static int modFMLoad(int dev, int fd)
|
||||
static int modFMLoad(WORD dev, int fd)
|
||||
{
|
||||
int i;
|
||||
struct sbi_instrument sbi;
|
||||
struct midi_out_fm_load_params params;
|
||||
|
||||
sbi.device = dev;
|
||||
sbi.key = FM_PATCH;
|
||||
params.dev_id = dev;
|
||||
params.fd = fd;
|
||||
OSS_CALL(midi_out_fm_load, ¶ms);
|
||||
|
||||
memset(sbi.operators + 16, 0, 16);
|
||||
for (i = 0; i < 128; i++) {
|
||||
sbi.channel = i;
|
||||
memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16);
|
||||
|
||||
if (write(fd, &sbi, sizeof(sbi)) == -1) {
|
||||
WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 128; i++) {
|
||||
sbi.channel = 128 + i;
|
||||
memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16);
|
||||
|
||||
if (write(fd, &sbi, sizeof(sbi)) == -1) {
|
||||
WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return params.ret;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
* Eric POUECH : MIDI FM patches for GM instruments
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#pragma makedep unix
|
||||
#endif
|
||||
|
||||
#define NOT_DEFINED 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
||||
const unsigned char midiFMInstrumentPatches[128 * 16] = {
|
||||
|
|
|
@ -1408,4 +1408,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
|
|||
midi_init,
|
||||
|
||||
midi_seq_open,
|
||||
midi_out_fm_load,
|
||||
};
|
||||
|
|
|
@ -345,3 +345,46 @@ wrapup:
|
|||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
extern const unsigned char midiFMInstrumentPatches[16 * 128];
|
||||
extern const unsigned char midiFMDrumsPatches[16 * 128];
|
||||
|
||||
NTSTATUS midi_out_fm_load(void *args)
|
||||
{
|
||||
struct midi_out_fm_load_params *params = args;
|
||||
WORD dev_id = params->dev_id;
|
||||
int fd = params->fd;
|
||||
struct sbi_instrument sbi;
|
||||
int i;
|
||||
|
||||
sbi.device = dev_id;
|
||||
sbi.key = FM_PATCH;
|
||||
|
||||
memset(sbi.operators + 16, 0, 16);
|
||||
for (i = 0; i < 128; i++)
|
||||
{
|
||||
sbi.channel = i;
|
||||
memcpy(sbi.operators, midiFMInstrumentPatches + i * 16, 16);
|
||||
|
||||
if (write(fd, &sbi, sizeof(sbi)) == -1)
|
||||
{
|
||||
WARN("Couldn't write patch for instrument %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno));
|
||||
params->ret = -1;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 128; i++)
|
||||
{
|
||||
sbi.channel = 128 + i;
|
||||
memcpy(sbi.operators, midiFMDrumsPatches + i * 16, 16);
|
||||
|
||||
if (write(fd, &sbi, sizeof(sbi)) == -1)
|
||||
{
|
||||
WARN("Couldn't write patch for drum %d, errno %d (%s)!\n", sbi.channel, errno, strerror(errno));
|
||||
params->ret = -1;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
params->ret = 0;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -252,6 +252,13 @@ struct midi_seq_open_params
|
|||
int fd;
|
||||
};
|
||||
|
||||
struct midi_out_fm_load_params
|
||||
{
|
||||
WORD dev_id;
|
||||
int fd;
|
||||
int ret;
|
||||
};
|
||||
|
||||
enum oss_funcs
|
||||
{
|
||||
oss_test_connect,
|
||||
|
@ -280,10 +287,12 @@ enum oss_funcs
|
|||
oss_midi_init,
|
||||
|
||||
oss_midi_seq_open, /* temporary */
|
||||
oss_midi_out_fm_load,
|
||||
};
|
||||
|
||||
NTSTATUS midi_init(void *args) DECLSPEC_HIDDEN;
|
||||
NTSTATUS midi_seq_open(void *args) DECLSPEC_HIDDEN;
|
||||
NTSTATUS midi_out_fm_load(void *args) DECLSPEC_HIDDEN;
|
||||
|
||||
extern unixlib_handle_t oss_handle;
|
||||
|
||||
|
|
Loading…
Reference in a new issue