Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Mayr
wine
Commits
209ce0be
Commit
209ce0be
authored
21 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Avoid linking error with older alsa libs.
parent
f6386788
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winmm/winealsa/midi.c
+144
-143
144 additions, 143 deletions
dlls/winmm/winealsa/midi.c
with
144 additions
and
143 deletions
dlls/winmm/winealsa/midi.c
+
144
−
143
View file @
209ce0be
...
...
@@ -155,149 +155,6 @@ static int MIDI_AlsaToWindowsDeviceType(int type)
return
MOD_FMSYNTH
;
}
/**************************************************************************
* 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]
*/
...
...
@@ -1101,6 +958,150 @@ static DWORD modReset(WORD wDevID)
* MIDI entry points *
*======================================================================*/
/**************************************************************************
* 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)
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment