mixer/Alsa: use MultiSocketMonitor
This commit is contained in:
@@ -27,6 +27,8 @@ extern "C" {
|
||||
|
||||
#include "pcm_volume.h"
|
||||
#include "GlobalEvents.hxx"
|
||||
#include "Main.hxx"
|
||||
#include "event/Loop.hxx"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
@@ -34,6 +36,8 @@ extern "C" {
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
EventLoop *main_loop;
|
||||
|
||||
#ifdef HAVE_PULSE
|
||||
#include "output/pulse_output_plugin.h"
|
||||
|
||||
@@ -122,6 +126,8 @@ int main(int argc, G_GNUC_UNUSED char **argv)
|
||||
|
||||
g_thread_init(NULL);
|
||||
|
||||
main_loop = new EventLoop(EventLoop::Default());
|
||||
|
||||
mixer = mixer_new(&alsa_mixer_plugin, NULL, NULL, &error);
|
||||
if (mixer == NULL) {
|
||||
g_printerr("mixer_new() failed: %s\n", error->message);
|
||||
@@ -141,6 +147,8 @@ int main(int argc, G_GNUC_UNUSED char **argv)
|
||||
mixer_close(mixer);
|
||||
mixer_free(mixer);
|
||||
|
||||
delete main_loop;
|
||||
|
||||
assert(volume >= -1 && volume <= 100);
|
||||
|
||||
if (volume < 0) {
|
||||
|
Reference in New Issue
Block a user