Commit a17324af authored by Florian Schlichting's avatar Florian Schlichting

Imported Upstream version 0.18.8

parent ec4a1cd4
...@@ -1061,6 +1061,7 @@ C_TESTS = \ ...@@ -1061,6 +1061,7 @@ C_TESTS = \
test/test_util \ test/test_util \
test/test_byte_reverse \ test/test_byte_reverse \
test/test_mixramp \ test/test_mixramp \
test/test_icy_parser \
test/test_pcm \ test/test_pcm \
test/test_queue_priority test/test_queue_priority
...@@ -1496,6 +1497,16 @@ test_test_mixramp_LDADD = \ ...@@ -1496,6 +1497,16 @@ test_test_mixramp_LDADD = \
$(GLIB_LIBS) \ $(GLIB_LIBS) \
$(CPPUNIT_LIBS) $(CPPUNIT_LIBS)
test_test_icy_parser_SOURCES = \
src/Log.cxx \
test/test_icy_parser.cxx
test_test_icy_parser_CPPFLAGS = $(AM_CPPFLAGS) $(CPPUNIT_CFLAGS) -DCPPUNIT_HAVE_RTTI=0
test_test_icy_parser_CXXFLAGS = $(AM_CXXFLAGS) -Wno-error=deprecated-declarations
test_test_icy_parser_LDADD = \
libtag.a \
$(GLIB_LIBS) \
$(CPPUNIT_LIBS)
test_test_pcm_SOURCES = \ test_test_pcm_SOURCES = \
test/test_pcm_util.hxx \ test/test_pcm_util.hxx \
test/test_pcm_dither.cxx \ test/test_pcm_dither.cxx \
......
This diff is collapsed.
ver 0.18.7 (2013/01/13) ver 0.18.8 (2014/02/07)
* decoder
- ffmpeg: support libav v10_alpha1
* encoder
- vorbis: fix linker failure
* output
- roar: documentation
* more robust Icy-Metadata parser
* fix Solaris build failure
ver 0.18.7 (2014/01/13)
* playlist * playlist
- pls: fix crash after parser error - pls: fix crash after parser error
- soundcloud: fix build failure with libyajl 2.0.1 - soundcloud: fix build failure with libyajl 2.0.1
......
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for mpd 0.18.7. # Generated by GNU Autoconf 2.69 for mpd 0.18.8.
# #
# Report bugs to <musicpd-dev-team@lists.sourceforge.net>. # Report bugs to <mpd-devel@musicpd.org>.
# #
# #
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
...@@ -267,10 +267,10 @@ fi ...@@ -267,10 +267,10 @@ fi
$as_echo "$0: be upgraded to zsh 4.3.4 or later." $as_echo "$0: be upgraded to zsh 4.3.4 or later."
else else
$as_echo "$0: Please tell bug-autoconf@gnu.org and $as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: musicpd-dev-team@lists.sourceforge.net about your $0: mpd-devel@musicpd.org about your system, including any
$0: system, including any error possibly output before this $0: error possibly output before this message. Then install
$0: message. Then install a modern shell, or manually run $0: a modern shell, or manually run the script under such a
$0: the script under such a shell if you do have one." $0: shell if you do have one."
fi fi
exit 1 exit 1
fi fi
...@@ -580,9 +580,9 @@ MAKEFLAGS= ...@@ -580,9 +580,9 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='mpd' PACKAGE_NAME='mpd'
PACKAGE_TARNAME='mpd' PACKAGE_TARNAME='mpd'
PACKAGE_VERSION='0.18.7' PACKAGE_VERSION='0.18.8'
PACKAGE_STRING='mpd 0.18.7' PACKAGE_STRING='mpd 0.18.8'
PACKAGE_BUGREPORT='musicpd-dev-team@lists.sourceforge.net' PACKAGE_BUGREPORT='mpd-devel@musicpd.org'
PACKAGE_URL='' PACKAGE_URL=''
ac_unique_file="src/Main.cxx" ac_unique_file="src/Main.cxx"
...@@ -1673,7 +1673,7 @@ if test "$ac_init_help" = "long"; then ...@@ -1673,7 +1673,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures mpd 0.18.7 to adapt to many kinds of systems. \`configure' configures mpd 0.18.8 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
...@@ -1743,7 +1743,7 @@ fi ...@@ -1743,7 +1743,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of mpd 0.18.7:";; short | recursive ) echo "Configuration of mpd 0.18.8:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
...@@ -1978,7 +1978,7 @@ Some influential environment variables: ...@@ -1978,7 +1978,7 @@ Some influential environment variables:
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
Report bugs to <musicpd-dev-team@lists.sourceforge.net>. Report bugs to <mpd-devel@musicpd.org>.
_ACEOF _ACEOF
ac_status=$? ac_status=$?
fi fi
...@@ -2041,7 +2041,7 @@ fi ...@@ -2041,7 +2041,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
mpd configure 0.18.7 mpd configure 0.18.8
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
...@@ -2351,9 +2351,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} ...@@ -2351,9 +2351,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ----------------------------------------------------- ## ( $as_echo "## ------------------------------------ ##
## Report this to musicpd-dev-team@lists.sourceforge.net ## ## Report this to mpd-devel@musicpd.org ##
## ----------------------------------------------------- ##" ## ------------------------------------ ##"
) | sed "s/^/$as_me: WARNING: /" >&2 ) | sed "s/^/$as_me: WARNING: /" >&2
;; ;;
esac esac
...@@ -2494,7 +2494,7 @@ cat >config.log <<_ACEOF ...@@ -2494,7 +2494,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by mpd $as_me 0.18.7, which was It was created by mpd $as_me 0.18.8, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
...@@ -3364,7 +3364,7 @@ fi ...@@ -3364,7 +3364,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='mpd' PACKAGE='mpd'
VERSION='0.18.7' VERSION='0.18.8'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
...@@ -12864,12 +12864,12 @@ if test -n "$PKG_CONFIG"; then ...@@ -12864,12 +12864,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBISENC_CFLAGS="$VORBISENC_CFLAGS" pkg_cv_VORBISENC_CFLAGS="$VORBISENC_CFLAGS"
else else
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc") 2>&5 ($PKG_CONFIG --exists --print-errors "vorbisenc vorbis") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_VORBISENC_CFLAGS=`$PKG_CONFIG --cflags "vorbisenc" 2>/dev/null` pkg_cv_VORBISENC_CFLAGS=`$PKG_CONFIG --cflags "vorbisenc vorbis" 2>/dev/null`
else else
pkg_failed=yes pkg_failed=yes
fi fi
...@@ -12882,12 +12882,12 @@ if test -n "$PKG_CONFIG"; then ...@@ -12882,12 +12882,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_VORBISENC_LIBS="$VORBISENC_LIBS" pkg_cv_VORBISENC_LIBS="$VORBISENC_LIBS"
else else
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"vorbisenc vorbis\""; } >&5
($PKG_CONFIG --exists --print-errors "vorbisenc") 2>&5 ($PKG_CONFIG --exists --print-errors "vorbisenc vorbis") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_VORBISENC_LIBS=`$PKG_CONFIG --libs "vorbisenc" 2>/dev/null` pkg_cv_VORBISENC_LIBS=`$PKG_CONFIG --libs "vorbisenc vorbis" 2>/dev/null`
else else
pkg_failed=yes pkg_failed=yes
fi fi
...@@ -12906,9 +12906,9 @@ else ...@@ -12906,9 +12906,9 @@ else
_pkg_short_errors_supported=no _pkg_short_errors_supported=no
fi fi
if test $_pkg_short_errors_supported = yes; then if test $_pkg_short_errors_supported = yes; then
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbisenc"` VORBISENC_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "vorbisenc vorbis"`
else else
VORBISENC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbisenc"` VORBISENC_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "vorbisenc vorbis"`
fi fi
# Put the nasty error message in config.log where it belongs # Put the nasty error message in config.log where it belongs
echo "$VORBISENC_PKG_ERRORS" >&5 echo "$VORBISENC_PKG_ERRORS" >&5
...@@ -18460,7 +18460,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ...@@ -18460,7 +18460,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by mpd $as_me 0.18.7, which was This file was extended by mpd $as_me 0.18.8, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
...@@ -18520,13 +18520,13 @@ $config_headers ...@@ -18520,13 +18520,13 @@ $config_headers
Configuration commands: Configuration commands:
$config_commands $config_commands
Report bugs to <musicpd-dev-team@lists.sourceforge.net>." Report bugs to <mpd-devel@musicpd.org>."
_ACEOF _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
mpd config.status 0.18.7 mpd config.status 0.18.8
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"
......
AC_PREREQ(2.60) AC_PREREQ(2.60)
AC_INIT(mpd, 0.18.7, musicpd-dev-team@lists.sourceforge.net) AC_INIT(mpd, 0.18.8, mpd-devel@musicpd.org)
VERSION_MAJOR=0 VERSION_MAJOR=0
VERSION_MINOR=18 VERSION_MINOR=18
...@@ -1139,7 +1139,7 @@ fi ...@@ -1139,7 +1139,7 @@ fi
AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes) AM_CONDITIONAL(ENABLE_FLAC_ENCODER, test x$enable_flac_encoder = xyes)
dnl ---------------------------- Ogg Vorbis Encoder --------------------------- dnl ---------------------------- Ogg Vorbis Encoder ---------------------------
MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc], MPD_AUTO_PKG(vorbis_encoder, VORBISENC, [vorbisenc vorbis],
[Ogg Vorbis encoder], [libvorbisenc not found]) [Ogg Vorbis encoder], [libvorbisenc not found])
if test x$enable_vorbis_encoder = xyes; then if test x$enable_vorbis_encoder = xyes; then
......
...@@ -155,7 +155,7 @@ foo(const char *abc, int xyz) ...@@ -155,7 +155,7 @@ foo(const char *abc, int xyz)
<para> <para>
Send your patches to the mailing list: Send your patches to the mailing list:
musicpd-dev-team@lists.sourceforge.net mpd-devel@musicpd.org
</para> </para>
</chapter> </chapter>
</book> </book>
...@@ -31,7 +31,7 @@ PROJECT_NAME = MPD ...@@ -31,7 +31,7 @@ PROJECT_NAME = MPD
# This could be handy for archiving the generated documentation or # This could be handy for archiving the generated documentation or
# if some version control system is used. # if some version control system is used.
PROJECT_NUMBER = 0.18.7 PROJECT_NUMBER = 0.18.8
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
# base path where the generated documentation will be put. # base path where the generated documentation will be put.
......
...@@ -1852,6 +1852,51 @@ systemctl start mpd.socket</programlisting> ...@@ -1852,6 +1852,51 @@ systemctl start mpd.socket</programlisting>
</informaltable> </informaltable>
</section> </section>
<section>
<title><varname>roar</varname></title>
<para>
The <varname>roar</varname> plugin connects to a <ulink
url="http://roaraudio.keep-cool.org/">RoarAudio</ulink>
server.
</para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Setting</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>
<varname>server</varname>
<parameter>HOSTNAME</parameter>
</entry>
<entry>
The host name of the RoarAudio server. If not
specified, then MPD will connect to the default
locations.
</entry>
</row>
<row>
<entry>
<varname>role</varname>
<parameter>ROLE</parameter>
</entry>
<entry>
The "role" that MPD registers itself as in the
RoarAudio server. The default is "music".
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</section>
<section> <section>
<title><varname>recorder</varname></title> <title><varname>recorder</varname></title>
......
...@@ -81,31 +81,85 @@ icy_add_item(Tag &tag, TagType type, const char *value) ...@@ -81,31 +81,85 @@ icy_add_item(Tag &tag, TagType type, const char *value)
} }
static void static void
icy_parse_tag_item(Tag &tag, const char *item) icy_parse_tag_item(Tag &tag, const char *name, const char *value)
{ {
gchar **p = g_strsplit(item, "=", 0); if (strcmp(name, "StreamTitle") == 0)
icy_add_item(tag, TAG_TITLE, value);
if (p[0] != nullptr && p[1] != nullptr) { else
if (strcmp(p[0], "StreamTitle") == 0) FormatDebug(icy_metadata_domain,
icy_add_item(tag, TAG_TITLE, p[1]); "unknown icy-tag: '%s'", name);
else }
FormatDebug(icy_metadata_domain,
"unknown icy-tag: '%s'", p[0]); /**
} * Find a single quote that is followed by a semicolon (or by the end
* of the string). If that fails, return the first single quote. If
* that also fails, return #end.
*/
static char *
find_end_quote(char *p, char *const end)
{
char *fallback = std::find(p, end, '\'');
if (fallback >= end - 1 || fallback[1] == ';')
return fallback;
g_strfreev(p); p = fallback + 1;
while (true) {
p = std::find(p, end, '\'');
if (p == end)
return fallback;
if (p == end - 1 || p[1] == ';')
return p;
++p;
}
} }
static Tag * static Tag *
icy_parse_tag(const char *p) icy_parse_tag(char *p, char *const end)
{ {
assert(p != nullptr);
assert(end != nullptr);
assert(p <= end);
Tag *tag = new Tag(); Tag *tag = new Tag();
gchar **items = g_strsplit(p, ";", 0);
for (unsigned i = 0; items[i] != nullptr; ++i) while (p != end) {
icy_parse_tag_item(*tag, items[i]); const char *const name = p;
char *eq = std::find(p, end, '=');
if (eq == end)
break;
*eq = 0;
p = eq + 1;
if (*p != '\'') {
/* syntax error; skip to the next semicolon,
try to recover */
char *semicolon = std::find(p, end, ';');
if (semicolon == end)
break;
p = semicolon + 1;
continue;
}
++p;
const char *const value = p;
char *quote = find_end_quote(p, end);
if (quote == end)
break;
*quote = 0;
p = quote + 1;
g_strfreev(items); icy_parse_tag_item(*tag, name, value);
char *semicolon = std::find(p, end, ';');
if (semicolon == end)
break;
p = semicolon + 1;
}
return tag; return tag;
} }
...@@ -152,15 +206,11 @@ IcyMetaDataParser::Meta(const void *data, size_t length) ...@@ -152,15 +206,11 @@ IcyMetaDataParser::Meta(const void *data, size_t length)
++length; ++length;
if (meta_position == meta_size) { if (meta_position == meta_size) {
/* null-terminate the string */
meta_data[meta_size] = 0;
/* parse */ /* parse */
delete tag; delete tag;
tag = icy_parse_tag(meta_data); tag = icy_parse_tag(meta_data, meta_data + meta_size);
g_free(meta_data); g_free(meta_data);
/* change back to normal data mode */ /* change back to normal data mode */
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
#ifndef MPD_OUTPUT_API_HXX #ifndef MPD_OUTPUT_API_HXX
#define MPD_OUTPUT_API_HxX #define MPD_OUTPUT_API_HXX
#include "OutputPlugin.hxx" #include "OutputPlugin.hxx"
#include "OutputInternal.hxx" #include "OutputInternal.hxx"
......
...@@ -30,7 +30,7 @@ struct playlist { ...@@ -30,7 +30,7 @@ struct playlist {
/** /**
* The song queue - it contains the "real" playlist. * The song queue - it contains the "real" playlist.
*/ */
struct queue queue; struct Queue queue;
/** /**
* This value is true if the player is currently playing (or * This value is true if the player is currently playing (or
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
void void
playlist_print_uris(Client &client, const playlist &playlist) playlist_print_uris(Client &client, const playlist &playlist)
{ {
const queue &queue = playlist.queue; const Queue &queue = playlist.queue;
queue_print_uris(client, queue, 0, queue.GetLength()); queue_print_uris(client, queue, 0, queue.GetLength());
} }
...@@ -49,7 +49,7 @@ bool ...@@ -49,7 +49,7 @@ bool
playlist_print_info(Client &client, const playlist &playlist, playlist_print_info(Client &client, const playlist &playlist,
unsigned start, unsigned end) unsigned start, unsigned end)
{ {
const queue &queue = playlist.queue; const Queue &queue = playlist.queue;
if (end > queue.GetLength()) if (end > queue.GetLength())
/* correct the "end" offset */ /* correct the "end" offset */
......
...@@ -65,7 +65,7 @@ playlist_print_uri(FILE *file, const char *uri) ...@@ -65,7 +65,7 @@ playlist_print_uri(FILE *file, const char *uri)
} }
PlaylistResult PlaylistResult
spl_save_queue(const char *name_utf8, const queue &queue) spl_save_queue(const char *name_utf8, const Queue &queue)
{ {
if (map_spl_path().IsNull()) if (map_spl_path().IsNull())
return PlaylistResult::DISABLED; return PlaylistResult::DISABLED;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <stdio.h> #include <stdio.h>
struct Song; struct Song;
struct queue; struct Queue;
struct playlist; struct playlist;
struct PlayerControl; struct PlayerControl;
class Error; class Error;
...@@ -40,7 +40,7 @@ playlist_print_uri(FILE *fp, const char *uri); ...@@ -40,7 +40,7 @@ playlist_print_uri(FILE *fp, const char *uri);
* Saves a queue object into a stored playlist file. * Saves a queue object into a stored playlist file.
*/ */
PlaylistResult PlaylistResult
spl_save_queue(const char *name_utf8, const queue &queue); spl_save_queue(const char *name_utf8, const Queue &queue);
/** /**
* Saves a playlist object into a stored playlist file. * Saves a playlist object into a stored playlist file.
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <stdlib.h> #include <stdlib.h>
queue::queue(unsigned _max_length) Queue::Queue(unsigned _max_length)
:max_length(_max_length), length(0), :max_length(_max_length), length(0),
version(1), version(1),
items(new Item[max_length]), items(new Item[max_length]),
...@@ -36,7 +36,7 @@ queue::queue(unsigned _max_length) ...@@ -36,7 +36,7 @@ queue::queue(unsigned _max_length)
{ {
} }
queue::~queue() Queue::~Queue()
{ {
Clear(); Clear();
...@@ -45,7 +45,7 @@ queue::~queue() ...@@ -45,7 +45,7 @@ queue::~queue()
} }
int int
queue::GetNextOrder(unsigned _order) const Queue::GetNextOrder(unsigned _order) const
{ {
assert(_order < length); assert(_order < length);
...@@ -62,7 +62,7 @@ queue::GetNextOrder(unsigned _order) const ...@@ -62,7 +62,7 @@ queue::GetNextOrder(unsigned _order) const
} }
void void
queue::IncrementVersion() Queue::IncrementVersion()
{ {
static unsigned long max = ((uint32_t) 1 << 31) - 1; static unsigned long max = ((uint32_t) 1 << 31) - 1;
...@@ -77,7 +77,7 @@ queue::IncrementVersion() ...@@ -77,7 +77,7 @@ queue::IncrementVersion()
} }
void void
queue::ModifyAtOrder(unsigned _order) Queue::ModifyAtOrder(unsigned _order)
{ {
assert(_order < length); assert(_order < length);
...@@ -86,7 +86,7 @@ queue::ModifyAtOrder(unsigned _order) ...@@ -86,7 +86,7 @@ queue::ModifyAtOrder(unsigned _order)
} }
unsigned unsigned
queue::Append(Song *song, uint8_t priority) Queue::Append(Song *song, uint8_t priority)
{ {
assert(!IsFull()); assert(!IsFull());
...@@ -105,7 +105,7 @@ queue::Append(Song *song, uint8_t priority) ...@@ -105,7 +105,7 @@ queue::Append(Song *song, uint8_t priority)
} }
void void
queue::SwapPositions(unsigned position1, unsigned position2) Queue::SwapPositions(unsigned position1, unsigned position2)
{ {
unsigned id1 = items[position1].id; unsigned id1 = items[position1].id;
unsigned id2 = items[position2].id; unsigned id2 = items[position2].id;
...@@ -120,7 +120,7 @@ queue::SwapPositions(unsigned position1, unsigned position2) ...@@ -120,7 +120,7 @@ queue::SwapPositions(unsigned position1, unsigned position2)
} }
void void
queue::MovePostion(unsigned from, unsigned to) Queue::MovePostion(unsigned from, unsigned to)
{ {
const Item tmp = items[from]; const Item tmp = items[from];
...@@ -156,7 +156,7 @@ queue::MovePostion(unsigned from, unsigned to) ...@@ -156,7 +156,7 @@ queue::MovePostion(unsigned from, unsigned to)
} }
void void
queue::MoveRange(unsigned start, unsigned end, unsigned to) Queue::MoveRange(unsigned start, unsigned end, unsigned to)
{ {
Item tmp[end - start]; Item tmp[end - start];
// Copy the original block [start,end-1] // Copy the original block [start,end-1]
...@@ -198,7 +198,7 @@ queue::MoveRange(unsigned start, unsigned end, unsigned to) ...@@ -198,7 +198,7 @@ queue::MoveRange(unsigned start, unsigned end, unsigned to)
}