summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG8
-rwxr-xr-xdocs/README1
-rw-r--r--lib/init.php2
-rw-r--r--localplay.php8
-rw-r--r--modules/localplay/mpd.controller.php6
-rw-r--r--modules/mpd/mpd.class.php104
-rw-r--r--templates/show_localplay.inc.php1
7 files changed, 82 insertions, 48 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index c341e18d..1c166a64 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -3,6 +3,14 @@
--------------------------------------------------------------------------
--------------------------------------------------------------------------
+ v.3.3.3-Beta1
+ - Added new Flash Player with full support for Non-US Char and
+ colors. (Thx PB1DFT/Enrico Lai http://www.enricolai.com)
+ - Tweaked how MPD is handled, if MPD is stopped a new play action
+ will clear old playlist, otherwise Play appends.
+ (Thx henrik)
+
+--------------------------------------------------------------------------
v.3.3.3-Alpha2 11/12/2006
- Added Export to Itunes DB function (Thx PB1DFT)
- Added New XSPF Player that's solves all the UTF8 encoding problems (Thx Enrico Lai)
diff --git a/docs/README b/docs/README
index 601e5257..4b68dab6 100755
--- a/docs/README
+++ b/docs/README
@@ -104,6 +104,7 @@ Contents:
Maan Bsat (random fixes)
latka (from media.tangent.org site) for orphaned song ideas
Lamar Hansford (README/INSTALL improvements) & Upload
+ Enrico Lai http://www.enricolai.com for the XSPF Flash Player
And many many more...
2. Getting all the components
diff --git a/lib/init.php b/lib/init.php
index a74d9ac4..6418c826 100644
--- a/lib/init.php
+++ b/lib/init.php
@@ -67,7 +67,7 @@ if (!$results = read_config($configfile,0)) {
}
/** This is the version.... fluf nothing more... **/
-$results['version'] = '3.3.3-Alpha2';
+$results['version'] = '3.3.3-Beta1 (Build 001)';
$results['raw_web_path'] = $results['web_path'];
$results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path'];
diff --git a/localplay.php b/localplay.php
index 0f593946..d91ea86e 100644
--- a/localplay.php
+++ b/localplay.php
@@ -71,7 +71,13 @@ switch ($action) {
require_once (conf('prefix') . '/templates/show_localplay.inc.php');
break;
default:
- require_once (conf('prefix') . '/templates/show_localplay.inc.php');
+ if ($localplay = init_localplay()) {
+ require_once (conf('prefix') . '/templates/show_localplay.inc.php');
+ }
+ else {
+ $GLOBALS['error']->add_error('general',_('Localplay Init Failed'));
+ $GLOBALS['error']->print_error('general');
+ }
break;
} // end switch action
diff --git a/modules/localplay/mpd.controller.php b/modules/localplay/mpd.controller.php
index b81b6a95..1d850b48 100644
--- a/modules/localplay/mpd.controller.php
+++ b/modules/localplay/mpd.controller.php
@@ -109,8 +109,10 @@ class AmpacheMpd {
* and then add them to MPD
*/
function add_songs($songs) {
- /* Clear the playlist first */
- $this->clean_playlist();
+
+ if (is_null($this->_mpd->ClearPLIfStopped())) {
+ debug_event('mpd_add', 'Error: Unable to clear the MPD playlist ' . $this->_mpd->errStr,'1');
+ }
foreach ($songs as $song_id) {
$song = new Song($song_id);
diff --git a/modules/mpd/mpd.class.php b/modules/mpd/mpd.class.php
index 1191f39a..ca853936 100644
--- a/modules/mpd/mpd.class.php
+++ b/modules/mpd/mpd.class.php
@@ -1,25 +1,27 @@
-<?php
-/*
- * mpd.class.php - PHP Object Interface to the MPD Music Player Daemon
- * Version 1.2, Released 05/05/2004
- * Copyright (C) 2003-2004 Benjamin Carlisle (bcarlisle@24oz.com)
- * http://mpd.24oz.com/ | 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
- */
-
+<?php
+/*
+ * mpd.class.php - PHP Object Interface to the MPD Music Player Daemon
+ * Version 1.2, Released 05/05/2004
+ * Copyright (C) 2003-2004 Benjamin Carlisle (bcarlisle@24oz.com)
+ * http://mpd.24oz.com/ | http://www.musicpd.org/
+ * Addition of Connection Timeout - Karl Vollmer (www.ampache.org)
+ * Addition of ClearPLIfStopped Function - Henrik (henrikDOTprobellATgmailDOTcom)
+ *
+ * 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
+ */
+
// Create common command definitions for MPD to use
define("MPD_CMD_STATUS", "status");
define("MPD_CMD_STATISTICS", "stats");
@@ -972,24 +974,40 @@ class mpd {
$playlist = $this->_parseFileListResponse($resp);
if ( $this->debugging ) echo "mpd->GetPlaylist() / return ".print_r($playlist)."\n";
return $playlist;
- }
-
- /* ----------------- Command compatibility tables --------------------- */
- var $COMPATIBILITY_MIN_TBL = array(
- MPD_CMD_SEEK => "0.9.1" ,
- MPD_CMD_PLMOVE => "0.9.1" ,
- MPD_CMD_RANDOM => "0.9.1" ,
- MPD_CMD_PLSWAPTRACK => "0.9.1" ,
- MPD_CMD_PLMOVETRACK => "0.9.1" ,
- MPD_CMD_PASSWORD => "0.10.0" ,
- MPD_CMD_SETVOL => "0.10.0"
- );
-
- var $COMPATIBILITY_MAX_TBL = array(
- MPD_CMD_VOLUME => "0.10.0"
- );
-
-} // ---------------------------- end of class ------------------------------
-
-
-?>
+ }
+
+ /* ClearPLIfStopped()
+ *
+ * This function clears the mpd playlist ONLY IF the mpd state is MPD_STATE_STOPPED
+ */
+ function ClearPLIfStopped() {
+
+ if ( $this->debugging ) echo "mpd->ClearPLIfStopped()\n";
+ $this->RefreshInfo();
+ if ($resp = ($this->state == MPD_STATE_STOPPED)) {
+ $this->PLClear();
+ }
+ if ( $this->debugging ) echo "mpd->ClearPLIfStopped() / return\n";
+ return $resp;
+
+ } // ClearPLIfStopped
+
+ /* ----------------- Command compatibility tables --------------------- */
+ var $COMPATIBILITY_MIN_TBL = array(
+ MPD_CMD_SEEK => "0.9.1" ,
+ MPD_CMD_PLMOVE => "0.9.1" ,
+ MPD_CMD_RANDOM => "0.9.1" ,
+ MPD_CMD_PLSWAPTRACK => "0.9.1" ,
+ MPD_CMD_PLMOVETRACK => "0.9.1" ,
+ MPD_CMD_PASSWORD => "0.10.0" ,
+ MPD_CMD_SETVOL => "0.10.0"
+ );
+
+ var $COMPATIBILITY_MAX_TBL = array(
+ MPD_CMD_VOLUME => "0.10.0"
+ );
+
+} // ---------------------------- end of class ------------------------------
+
+
+?>
diff --git a/templates/show_localplay.inc.php b/templates/show_localplay.inc.php
index 0ad5938c..a6d6ce08 100644
--- a/templates/show_localplay.inc.php
+++ b/templates/show_localplay.inc.php
@@ -22,7 +22,6 @@
$web_path = conf('web_path');
$localplay = init_localplay();
-$songs = $localplay->get();
?>
<?php show_box_top(ucfirst($localplay->type) . ' ' . _('Localplay')); ?>
<table>