aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-26 08:41:05 +0200
committerMax Kellermann <max@duempel.org>2008-08-26 08:41:05 +0200
commit4255bba0f7cbd4a1ac24859a65f8d974d1fb5a9b (patch)
treeb772aada976c129bd87759300e476b2d69ec2bf2 /src
parenta94845ee00d3107af7ffbe89bf1ec46380ae24ff (diff)
downloadmpd-4255bba0f7cbd4a1ac24859a65f8d974d1fb5a9b.tar.gz
mpd-4255bba0f7cbd4a1ac24859a65f8d974d1fb5a9b.tar.xz
mpd-4255bba0f7cbd4a1ac24859a65f8d974d1fb5a9b.zip
moved global variable "pc" to player.h
This is the last of the three variables. Now we don't need playerData.h anymore in most sources.
Diffstat (limited to '')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/decode.c2
-rw-r--r--src/decoder_api.c2
-rw-r--r--src/decoder_list.c1
-rw-r--r--src/main.c1
-rw-r--r--src/player.c1
-rw-r--r--src/player.h6
-rw-r--r--src/playerData.c2
-rw-r--r--src/playerData.h3
-rw-r--r--src/player_control.c21
-rw-r--r--src/player_thread.c1
11 files changed, 32 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index d31783e4f..28a949b4e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -130,6 +130,7 @@ mpd_SOURCES = \
pcm_utils.c \
permission.c \
player.c \
+ player_control.c \
player_thread.c \
playerData.c \
playlist.c \
diff --git a/src/decode.c b/src/decode.c
index 33f01701a..3362077ac 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -18,8 +18,8 @@
#include "decode.h"
#include "decoder_internal.h"
+#include "player.h"
-#include "playerData.h"
#include "path.h"
#include "log.h"
#include "ls.h"
diff --git a/src/decoder_api.c b/src/decoder_api.c
index f6119aa02..4ce9ee980 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -20,11 +20,11 @@
#include "decoder_internal.h"
#include "decoder_list.h"
#include "decode.h"
+#include "player.h"
#include "audio.h"
#include "utils.h"
#include "normalize.h"
-#include "playerData.h"
#include "outputBuffer.h"
#include "gcc.h"
diff --git a/src/decoder_list.c b/src/decoder_list.c
index dd2c79733..8bbe40924 100644
--- a/src/decoder_list.c
+++ b/src/decoder_list.c
@@ -18,6 +18,7 @@
#include "decoder_list.h"
#include "decoder_api.h"
+#include "list.h"
extern struct decoder_plugin mp3Plugin;
extern struct decoder_plugin oggvorbisPlugin;
diff --git a/src/main.c b/src/main.c
index 2d9f62390..5a98b7e27 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,6 +26,7 @@
#include "path.h"
#include "playerData.h"
#include "decode.h"
+#include "player.h"
#include "stats.h"
#include "sig_handlers.h"
#include "audio.h"
diff --git a/src/player.c b/src/player.c
index 4de92fb8e..8803cdfd9 100644
--- a/src/player.c
+++ b/src/player.c
@@ -20,7 +20,6 @@
#include "player_thread.h"
#include "path.h"
#include "command.h"
-#include "playerData.h"
#include "ack.h"
#include "os_compat.h"
#include "main_notify.h"
diff --git a/src/player.h b/src/player.h
index a4db82dc2..a030c02da 100644
--- a/src/player.h
+++ b/src/player.h
@@ -79,7 +79,7 @@ enum player_queue_state {
#define PLAYER_QUEUE_UNLOCKED 0
#define PLAYER_QUEUE_LOCKED 1
-typedef struct _PlayerControl {
+struct player_control {
Notify notify;
volatile enum player_command command;
volatile enum player_state state;
@@ -99,7 +99,9 @@ typedef struct _PlayerControl {
volatile float crossFade;
volatile mpd_uint16 softwareVolume;
volatile double totalPlayTime;
-} PlayerControl;
+};
+
+extern struct player_control pc;
void player_command_finished(void);
diff --git a/src/playerData.c b/src/playerData.c
index d72f2fe17..308fc4b59 100644
--- a/src/playerData.c
+++ b/src/playerData.c
@@ -18,6 +18,7 @@
#include "playerData.h"
#include "decode.h"
+#include "player.h"
#include "outputBuffer.h"
#include "conf.h"
#include "log.h"
@@ -27,7 +28,6 @@
#define DEFAULT_BUFFER_BEFORE_PLAY 10
unsigned int buffered_before_play;
-PlayerControl pc;
void initPlayerData(void)
{
diff --git a/src/playerData.h b/src/playerData.h
index a469ffaca..9d2918c8d 100644
--- a/src/playerData.h
+++ b/src/playerData.h
@@ -19,10 +19,7 @@
#ifndef PLAYER_DATA_H
#define PLAYER_DATA_H
-#include "player.h"
-
extern unsigned int buffered_before_play;
-extern PlayerControl pc;
void initPlayerData(void);
diff --git a/src/player_control.c b/src/player_control.c
new file mode 100644
index 000000000..1f6aecd97
--- /dev/null
+++ b/src/player_control.c
@@ -0,0 +1,21 @@
+/* the Music Player Daemon (MPD)
+ * Copyright (C) 2008 Max Kellermann <max@duempel.org>
+ * This project's homepage is: http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "player.h"
+
+struct player_control pc;
diff --git a/src/player_thread.c b/src/player_thread.c
index ab7074ad2..9cccc1ab2 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -17,6 +17,7 @@
*/
#include "player_thread.h"
+#include "player.h"
#include "playerData.h"
#include "decode.h"
#include "audio.h"