Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
eb47e072
Commit
eb47e072
authored
Mar 15, 2005
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/audio_output/waveout.c: use hardware volume control.
parent
dfb46c59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
5 deletions
+38
-5
modules/audio_output/waveout.c
modules/audio_output/waveout.c
+38
-5
No files found.
modules/audio_output/waveout.c
View file @
eb47e072
...
@@ -34,11 +34,7 @@
...
@@ -34,11 +34,7 @@
#include <windows.h>
#include <windows.h>
#include <mmsystem.h>
#include <mmsystem.h>
#ifdef UNDER_CE
#define FRAME_SIZE 4096
/* The size is in samples, not in bytes */
# define FRAME_SIZE 4096
/* The size is in samples, not in bytes */
#else
# define FRAME_SIZE 1024
/* The size is in samples, not in bytes */
#endif
#define FRAMES_NUM 8
#define FRAMES_NUM 8
/*****************************************************************************
/*****************************************************************************
...
@@ -127,6 +123,10 @@ static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
...
@@ -127,6 +123,10 @@ static int PlayWaveOut ( aout_instance_t *, HWAVEOUT, WAVEHDR *,
static
void
CALLBACK
WaveOutCallback
(
HWAVEOUT
,
UINT
,
DWORD
,
DWORD
,
DWORD
);
static
void
CALLBACK
WaveOutCallback
(
HWAVEOUT
,
UINT
,
DWORD
,
DWORD
,
DWORD
);
static
void
WaveOutThread
(
notification_thread_t
*
);
static
void
WaveOutThread
(
notification_thread_t
*
);
static
int
VolumeInfos
(
aout_instance_t
*
,
audio_volume_t
*
);
static
int
VolumeGet
(
aout_instance_t
*
,
audio_volume_t
*
);
static
int
VolumeSet
(
aout_instance_t
*
,
audio_volume_t
);
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
*****************************************************************************/
*****************************************************************************/
...
@@ -291,6 +291,10 @@ static int Open( vlc_object_t *p_this )
...
@@ -291,6 +291,10 @@ static int Open( vlc_object_t *p_this )
p_aout
->
output
.
output
.
i_bytes_per_frame
;
p_aout
->
output
.
output
.
i_bytes_per_frame
;
aout_VolumeSoftInit
(
p_aout
);
aout_VolumeSoftInit
(
p_aout
);
p_aout
->
output
.
pf_volume_infos
=
VolumeInfos
;
p_aout
->
output
.
pf_volume_get
=
VolumeGet
;
p_aout
->
output
.
pf_volume_set
=
VolumeSet
;
}
}
...
@@ -778,3 +782,32 @@ static void WaveOutThread( notification_thread_t *p_notif )
...
@@ -778,3 +782,32 @@ static void WaveOutThread( notification_thread_t *p_notif )
}
}
}
}
}
}
static
int
VolumeInfos
(
aout_instance_t
*
p_aout
,
audio_volume_t
*
pi_soft
)
{
*
pi_soft
=
AOUT_VOLUME_MAX
/
2
;
return
0
;
}
static
int
VolumeGet
(
aout_instance_t
*
p_aout
,
audio_volume_t
*
pi_volume
)
{
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
DWORD
i_waveout_vol
;
waveOutGetVolume
(
p_sys
->
h_waveout
,
&
i_waveout_vol
);
i_waveout_vol
&=
0xFFFF
;
*
pi_volume
=
p_aout
->
output
.
i_volume
=
i_waveout_vol
*
AOUT_VOLUME_MAX
/
2
/
0xFFFF
;
return
0
;
}
static
int
VolumeSet
(
aout_instance_t
*
p_aout
,
audio_volume_t
i_volume
)
{
aout_sys_t
*
p_sys
=
p_aout
->
output
.
p_sys
;
unsigned
long
i_waveout_vol
=
i_volume
*
0xFFFF
*
2
/
AOUT_VOLUME_MAX
;
i_waveout_vol
|=
(
i_waveout_vol
<<
16
);
waveOutSetVolume
(
p_sys
->
h_waveout
,
i_waveout_vol
);
p_aout
->
output
.
i_volume
=
i_volume
;
return
0
;
}
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