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
3ddfd217
Commit
3ddfd217
authored
Jan 15, 2003
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VolumeUp/Down/Mute now work even if no file is playing.
parent
305bc15e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
modules/gui/macosx/controls.m
modules/gui/macosx/controls.m
+4
-3
src/audio_output/intf.c
src/audio_output/intf.c
+26
-8
No files found.
modules/gui/macosx/controls.m
View file @
3ddfd217
...
...
@@ -2,7 +2,7 @@
* controls.m: MacOS X interface plugin
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: controls.m,v 1.
6 2003/01/05 16:23:57
massiot Exp $
* $Id: controls.m,v 1.
7 2003/01/15 11:27:29
massiot Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr>
...
...
@@ -240,15 +240,16 @@
intf_thread_t
*
p_intf
=
[
NSApp
getIntf
];
aout_instance_t
*
p_aout
=
vlc_object_find
(
p_intf
,
VLC_OBJECT_AOUT
,
FIND_ANYWHERE
);
audio_volume_t
i_volume
;
if
(
p_aout
!=
NULL
)
{
aout_VolumeMute
(
p_aout
,
NULL
);
aout_VolumeMute
(
p_aout
,
&
i_volume
);
vlc_object_release
(
(
vlc_object_t
*
)
p_aout
);
}
NSMenuItem
*
o_mi
=
(
NSMenuItem
*
)
sender
;
p_intf
->
p_sys
->
b_mute
=
!
p_intf
->
p_sys
->
b_mute
;
p_intf
->
p_sys
->
b_mute
=
(
i_volume
==
0
)
;
[
o_mi
setState
:
p_intf
->
p_sys
->
b_mute
?
NSOnState
:
NSOffState
];
}
...
...
src/audio_output/intf.c
View file @
3ddfd217
...
...
@@ -2,7 +2,7 @@
* intf.c : audio output API towards the interface modules
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: intf.c,v 1.1
1 2002/12/10 18:22:01 gbazin
Exp $
* $Id: intf.c,v 1.1
2 2003/01/15 11:27:29 massiot
Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
...
...
@@ -141,10 +141,18 @@ int aout_VolumeUp( aout_instance_t * p_aout, int i_nb_steps,
if
(
p_aout
->
mixer
.
b_error
)
{
int
i
;
/* The output module is destroyed. */
vlc_mutex_unlock
(
&
p_aout
->
mixer_lock
);
msg_Err
(
p_aout
,
"VolumeUp called without output module"
);
return
-
1
;
i
=
config_GetInt
(
p_aout
,
"volume"
);
i
+=
AOUT_VOLUME_STEP
*
i_nb_steps
;
if
(
i
>
AOUT_VOLUME_MAX
)
{
i
=
AOUT_VOLUME_MAX
;
}
config_PutInt
(
p_aout
,
"volume"
,
i
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
(
audio_volume_t
)
i
;
return
0
;
}
if
(
p_aout
->
output
.
pf_volume_get
(
p_aout
,
&
i_volume
)
)
...
...
@@ -154,7 +162,7 @@ int aout_VolumeUp( aout_instance_t * p_aout, int i_nb_steps,
}
i_volume
+=
AOUT_VOLUME_STEP
*
i_nb_steps
;
if
(
i_volume
>
1024
)
i_volume
=
1024
;
if
(
i_volume
>
AOUT_VOLUME_MAX
)
i_volume
=
AOUT_VOLUME_MAX
;
i_result
=
p_aout
->
output
.
pf_volume_set
(
p_aout
,
i_volume
);
...
...
@@ -180,10 +188,18 @@ int aout_VolumeDown( aout_instance_t * p_aout, int i_nb_steps,
if
(
p_aout
->
mixer
.
b_error
)
{
int
i
;
/* The output module is destroyed. */
vlc_mutex_unlock
(
&
p_aout
->
mixer_lock
);
msg_Err
(
p_aout
,
"VolumeUp called without output module"
);
return
-
1
;
i
=
config_GetInt
(
p_aout
,
"volume"
);
i
-=
AOUT_VOLUME_STEP
*
i_nb_steps
;
if
(
i
<
0
)
{
i
=
AOUT_VOLUME_MAX
;
}
config_PutInt
(
p_aout
,
"volume"
,
i
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
(
audio_volume_t
)
i
;
return
0
;
}
if
(
p_aout
->
output
.
pf_volume_get
(
p_aout
,
&
i_volume
)
)
...
...
@@ -220,10 +236,12 @@ int aout_VolumeMute( aout_instance_t * p_aout, audio_volume_t * pi_volume )
if
(
p_aout
->
mixer
.
b_error
)
{
int
i
;
/* The output module is destroyed. */
vlc_mutex_unlock
(
&
p_aout
->
mixer_lock
);
msg_Err
(
p_aout
,
"VolumeUp called without output module"
);
return
-
1
;
config_PutInt
(
p_aout
,
"volume"
,
0
);
if
(
pi_volume
!=
NULL
)
*
pi_volume
=
0
;
return
0
;
}
if
(
p_aout
->
output
.
pf_volume_get
(
p_aout
,
&
i_volume
)
)
...
...
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