Commit 9a4f7156 authored by Mateusz Łukasik's avatar Mateusz Łukasik

Updated version 3.9 from 'upstream/3.9'

with Debian dir 31be796c8907995314ba85bf54757d42b8379701
parents b777f39a fe91e6f4
LICENSE
Copyright © 2001-2016 Audacious developers and others
Copyright © 2001-2017 Audacious developers and others
(A list of the copyright holders is provided in the AUTHORS file.)
......
......@@ -110,9 +110,10 @@ if test $HAVE_LINUX = yes ; then
LDFLAGS="$LDFLAGS -Wl,-z,defs"
fi
dnl MinGW needs -march=i686 for atomics
dnl ===================================
dnl MinGW-specific flags
dnl ====================
if test $HAVE_MSWINDOWS = yes ; then
AC_DEFINE([__USE_MINGW_ANSI_STDIO], [1], "Use GNU-style printf")
CFLAGS="$CFLAGS -march=i686"
fi
......
......@@ -14,7 +14,7 @@ MimeType=application/ogg;application/x-cue;application/x-ogg;application/xspf+xm
Comment[ar]=استمع إلى الموسيقى
Comment[be]=Слухайце музыку
Comment[bg]=Слушай музика
Comment[bg]=Слушане на музика
Comment[ca]=Escolteu música
Comment[cs]=Poslouchat hudbu
Comment[da]=Lyt til musik
......@@ -24,6 +24,8 @@ Comment[eo]=Aŭskulti muzikon
Comment[es_CL]=Listado de musica
Comment[es_MX]=Escuchar la música
Comment[es]=Escuchar música
Comment[et]=Kuula muusikat
Comment[fa_IR]=به موسیقی گوش کنید
Comment[fi]=Kuuntele musiikkia
Comment[fr]=Écouter de la musique
Comment[gl]=Escoitar música
......@@ -40,6 +42,7 @@ Comment[nl]=Luister naar muziek
Comment[pl]=Słuchaj muzyki
Comment[pt_BR]=Ouça música
Comment[pt_PT]=Reprodução de músicas
Comment[pt]=Escuta musica
Comment[ro]=Ascultă muzică
Comment[ru]=Слушать музыку
Comment[sk]=Počúvajte hudbu
......@@ -63,11 +66,13 @@ GenericName[eo]=Muzik-ludilo
GenericName[es_CL]=Reproductor de musica
GenericName[es_MX]=Reproductor de Música
GenericName[es]=Reproductor de música
GenericName[et]=Muusikaesitaja
GenericName[fa_IR]=پخش کننده موسیقی
GenericName[fi]=Musiikkisoitin
GenericName[fr]=Diffuseur de musique
GenericName[gl]=Reprodutor de música
GenericName[hr]=Svirač glazbe
GenericName[hu]=Zene lejátszó
GenericName[hu]=Zenelejátszó
GenericName[id_ID]=Pemutar musik
GenericName[it]=Lettore musicale
GenericName[ja]=音楽プレイヤー
......@@ -79,6 +84,7 @@ GenericName[nl]=Muziekspeler
GenericName[pl]=Odtwarzacz muzyczny
GenericName[pt_BR]=Reprodutor de Música
GenericName[pt_PT]=Reprodutor áudio
GenericName[pt]=Reprodutor de musica
GenericName[ro]=Player de muzică
GenericName[ru]=Музыкальный проигрыватель
GenericName[sk]=Hudobný prehrávač
......
......@@ -131,3 +131,6 @@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* "Use GNU-style printf" */
#undef __USE_MINGW_ANSI_STDIO
This diff is collapsed.
......@@ -6,7 +6,7 @@ dnl Initialize
dnl ==========
AC_PREREQ([2.59])
AC_INIT([audacious], [3.8.2])
AC_INIT([audacious], [3.9])
AC_COPYRIGHT([Copyright (C) 2001-2017 Audacious developers and others])
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Name of package])
......
......@@ -114,6 +114,33 @@ Toggle recording of the output stream (using FileWriter).
.B --playback-recording
Return an exit code of 0 (true) if stream recording is enabled.
.SS Playlist selection:
.TP
.B --select-displayed
Specifies that any subsequent playlist commands should apply to the playlist
currently displayed by Audacious, regardless of which playlist is playing. This
setting takes effect until it is overridden by \fB--select-playing\fR or
Audacious is restarted.
The following commands are also affected:
.RS
.RS
--current-song
.br
--current-song-filename
.br
--current-song-length[-seconds,-frames]
.br
--current-song-tuple-data
.RE
.RE
.TP
.B --select-playing
Specifies that when playback is active, any subsequent playlist commands should
apply to the playlist currently playing. When playback is stopped, the behavior
is the same as \fB--select-displayed\fR. This setting is the default.
.SS Playlist commands:
.TP
......@@ -202,19 +229,18 @@ Toggle the ``stop after current song'' option.
Print the number of open playlists.
.TP
.B --current-playlist
Print the number of the current playlist. When a song is playing, the current
playlist is defined as the playlist containing that song. Otherwise, it is the
playlist currently displayed in Audacious.
Print the number of the current playlist, where "current" is interpreted
according to \fB--select-displayed\fR or fB--select-playing\fR.
.TP
.B --play-current-playlist
Start playback. If paused or previously stopped in the middle of a song,
playback will resume from the last point played. There is no effect if playback
is already active and not paused.
Start playback in the current playlist, resuming from the last point played if
possible. When \fB--select-displayed\fR is in effect, this command can be used
to switch playback to the displayed playlist.
.TP
.B --set-current-playlist \fIplaylist\fR
Switch to the given playlist. If another playlist is playing, playback will
switch to this one, resuming from the last point played. If playback is
currently paused, it will remain so after the switch.
Display the given playlist. When \fB--select-playing\fR is in effect and a
different playlist is playing, this command will also switch playback to the
given playlist. The \fB--select-displayed\fR option disables this behavior.
.TP
.B --current-playlist-name
Print the title of the current playlist.
......@@ -227,7 +253,7 @@ Insert a new playlist after the current one and switch to it as if
\fB--set-current-playlist\fR were used.
.TP
.B --delete-current-playlist
Remove the current playlist. Playback, if active, will be stopped.
Remove the current playlist.
.SS Playlist queue commands:
......
......@@ -2,6 +2,7 @@
src/audacious/main.cc
src/libaudcore/adder.cc
src/libaudcore/audstrings.cc
src/libaudcore/drct.cc
src/libaudcore/output.cc
src/libaudcore/playback.cc
src/libaudcore/playlist.cc
......@@ -39,6 +40,7 @@ src/libaudqt/log-inspector.cc
src/libaudqt/playlist-management.cc
src/libaudqt/plugin-menu.cc
src/libaudqt/prefs-plugin.cc
src/libaudqt/prefs-pluginlist-model.cc
src/libaudqt/prefs-window.cc
src/libaudqt/queue-manager.cc
src/libaudqt/url-opener.cc
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -21,8 +21,11 @@
#include <stdlib.h>
#include <string.h>
#include <glib.h> /* for g_get_current_dir, g_path_is_absolute */
#ifdef _WIN32
#include <windows.h>
#endif
#define AUD_GLIB_INTEGRATION
#include <libaudcore/audstrings.h>
#include <libaudcore/drct.h>
#include <libaudcore/hook.h>
......@@ -81,8 +84,7 @@ static const struct {
static bool parse_options (int argc, char * * argv)
{
char * cur = g_get_current_dir ();
bool success = true;
CharPtr cur (g_get_current_dir ());
#ifdef _WIN32
Index<String> args = get_argv_utf8 ();
......@@ -134,8 +136,7 @@ static bool parse_options (int argc, char * * argv)
if (! found)
{
fprintf (stderr, _("Unknown option: %s\n"), arg);
success = false;
goto OUT;
return false;
}
}
else /* short form */
......@@ -157,8 +158,7 @@ static bool parse_options (int argc, char * * argv)
if (! found)
{
fprintf (stderr, _("Unknown option: -%c\n"), arg[c]);
success = false;
goto OUT;
return false;
}
}
}
......@@ -174,16 +174,14 @@ static bool parse_options (int argc, char * * argv)
if (options.qt)
aud_set_mainloop_type (MainloopType::Qt);
OUT:
g_free (cur);
return success;
return true;
}
static void print_help ()
{
static const char pad[21] = " ";
fprintf (stderr, _("Usage: audacious [OPTION] ... [FILE] ...\n\n"));
fprintf (stderr, "%s", _("Usage: audacious [OPTION] ... [FILE] ...\n\n"));
fprintf (stderr, " -1, -2, -3, etc. %s\n", _("Select instance to run/control"));
for (auto & arg_info : arg_map)
......@@ -330,7 +328,7 @@ static void main_cleanup ()
static bool check_should_quit ()
{
return options.quit_after_play && ! aud_drct_get_playing () &&
! aud_playlist_add_in_progress (-1);
! Playlist::add_in_progress_any ();
}
static void maybe_quit ()
......@@ -343,6 +341,9 @@ int main (int argc, char * * argv)
{
atexit (main_cleanup);
#ifdef _WIN32
SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
#endif
#ifdef HAVE_SIGWAIT
signals_init_one ();
#endif
......
......@@ -59,6 +59,8 @@ void get_current_song_info (int argc, char * * argv);
void get_volume (int, char * *);
void set_volume (int, char * *);
void select_displayed (int, char * *);
void select_playing (int, char * *);
void playlist_position (int, char * *);
void playlist_advance (int, char * *);
void playlist_auto_advance_status (int, char * *);
......
......@@ -24,6 +24,16 @@
#include "audtool.h"
#include "wrappers.h"
void select_displayed (int argc, char * * argv)
{
obj_audacious_call_select_displayed_playlist_sync (dbus_proxy, NULL, NULL);
}
void select_playing (int argc, char * * argv)
{
obj_audacious_call_select_playing_playlist_sync (dbus_proxy, NULL, NULL);
}
void playlist_reverse (int argc, char * * argv)
{
obj_audacious_call_reverse_sync (dbus_proxy, NULL, NULL);
......
......@@ -59,6 +59,8 @@ const struct commandhandler handlers[] =
{"playback-recording", playback_recording, "exit code = 0 if recording", 0},
{"<sep>", NULL, "Playlist commands", 0},
{"select-displayed", select_displayed, "apply commands to displayed playlist", 0},
{"select-playing", select_playing, "apply commands to playing playlist", 0},
{"playlist-advance", playlist_advance, "skip to next song", 0},
{"playlist-reverse", playlist_reverse, "skip to previous song", 0},
{"playlist-addurl", playlist_add_url_string, "add URI at end of playlist", 1},
......
This diff is collapsed.
SHARED_LIB = ${LIB_PREFIX}audcore${LIB_SUFFIX}
LIB_MAJOR = 4
LIB_MINOR = 1
LIB_MAJOR = 5
LIB_MINOR = 0
SRCS = adder.cc \
art.cc \
......@@ -30,6 +30,7 @@ SRCS = adder.cc \
playback.cc \
playlist.cc \
playlist-cache.cc \
playlist-data.cc \
playlist-files.cc \
playlist-utils.cc \
plugin-init.cc \
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -22,13 +22,13 @@
#define AUD_MAX_CHANNELS 10
/* 24-bit integer samples are padded to 32-bit; high byte is always 0 */
enum {
FMT_FLOAT,
FMT_S8, FMT_U8,
FMT_S16_LE, FMT_S16_BE, FMT_U16_LE, FMT_U16_BE,
FMT_S24_LE, FMT_S24_BE, FMT_U24_LE, FMT_U24_BE,
FMT_S32_LE, FMT_S32_BE, FMT_U32_LE, FMT_U32_BE};
FMT_S24_LE, FMT_S24_BE, FMT_U24_LE, FMT_U24_BE, /* padded to 4 bytes */
FMT_S32_LE, FMT_S32_BE, FMT_U32_LE, FMT_U32_BE,
FMT_S24_3LE, FMT_S24_3BE, FMT_U24_3LE, FMT_U24_3BE }; /* packed in 3 bytes */
struct ReplayGainInfo {
float track_gain; /* dB */
......@@ -77,6 +77,8 @@ constexpr uint64_t bswap64 (uint64_t x)
#define FMT_U24_NE FMT_U24_BE
#define FMT_S32_NE FMT_S32_BE
#define FMT_U32_NE FMT_U32_BE
#define FMT_S24_3NE FMT_S24_3BE
#define FMT_U24_3NE FMT_U24_3BE
#ifdef WANT_AUD_BSWAP
#define FROM_BE16(x) (x)
......@@ -101,6 +103,8 @@ constexpr uint64_t bswap64 (uint64_t x)
#define FMT_U24_NE FMT_U24_LE
#define FMT_S32_NE FMT_S32_LE
#define FMT_U32_NE FMT_U32_LE
#define FMT_S24_3NE FMT_S24_3LE
#define FMT_U24_3NE FMT_U24_3LE
#ifdef WANT_AUD_BSWAP
#define FROM_BE16(x) (bswap16 (x))
......@@ -119,7 +123,10 @@ constexpr uint64_t bswap64 (uint64_t x)
#endif
#define FMT_SIZEOF(f) ((f) == FMT_FLOAT ? sizeof (float) : (f) <= FMT_U8 ? 1 : (f) <= FMT_U16_BE ? 2 : 4)
#define FMT_SIZEOF(f) (((f) >= FMT_S24_3LE) ? 3 : \
((f) >= FMT_S24_LE) ? 4 : \
((f) >= FMT_S16_LE) ? 2 : \
((f) >= FMT_S8) ? 1 : sizeof (float))
void audio_interlace (const void * const * in, int format, int channels, void * out, int frames);
void audio_deinterlace (const void * in, int format, int channels, void * const * out, int frames);
......
......@@ -55,7 +55,13 @@ static const char uri_legal_table[256] =
"\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0"
"\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0"
"\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x1\x1\x1" // '-' '.' '/'
#ifdef _WIN32
/* We assume ':' is used with a "reserved purpose" (i.e. drive letter).
* This assumption might need to be reconsidered for non-file URIs. */
"\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x0\x0\x0\x0\x0" // 0-9 ':'
#else
"\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x0\x0\x0\x0\x0\x0" // 0-9
#endif
"\x0\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1" // A-O
"\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x0\x0\x0\x0\x1" // P-Z '_'
"\x0\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1" // a-o
......@@ -314,6 +320,37 @@ EXPORT StringBuf str_tolower_utf8 (const char * str)
return buf;
}
EXPORT StringBuf str_toupper (const char * str)
{
StringBuf buf (strlen (str));
char * set = buf;
while (* str)
* set ++ = g_ascii_toupper (* str ++);
return buf;
}
EXPORT StringBuf str_toupper_utf8 (const char * str)
{
StringBuf buf (6 * strlen (str));
char * set = buf;
gunichar c;
while ((c = g_utf8_get_char (str)))
{
if (c < 128)
* set ++ = g_ascii_toupper (c);
else
set += g_unichar_to_utf8 (g_unichar_toupper (c), set);
str = g_utf8_next_char (str);
}
buf.resize (set - buf);
return buf;
}
EXPORT void str_replace_char (char * string, char old_c, char new_c)
{
while ((string = strchr (string, old_c)))
......@@ -1057,15 +1094,20 @@ EXPORT StringBuf double_array_to_str (const double * array, int count)
EXPORT StringBuf str_format_time (int64_t milliseconds)
{
bool neg = milliseconds < 0;
if (neg)
milliseconds *= -1;
int hours = milliseconds / 3600000;
int minutes = milliseconds / 60000;
int seconds = (milliseconds / 1000) % 60;
if (hours && aud_get_bool (nullptr, "show_hours"))
return str_printf ("%d:%02d:%02d", hours, minutes % 60, seconds);
return str_printf ("%s%d:%02d:%02d", neg ? "- " : "", hours, minutes % 60, seconds);
else
{
bool zero = aud_get_bool (nullptr, "leading_zero");
return str_printf (zero ? "%02d:%02d" : "%d:%02d", minutes, seconds);
return str_printf (zero ? "%s%02d:%02d" : "%s%d:%02d", neg ? "- " : "", minutes, seconds);
}
}
......@@ -34,7 +34,11 @@ int strlen_bounded (const char * s, int len = -1);
StringBuf str_copy (const char * s, int len = -1);
StringBuf str_concat (const std::initializer_list<const char *> & strings);
#ifdef _WIN32
StringBuf str_printf (const char * format, ...) __attribute__ ((__format__ (gnu_printf, 1, 2)));
#else
StringBuf str_printf (const char * format, ...) __attribute__ ((__format__ (__printf__, 1, 2)));
#endif
StringBuf str_vprintf (const char * format, va_list args);
bool str_has_prefix_nocase (const char * str, const char * prefix);
......@@ -52,6 +56,8 @@ static inline char * strstr_nocase_utf8 (char * haystack, const char * needle)
StringBuf str_tolower (const char * str);
StringBuf str_tolower_utf8 (const char * str);
StringBuf str_toupper (const char * str);
StringBuf str_toupper_utf8 (const char * str);
void str_replace_char (char * string, char old_c, char new_c);
......
......@@ -190,7 +190,7 @@ EXPORT StringBuf str_to_utf8 (StringBuf && str)
return std::move (str);
}
static void chardet_update ()
static void chardet_update (void * = nullptr, void * = nullptr)
{
String region = aud_get_str (nullptr, "chardet_detector");
String fallbacks = aud_get_str (nullptr, "chardet_fallback");
......@@ -202,14 +202,14 @@ void chardet_init ()
{
chardet_update ();
hook_associate ("set chardet_detector", (HookFunction) chardet_update, nullptr);
hook_associate ("set chardet_fallback", (HookFunction) chardet_update, nullptr);
hook_associate ("set chardet_detector", chardet_update, nullptr);
hook_associate ("set chardet_fallback", chardet_update, nullptr);
}
void chardet_cleanup ()
{
hook_dissociate ("set chardet_detector", (HookFunction) chardet_update);
hook_dissociate ("set chardet_fallback", (HookFunction) chardet_update);
hook_dissociate ("set chardet_detector", chardet_update);
hook_dissociate ("set chardet_fallback", chardet_update);
set_charsets (nullptr, nullptr);
}
This diff is collapsed.
This diff is collapsed.
......@@ -69,6 +69,10 @@ void aud_drct_get_ab_repeat (int & a, int & b);
/* --- RECORDING CONTROL --- */
/* Note that the behavior of these functions has changed in Audacious 3.9;
* "enabled" now means only that a plugin has been selected for recording.
* The "record" config option is now used to start/stop recording. */
/* Returns the output plugin that will be used for recording, or null if none is
* available. Connect to the "enable record" hook to monitor changes. */
PluginHandle * aud_drct_get_record_plugin ();
......@@ -77,8 +81,8 @@ PluginHandle * aud_drct_get_record_plugin ();
* "enable record" hook to monitor changes. */
bool aud_drct_get_record_enabled ();
/* Enables or disables output recording. If playback is active, recording
* begins immediately. Returns true on success, otherwise false. */
/* Enables or disables output recording (but does not actually start recording).
* Returns true on success, otherwise false. */
bool aud_drct_enable_record (bool enable);
/* --- VOLUME CONTROL --- */
......
......@@ -18,13 +18,12 @@
* the use of this software.
*/
#define AUD_GLIB_INTEGRATION
#include "equalizer.h"
#include <math.h>
#include <string.h>
#include <glib.h> /* for GKeyFile */
#include "audstrings.h"
#include "runtime.h"
#include "vfs.h"
......@@ -49,7 +48,7 @@ EXPORT Index<EqualizerPreset> aud_eq_read_presets (const char * basename)
for (int p = 0;; p ++)
{
char * name = g_key_file_get_string (rcfile, "Presets", str_printf ("Preset%d", p), nullptr);
CharPtr name (g_key_file_get_string (rcfile, "Presets", str_printf ("Preset%d", p), nullptr));
if (! name)
break;
......@@ -58,8 +57,6 @@ EXPORT Index<EqualizerPreset> aud_eq_read_presets (const char * basename)
for (int i = 0; i < AUD_EQ_NBANDS; i++)
preset.bands[i] = g_key_file_get_double (rcfile, name, str_printf ("Band%d", i), nullptr);
g_free (name);
}
g_key_file_free (rcfile);
......@@ -83,13 +80,12 @@ EXPORT bool aud_eq_write_presets (const Index<EqualizerPreset> & list, const cha
}
size_t len;
char * data = g_key_file_to_data (rcfile, & len, nullptr);
CharPtr data (g_key_file_to_data (rcfile, & len, nullptr));
StringBuf filename = filename_build ({aud_get_path (AudPath::UserDir), basename});
bool success = g_file_set_contents (filename, data, len, nullptr);
g_key_file_free (rcfile);
g_free (data);
return success;
}
......@@ -166,12 +162,11 @@ EXPORT bool aud_save_preset_file (const EqualizerPreset & preset, VFSFile & file
str_printf ("Band%d", i), preset.bands[i]);
size_t len;
char * data = g_key_file_to_data (rcfile, & len, nullptr);
CharPtr data (g_key_file_to_data (rcfile, & len, nullptr));
bool success = (file.fwrite (data, 1, len) == (int64_t) len);
g_key_file_free (rcfile);
g_free (data);
return success;
}
......
This diff is collapsed.
......@@ -106,7 +106,7 @@ void event_queue (const char * name, void * data, EventDestroyFunc destroy = nul
/* Cancels pending hook calls matching <name> and <data>. If <data> is nullptr,
* all hook calls matching <name> are canceled. */
void event_queue_cancel (const char * name, void * data);
void event_queue_cancel (const char * name, void * data = nullptr);
/* Convenience wrapper for C++ classes. Allows non-static member functions to
* be used as hook callbacks. The HookReceiver should be made a member of the
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.