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
c1e3bbff
Commit
c1e3bbff
authored
Sep 27, 1999
by
Eric Pouech
Committed by
Alexandre Julliard
Sep 27, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for OSS driver presence and return error accordingly.
parent
322f45cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
20 deletions
+57
-20
mixer.c
multimedia/mixer.c
+29
-3
mmaux.c
multimedia/mmaux.c
+28
-17
No files found.
multimedia/mixer.c
View file @
c1e3bbff
...
...
@@ -328,9 +328,20 @@ static DWORD MIX_GetLineInfo(WORD wDevID, LPMIXERLINEA lpMl, DWORD fdwInfo)
*/
static
DWORD
MIX_Open
(
WORD
wDevID
,
LPMIXEROPENDESC
lpMod
,
DWORD
flags
)
{
int
mixer
;
TRACE
(
"(%04X, %p, %lu);
\n
"
,
wDevID
,
lpMod
,
flags
);
if
(
lpMod
==
NULL
)
return
MMSYSERR_INVALPARAM
;
/* hmm. We don't keep the mixer device open. So just pretend it works */
/* hmm. We don't keep the mixer device open. only check if it's present */
if
((
mixer
=
open
(
MIXER_DEV
,
O_RDWR
))
<
0
)
{
if
(
errno
==
ENODEV
||
errno
==
ENXIO
)
{
/* no driver present */
return
MMSYSERR_NODRIVER
;
}
}
else
{
close
(
mixer
);
}
return
MMSYSERR_NOERROR
;
}
...
...
@@ -502,6 +513,22 @@ static DWORD MIX_SetControlDetails(WORD wDevID, LPMIXERCONTROLDETAILS lpmcd, DWO
return
MMSYSERR_NOTSUPPORTED
;
}
static
DWORD
MIX_GetNumDevs
(
UINT
wDevID
)
{
int
mixer
;
int
ret
;
if
((
mixer
=
open
(
MIXER_DEV
,
O_RDWR
))
<
0
)
{
/* FIXME: ENXIO => no mixer installed */
WARN
(
"mixer device not available !
\n
"
);
ret
=
0
;
}
else
{
close
(
mixer
);
ret
=
1
;
}
TRACE
(
"return %d;
\n
"
,
ret
);
return
ret
;
}
#endif
/* HAVE_OSS */
/**************************************************************************
...
...
@@ -526,8 +553,7 @@ DWORD WINAPI OSS_mixMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
case
MXDM_GETLINEINFO
:
return
MIX_GetLineInfo
(
wDevID
,
(
LPMIXERLINEA
)
dwParam1
,
dwParam2
);
case
MXDM_GETNUMDEVS
:
TRACE
(
"return 1;
\n
"
);
return
1
;
return
MIX_GetNumDevs
(
wDevID
);
case
MXDM_OPEN
:
return
MIX_Open
(
wDevID
,
(
LPMIXEROPENDESC
)
dwParam1
,
dwParam2
);
case
MXDM_CLOSE
:
...
...
multimedia/mmaux.c
View file @
c1e3bbff
...
...
@@ -20,19 +20,33 @@
DEFAULT_DEBUG_CHANNEL
(
mmaux
)
#ifdef HAVE_OSS
#define MIXER_DEV "/dev/mixer"
static
int
NumDev
=
6
;
/*-----------------------------------------------------------------------*/
static
int
AUXDRV_Init
(
void
)
{
int
mixer
;
if
((
mixer
=
open
(
MIXER_DEV
,
O_RDWR
))
<
0
)
{
WARN
(
"mixer device not available !
\n
"
);
NumDev
=
0
;
}
else
{
close
(
mixer
);
NumDev
=
6
;
}
return
NumDev
;
}
/**************************************************************************
* AUX_GetDevCaps [internal]
*/
static
DWORD
AUX_GetDevCaps
(
WORD
wDevID
,
LPAUXCAPSA
lpCaps
,
DWORD
dwSize
)
{
#ifdef HAVE_OSS
int
mixer
,
volume
;
TRACE
(
"(%04X, %p, %lu);
\n
"
,
wDevID
,
lpCaps
,
dwSize
);
...
...
@@ -43,7 +57,7 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSA lpCaps, DWORD dwSize)
}
if
(
ioctl
(
mixer
,
SOUND_MIXER_READ_LINE
,
&
volume
)
==
-
1
)
{
close
(
mixer
);
WARN
(
"unable read mixer !
\n
"
);
WARN
(
"unable
to
read mixer !
\n
"
);
return
MMSYSERR_NOTENABLED
;
}
close
(
mixer
);
...
...
@@ -92,9 +106,6 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSA lpCaps, DWORD dwSize)
lpCaps
->
dwSupport
=
AUXCAPS_VOLUME
|
AUXCAPS_LRVOLUME
;
#endif
return
MMSYSERR_NOERROR
;
#else
return
MMSYSERR_NOTENABLED
;
#endif
}
...
...
@@ -103,7 +114,6 @@ static DWORD AUX_GetDevCaps(WORD wDevID, LPAUXCAPSA lpCaps, DWORD dwSize)
*/
static
DWORD
AUX_GetVolume
(
WORD
wDevID
,
LPDWORD
lpdwVol
)
{
#ifdef HAVE_OSS
int
mixer
,
volume
,
left
,
right
,
cmd
;
TRACE
(
"(%04X, %p);
\n
"
,
wDevID
,
lpdwVol
);
...
...
@@ -142,7 +152,7 @@ static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
return
MMSYSERR_NOTENABLED
;
}
if
(
ioctl
(
mixer
,
cmd
,
&
volume
)
==
-
1
)
{
WARN
(
"unable read mixer !
\n
"
);
WARN
(
"unable
to
read mixer !
\n
"
);
return
MMSYSERR_NOTENABLED
;
}
close
(
mixer
);
...
...
@@ -151,9 +161,6 @@ static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
TRACE
(
"left=%d right=%d !
\n
"
,
left
,
right
);
*
lpdwVol
=
MAKELONG
((
left
*
0xFFFFL
)
/
100
,
(
right
*
0xFFFFL
)
/
100
);
return
MMSYSERR_NOERROR
;
#else
return
MMSYSERR_NOTENABLED
;
#endif
}
/**************************************************************************
...
...
@@ -161,8 +168,7 @@ static DWORD AUX_GetVolume(WORD wDevID, LPDWORD lpdwVol)
*/
static
DWORD
AUX_SetVolume
(
WORD
wDevID
,
DWORD
dwParam
)
{
#ifdef HAVE_OSS
int
mixer
;
int
mixer
;
int
volume
,
left
,
right
;
int
cmd
;
...
...
@@ -207,16 +213,14 @@ static DWORD AUX_SetVolume(WORD wDevID, DWORD dwParam)
return
MMSYSERR_NOTENABLED
;
}
if
(
ioctl
(
mixer
,
cmd
,
&
volume
)
==
-
1
)
{
WARN
(
"unable set mixer !
\n
"
);
WARN
(
"unable
to
set mixer !
\n
"
);
return
MMSYSERR_NOTENABLED
;
}
close
(
mixer
);
return
MMSYSERR_NOERROR
;
#else
return
MMSYSERR_NOTENABLED
;
#endif
}
#endif
/**************************************************************************
* OSS_auxMessage [sample driver]
...
...
@@ -226,8 +230,12 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
{
TRACE
(
"(%04X, %04X, %08lX, %08lX, %08lX);
\n
"
,
wDevID
,
wMsg
,
dwUser
,
dwParam1
,
dwParam2
);
switch
(
wMsg
)
{
#ifdef HAVE_OSS
switch
(
wMsg
)
{
case
DRVM_INIT
:
AUXDRV_Init
();
/* fall thru */
case
DRVM_EXIT
:
case
DRVM_ENABLE
:
case
DRVM_DISABLE
:
...
...
@@ -246,4 +254,7 @@ DWORD WINAPI OSS_auxMessage(UINT wDevID, UINT wMsg, DWORD dwUser,
WARN
(
"unknown message !
\n
"
);
}
return
MMSYSERR_NOTSUPPORTED
;
#else
return
MMSYSERR_NOTENABLED
;
#endif
}
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