aboutsummaryrefslogtreecommitdiffstats
path: root/test/run_output.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--test/run_output.cxx (renamed from test/run_output.c)42
1 files changed, 25 insertions, 17 deletions
diff --git a/test/run_output.c b/test/run_output.cxx
index bbb1be7d2..505423479 100644
--- a/test/run_output.c
+++ b/test/run_output.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -18,18 +18,23 @@
*/
#include "config.h"
-#include "io_thread.h"
+#include "OutputControl.hxx"
+#include "conf.h"
+#include "Idle.hxx"
+#include "Main.hxx"
+#include "event/Loop.hxx"
+#include "GlobalEvents.hxx"
+#include "IOThread.hxx"
+
+extern "C" {
#include "output_plugin.h"
#include "output_internal.h"
-#include "output_control.h"
-#include "conf.h"
#include "audio_parser.h"
#include "filter_registry.h"
#include "pcm_convert.h"
-#include "event_pipe.h"
-#include "idle.h"
-#include "playlist.h"
-#include "player_control.h"
+}
+
+#include "PlayerControl.hxx"
#include "stdbin.h"
#include <glib.h>
@@ -39,15 +44,10 @@
#include <unistd.h>
#include <stdlib.h>
-struct playlist g_playlist;
+EventLoop *main_loop;
void
-idle_add(G_GNUC_UNUSED unsigned flags)
-{
-}
-
-void
-event_pipe_emit(G_GNUC_UNUSED enum pipe_event event)
+GlobalEvents::Emit(gcc_unused Event event)
{
}
@@ -94,6 +94,10 @@ find_named_config_block(const char *block, const char *name)
return NULL;
}
+player_control::player_control(gcc_unused unsigned _buffer_chunks,
+ gcc_unused unsigned _buffered_before_play) {}
+player_control::~player_control() {}
+
static struct audio_output *
load_audio_output(const char *name)
{
@@ -103,10 +107,10 @@ load_audio_output(const char *name)
param = find_named_config_block(CONF_AUDIO_OUTPUT, name);
if (param == NULL) {
g_printerr("No such configured audio output: %s\n", name);
- return false;
+ return nullptr;
}
- static struct player_control dummy_player_control;
+ static struct player_control dummy_player_control(32, 4);
struct audio_output *ao =
audio_output_new(param, &dummy_player_control, &error);
@@ -211,6 +215,8 @@ int main(int argc, char **argv)
return 1;
}
+ main_loop = new EventLoop(EventLoop::Default());
+
io_thread_init();
if (!io_thread_start(&error)) {
g_warning("%s", error->message);
@@ -247,6 +253,8 @@ int main(int argc, char **argv)
io_thread_deinit();
+ delete main_loop;
+
config_global_finish();
return success ? EXIT_SUCCESS : EXIT_FAILURE;