Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
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
Иван Мажукин
mpd
Commits
b8ccc885
Commit
b8ccc885
authored
Oct 21, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
volume: added PIPE_EVENT_MIXER
Flush the hardware volume cache, and send the MIXER idle event. This allows mixer plugins to detect volume changes.
parent
4e2fb3fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
0 deletions
+19
-0
event_pipe.h
src/event_pipe.h
+3
-0
volume.c
src/volume.c
+16
-0
No files found.
src/event_pipe.h
View file @
b8ccc885
...
...
@@ -41,6 +41,9 @@ enum pipe_event {
/** SIGHUP received: reload configuration, roll log file */
PIPE_EVENT_RELOAD
,
/** a hardware mixer plugin has detected a change */
PIPE_EVENT_MIXER
,
PIPE_EVENT_MAX
};
...
...
src/volume.c
View file @
b8ccc885
...
...
@@ -27,6 +27,7 @@
#include "mixer_control.h"
#include "mixer_all.h"
#include "mixer_type.h"
#include "event_pipe.h"
#include <glib.h>
...
...
@@ -47,6 +48,19 @@ static int last_hardware_volume = -1;
/** the age of #last_hardware_volume */
static
GTimer
*
hardware_volume_timer
;
/**
* Handler for #PIPE_EVENT_MIXER.
*/
static
void
mixer_event_callback
(
void
)
{
/* flush the hardware volume cache */
last_hardware_volume
=
-
1
;
/* notify clients */
idle_add
(
IDLE_MIXER
);
}
void
volume_finish
(
void
)
{
g_timer_destroy
(
hardware_volume_timer
);
...
...
@@ -55,6 +69,8 @@ void volume_finish(void)
void
volume_init
(
void
)
{
hardware_volume_timer
=
g_timer_new
();
event_pipe_register
(
PIPE_EVENT_MIXER
,
mixer_event_callback
);
}
int
volume_level_get
(
void
)
...
...
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