Commit 4de0719a authored by Simon Quigley's avatar Simon Quigley

New upstream version 3.9

parent 5d911895
......@@ -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
......
......@@ -143,3 +143,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.
......@@ -5,7 +5,7 @@ dnl ***
dnl Initialize
dnl ==========
AC_PREREQ([2.59])
AC_INIT([audacious-plugins], [3.8.2])
AC_INIT([audacious-plugins], [3.9])
AC_COPYRIGHT([Copyright (C) 2001-2017 Audacious developers and others])
AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE_NAME", [Name of package])
......@@ -31,9 +31,9 @@ LIBS="$LIBS $LIBINTL"
dnl Check for Audacious
dnl ===================
PKG_CHECK_MODULES(AUDACIOUS, [audacious >= 3.8],
PKG_CHECK_MODULES(AUDACIOUS, [audacious >= 3.9],
[],
[AC_MSG_ERROR([Cannot find Audacious 3.8; have you installed Audacious yet?])]
[AC_MSG_ERROR([Cannot find Audacious 3.9; have you installed Audacious yet?])]
)
CPPFLAGS="$CPPFLAGS $AUDACIOUS_CFLAGS"
......@@ -465,7 +465,7 @@ ENABLE_PLUGIN_WITH_DEP(ampache,
auto,
GENERAL,
AMPACHE,
ampache_browser_0)
ampache_browser_1)
ENABLE_PLUGIN_WITH_DEP(qtaudio,
QtMultimedia output,
......
......@@ -134,12 +134,12 @@ src/psf/psx.h
src/pulse/pulse_audio.cc
src/qtaudio/qtaudio.cc
src/qtglspectrum/gl-spectrum.cc
src/qtui/dialog_windows.cc
src/qtui/filter_input.cc
src/qtui/main_window.cc
src/qtui/menus.cc
src/qtui/playlist_header.cc
src/qtui/playlist_model.cc
src/qtui/qtui.cc
src/qtui/search_bar.cc
src/qtui/settings.cc
src/qtui/status_bar.cc
src/resample/resample.cc
......@@ -181,6 +181,7 @@ src/statusicon-qt/statusicon.cc
src/statusicon/statusicon.cc
src/stereo_plugin/stereo.cc
src/tonegen/tonegen.cc
src/ui-common/dialogs-qt.cc
src/voice_removal/voice_removal.cc
src/vorbis/vorbis.cc
src/vorbis/vorbis.h
......
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.
......@@ -64,5 +64,5 @@ plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
LD = ${CXX}
CFLAGS += ${PLUGIN_CFLAGS}
# FIXME: Turning off warnings for now; this code is awful
CXXFLAGS += ${PLUGIN_CFLAGS} -Wno-sign-compare
CXXFLAGS += ${PLUGIN_CFLAGS} -Wno-sign-compare -Wno-shift-negative-value
CPPFLAGS += ${PLUGIN_CPPFLAGS} -I../.. -I./core -I./binio
......@@ -105,25 +105,9 @@ static float *rptr[9], *nrptr[9];
static float rbuf[9][FIFOSIZ*2];
static float snd[FIFOSIZ*2];
#ifndef USING_ASM
#define _inline
#endif
#ifdef USING_ASM
static _inline void ftol (float f, long *a)
{
_asm
{
mov eax, a
fld f
fistp dword ptr [eax]
}
}
#else
static void ftol(float f, long *a) {
*a=f;
}
#endif
#define ctc ((celltype *)c) //A rare attempt to make code easier to read!
void docell4 (void *c, float modulator) { }
......@@ -382,42 +366,6 @@ void adlib0 (long i, long v)
//outdata(i,v);
}
#ifdef USING_ASM
static long fpuasm;
static float fakeadd = 8388608.0+128.0;
static _inline void clipit8 (float f, long a)
{
_asm
{
mov edi, a
fld dword ptr f
fadd dword ptr fakeadd
fstp dword ptr fpuasm
mov eax, fpuasm
test eax, 0x007fff00
jz short skipit
shr eax, 16
xor eax, -1
skipit: mov byte ptr [edi], al
}
}
static _inline void clipit16 (float f, long a)
{
_asm
{
mov eax, a
fld dword ptr f
fist word ptr [eax]
cmp word ptr [eax], 0x8000
jne short skipit2
fst dword ptr [fpuasm]
cmp fpuasm, 0x80000000
sbb word ptr [eax], 0
skipit2: fstp st
}
}
#else
static void clipit8(float f,unsigned char *a) {
f/=256.0;
f+=128.0;
......@@ -431,7 +379,6 @@ static void clipit16(float f,short *a) {
else if (f<-32767.5) *a=-32768;
else *a=f;
}
#endif
void adlibsetvolume(int i) {
AMPSCALE=i;
......
......@@ -205,7 +205,7 @@ bool CmodPlayer::update()
for(chan = 0; chan < nchans; chan++) {
oplchan = set_opl_chip(chan);
if(!(activechan >> (31 - chan)) & 1) { // channel active?
if(!((activechan >> (31 - chan)) & 1)) { // channel active?
AdPlug_LogWrite("N/A|");
continue;
}
......
......@@ -44,15 +44,12 @@ EXPORT AlbumArtPlugin aud_plugin_instance;
static void album_update (void *, GtkWidget * widget)
{
GdkPixbuf * pixbuf = audgui_pixbuf_request_current ();
AudguiPixbuf pixbuf = audgui_pixbuf_request_current ();
if (! pixbuf)
pixbuf = audgui_pixbuf_fallback ();
audgui_scaled_image_set (widget, pixbuf);
if (pixbuf)
g_object_unref (pixbuf);
audgui_scaled_image_set (widget, pixbuf.get ());
}
static void album_clear (void *, GtkWidget * widget)
......
......@@ -296,6 +296,10 @@ static snd_pcm_format_t convert_aud_format (int aud_format)
{FMT_S32_BE, SND_PCM_FORMAT_S32_BE},
{FMT_U32_LE, SND_PCM_FORMAT_U32_LE},
{FMT_U32_BE, SND_PCM_FORMAT_U32_BE},
{FMT_S24_3LE, SND_PCM_FORMAT_S24_3LE},
{FMT_S24_3BE, SND_PCM_FORMAT_S24_3BE},
{FMT_U24_3LE, SND_PCM_FORMAT_U24_3LE},
{FMT_U24_3BE, SND_PCM_FORMAT_U24_3BE},
};
for (auto & conv : table)
......@@ -326,7 +330,7 @@ bool ALSAPlugin::open_audio (int aud_format, int rate, int channels, String & er
goto FAILED;
}
AUDDBG ("Opening PCM device %s for %s, %d channels, %d Hz.\n",
AUDINFO ("Opening PCM device %s for %s, %d channels, %d Hz.\n",
(const char *) pcm, snd_pcm_format_name (format), channels, rate);
CHECK_STR (error, snd_pcm_open, & alsa_handle, pcm, SND_PCM_STREAM_PLAYBACK, 0);
......@@ -360,7 +364,7 @@ bool ALSAPlugin::open_audio (int aud_format, int rate, int channels, String & er
CHECK_STR (error, snd_pcm_hw_params, alsa_handle, params);
soft_buffer = aud::max (total_buffer / 2, total_buffer - hard_buffer);
AUDDBG ("Buffer: hardware %d ms, software %d ms, period %d ms.\n",
AUDINFO ("Buffer: hardware %d ms, software %d ms, period %d ms.\n",
hard_buffer, soft_buffer, alsa_period);
buffer_frames = aud::rescale<int64_t> (soft_buffer, 1000, rate);
......
......@@ -56,7 +56,7 @@ public:
#ifdef USE_GTK
bool file_info_box (const char * filename, VFSFile & file)
{ i_fileinfo_gui (filename, file); return true; }
{ return i_fileinfo_gui (filename, file); }
#endif
protected:
......
......@@ -103,8 +103,12 @@ void i_fileinfo_text_fill (midifile_t * mf, GtkTextBuffer * text_tb, GtkTextBuff
}
void i_fileinfo_gui (const char * filename_uri, VFSFile & file)
bool i_fileinfo_gui (const char * filename_uri, VFSFile & file)
{
// TODO: Qt support
if (aud_get_mainloop_type () != MainloopType::GLib)
return false;
static GtkWidget * fileinfowin = nullptr;
GtkWidget * fileinfowin_vbox, *fileinfowin_columns_hbox;
GtkWidget * midiinfoboxes_vbox, *miditextboxes_vbox, *miditextboxes_paned;
......@@ -122,13 +126,13 @@ void i_fileinfo_gui (const char * filename_uri, VFSFile & file)
int bpm = 0, wavg_bpm = 0;
if (fileinfowin)
return;
return true;
midifile_t mf;
/****************** midifile parser ******************/
if (! mf.parse_from_file (filename_uri, file))
return;
return false;
/* midifile is filled with information at this point,
bpm information is needed too */
......@@ -339,6 +343,8 @@ void i_fileinfo_gui (const char * filename_uri, VFSFile & file)
gtk_widget_grab_focus (GTK_WIDGET (footer_bclose));
gtk_widget_show_all (fileinfowin);
return true;
}
#endif // USE_GTK
......@@ -23,6 +23,6 @@
class VFSFile;
void i_fileinfo_gui (const char * filename_uri, VFSFile & file);
bool i_fileinfo_gui (const char * filename_uri, VFSFile & file);
#endif /* !_I_FILEINFO_H */
......@@ -43,10 +43,10 @@ public:
};
const char AmpacheBrowserPlugin::about[] =
N_("Ampache Browser\n\n"
"Ampache client for Audacious.\n\n"
"License: GNU GPLv3\n"
"Copyright (C) Róbert Čerňanský and John Lindgren\n");
N_("Ampache Browser for Audacious\n"
"http://ampache-browser.org/\n\n"
"Copyright (C) Róbert Čerňanský and John Lindgren\n"
"License: GNU GPLv3");
static SmartPtr<ampache_browser::ApplicationQt> s_app;
......@@ -108,11 +108,11 @@ bool AmpacheBrowserPlugin::init()
});
browser.connectCreatePlaylist([](const UrlList& urls) {
aud_playlist_entry_insert_batch(aud_playlist_new(), -1, toAddItems(urls), true);
Playlist::new_playlist().insert_items(-1, toAddItems(urls), false);
});
browser.connectAddToPlaylist([](const UrlList& urls) {
aud_playlist_entry_insert_batch(aud_playlist_get_active(), -1, toAddItems(urls), false);
Playlist::active_playlist().insert_items(-1, toAddItems(urls), false);
});
initSettings(s_app->getSettings());
......
......@@ -172,18 +172,18 @@ static void cdaudio_error (const char * message_format, ...)
}
/* main thread only */
static void purge_playlist (int playlist)
static void purge_playlist (Playlist playlist)
{
int length = aud_playlist_entry_count (playlist);
int length = playlist.n_entries ();
for (int count = 0; count < length; count ++)
for (int i = 0; i < length; i ++)
{
String filename = aud_playlist_entry_get_filename (playlist, count);
String filename = playlist.entry_filename (i);
if (! strncmp (filename, "cdda://", 7))
{
aud_playlist_entry_delete (playlist, count, 1);
count--;
playlist.remove_entry (i);
i--;
length--;
}
}
......@@ -192,11 +192,10 @@ static void purge_playlist (int playlist)
/* main thread only */
static void purge_all_playlists (void * = nullptr)
{
int playlists = aud_playlist_count ();
int count;
int playlists = Playlist::n_playlists ();
for (count = 0; count < playlists; count++)
purge_playlist (count);
for (int i = 0; i < playlists; i++)
purge_playlist (Playlist::by_index (i));
}
/* main thread only */
......
......@@ -61,6 +61,6 @@ plugindir := ${plugindir}/${INPUT_PLUGIN_DIR}
LD = ${CXX}
CFLAGS += ${PLUGIN_CFLAGS}
CXXFLAGS += ${PLUGIN_CFLAGS}
CXXFLAGS += ${PLUGIN_CFLAGS} -Wno-shift-negative-value
CPPFLAGS += ${PLUGIN_CPPFLAGS} -I../..
LIBS += -lz
......@@ -101,16 +101,16 @@ static void confirm_delete ()
{
Index<String> files;
int playlist = aud_playlist_get_active ();
int entry_count = aud_playlist_entry_count (playlist);
auto playlist = Playlist::active_playlist ();
int entry_count = playlist.n_entries ();
for (int i = 0; i < entry_count; i ++)
{
if (aud_playlist_entry_get_selected (playlist, i))
files.append (aud_playlist_entry_get_filename (playlist, i));
if (playlist.entry_selected (i))
files.append (playlist.entry_filename (i));
}
aud_playlist_delete_selected (playlist);
playlist.remove_selected ();
for (const String & uri : files)
{
......
......@@ -662,6 +662,9 @@ const char * const FFaudio::exts[] = {
/* True Audio */
"tta",
/* WebM */
"webm",
/* end of table */
nullptr
};
......
......@@ -2,13 +2,13 @@ PLUGIN = gtkui${PLUGIN_SUFFIX}
SRCS = columns.cc \
layout.cc \
menu-ops.cc \
menus.cc \
ui_infoarea.cc \
ui_gtk.cc \
ui_playlist_widget.cc \
ui_playlist_notebook.cc \
ui_statusbar.cc \
playlist_util.cc \
settings.cc
include ../../buildsys.mk
......
......@@ -45,7 +45,8 @@ const char * const pw_col_names[PW_COLS] = {
N_("File path"),
N_("File name"),
N_("Custom title"),
N_("Bitrate")
N_("Bitrate"),
N_("Comment")
};
int pw_num_cols;
......@@ -66,7 +67,8 @@ static const char * const pw_col_keys[PW_COLS] = {
"path",
"filename",
"custom",
"bitrate"
"bitrate",
"comment"
};
static const int pw_default_widths[PW_COLS] = {
......@@ -83,7 +85,8 @@ static const int pw_default_widths[PW_COLS] = {
275, // path
275, // filename
275, // custom title
10 // bitrate
10, // bitrate
275 // comment
};
void pw_col_init ()
......@@ -111,14 +114,13 @@ void pw_col_init ()
pw_cols[pw_num_cols ++] = i;
}
String widths = aud_get_str ("gtkui", "column_widths");
auto widths = str_list_to_index (aud_get_str ("gtkui", "column_widths"), ", ");
int nwidths = aud::min (widths.len (), (int) PW_COLS);
int iwidths[PW_COLS];
bool valid = str_to_int_array (widths, iwidths, PW_COLS);
auto source = valid ? iwidths : pw_default_widths;
for (int i = 0; i < PW_COLS; i ++)
pw_col_widths[i] = audgui_to_native_dpi (source[i]);
for (int i = 0; i < nwidths; i ++)
pw_col_widths[i] = audgui_to_native_dpi (str_to_int (widths[i]));
for (int i = nwidths; i < PW_COLS; i ++)
pw_col_widths[i] = audgui_to_native_dpi (pw_default_widths[i]);
}
struct Column {
......@@ -134,12 +136,12 @@ static void apply_changes ()
int cols = chosen.len ();
g_return_if_fail (cols <= PW_COLS);
ui_playlist_notebook_empty ();
pl_notebook_purge ();
for (pw_num_cols = 0; pw_num_cols < cols; pw_num_cols ++)
pw_cols[pw_num_cols] = chosen[pw_num_cols].column;
ui_playlist_notebook_populate ();
pl_notebook_populate ();
}
static void get_value (void * user, int row, int column, GValue * value)
......
......@@ -23,6 +23,7 @@
#include <stdint.h>
#include <gtk/gtk.h>
class Playlist;
struct PluginPreferences;
/* menus.c */
......@@ -30,7 +31,7 @@ GtkWidget * make_menu_bar (GtkAccelGroup * accel);
GtkWidget * make_menu_main (GtkAccelGroup * accel);
GtkWidget * make_menu_rclick (GtkAccelGroup * accel);
GtkWidget * make_menu_tab (GtkAccelGroup * accel);
extern int menu_tab_playlist_id;
extern Playlist menu_tab_playlist;
/* settings.c */
extern const PluginPreferences gtkui_prefs;
......@@ -44,7 +45,7 @@ void show_hide_infoarea ();
void show_hide_infoarea_vis ();
void show_hide_statusbar ();
void popup_menu_rclick (unsigned button, uint32_t time);
void popup_menu_tab (unsigned button, uint32_t time, int playlist);
void popup_menu_tab (unsigned button, uint32_t time, Playlist playlist);
void activate_search_tool ();
void activate_playlist_manager ();
void update_step_size ();
......
......@@ -22,6 +22,7 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#define AUD_GLIB_INTEGRATION
#include <libaudcore/i18n.h>
#include <libaudcore/runtime.h>
#include <libaudcore/plugins.h>
......@@ -195,9 +196,8 @@ static GtkWidget * vbox_new (GtkWidget * widget, const char * name)
widget);
GtkWidget * label = gtk_label_new (nullptr);
char * markup = g_markup_printf_escaped ("<small><b>%s</b></small>", name);
CharPtr markup (g_markup_printf_escaped ("<small><b>%s</b></small>", name));
gtk_label_set_markup ((GtkLabel *) label, markup);
g_free (markup);
gtk_misc_set_alignment ((GtkMisc *) label, 0, 0);
gtk_container_add ((GtkContainer *) ebox, label);
......@@ -563,7 +563,7 @@ void layout_save ()
Item * item = (Item *) node->data;
g_return_if_fail (item && item->name);
char key[16], value[64];
char key[32], value[64];
snprintf (key, sizeof key, "item%d_name", i);
aud_set_str ("gtkui-layout", key, item->name);
......@@ -590,7 +590,7 @@ void layout_load ()
for (int i = 0; i < count; i ++)
{
char key[16];
char key[32];
snprintf (key, sizeof key, "item%d_name", i);
String name = aud_get_str ("gtkui-layout", key);
......
#include "../ui-common/menu-ops.cc"
#include "../ui-common/menu-ops-gtk.cc"
......@@ -32,7 +32,6 @@
#include <libaudgui/menu.h>
#include "gtkui.h"
#include "playlist_util.h"
#include "ui_playlist_notebook.h"
#include "ui_playlist_widget.h"
......@@ -45,7 +44,7 @@
#define SHIFT_CTRL (GdkModifierType) (SHIFT | CTRL)
#define NONE 0, (GdkModifierType) 0
int menu_tab_playlist_id = -1; /* should really be stored in the menu somehow */
Playlist menu_tab_playlist; /* should really be stored in the menu somehow */
static void open_files () { audgui_run_filebrowser (true); }
static void open_url () { audgui_show_add_url_window (true); }
......@@ -56,42 +55,26 @@ static void configure_effects () { audgui_show_prefs_for_plugin_type (PluginType
static void configure_output () { audgui_show_prefs_for_plugin_type (PluginType::Output); }
static void configure_visualizations () { audgui_show_prefs_for_plugin_type (PluginType::Vis); }
static void pl_rename () { start_rename_playlist (aud_playlist_get_active ()); }
static void pl_close () { audgui_confirm_playlist_delete (aud_playlist_get_active ()); }
static void pl_rename () { start_rename_playlist (Playlist::active_playlist ()); }
static void pl_close () { audgui_confirm_playlist_delete (Playlist::active_playlist ()); }
static void pl_tab_play ()
{
int playlist = aud_playlist_by_unique_id (menu_tab_playlist_id);
if (playlist >= 0)
aud_playlist_play (playlist);
}
static void pl_tab_play () { menu_tab_playlist.start_playback (); }
static void pl_tab_rename ()
{
int playlist = aud_playlist_by_unique_id (menu_tab_playlist_id);
if (playlist >= 0)
start_rename_playlist (playlist);
if (menu_tab_playlist.exists ())
start_rename_playlist (menu_tab_playlist);
}
static void pl_tab_close ()
{
int playlist = aud_playlist_by_unique_id (menu_tab_playlist_id);
if (playlist >= 0)
audgui_confirm_playlist_delete (playlist);
if (menu_tab_playlist.exists ())
audgui_confirm_playlist_delete (menu_tab_playlist);
}
static GtkWidget * get_services_main () { return audgui_get_plugin_menu (AudMenuID::Main); }
static GtkWidget * get_services_pl () { return audgui_get_plugin_menu (AudMenuID::Playlist); }
static void toggle_record ()
{
if (! aud_drct_enable_record (aud_get_bool ("gtkui", "record")))
{
aud_set_bool ("gtkui", "record", aud_drct_get_record_enabled ());
hook_call ("gtkui set record", nullptr);
}
}
static const AudguiMenuItem file_items[] = {
MenuCommand (N_("_Open Files ..."), "document-open", 'o', CTRL, open_files),
MenuCommand (N_("Open _URL ..."), "folder-remote", 'l', CTRL, open_url),
......@@ -144,6 +127,7 @@ static const AudguiMenuItem sort_items[] = {
MenuCommand (N_("By _Length"), nullptr, NONE, sort_length),
MenuCommand (N_("By _File Path"), nullptr, NONE, sort_path),
MenuCommand (N_("By _Custom Title"), nullptr, NONE, sort_custom_title),
MenuCommand (N_("By C_omment"), nullptr, NONE, sort_comment),
MenuSep (),
MenuCommand (N_("R_everse Order"), "view-sort-descending", NONE, sort_reverse),
MenuCommand (N_("_Random Order"), nullptr, NONE, sort_random)
......@@ -160,6 +144,7 @@ static const AudguiMenuItem sort_sel_items[] = {
MenuCommand (N_("By _Length"), nullptr, NONE, sort_sel_length),
MenuCommand (N_("By _File Path"), nullptr, NONE, sort_sel_path),
MenuCommand (N_("By _Custom Title"), nullptr, NONE, sort_sel_custom_title),
MenuCommand (N_("By C_omment"), nullptr, NONE, sort_sel_comment),