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
26ebfc04
Commit
26ebfc04
authored
Jan 09, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EventPipe: rename to GlobalEvents
parent
8782f6d2
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
135 additions
and
142 deletions
+135
-142
Makefile.am
Makefile.am
+1
-1
GlobalEvents.cxx
src/GlobalEvents.cxx
+58
-66
GlobalEvents.hxx
src/GlobalEvents.hxx
+34
-33
Idle.cxx
src/Idle.cxx
+2
-2
Main.cxx
src/Main.cxx
+7
-7
Main.hxx
src/Main.hxx
+1
-1
PlayerThread.cxx
src/PlayerThread.cxx
+5
-5
PlaylistGlobal.cxx
src/PlaylistGlobal.cxx
+3
-3
SignalHandlers.cxx
src/SignalHandlers.cxx
+3
-3
UpdateGlue.cxx
src/UpdateGlue.cxx
+3
-3
UpdateRemove.cxx
src/UpdateRemove.cxx
+3
-3
Volume.cxx
src/Volume.cxx
+3
-3
Win32Main.cxx
src/Win32Main.cxx
+3
-3
AlsaMixerPlugin.cxx
src/mixer/AlsaMixerPlugin.cxx
+2
-2
PulseMixerPlugin.cxx
src/mixer/PulseMixerPlugin.cxx
+3
-3
read_mixer.cxx
test/read_mixer.cxx
+2
-2
run_output.cxx
test/run_output.cxx
+2
-2
No files found.
Makefile.am
View file @
26ebfc04
...
...
@@ -243,7 +243,7 @@ src_mpd_SOURCES = \
src/io_thread.c src/io_thread.h
\
src/Main.cxx src/Main.hxx
\
src/Win32Main.cxx
\
src/
EventPipe.cxx src/EventPipe
.hxx
\
src/
GlobalEvents.cxx src/GlobalEvents
.hxx
\
src/daemon.c
\
src/AudioCompress/compress.c
\
src/MusicBuffer.cxx src/MusicBuffer.hxx
\
...
...
src/
EventPipe
.cxx
→
src/
GlobalEvents
.cxx
View file @
26ebfc04
...
...
@@ -18,144 +18,136 @@
*/
#include "config.h"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include "thread/Mutex.hxx"
#include "fd_util.h"
#include "mpd_error.h"
#include <stdbool.h>
#include <assert.h>
#include <glib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <unistd.h>
#ifdef WIN32
/* for _O_BINARY */
#include <fcntl.h>
#endif
#undef G_LOG_DOMAIN
#define G_LOG_DOMAIN "event_pipe"
static
int
event_pipe
[
2
];
static
GIOChannel
*
event_channel
;
static
guint
event_pipe_source_id
;
static
Mutex
event_pipe_mutex
;
static
bool
pipe_events
[
PIPE_EVENT_MAX
];
static
event_pipe_callback_t
event_pipe_callbacks
[
PIPE_EVENT_MAX
];
#define G_LOG_DOMAIN "global_events"
namespace
GlobalEvents
{
static
int
fds
[
2
];
static
GIOChannel
*
channel
;
static
guint
source_id
;
static
Mutex
mutex
;
static
bool
flags
[
MAX
];
static
Handler
handlers
[
MAX
];
}
/**
* Invoke the callback for a certain event.
*/
static
void
event_pipe_invoke
(
enum
pipe_e
vent
event
)
InvokeGlobalEvent
(
GlobalEvents
::
E
vent
event
)
{
assert
((
unsigned
)
event
<
PIPE_EVENT_
MAX
);
assert
(
event_pipe_callback
s
[
event
]
!=
NULL
);
assert
((
unsigned
)
event
<
GlobalEvents
::
MAX
);
assert
(
GlobalEvents
::
handler
s
[
event
]
!=
NULL
);
event_pipe_callback
s
[
event
]();
GlobalEvents
::
handler
s
[
event
]();
}
static
gboolean
main_notify_event
(
G_GNUC_UNUSED
GIOChannel
*
source
,
G_GNUC_UNUSED
GIOCondition
condition
,
G_GNUC_UNUSED
gpointer
data
)
GlobalEventCallback
(
G_GNUC_UNUSED
GIOChannel
*
source
,
G_GNUC_UNUSED
GIOCondition
condition
,
G_GNUC_UNUSED
gpointer
data
)
{
char
buffer
[
256
];
gsize
bytes_read
;
GError
*
error
=
NULL
;
GIOStatus
status
=
g_io_channel_read_chars
(
event_
channel
,
GIOStatus
status
=
g_io_channel_read_chars
(
GlobalEvents
::
channel
,
buffer
,
sizeof
(
buffer
),
&
bytes_read
,
&
error
);
if
(
status
==
G_IO_STATUS_ERROR
)
MPD_ERROR
(
"error reading from pipe: %s"
,
error
->
message
);
bool
events
[
PIPE_EVENT_MAX
];
event_pipe_mutex
.
lock
();
memcpy
(
events
,
pipe_events
,
sizeof
(
events
));
memset
(
pipe_events
,
0
,
sizeof
(
pipe_events
));
event_pipe_mutex
.
unlock
();
bool
events
[
GlobalEvents
::
MAX
];
GlobalEvents
::
mutex
.
lock
();
memcpy
(
events
,
GlobalEvents
::
flags
,
sizeof
(
events
));
memset
(
GlobalEvents
::
flags
,
0
,
sizeof
(
GlobalEvents
::
flags
));
GlobalEvents
::
mutex
.
unlock
();
for
(
unsigned
i
=
0
;
i
<
PIPE_EVENT_
MAX
;
++
i
)
for
(
unsigned
i
=
0
;
i
<
GlobalEvents
::
MAX
;
++
i
)
if
(
events
[
i
])
/* invoke the event handler */
event_pipe_invoke
(
pipe_e
vent
(
i
));
InvokeGlobalEvent
(
GlobalEvents
::
E
vent
(
i
));
return
true
;
}
void
event_pipe_init
(
void
)
void
GlobalEvents
::
Initialize
()
{
GIOChannel
*
channel
;
int
ret
;
ret
=
pipe_cloexec_nonblock
(
event_pipe
);
if
(
ret
<
0
)
if
(
pipe_cloexec_nonblock
(
fds
)
<
0
)
MPD_ERROR
(
"Couldn't open pipe: %s"
,
strerror
(
errno
));
#ifndef G_OS_WIN32
channel
=
g_io_channel_unix_new
(
event_pipe
[
0
]);
channel
=
g_io_channel_unix_new
(
fds
[
0
]);
#else
channel
=
g_io_channel_win32_new_fd
(
event_pipe
[
0
]);
channel
=
g_io_channel_win32_new_fd
(
fds
[
0
]);
#endif
g_io_channel_set_encoding
(
channel
,
NULL
,
NULL
);
g_io_channel_set_buffered
(
channel
,
false
);
event_pipe_source_id
=
g_io_add_watch
(
channel
,
G_IO_IN
,
main_notify_event
,
NULL
);
event_channel
=
channel
;
source_id
=
g_io_add_watch
(
channel
,
G_IO_IN
,
GlobalEventCallback
,
NULL
);
}
void
event_pipe_deinit
(
void
)
void
GlobalEvents
::
Deinitialize
()
{
g_source_remove
(
event_pipe_
source_id
);
g_io_channel_unref
(
event_
channel
);
g_source_remove
(
source_id
);
g_io_channel_unref
(
channel
);
#ifndef WIN32
/* By some strange reason this call hangs on Win32 */
close
(
event_pipe
[
0
]);
close
(
fds
[
0
]);
#endif
close
(
event_pipe
[
1
]);
close
(
fds
[
1
]);
}
void
event_pipe_register
(
enum
pipe_event
event
,
event_pipe_callback_t
callback
)
GlobalEvents
::
Register
(
Event
event
,
Handler
callback
)
{
assert
((
unsigned
)
event
<
PIPE_EVENT_
MAX
);
assert
(
event_pipe_callback
s
[
event
]
==
NULL
);
assert
((
unsigned
)
event
<
MAX
);
assert
(
handler
s
[
event
]
==
NULL
);
event_pipe_callback
s
[
event
]
=
callback
;
handler
s
[
event
]
=
callback
;
}
void
event_pipe_emit
(
enum
pipe_event
event
)
void
GlobalEvents
::
Emit
(
Event
event
)
{
ssize_t
w
;
assert
((
unsigned
)
event
<
MAX
)
;
assert
((
unsigned
)
event
<
PIPE_EVENT_MAX
);
event_pipe_mutex
.
lock
();
if
(
pipe_events
[
event
])
{
mutex
.
lock
();
if
(
flags
[
event
])
{
/* already set: don't write */
event_pipe_
mutex
.
unlock
();
mutex
.
unlock
();
return
;
}
pipe_event
s
[
event
]
=
true
;
event_pipe_
mutex
.
unlock
();
flag
s
[
event
]
=
true
;
mutex
.
unlock
();
w
=
write
(
event_pipe
[
1
],
""
,
1
);
ssize_t
w
=
write
(
fds
[
1
],
""
,
1
);
if
(
w
<
0
&&
errno
!=
EAGAIN
&&
errno
!=
EINTR
)
MPD_ERROR
(
"error writing to pipe: %s"
,
strerror
(
errno
));
}
void
event_pipe_emit_fast
(
enum
pipe_event
event
)
void
GlobalEvents
::
FastEmit
(
Event
event
)
{
assert
((
unsigned
)
event
<
PIPE_EVENT_
MAX
);
assert
((
unsigned
)
event
<
MAX
);
pipe_event
s
[
event
]
=
true
;
flag
s
[
event
]
=
true
;
G_GNUC_UNUSED
ssize_t
nbytes
=
write
(
event_pipe
[
1
],
""
,
1
);
G_GNUC_UNUSED
ssize_t
nbytes
=
write
(
fds
[
1
],
""
,
1
);
}
src/
EventPipe
.hxx
→
src/
GlobalEvents
.hxx
View file @
26ebfc04
...
...
@@ -17,53 +17,54 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_
EVENT_PIPE
_HXX
#define MPD_
EVENT_PIPE
_HXX
#ifndef MPD_
GLOBAL_EVENTS
_HXX
#define MPD_
GLOBAL_EVENTS
_HXX
enum
pipe_event
{
/** database update was finished */
PIPE_EVENT_UPDATE
,
namespace
GlobalEvents
{
enum
Event
{
/** database update was finished */
UPDATE
,
/** during database update, a song was deleted */
PIPE_EVENT_
DELETE
,
/** during database update, a song was deleted */
DELETE
,
/** an idle event was emitted */
PIPE_EVENT_
IDLE
,
/** an idle event was emitted */
IDLE
,
/** must call playlist_sync() */
PIPE_EVENT_
PLAYLIST
,
/** must call playlist_sync() */
PLAYLIST
,
/** the current song's tag has changed */
PIPE_EVENT_
TAG
,
/** the current song's tag has changed */
TAG
,
/** SIGHUP received: reload configuration, roll log file */
PIPE_EVENT_
RELOAD
,
/** SIGHUP received: reload configuration, roll log file */
RELOAD
,
/** a hardware mixer plugin has detected a change */
PIPE_EVENT_
MIXER
,
/** a hardware mixer plugin has detected a change */
MIXER
,
/** shutdown requested */
PIPE_EVENT_
SHUTDOWN
,
/** shutdown requested */
SHUTDOWN
,
PIPE_EVENT_
MAX
};
MAX
};
typedef
void
(
*
event_pipe_callback_t
)(
void
);
typedef
void
(
*
Handler
)(
);
void
event_pipe_init
(
void
);
void
Initialize
(
);
void
event_pipe_deinit
(
void
);
void
Deinitialize
(
);
void
event_pipe_register
(
enum
pipe_event
event
,
event_pipe_callback_t
callback
);
void
Register
(
Event
event
,
Handler
handler
);
void
event_pipe_emit
(
enum
pipe_e
vent
event
);
void
Emit
(
E
vent
event
);
/**
* Similar to event_pipe_emit(), but aimed for use in signal handlers:
* it doesn't lock the mutex, and doesn't log on error. That makes it
* potentially lossy, but for its intended use, that does not matter.
*/
void
event_pipe_emit_fast
(
enum
pipe_event
event
);
/**
* Similar to event_pipe_emit(), but aimed for use in signal handlers:
* it doesn't lock the mutex, and doesn't log on error. That makes it
* potentially lossy, but for its intended use, that does not matter.
*/
void
FastEmit
(
Event
event
);
}
#endif
/* MAIN_NOTIFY_H */
src/Idle.cxx
View file @
26ebfc04
...
...
@@ -24,7 +24,7 @@
#include "config.h"
#include "Idle.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <assert.h>
#include <glib.h>
...
...
@@ -71,7 +71,7 @@ idle_add(unsigned flags)
idle_flags
|=
flags
;
g_mutex_unlock
(
idle_mutex
);
event_pipe_emit
(
PIPE_EVENT_
IDLE
);
GlobalEvents
::
Emit
(
GlobalEvents
::
IDLE
);
}
unsigned
...
...
src/Main.cxx
View file @
26ebfc04
...
...
@@ -43,7 +43,7 @@
#include "Idle.hxx"
#include "SignalHandlers.hxx"
#include "Log.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
extern
"C"
{
#include "daemon.h"
...
...
@@ -316,7 +316,7 @@ initialize_decoder_and_player(void)
}
/**
*
event_pipe callback function for PIPE_EVENT_IDLE
*
Handler for GlobalEvents::IDLE.
*/
static
void
idle_event_emitted
(
void
)
...
...
@@ -329,7 +329,7 @@ idle_event_emitted(void)
}
/**
*
event_pipe callback function for PIPE_EVENT_SHUTDOWN
*
Handler for GlobalEvents::SHUTDOWN.
*/
static
void
shutdown_event_emitted
(
void
)
...
...
@@ -406,9 +406,9 @@ int mpd_main(int argc, char *argv[])
main_loop
=
g_main_loop_new
(
NULL
,
FALSE
);
main_cond
=
g_cond_new
();
event_pipe_init
();
event_pipe_register
(
PIPE_EVENT_
IDLE
,
idle_event_emitted
);
event_pipe_register
(
PIPE_EVENT_
SHUTDOWN
,
shutdown_event_emitted
);
GlobalEvents
::
Initialize
();
GlobalEvents
::
Register
(
GlobalEvents
::
IDLE
,
idle_event_emitted
);
GlobalEvents
::
Register
(
GlobalEvents
::
SHUTDOWN
,
shutdown_event_emitted
);
path_global_init
();
...
...
@@ -537,7 +537,7 @@ int mpd_main(int argc, char *argv[])
#endif
g_cond_free
(
main_cond
);
event_pipe_deinit
();
GlobalEvents
::
Deinitialize
();
playlist_list_global_finish
();
input_stream_global_finish
();
...
...
src/Main.hxx
View file @
26ebfc04
...
...
@@ -52,7 +52,7 @@ win32_main(int argc, char *argv[]);
* When running as a service reports to service control manager
* that our service is started.
* When running as a console application enables console handler that will
* trigger
PIPE_EVENT_
SHUTDOWN when user closes console window
* trigger
GlobalEvents::
SHUTDOWN when user closes console window
* or presses Ctrl+C.
* This function should be called just before entering main loop.
*/
...
...
src/PlayerThread.cxx
View file @
26ebfc04
...
...
@@ -32,7 +32,7 @@
#include "OutputAll.hxx"
#include "tag.h"
#include "Idle.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <cmath>
...
...
@@ -285,7 +285,7 @@ player_wait_for_decoder(struct player *player)
player_unlock
(
pc
);
/* call syncPlaylistWithQueue() in the main thread */
event_pipe_emit
(
PIPE_EVENT_
PLAYLIST
);
GlobalEvents
::
Emit
(
GlobalEvents
::
PLAYLIST
);
return
true
;
}
...
...
@@ -665,7 +665,7 @@ update_song_tag(struct song *song, const struct tag *new_tag)
/* the main thread will update the playlist version when he
receives this event */
event_pipe_emit
(
PIPE_EVENT_
TAG
);
GlobalEvents
::
Emit
(
GlobalEvents
::
TAG
);
/* notify all clients that the tag of the current song has
changed */
...
...
@@ -909,7 +909,7 @@ static void do_play(struct player_control *pc, struct decoder_control *dc)
player_dc_stop
(
&
player
);
player_command_finished
(
pc
);
music_pipe_free
(
player
.
pipe
);
event_pipe_emit
(
PIPE_EVENT_
PLAYLIST
);
GlobalEvents
::
Emit
(
GlobalEvents
::
PLAYLIST
);
player_lock
(
pc
);
return
;
}
...
...
@@ -1086,7 +1086,7 @@ static void do_play(struct player_control *pc, struct decoder_control *dc)
player_unlock
(
pc
);
event_pipe_emit
(
PIPE_EVENT_
PLAYLIST
);
GlobalEvents
::
Emit
(
GlobalEvents
::
PLAYLIST
);
player_lock
(
pc
);
}
...
...
src/PlaylistGlobal.cxx
View file @
26ebfc04
...
...
@@ -27,7 +27,7 @@
#include "Playlist.hxx"
#include "Main.hxx"
#include "Partition.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
static
void
playlist_tag_event
(
void
)
...
...
@@ -44,6 +44,6 @@ playlist_event(void)
void
playlist_global_init
()
{
event_pipe_register
(
PIPE_EVENT_
TAG
,
playlist_tag_event
);
event_pipe_register
(
PIPE_EVENT_
PLAYLIST
,
playlist_event
);
GlobalEvents
::
Register
(
GlobalEvents
::
TAG
,
playlist_tag_event
);
GlobalEvents
::
Register
(
GlobalEvents
::
PLAYLIST
,
playlist_event
);
}
src/SignalHandlers.cxx
View file @
26ebfc04
...
...
@@ -24,7 +24,7 @@
#include "Log.hxx"
#include "Main.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include "mpd_error.h"
#include <glib.h>
...
...
@@ -40,7 +40,7 @@ static void exit_signal_handler(G_GNUC_UNUSED int signum)
static
void
reload_signal_handler
(
G_GNUC_UNUSED
int
signum
)
{
event_pipe_emit_fast
(
PIPE_EVENT_
RELOAD
);
GlobalEvents
::
FastEmit
(
GlobalEvents
::
RELOAD
);
}
static
void
...
...
@@ -73,7 +73,7 @@ void initSigHandlers(void)
x_sigaction
(
SIGINT
,
&
sa
);
x_sigaction
(
SIGTERM
,
&
sa
);
event_pipe_register
(
PIPE_EVENT_
RELOAD
,
handle_reload_event
);
GlobalEvents
::
Register
(
GlobalEvents
::
RELOAD
,
handle_reload_event
);
sa
.
sa_handler
=
reload_signal_handler
;
x_sigaction
(
SIGHUP
,
&
sa
);
#endif
...
...
src/UpdateGlue.cxx
View file @
26ebfc04
...
...
@@ -25,7 +25,7 @@
#include "Mapper.hxx"
#include "DatabaseSimple.hxx"
#include "Idle.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
extern
"C"
{
#include "stats.h"
...
...
@@ -92,7 +92,7 @@ static void * update_task(void *_path)
g_free
(
_path
);
progress
=
UPDATE_PROGRESS_DONE
;
event_pipe_emit
(
PIPE_EVENT_
UPDATE
);
GlobalEvents
::
Emit
(
GlobalEvents
::
UPDATE
);
return
NULL
;
}
...
...
@@ -173,7 +173,7 @@ static void update_finished_event(void)
void
update_global_init
(
void
)
{
event_pipe_register
(
PIPE_EVENT_
UPDATE
,
update_finished_event
);
GlobalEvents
::
Register
(
GlobalEvents
::
UPDATE
,
update_finished_event
);
update_remove_global_init
();
update_walk_global_init
();
...
...
src/UpdateRemove.cxx
View file @
26ebfc04
...
...
@@ -21,7 +21,7 @@
#include "UpdateRemove.hxx"
#include "Playlist.hxx"
#include "Partition.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include "song.h"
#include "Main.hxx"
...
...
@@ -76,7 +76,7 @@ update_remove_global_init(void)
remove_mutex
=
g_mutex_new
();
remove_cond
=
g_cond_new
();
event_pipe_register
(
PIPE_EVENT_
DELETE
,
song_remove_event
);
GlobalEvents
::
Register
(
GlobalEvents
::
DELETE
,
song_remove_event
);
}
void
...
...
@@ -93,7 +93,7 @@ update_remove_song(const struct song *song)
removed_song
=
song
;
event_pipe_emit
(
PIPE_EVENT_
DELETE
);
GlobalEvents
::
Emit
(
GlobalEvents
::
DELETE
);
g_mutex_lock
(
remove_mutex
);
...
...
src/Volume.cxx
View file @
26ebfc04
...
...
@@ -21,7 +21,7 @@
#include "Volume.hxx"
#include "MixerAll.hxx"
#include "Idle.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <glib.h>
...
...
@@ -41,7 +41,7 @@ static int last_hardware_volume = -1;
static
GTimer
*
hardware_volume_timer
;
/**
* Handler for #
PIPE_EVENT_
MIXER.
* Handler for #
GlobalEvents::
MIXER.
*/
static
void
mixer_event_callback
(
void
)
...
...
@@ -62,7 +62,7 @@ void volume_init(void)
{
hardware_volume_timer
=
g_timer_new
();
event_pipe_register
(
PIPE_EVENT_
MIXER
,
mixer_event_callback
);
GlobalEvents
::
Register
(
GlobalEvents
::
MIXER
,
mixer_event_callback
);
}
int
volume_level_get
(
void
)
...
...
src/Win32Main.cxx
View file @
26ebfc04
...
...
@@ -23,7 +23,7 @@
#ifdef WIN32
#include "mpd_error.h"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <glib.h>
...
...
@@ -68,7 +68,7 @@ service_dispatcher(G_GNUC_UNUSED DWORD control, G_GNUC_UNUSED DWORD event_type,
switch
(
control
)
{
case
SERVICE_CONTROL_SHUTDOWN
:
case
SERVICE_CONTROL_STOP
:
event_pipe_emit
(
PIPE_EVENT_
SHUTDOWN
);
GlobalEvents
::
Emit
(
GlobalEvents
::
SHUTDOWN
);
return
NO_ERROR
;
default:
return
NO_ERROR
;
...
...
@@ -104,7 +104,7 @@ console_handler(DWORD event)
case
CTRL_C_EVENT
:
case
CTRL_CLOSE_EVENT
:
if
(
!
ignore_console_events
)
event_pipe_emit
(
PIPE_EVENT_
SHUTDOWN
);
GlobalEvents
::
Emit
(
GlobalEvents
::
SHUTDOWN
);
return
TRUE
;
default:
return
FALSE
;
...
...
src/mixer/AlsaMixerPlugin.cxx
View file @
26ebfc04
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#include "mixer_api.h"
#include "output_api.h"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <glib.h>
#include <alsa/asoundlib.h>
...
...
@@ -211,7 +211,7 @@ static int
alsa_mixer_elem_callback
(
G_GNUC_UNUSED
snd_mixer_elem_t
*
elem
,
unsigned
mask
)
{
if
(
mask
&
SND_CTL_EVENT_MASK_VALUE
)
event_pipe_emit
(
PIPE_EVENT_
MIXER
);
GlobalEvents
::
Emit
(
GlobalEvents
::
MIXER
);
return
0
;
}
...
...
src/mixer/PulseMixerPlugin.cxx
View file @
26ebfc04
...
...
@@ -22,7 +22,7 @@
#include "mixer_api.h"
#include "output/pulse_output_plugin.h"
#include "conf.h"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <glib.h>
...
...
@@ -66,7 +66,7 @@ pulse_mixer_offline(struct pulse_mixer *pm)
pm
->
online
=
false
;
event_pipe_emit
(
PIPE_EVENT_
MIXER
);
GlobalEvents
::
Emit
(
GlobalEvents
::
MIXER
);
}
/**
...
...
@@ -90,7 +90,7 @@ pulse_mixer_volume_cb(G_GNUC_UNUSED pa_context *context, const pa_sink_input_inf
pm
->
online
=
true
;
pm
->
volume
=
i
->
volume
;
event_pipe_emit
(
PIPE_EVENT_
MIXER
);
GlobalEvents
::
Emit
(
GlobalEvents
::
MIXER
);
}
static
void
...
...
test/read_mixer.cxx
View file @
26ebfc04
...
...
@@ -26,7 +26,7 @@ extern "C" {
}
#include "pcm_volume.h"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
#include <glib.h>
...
...
@@ -88,7 +88,7 @@ roar_output_set_volume(G_GNUC_UNUSED struct roar *roar,
#endif
void
event_pipe_emit
(
G_GNUC_UNUSED
enum
pipe_e
vent
event
)
GlobalEvents
::
Emit
(
gcc_unused
E
vent
event
)
{
}
...
...
test/run_output.cxx
View file @
26ebfc04
...
...
@@ -21,7 +21,7 @@
#include "OutputControl.hxx"
#include "conf.h"
#include "Idle.hxx"
#include "
EventPipe
.hxx"
#include "
GlobalEvents
.hxx"
extern
"C"
{
#include "output_plugin.h"
...
...
@@ -43,7 +43,7 @@ extern "C" {
#include <stdlib.h>
void
event_pipe_emit
(
G_GNUC_UNUSED
enum
pipe_e
vent
event
)
GlobalEvents
::
Emit
(
gcc_unused
E
vent
event
)
{
}
...
...
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