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
e2092afc
Commit
e2092afc
authored
Aug 02, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DirectSound: save/restore volume if configured
parent
138e83c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
modules/audio_output/directx.c
modules/audio_output/directx.c
+14
-2
No files found.
modules/audio_output/directx.c
View file @
e2092afc
...
@@ -132,6 +132,9 @@ static const char *const ppsz_adev_text[] = {"default", };
...
@@ -132,6 +132,9 @@ static const char *const ppsz_adev_text[] = {"default", };
#define SPEAKER_LONGTEXT N_("Select speaker configuration you want to use. " \
#define SPEAKER_LONGTEXT N_("Select speaker configuration you want to use. " \
"This option doesn't upmix! So NO e.g. Stereo -> 5.1 conversion." )
"This option doesn't upmix! So NO e.g. Stereo -> 5.1 conversion." )
#define VOLUME_TEXT N_("Audio volume")
#define VOLUME_LONGTEXT N_("Audio volume in hundredths of decibels (dB).")
vlc_module_begin
()
vlc_module_begin
()
set_description
(
N_
(
"DirectX audio output"
)
)
set_description
(
N_
(
"DirectX audio output"
)
)
set_shortname
(
"DirectX"
)
set_shortname
(
"DirectX"
)
...
@@ -150,6 +153,9 @@ vlc_module_begin ()
...
@@ -150,6 +153,9 @@ vlc_module_begin ()
add_string
(
"directx-audio-speaker"
,
"Windows default"
,
add_string
(
"directx-audio-speaker"
,
"Windows default"
,
SPEAKER_TEXT
,
SPEAKER_LONGTEXT
,
true
)
SPEAKER_TEXT
,
SPEAKER_LONGTEXT
,
true
)
change_string_list
(
speaker_list
,
0
,
0
)
change_string_list
(
speaker_list
,
0
,
0
)
add_integer
(
"directx-volume"
,
DSBVOLUME_MAX
,
VOLUME_TEXT
,
VOLUME_LONGTEXT
,
true
)
change_integer_range
(
DSBVOLUME_MIN
,
DSBVOLUME_MAX
)
set_callbacks
(
OpenAudio
,
CloseAudio
)
set_callbacks
(
OpenAudio
,
CloseAudio
)
vlc_module_end
()
vlc_module_end
()
...
@@ -326,10 +332,13 @@ static int OpenAudio( vlc_object_t *p_this )
...
@@ -326,10 +332,13 @@ static int OpenAudio( vlc_object_t *p_this )
}
}
else
else
{
{
p_aout
->
sys
->
volume
.
mb
=
0
;
LONG
mb
=
var_InheritInteger
(
p_aout
,
"directx-volume"
)
;
p_aout
->
sys
->
volume
.
mute
=
false
;
p_aout
->
volume_set
=
VolumeSet
;
p_aout
->
volume_set
=
VolumeSet
;
p_aout
->
mute_set
=
MuteSet
;
p_aout
->
mute_set
=
MuteSet
;
p_aout
->
sys
->
volume
.
mb
=
mb
;
aout_VolumeReport
(
p_aout
,
cbrtf
(
powf
(
10
.
f
,
((
float
)
mb
)
/
2000
.
f
))
);
MuteSet
(
p_aout
,
var_InheritBool
(
p_aout
,
"mute"
)
);
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
...
@@ -620,6 +629,9 @@ static int VolumeSet( audio_output_t *p_aout, float vol )
...
@@ -620,6 +629,9 @@ static int VolumeSet( audio_output_t *p_aout, float vol )
/* Convert back to UI volume */
/* Convert back to UI volume */
vol
=
cbrtf
(
powf
(
10
.
f
,
((
float
)
mb
)
/
2000
.
f
));
vol
=
cbrtf
(
powf
(
10
.
f
,
((
float
)
mb
)
/
2000
.
f
));
aout_VolumeReport
(
p_aout
,
vol
);
aout_VolumeReport
(
p_aout
,
vol
);
if
(
var_InheritBool
(
p_aout
,
"volume-save"
)
)
config_PutInt
(
p_aout
,
"directx-volume"
,
mb
);
return
ret
;
return
ret
;
}
}
...
...
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