This is the last of the three variables.  Now we don't need
playerData.h anymore in most sources.
---

 src/Makefile.am      |    1 +
 src/decode.c         |    2 +-
 src/decoder_api.c    |    2 +-
 src/decoder_list.c   |    1 +
 src/main.c           |    1 +
 src/player.c         |    1 -
 src/player.h         |    6 ++++--
 src/playerData.c     |    2 +-
 src/playerData.h     |    3 ---
 src/player_control.c |   21 +++++++++++++++++++++
 src/player_thread.c  |    1 +
 11 files changed, 32 insertions(+), 9 deletions(-)
 create mode 100644 src/player_control.c

diff --git a/src/Makefile.am b/src/Makefile.am
index d31783e..28a949b 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 33f0170..3362077 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 f6119aa..4ce9ee9 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 dd2c797..8bbe409 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 2d9f623..5a98b7e 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 4de92fb..8803cdf 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 a4db82d..a030c02 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 d72f2fe..308fc4b 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 a469ffa..9d2918c 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 0000000..1f6aecd
--- /dev/null
+++ b/src/player_control.c
@@ -0,0 +1,21 @@
+/* the Music Player Daemon (MPD)
+ * Copyright (C) 2008 Max Kellermann <[EMAIL PROTECTED]>
+ * 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 ab7074a..9cccc1a 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"


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team

Reply via email to