Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
209ce0be
Commit
209ce0be
authored
Sep 17, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid linking error with older alsa libs.
parent
f6386788
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
144 additions
and
143 deletions
+144
-143
midi.c
dlls/winmm/winealsa/midi.c
+144
-143
No files found.
dlls/winmm/winealsa/midi.c
View file @
209ce0be
...
...
@@ -156,149 +156,6 @@ static int MIDI_AlsaToWindowsDeviceType(int type)
}
/**************************************************************************
* OSS_MidiInit [internal]
*
* Initializes the MIDI devices information variables
*/
LONG
ALSA_MidiInit
(
void
)
{
static
BOOL
bInitDone
=
FALSE
;
snd_seq_client_info_t
*
cinfo
;
snd_seq_port_info_t
*
pinfo
;
int
count
;
if
(
bInitDone
)
return
TRUE
;
TRACE
(
"Initializing the MIDI variables.
\n
"
);
bInitDone
=
TRUE
;
/* try to open device */
if
(
midiOpenSeq
(
0
)
==
-
1
)
{
return
TRUE
;
}
#if 0 /* Debug purpose */
snd_lib_error_set_handler(error_handler);
#endif
snd_seq_client_info_alloca
(
&
cinfo
);
snd_seq_port_info_alloca
(
&
pinfo
);
snd_seq_client_info_set_client
(
cinfo
,
-
1
);
while
(
snd_seq_query_next_client
(
midiSeq
,
cinfo
)
>=
0
)
{
snd_seq_port_info_set_client
(
pinfo
,
snd_seq_client_info_get_client
(
cinfo
));
snd_seq_port_info_set_port
(
pinfo
,
-
1
);
count
=
0
;
while
(
snd_seq_query_next_port
(
midiSeq
,
pinfo
)
>=
0
)
{
int
cap
=
snd_seq_port_info_get_capability
(
pinfo
);
int
type
=
snd_seq_port_info_get_type
(
pinfo
);
if
(
cap
&
SND_SEQ_PORT_CAP_WRITE
)
{
TRACE
(
"OUT (%d:%s:%s:%d:%s:%x)
\n
"
,
snd_seq_client_info_get_client
(
cinfo
),
snd_seq_client_info_get_name
(
cinfo
),
snd_seq_client_info_get_type
(
cinfo
)
==
SND_SEQ_USER_CLIENT
?
"user"
:
"kernel"
,
snd_seq_port_info_get_port
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
if
(
MODM_NumDevs
>=
MAX_MIDIOUTDRV
)
continue
;
if
(
!
type
)
continue
;
memcpy
(
&
MidiOutDev
[
MODM_NumDevs
].
addr
,
snd_seq_port_info_get_addr
(
pinfo
),
sizeof
(
snd_seq_addr_t
));
/* Manufac ID. We do not have access to this with soundcard.h
* Does not seem to be a problem, because in mmsystem.h only
* Microsoft's ID is listed.
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
wMid
=
0x00FF
;
MidiOutDev
[
MODM_NumDevs
].
caps
.
wPid
=
0x0001
;
/* FIXME Product ID */
/* Product Version. We simply say "1" */
MidiOutDev
[
MODM_NumDevs
].
caps
.
vDriverVersion
=
0x001
;
MidiOutDev
[
MODM_NumDevs
].
caps
.
wChannelMask
=
0xFFFF
;
/* FIXME Do we have this information?
* Assuming the soundcards can handle
* MIDICAPS_VOLUME and MIDICAPS_LRVOLUME but
* not MIDICAPS_CACHE.
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
dwSupport
=
MIDICAPS_VOLUME
|
MIDICAPS_LRVOLUME
;
strcpy
(
MidiOutDev
[
MODM_NumDevs
].
caps
.
szPname
,
snd_seq_client_info_get_name
(
cinfo
));
MidiOutDev
[
MODM_NumDevs
].
caps
.
wTechnology
=
MIDI_AlsaToWindowsDeviceType
(
type
);
MidiOutDev
[
MODM_NumDevs
].
caps
.
wVoices
=
16
;
/* FIXME Is it possible to know the maximum
* number of simultaneous notes of a soundcard ?
* I believe we don't have this information, but
* it's probably equal or more than wVoices
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
wNotes
=
16
;
MidiOutDev
[
MODM_NumDevs
].
bEnabled
=
TRUE
;
TRACE
(
"MidiOut[%d]
\t
name='%s' techn=%d voices=%d notes=%d chnMsk=%04x support=%ld
\n
"
"
\t
ALSA info: midi dev-type=%lx, capa=%lx
\n
"
,
MODM_NumDevs
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
szPname
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wTechnology
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wVoices
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wNotes
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wChannelMask
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
dwSupport
,
(
long
)
type
,
(
long
)
0
);
MODM_NumDevs
++
;
}
if
(
cap
&
SND_SEQ_PORT_CAP_READ
)
{
TRACE
(
"IN (%d:%s:%s:%d:%s:%x)
\n
"
,
snd_seq_client_info_get_client
(
cinfo
),
snd_seq_client_info_get_name
(
cinfo
),
snd_seq_client_info_get_type
(
cinfo
)
==
SND_SEQ_USER_CLIENT
?
"user"
:
"kernel"
,
snd_seq_port_info_get_port
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
if
(
MIDM_NumDevs
>=
MAX_MIDIINDRV
)
continue
;
if
(
!
type
)
continue
;
memcpy
(
&
MidiInDev
[
MIDM_NumDevs
].
addr
,
snd_seq_port_info_get_addr
(
pinfo
),
sizeof
(
snd_seq_addr_t
));
/* Manufac ID. We do not have access to this with soundcard.h
* Does not seem to be a problem, because in mmsystem.h only
* Microsoft's ID is listed.
*/
MidiInDev
[
MIDM_NumDevs
].
caps
.
wMid
=
0x00FF
;
MidiInDev
[
MIDM_NumDevs
].
caps
.
wPid
=
0x0001
;
/* FIXME Product ID */
/* Product Version. We simply say "1" */
MidiInDev
[
MIDM_NumDevs
].
caps
.
vDriverVersion
=
0x001
;
/* FIXME Do we have this information?
* Assuming the soundcards can handle
* MIDICAPS_VOLUME and MIDICAPS_LRVOLUME but
* not MIDICAPS_CACHE.
*/
MidiInDev
[
MIDM_NumDevs
].
caps
.
dwSupport
=
MIDICAPS_VOLUME
|
MIDICAPS_LRVOLUME
;
strcpy
(
MidiInDev
[
MIDM_NumDevs
].
caps
.
szPname
,
snd_seq_client_info_get_name
(
cinfo
));
MidiInDev
[
MIDM_NumDevs
].
state
=
0
;
TRACE
(
"MidiIn [%d]
\t
name='%s' support=%ld
\n
"
"
\t
ALSA info: midi dev-type=%lx, capa=%lx
\n
"
,
MIDM_NumDevs
,
MidiInDev
[
MIDM_NumDevs
].
caps
.
szPname
,
MidiInDev
[
MIDM_NumDevs
].
caps
.
dwSupport
,
(
long
)
type
,
(
long
)
0
);
MIDM_NumDevs
++
;
}
}
}
/* close file and exit */
midiCloseSeq
();
TRACE
(
"End
\n
"
);
return
TRUE
;
}
/**************************************************************************
* MIDI_NotifyClient [internal]
*/
static
DWORD
MIDI_NotifyClient
(
UINT
wDevID
,
WORD
wMsg
,
...
...
@@ -1102,6 +959,150 @@ static DWORD modReset(WORD wDevID)
*======================================================================*/
/**************************************************************************
* ALSA_MidiInit [internal]
*
* Initializes the MIDI devices information variables
*/
LONG
ALSA_MidiInit
(
void
)
{
#if defined(HAVE_ALSA) && ((SND_LIB_MAJOR == 0 && SND_LIB_MINOR >= 9) || SND_LIB_MAJOR >= 1)
static
BOOL
bInitDone
=
FALSE
;
snd_seq_client_info_t
*
cinfo
;
snd_seq_port_info_t
*
pinfo
;
int
count
;
if
(
bInitDone
)
return
TRUE
;
TRACE
(
"Initializing the MIDI variables.
\n
"
);
bInitDone
=
TRUE
;
/* try to open device */
if
(
midiOpenSeq
(
0
)
==
-
1
)
{
return
TRUE
;
}
#if 0 /* Debug purpose */
snd_lib_error_set_handler(error_handler);
#endif
snd_seq_client_info_alloca
(
&
cinfo
);
snd_seq_port_info_alloca
(
&
pinfo
);
snd_seq_client_info_set_client
(
cinfo
,
-
1
);
while
(
snd_seq_query_next_client
(
midiSeq
,
cinfo
)
>=
0
)
{
snd_seq_port_info_set_client
(
pinfo
,
snd_seq_client_info_get_client
(
cinfo
));
snd_seq_port_info_set_port
(
pinfo
,
-
1
);
count
=
0
;
while
(
snd_seq_query_next_port
(
midiSeq
,
pinfo
)
>=
0
)
{
int
cap
=
snd_seq_port_info_get_capability
(
pinfo
);
int
type
=
snd_seq_port_info_get_type
(
pinfo
);
if
(
cap
&
SND_SEQ_PORT_CAP_WRITE
)
{
TRACE
(
"OUT (%d:%s:%s:%d:%s:%x)
\n
"
,
snd_seq_client_info_get_client
(
cinfo
),
snd_seq_client_info_get_name
(
cinfo
),
snd_seq_client_info_get_type
(
cinfo
)
==
SND_SEQ_USER_CLIENT
?
"user"
:
"kernel"
,
snd_seq_port_info_get_port
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
if
(
MODM_NumDevs
>=
MAX_MIDIOUTDRV
)
continue
;
if
(
!
type
)
continue
;
memcpy
(
&
MidiOutDev
[
MODM_NumDevs
].
addr
,
snd_seq_port_info_get_addr
(
pinfo
),
sizeof
(
snd_seq_addr_t
));
/* Manufac ID. We do not have access to this with soundcard.h
* Does not seem to be a problem, because in mmsystem.h only
* Microsoft's ID is listed.
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
wMid
=
0x00FF
;
MidiOutDev
[
MODM_NumDevs
].
caps
.
wPid
=
0x0001
;
/* FIXME Product ID */
/* Product Version. We simply say "1" */
MidiOutDev
[
MODM_NumDevs
].
caps
.
vDriverVersion
=
0x001
;
MidiOutDev
[
MODM_NumDevs
].
caps
.
wChannelMask
=
0xFFFF
;
/* FIXME Do we have this information?
* Assuming the soundcards can handle
* MIDICAPS_VOLUME and MIDICAPS_LRVOLUME but
* not MIDICAPS_CACHE.
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
dwSupport
=
MIDICAPS_VOLUME
|
MIDICAPS_LRVOLUME
;
strcpy
(
MidiOutDev
[
MODM_NumDevs
].
caps
.
szPname
,
snd_seq_client_info_get_name
(
cinfo
));
MidiOutDev
[
MODM_NumDevs
].
caps
.
wTechnology
=
MIDI_AlsaToWindowsDeviceType
(
type
);
MidiOutDev
[
MODM_NumDevs
].
caps
.
wVoices
=
16
;
/* FIXME Is it possible to know the maximum
* number of simultaneous notes of a soundcard ?
* I believe we don't have this information, but
* it's probably equal or more than wVoices
*/
MidiOutDev
[
MODM_NumDevs
].
caps
.
wNotes
=
16
;
MidiOutDev
[
MODM_NumDevs
].
bEnabled
=
TRUE
;
TRACE
(
"MidiOut[%d]
\t
name='%s' techn=%d voices=%d notes=%d chnMsk=%04x support=%ld
\n
"
"
\t
ALSA info: midi dev-type=%lx, capa=%lx
\n
"
,
MODM_NumDevs
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
szPname
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wTechnology
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wVoices
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wNotes
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
wChannelMask
,
MidiOutDev
[
MODM_NumDevs
].
caps
.
dwSupport
,
(
long
)
type
,
(
long
)
0
);
MODM_NumDevs
++
;
}
if
(
cap
&
SND_SEQ_PORT_CAP_READ
)
{
TRACE
(
"IN (%d:%s:%s:%d:%s:%x)
\n
"
,
snd_seq_client_info_get_client
(
cinfo
),
snd_seq_client_info_get_name
(
cinfo
),
snd_seq_client_info_get_type
(
cinfo
)
==
SND_SEQ_USER_CLIENT
?
"user"
:
"kernel"
,
snd_seq_port_info_get_port
(
pinfo
),
snd_seq_port_info_get_name
(
pinfo
),
type
);
if
(
MIDM_NumDevs
>=
MAX_MIDIINDRV
)
continue
;
if
(
!
type
)
continue
;
memcpy
(
&
MidiInDev
[
MIDM_NumDevs
].
addr
,
snd_seq_port_info_get_addr
(
pinfo
),
sizeof
(
snd_seq_addr_t
));
/* Manufac ID. We do not have access to this with soundcard.h
* Does not seem to be a problem, because in mmsystem.h only
* Microsoft's ID is listed.
*/
MidiInDev
[
MIDM_NumDevs
].
caps
.
wMid
=
0x00FF
;
MidiInDev
[
MIDM_NumDevs
].
caps
.
wPid
=
0x0001
;
/* FIXME Product ID */
/* Product Version. We simply say "1" */
MidiInDev
[
MIDM_NumDevs
].
caps
.
vDriverVersion
=
0x001
;
/* FIXME Do we have this information?
* Assuming the soundcards can handle
* MIDICAPS_VOLUME and MIDICAPS_LRVOLUME but
* not MIDICAPS_CACHE.
*/
MidiInDev
[
MIDM_NumDevs
].
caps
.
dwSupport
=
MIDICAPS_VOLUME
|
MIDICAPS_LRVOLUME
;
strcpy
(
MidiInDev
[
MIDM_NumDevs
].
caps
.
szPname
,
snd_seq_client_info_get_name
(
cinfo
));
MidiInDev
[
MIDM_NumDevs
].
state
=
0
;
TRACE
(
"MidiIn [%d]
\t
name='%s' support=%ld
\n
"
"
\t
ALSA info: midi dev-type=%lx, capa=%lx
\n
"
,
MIDM_NumDevs
,
MidiInDev
[
MIDM_NumDevs
].
caps
.
szPname
,
MidiInDev
[
MIDM_NumDevs
].
caps
.
dwSupport
,
(
long
)
type
,
(
long
)
0
);
MIDM_NumDevs
++
;
}
}
}
/* close file and exit */
midiCloseSeq
();
TRACE
(
"End
\n
"
);
#endif
return
TRUE
;
}
/**************************************************************************
* midMessage (WINEOSS.4)
*/
DWORD
WINAPI
ALSA_midMessage
(
UINT
wDevID
,
UINT
wMsg
,
DWORD
dwUser
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment