audacious-dumb-0.82/0000755000000000000000000000000012063567001013043 5ustar rootrootaudacious-dumb-0.82/ChangeLog0000644000000000000000000001676712013141414014625 0ustar rootrootChangeLog: v0.82 - Replaced gtk_hbox_new() and gtk_vbox_new() with gtk_box_new() v0.81 - Removed Gtk+-2 support (no longer supported by the core) (gtk_vbox_new/gtk_hbox_new need to be ported to gtk_box_new) - Removed gtk-compat.h include and replaced GDK_Escape with GDK_KEY_Escape - Implement preferences API changes from core - Remove no longer present buffer_playing and close_audio calls WARNING: 0.81 Requires 3.3 or later v0.80 - Drop the custom tuple formatter since it's no longer supported in the core. Offer a more simple optional format "Filename (Real Mod Title)" - use tuple_set_xxx() functions for tuple handing - Window title now contains the file name and tracker format information - use g_convert() to UTF-8 for the song message WARNING: 0.80 Requires 3.2.1 or later v0.74 - Change required version to 3.1 v0.73 - Added config options for the custom title settings - Fixed Makefile Audacious version check v0.72 - Escape key will now close the song info window v0.71 - Switch to new config API (replacing old configdb.h) WARNING: 0.71 requires Audacious 3.1-alpha1 v0.70 - Switch preferences window from glade to audacious prefs style - Re-implemented the file info box using raw Gtk+ C code - Remove all remaining Glade files WARNING: 0.70 requires Audacious 3.0 v0.66 - Include audacious/gtk-compat.h in audacious.c - Handle return values from vfs_xxxx() functions - Use new AUD_INPUT_PLUGIN() function to initialize the plugin v0.65 - Implement recent input API changes (play, stop, pause, seek) - Remove deprecated plugin function get_song_tuple - Merge __duh_probe_for_tuple and duh_probe_for_tuple - Remove pointless "CC ?= gcc" from Makefile v0.64 - Merged play_loop() into play_file(). Separation was only needed for in-plugin threading - Switched from play_file to play API function - include configdb.h and change ConfigDb to mcs_handle_t - Removed aud_ prefix from vfs functions - Use VFS handle in play_file instead of NULL, so it no longer causes an additional vfs_fopen - Added the LDFLAGS environment variable to the Makefile - Define fmts[] as static const. WARNING: 0.64 requires Audacious 2.4 v0.63 - Renamed the plugin file from libdumb.so to dumb.so - Replaced the old includes with the new ones - Removed obsolete seek() function - Changed the about dialog to use the new GUI functions - Removed sampling rates below 22kHz and added 192khz for insane people - No longer include output.h (no idea why it was included) v0.62 - Added a patch from John Lindgren Which fixes a 100% CPU loop freeze of Audacious with ALSA ALSA is the first plugin which has support for gap less playback. Thats why it behaves a bit different and more picky. v0.61 - Minor code cleanups and sanity v0.60 - Ported to new Audacious 2.2+ input plugin API which means: * Removed threading from the plugin * Changed stop, pause and seek functions * Replaced all set title and lenght functions with set tuple * Lots of minor stuff to make it work again WARNING: 0.60 requires at least Audacious 2.2 v0.57 - Added a mutex for the DUMB loader because at least the reading function seems not to be thread safe. v0.56 - Fix formater to fix empty titles. v0.55 - Renamed all vfs_* functions to aud_vfs_*. - Removed the inclusion of audacious/vfs.h. - Renamed bmp_cfg_db_* to aud_cfg_db_*. - Renamed tuple_* to aud_tuple_*. - Replaced set_info with playback->set_params. - Replace produce_audio() with playback->pass_audio(). v0.54 - Switch to Plugin API 6 style tuple_associate functions. - Use audacious_info_dialog for about dialog. v0.53 - Use SIMPLE_INPUT_PLUGIN for plugin declaration. - Using new set_pb_ready call to declare readyness after play init. - Switched to new Tuplez system. - Remove obsolete is_our_file(). WARNING: 0.53+ requires a hg core from the 10. Aug or later. v0.52 - On EOF, the decode_loop() now waits for the buffers to empty and then clears playback->playing itself, because the core doesn't do it anymore. v0.51 - Use vfs_fsize() to determine the filesize. - Unescape url encoded filename for tuple (file_name, file_path). - Make plugin definition more human readable. - Add support for probe_for_tuple(), a combined is_our_file_from_vfs() and get_song_tuple() - Remove cleanup call dumb_exit, because there's no such function. - Remove dumb_register_stdfiles() from init. We don't let the DUMB library open files directly and only call dumbfile_open_memory. - Define ok and cancel functions the same way in duh_configure(). - Cleanup of and added robustness to duh_universal_load_vfs() - Report failures with g_message() or g_warning(). - Support new threading model of plugin API 3. (This will require a HG player core from 23. Jul 2007 or later) v0.50 - Switch to Audacious plugin2 API WARNING: 0.5x versions require the plugin2 API in 1.4 or recent hg v0.43 - Add mseek() support. v0.42 - Use a bitmask to define what types should be tried in the duh_universal_load_vfs() function. v0.41 - Using VFS functions to open all sound files now. - Cleaned up the universal loading function. v0.40 - Switched to InputPlayback API which breaks support for Audacious versions older than 1.3 (final). WARNING: 0.4x versions require Audacious 1.3-alpha4 or later. v0.31 - Added is_our_file_from_vfs() using VFS functions. v0.30 - Added the extension list (fmts) for Audacious 1.3+ v0.25 - Fixed -Wall warnings from gcc 4.1.1 v0.24 - Don't include the filename in "file_path". - Some -Wall cleanups (but gcc 4.1.1 brought in new ones). v0.23 - Convert title strings from CP850 to UTF8 before returning. All my S3M/IT/XM work with this and MOD seems to be 7bit ASCII clean, so it doesn't cause any harm. - More internal cleanup to unify tuple and other titleinfo. v0.22 - Internal cleanup. v0.21 - Added the new get_tuple_info() function for SVN Audacious WARNING: the 0.2x versions require Audacious 1.1 or later. v0.11 - Makefile simplification (Added local include and lib dir) v0.10 - Mostly cosmetic cleanups in the play_loop. v0.9 - Waiting for buffer before doing the next produce_audio(). This makes the pause workaround obsolete. v0.8 - Added workaround when receiving stop signal while paused. - using g_thread functions for all threading calls now. v0.7 - Added prefs option for output frequency (default: 44100Hz). - Raised maximum mixing channels of DUMB from 64 to 256. v0.6 - Added prefs GUI for the Amiga sound disable option. - Added about window. v0.5 - Using Audacious produce_audio() for output. - Dirty and hidden gconf option to disable Amiga Protracker MODs (only checked at launch time / clean solution would be a prefs GUI) v0.4 - Moved the GTK1 font definition over to GTK2 pango. - Close button has now a modern "X" :) v0.3 - Added file_info_box (mostly from CVS xmms-dumb) - Fixed broke result of libglade-convert v0.2 - Cut'n'Paste newer get_title() from xmms-dumb CVS version to display the real songname in the playlist. v0.1 - Replaced "bmp" strings with "audacious". - Minor Makefile changes (use install, add PIC, handle DESTDIR). - replaced bmp_usleep() with g_usleep(). audacious-dumb-0.82/Makefile0000644000000000000000000000551512013141414014500 0ustar rootrootPLUGIN_FILE := dumb.so PACKAGE := audacious-dumb AUDMINVER := 3.3 CFLAGS ?= -O2 -pipe CFLAGS += -Wall -fPIC -DPIC -I/usr/local/include INSTALL_DIR := $(shell pkg-config audacious --variable=input_plugin_dir) INSTALL_DIR_HOME := ~/.local/share/audacious/Plugins/Input AUDPREFIX := $(shell pkg-config audacious --variable=exec_prefix) AUDBIN := $(AUDPREFIX)/bin/audacious GTKCFLAGS := $(shell pkg-config gtk+-3.0 --cflags) AUDACIOUSCFLAGS := $(shell pkg-config 'audacious >= $(AUDMINVER)' --cflags || echo "old") ifeq ($(AUDACIOUSCFLAGS),old) version: @echo "Your Audacious version is too old. Version $(AUDMINVER) or later is required." @false else CFLAGS += $(AUDACIOUSCFLAGS) $(GTKCFLAGS) -DPACKAGE=\"$(PACKAGE)\" endif DUMBLIBS := -ldumb -L/usr/local/lib AUDACIOUSLIBS := $(shell pkg-config audacious --libs) GTKLIBS += $(shell pkg-config gtk+-3.0 --libs) SOURCES := audacious-dumb.c OBJDIR := obj OBJECTS := $(SOURCES:%.c=$(OBJDIR)/%.o) all: $(PLUGIN_FILE) @echo @echo "The plug-in has been compiled. Run one of the following:" @echo "make install - for global (root) installation to $(INSTALL_DIR)" @echo "make install-home - for installation to home directory $(INSTALL_DIR_HOME)" $(PLUGIN_FILE): $(OBJECTS) $(CC) -shared $(LDFLAGS) -o $@ $^ $(DUMBLIBS) $(AUDACIOUSLIBS) $(GTKLIBS) $(OBJDIR)/%.o: %.c $(CC) -o $@ $(CFLAGS) -c $< install: all install -d $(DESTDIR)$(INSTALL_DIR) install -m 0755 $(PLUGIN_FILE) $(DESTDIR)$(INSTALL_DIR) @echo @echo "The plug-in has been installed." @echo "It is recommended you disable the Modplug plug-in" @echo "and any others that support the IT, XM, S3M or MOD formats." @echo "Enjoy!" install-home: all install -d $(INSTALL_DIR_HOME) install -m 0755 $(PLUGIN_FILE) $(INSTALL_DIR_HOME) @echo @echo "The plug-in has been installed." @echo "It is recommended you disable the Modplug plug-in" @echo "and any others that support the IT, XM, S3M or MOD formats." @echo "Enjoy!" uninstall: rm -f $(DESTDIR)$(INSTALL_DIR)/$(PLUGIN_FILE) @echo @echo "The plug-in has been uninstalled." uninstall-home: rm -f $(INSTALL_DIR_HOME)/$(PLUGIN_FILE) @echo @echo "The plug-in has been uninstalled." clean: rm -f $(OBJECTS) distclean: clean rm -f $(PLUGIN_FILE) *~ DEPCC := echo "int main() { return 0; };" | $(CC) -x c -o /dev/null - depcheck: @echo -n "dumb.h ... " @$(DEPCC) -include dumb.h && echo "found." || exit 1 @echo -n "libdumb.so ... " @$(DEPCC) $(DUMBLIBS) -lm && echo "found." || exit 1 @echo -n "Audacious ... " @pkg-config audacious --exists || { echo -n "pkg-config audacious not found: " && exit 1; } @pkg-config audacious --atleast-version=$(AUDMINVER) || { echo -n "version $(AUDMINVER) or later not found." && exit 1; } @$(DEPCC) $(CFLAGS) $(AUDACIOUSLIBS) -include audacious/plugin.h && echo "`pkg-config audacious --modversion` found." || exit 1 @echo "Everything seems to be ok." audacious-dumb-0.82/audacious-dumb.c0000644000000000000000000005260112013141414016104 0ustar rootroot/* Audacious-DUMB Plug-in to enable audacious to use DUMB for IT/XM/S3M/MOD files * Copyright (C) 2006-2011 Christian Birchinger * Audacious port based on previous plugins for XMMS and BMP * Copyright (C) 2002-2003 Ben Davis * Incorporates code from the wav plug-in, * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies * * 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 "audacious-dumb.h" #include #include #include DuhFile *duh_file = NULL; static GMutex *dumblock; dumb_config_t dumb_config; dumb_config_t dumb_config_gui; static GMutex *control_mutex; static GCond *control_cond; static gboolean stop_flag = FALSE; static const gchar *fmts[] = { "mod", "s3m", "it", "xm", "duh", NULL }; static const gchar * const DUMB_defaults[] = { "disable_amiga_mods", "FALSE", "output_frequency", "44100", "use_custom_title", "TRUE", NULL}; AUD_INPUT_PLUGIN ( .name = N_("DUMB Plugin " VERSION), .domain = PACKAGE, .init = duh_init, .cleanup = duh_cleanup, .about = duh_about, .prefs = &preferences, .play = play_start, .stop = stop, .pause = duh_pause, .file_info_box = file_info_box, .is_our_file_from_vfs = is_our_file_from_vfs, .extensions = fmts, .mseek = mseek, .probe_for_tuple = duh_probe_for_tuple, .priority = 0 /* Would be nice to be above Modplug but minus values don't work */ ) static gboolean duh_init(void) { aud_config_set_defaults ("DUMB", DUMB_defaults); memset(&dumb_config, 0, sizeof(dumb_config)); dumb_config.disable_amiga_mods = aud_get_bool("DUMB", "disable_amiga_mods"); dumb_config.output_frequency = aud_get_int("DUMB", "output_frequency"); if (dumb_config.output_frequency < 22050 || dumb_config.output_frequency > 192000) { dumb_config.output_frequency = 44100; aud_set_int ("DUMB", "output_frequency", dumb_config.output_frequency); } dumb_config.use_custom_title = aud_get_bool("DUMB", "use_custom_title"); /* dumb_register_stdfiles(); */ /* Seems only needed when opening files with dumb directly * * and not when VFS puts them to a memory location first */ dumb_it_max_to_mix = 256; dumblock = g_mutex_new(); control_mutex = g_mutex_new(); control_cond = g_cond_new(); return TRUE; } static void duh_cleanup(void) { g_mutex_free(dumblock); g_mutex_free(control_mutex); g_cond_free(control_cond); } static int is_our_file_from_vfs(const gchar *filename, VFSFile *file) { gchar magic[4]; const gchar *ext; g_return_val_if_fail(filename != NULL, FALSE); g_return_val_if_fail(file != NULL, FALSE); if (vfs_fread(magic, 1, 4, file) != sizeof magic) return FALSE; if (!memcmp(magic, XM_MAGIC, 4)) return TRUE; if (!memcmp(magic, IT_MAGIC, 4)) return TRUE; if (vfs_fseek(file, 44, SEEK_SET)) return FALSE; if (vfs_fread(magic, 1, 4, file) != sizeof magic) return FALSE; if (!memcmp(magic, S3M_MAGIC, 4)) return TRUE; if (vfs_fseek(file, 1080, SEEK_SET)) return FALSE; if (vfs_fread(magic, 1, 4, file) != sizeof magic) return FALSE; if (!memcmp(magic, MOD_MAGIC_FASTTRACKER6, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_FASTTRACKER8, 4)) return TRUE; /* printf("Is %s our file?\n", filename); if (disable_amiga_mods) { printf("Amiga support is disabled\n"); } */ if (!dumb_config.disable_amiga_mods) { if (!memcmp(magic, MOD_MAGIC_PROTRACKER4, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_PROTRACKER4X, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_NOISETRACKER, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_STARTRACKER4, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_STARTRACKER8, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_STARTRACKER4X, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_STARTRACKER8X, 4)) return TRUE; if (!memcmp(magic, MOD_MAGIC_FASTTRACKER4, 4)) return TRUE; } ext = strrchr(filename, '.'); if (ext) { if (!strcasecmp(ext, ".duh")) return TRUE; if (!strcasecmp(ext, ".it")) return TRUE; if (!strcasecmp(ext, ".xm")) return TRUE; if (!strcasecmp(ext, ".s3m")) return TRUE; if (!dumb_config.disable_amiga_mods) { if (!strcasecmp(ext, ".mod")) return TRUE; } } return FALSE; } static gint duh_universal_load_vfs(DUH **duh, const char *filename, VFSFile *extfd, const short testmask) { DUMBFILE *filedumb; gint ext_index = -1; VFSFile *fd = NULL; off_t filesize, readsize; gchar *filemap; *duh = NULL; if (extfd) fd = extfd; else { fd = vfs_fopen(filename, "rb"); g_return_val_if_fail(fd != NULL, -1); } filesize = vfs_fsize(fd); g_return_val_if_fail(filesize > 0, -1); filemap = malloc(filesize); g_return_val_if_fail(filemap != NULL, -1); readsize = vfs_fread(filemap, 1, filesize, fd); if (!extfd) vfs_fclose(fd); if (readsize == 0) { g_warning("audacious-dumb: Couldn't read from %s", filename); free(filemap); filemap = NULL; return -1; } /* The close and re-opening after reach read attempt is needed. Quote from the documentation: WARNING: The behaviour of these functions are undefined if you pass a DUMBFILE from which data have already been read; they are likely not to work. This oversight will be fixed in future releases. */ int count, total_count = sizeof(uniread) / sizeof(uniread_struct_t); for (count = 0; count < total_count; count++) { if (uniread[count].testmask & testmask) { g_mutex_lock(dumblock); filedumb = dumbfile_open_memory(filemap, readsize); *duh = uniread[count].read(filedumb); dumbfile_close(filedumb); g_mutex_unlock(dumblock); if (*duh) { ext_index = count; break; } } } free(filemap); filemap = NULL; return ext_index; } static Tuple *get_tuple_info_from_duh(DUH *duh, const gchar *filename) { const gchar *mod_title_raw; gchar *mod_title; g_return_val_if_fail(filename != NULL, NULL); g_return_val_if_fail(duh != NULL, NULL); Tuple *tuple = tuple_new_from_filename(filename); tuple_set_str(tuple, FIELD_QUALITY, NULL, "sequenced"); tuple_set_int(tuple, FIELD_LENGTH, NULL, (int)(duh_get_length(duh) * 1000LL >> 16) ); mod_title_raw = duh_get_tag(duh, "TITLE"); if (mod_title_raw) { /* DOS (CP850) all my XM IT and S3M use this (MODs should be 7bit ASCII) */ mod_title = g_convert(mod_title_raw, -1, "UTF-8", "CP850", NULL, NULL, NULL); /* Raw copy but GTK2 doesn't like none-UTF8 stuff mod_title = g_strdup(mod_title_raw); */ g_strstrip(mod_title); if (mod_title[0]) { if (dumb_config.use_custom_title) { gchar *custom_title, *file_title; const char *basename, *basename_ext; uri_parse(filename, &basename, &basename_ext, NULL, NULL); file_title = g_strndup(basename, basename_ext - basename); custom_title = g_strdup_printf("%s (%s)", file_title, mod_title); tuple_set_str(tuple, FIELD_TITLE, NULL, custom_title ); g_free(custom_title); g_free(file_title); } else tuple_set_str(tuple, FIELD_TITLE, NULL, mod_title); } g_free(mod_title); mod_title = NULL; } mod_title_raw = NULL; return tuple; } static Tuple *duh_probe_for_tuple(const gchar *filename, VFSFile *fd) { Tuple *input = NULL; DUH *duh = NULL; int ext_index; g_return_val_if_fail(filename != NULL, NULL); g_return_val_if_fail(fd != NULL, NULL); if (!is_our_file_from_vfs(filename, fd)) return NULL; vfs_rewind(fd); ext_index = duh_universal_load_vfs(&duh, filename, fd, UNIREAD_ALL); if (ext_index == -1) return NULL; /* Return empty Tuple if module was not loadable */ input = get_tuple_info_from_duh(duh, filename); tuple_set_str(input, FIELD_CODEC, NULL, uniread[ext_index].description); return input; } static void install_callbacks(DUH_SIGRENDERER *sr) { DUMB_IT_SIGRENDERER *itsr = duh_get_it_sigrenderer(sr); dumb_it_set_loop_callback(itsr, &dumb_it_callback_terminate, NULL); dumb_it_set_xm_speed_zero_callback(itsr, &dumb_it_callback_terminate, NULL); } static gboolean play_start(InputPlayback *playback, const gchar *filename, VFSFile *file, gint start_time, gint stop_time, gboolean pause) { Tuple *tuple; int rate; const int buffer_size = 16 * 1024; char *buffer; int actual_read, render_size; float delta, volume; if (file == NULL) return FALSE; duh_file = g_malloc(sizeof (DuhFile)); memset(duh_file, 0, sizeof (DuhFile)); duh_universal_load_vfs(&duh_file->duh, filename, file, UNIREAD_ALL); if (!duh_file->duh) { g_warning("audacious-dumb: Unable to play %s", filename); g_free(duh_file); duh_file = NULL; return FALSE; } if ((duh_file->file = duh_start_sigrenderer(duh_file->duh, 0, 2, 0))) { install_callbacks(duh_file->file); duh_file->channels = 2; duh_file->samples_per_sec = dumb_config.output_frequency; duh_file->bits_per_sample = 16; if (playback->output->open_audio((duh_file->bits_per_sample == 16) ? FMT_S16_LE : FMT_U8, duh_file->samples_per_sec, duh_file->channels) == 0) { duh_end_sigrenderer(duh_file->file); unload_duh(duh_file->duh); g_free(duh_file); duh_file = NULL; return FALSE; } if (pause) playback->output->pause(TRUE); rate = duh_file->samples_per_sec * duh_file->channels * (duh_file->bits_per_sample / 8); tuple = get_tuple_info_from_duh(duh_file->duh, filename); playback->set_tuple(playback, tuple); playback->set_params(playback, 8 * rate, duh_file->samples_per_sec, duh_file->channels); g_mutex_lock(control_mutex); duh_file->seek_to = (start_time > 0) ? start_time : -1; stop_flag = FALSE; playback->set_pb_ready(playback); g_mutex_unlock(control_mutex); /* Values taken from the dumbout.c example */ delta = 65536.0f / duh_file->samples_per_sec; volume = 1.0f; buffer = g_malloc(buffer_size); /* The docs say output buffer equals render_size * channels (2) * but it seems not enough so we're keeping the old calculated value (4) */ render_size = buffer_size / ((duh_file->bits_per_sample / 8) * duh_file->channels); while (!stop_flag) { g_mutex_lock(control_mutex); if (duh_file->seek_to != -1) { duh_end_sigrenderer(duh_file->file); duh_file->file = duh_start_sigrenderer(duh_file->duh, 0, duh_file->channels, (unsigned long)((gint64)duh_file->seek_to << 16) / 1000L); install_callbacks(duh_file->file); playback->output->flush(duh_file->seek_to); duh_file->seek_to = -1; g_cond_signal(control_cond); } g_mutex_unlock(control_mutex); if (!duh_file->eof) { actual_read = duh_render(duh_file->file, duh_file->bits_per_sample, 0, volume, delta, render_size, buffer); actual_read *= (duh_file->bits_per_sample / 8) * duh_file->channels; if (actual_read == 0) duh_file->eof = TRUE; else { if (!stop_flag && duh_file->seek_to == -1) playback->output->write_audio(buffer, actual_read); } } else break; } g_mutex_lock(control_mutex); stop_flag = TRUE; duh_file->eof = TRUE; g_mutex_unlock(control_mutex); duh_end_sigrenderer(duh_file->file); unload_duh(duh_file->duh); g_free(buffer); g_free(duh_file); duh_file = NULL; return TRUE; } return FALSE; } static void stop(InputPlayback *playback) { g_mutex_lock(control_mutex); if (!stop_flag) { stop_flag = TRUE; playback->output->abort_write(); g_cond_signal(control_cond); } g_mutex_unlock (control_mutex); } static void duh_pause(InputPlayback *playback, gboolean pause) { g_mutex_lock(control_mutex); if (!stop_flag) playback->output->pause(pause); g_mutex_unlock(control_mutex); } static void mseek(InputPlayback *playback, gint time) { g_mutex_lock(control_mutex); if (!stop_flag) { duh_file->seek_to = time; duh_file->eof = FALSE; g_cond_signal(control_cond); g_cond_wait(control_cond, control_mutex); } g_mutex_unlock(control_mutex); } static void duh_about(void) { static GtkWidget *about; gchar *about_text; if (about) return; about_text = g_strjoin("", _("DUMB Input Plugin "), VERSION, _("\n" "by Christian Birchinger \n" "\n" "Based on the original XMMS plugin by Ben Davis\n" "and the BMP port by Michael Doering\n" "\n" "Built with DUMB version "), DUMB_VERSION_STR, NULL); audgui_simple_message (& about, GTK_MESSAGE_INFO, "About DUMB Plugin", about_text); g_free(about_text); } /* Preferences Window */ static void configure_init(void) { memcpy(&dumb_config_gui, &dumb_config, sizeof(dumb_config_gui)); } static void configure_cleanup(void) { } static void configure_apply() { memcpy(&dumb_config, &dumb_config_gui, sizeof(dumb_config)); aud_set_bool("DUMB", "disable_amiga_mods", dumb_config.disable_amiga_mods); aud_set_int("DUMB", "output_frequency", dumb_config.output_frequency); aud_set_bool("DUMB", "use_custom_title", dumb_config.use_custom_title); } static ComboBoxElements frequency_elements[] = { { GINT_TO_POINTER(22050), "22050" }, { GINT_TO_POINTER(44100), "44100" }, { GINT_TO_POINTER(48000), "48000" }, { GINT_TO_POINTER(64000), "64000" }, { GINT_TO_POINTER(96000), "96000" }, { GINT_TO_POINTER(192000), "192000" }, }; static PreferencesWidget settings[] = { {WIDGET_CHK_BTN, N_("Disable Amiga Support"), .cfg_type = VALUE_BOOLEAN, .cfg = &dumb_config_gui.disable_amiga_mods, .tooltip = N_("Use this if you have a better decoder for 4 " "channel Amiga MOD files (like UADE)"), }, {WIDGET_COMBO_BOX, N_("Frequency:"), .cfg_type = VALUE_INT, .cfg = &dumb_config_gui.output_frequency, .data = {.combo = {frequency_elements, G_N_ELEMENTS (frequency_elements)}}, .tooltip = N_("If you use dmix, pulseaudio or a similar stream " "mixer, choose the same frequency here to avoid " "useless resampling, otherwise pick whatever quality " "you like"), }, {WIDGET_SEPARATOR, .data = {.separator = {TRUE}}}, {WIDGET_CHK_BTN, N_("Use \"Filename (Real Mod Title)\" as title"), .cfg_type = VALUE_BOOLEAN, .cfg = &dumb_config_gui.use_custom_title, .tooltip = N_("Recommended because many MOD titles are " "stylized, contain trailing or leading spaces or even " "ASCII art which is very bad for playlist sorting"), }, {WIDGET_SEPARATOR, .data = {.separator = {TRUE}}}, }; static PluginPreferences preferences = { .widgets = settings, .n_widgets = G_N_ELEMENTS(settings), .init = configure_init, .apply = configure_apply, .cleanup = configure_cleanup, }; static void close_window(GtkWidget *widget, gpointer win) { gtk_widget_destroy(GTK_WIDGET(win)); } static gboolean escape_close(GtkWidget *widget, GdkEventKey *event, gpointer data) { if (event->keyval == GDK_KEY_Escape) { gtk_widget_destroy(GTK_WIDGET(widget)); return TRUE; } return FALSE; } static void file_info_box(const gchar *filename) { GtkWidget *window; GtkWidget *window_vbox; GtkWidget *notebook; GtkWidget *label1, *label2, *label3; GtkWidget *child1, *child2, *child3; GtkWidget *child1_scroll, *child2_scroll, *child3_scroll; GtkWidget *close_hbox, *close_button; GtkTextIter child1_iter; GtkTextBuffer *child1_buffer; GtkTreeIter child2_iter, child3_iter; GtkListStore *child2_store, *child3_store; PangoFontDescription *font_desc; const gchar *message, *basename; gchar *msg_clean, *window_title; int i, n, ext_index; DUMB_IT_SIGDATA *sd; DUH *duh; ext_index = duh_universal_load_vfs(&duh, filename, NULL, UNIREAD_MOD); if (ext_index == -1) return; sd = duh_get_it_sigdata(duh); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); uri_parse(filename, &basename, NULL, NULL, NULL); window_title = g_strdup_printf("Track Information - %s (%s)", basename, uniread[ext_index].description); gtk_window_set_title (GTK_WINDOW (window), window_title); g_free(window_title); gtk_container_set_border_width (GTK_CONTAINER (window), 10); gtk_widget_set_size_request (window, 640, 480); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(close_window), window); g_signal_connect(G_OBJECT(window), "key-press-event", G_CALLBACK(escape_close), NULL); window_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); gtk_container_add (GTK_CONTAINER (window), window_vbox); font_desc = pango_font_description_from_string ("monospace"); /* ========= content child widgets for the 3 tabs =========*/ notebook = gtk_notebook_new(); gtk_box_pack_start(GTK_BOX(window_vbox), notebook, TRUE, TRUE, 4); /* --- tab 1 content (text view) --- */ message = (gchar*) dumb_it_sd_get_song_message(sd); if (message) { child1_scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(child1_scroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); child1 = gtk_text_view_new(); gtk_text_view_set_editable(GTK_TEXT_VIEW(child1), FALSE); gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(child1), FALSE); gtk_container_add(GTK_CONTAINER(child1_scroll), child1); child1_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(child1) ); gtk_text_buffer_get_iter_at_offset(child1_buffer, &child1_iter, 0); gtk_text_buffer_create_tag(child1_buffer, "lmarg", "left_margin", 5, NULL); /* add message textview content */ /* msg_clean = g_strdup(message); */ msg_clean = g_convert(message, -1, "UTF-8", "CP850", NULL, NULL, NULL); for (i = 0; msg_clean[i]; i++) if (msg_clean[i] == '\r') msg_clean[i] = '\n'; gtk_text_buffer_insert_with_tags_by_name(child1_buffer, &child1_iter, msg_clean, -1, "lmarg", NULL); g_free(msg_clean); gtk_widget_modify_font(child1, font_desc); label1 = gtk_label_new("Message"); gtk_notebook_append_page(GTK_NOTEBOOK (notebook), child1_scroll, label1); } /* --- tab 2 content (tree view) --- */ n = dumb_it_sd_get_n_samples(sd); if (n) { child2_scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(child2_scroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); child2 = gtk_tree_view_new(); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(child2), TRUE); gtk_container_add(GTK_CONTAINER(child2_scroll), child2); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child2), -1, "#", gtk_cell_renderer_text_new(), "text", COL_N, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child2), -1, "Sample Name", gtk_cell_renderer_text_new(), "text", COL_NAME, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child2), -1, "File Name", gtk_cell_renderer_text_new(), "text", COL_FILE, NULL); child2_store = gtk_list_store_new(NUM_COLS, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); for (i = 0; i < n; i++) { gtk_list_store_append(child2_store, &child2_iter); gtk_list_store_set(child2_store, &child2_iter, COL_N, i+1, COL_NAME, (gchar*) dumb_it_sd_get_sample_name(sd, i), COL_FILE, (gchar*) dumb_it_sd_get_sample_filename(sd, i), -1); } gtk_tree_view_set_model(GTK_TREE_VIEW(child2), GTK_TREE_MODEL(child2_store)); gtk_widget_modify_font(child2, font_desc); label2 = gtk_label_new("Samples"); gtk_notebook_append_page(GTK_NOTEBOOK (notebook), child2_scroll, label2); } /* --- tab 3 content (tree view) --- */ n = dumb_it_sd_get_n_instruments(sd); if (n) { child3_scroll = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(child3_scroll), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS ); child3 = gtk_tree_view_new(); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(child3), TRUE); gtk_container_add(GTK_CONTAINER(child3_scroll), child3); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child3), -1, "#", gtk_cell_renderer_text_new(), "text", COL_N, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child3), -1, "Instrument Name", gtk_cell_renderer_text_new(), "text", COL_NAME, NULL); gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW(child3), -1, "File Name", gtk_cell_renderer_text_new(), "text", COL_FILE, NULL); child3_store = gtk_list_store_new(NUM_COLS, G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING); for (i = 0; i < n; i++) { gtk_list_store_append(child3_store, &child3_iter); gtk_list_store_set(child3_store, &child3_iter, COL_N, i+1, COL_NAME, (gchar*) dumb_it_sd_get_instrument_name(sd, i), COL_FILE, (gchar*) dumb_it_sd_get_instrument_filename(sd, i), -1); } gtk_tree_view_set_model(GTK_TREE_VIEW(child3), GTK_TREE_MODEL(child3_store)); gtk_widget_modify_font(child3, font_desc); label3 = gtk_label_new("Instrument"); gtk_notebook_append_page(GTK_NOTEBOOK (notebook), child3_scroll, label3); } /* close button within hbox */ close_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); gtk_box_pack_end(GTK_BOX(close_hbox), close_button, FALSE, FALSE, 6); g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(close_window), window); gtk_box_pack_start(GTK_BOX(window_vbox), close_hbox, FALSE, FALSE, 2); /* */ if (duh) unload_duh(duh); gtk_widget_show_all(window); } audacious-dumb-0.82/README0000644000000000000000000000027212013141414013713 0ustar rootrootThis plugin is based on the original XMMS version by Ben Davis and the BMP port by Michael Doering. See: README-dumb-xmms and README-dumb-bmp Christian Birchinger audacious-dumb-0.82/obj/0000755000000000000000000000000012063566767013637 5ustar rootrootaudacious-dumb-0.82/README-dumb-bmp0000644000000000000000000000060112013141414015410 0ustar rootrootThis a quick and dirty port of the xmms dumb module player input plugin to beep-mediaplayer. Read README-dumb-xmms for further installation infos and features of the plugin. have fun, I won't maintain it. So you are on your own ;) Michael Doering Changelog: Nov 2004 mld/uade team dumb input plugin ported to beep-mediaplayer fixed lockup (null pointer bug) on filechange audacious-dumb-0.82/README-dumb-xmms0000644000000000000000000000475212013141414015631 0ustar rootrootDUMB-XMMS - Plug-in to enable XMMS to use DUMB for IT/XM/S3M/MOD files Copyright (C) 2002-2003 Ben Davis Incorporates code from the wav plug-in, Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies 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. --- First, get DUMB from http://dumb.sf.net/ . The following commands should compile and install it: make su -c 'make install' You will be prompted as to whether you want Allegro support; you can safely say no for this plug-in. See DUMB's docs for further information. Once DUMB is installed, change to this directory and run: make The plug-in will be built. When it has finished, you can install it system- wide by running: su -c 'make install' Or, if you only want to install into your home directory, for yourself, run: make install-home Run "make clean" to remove intermediate files. Run "make veryclean" to remove intermediate files and the plug-in (won't uninstall). If you ever need to uninstall the plug-in, use "su -c 'make uninstall'" or "make uninstall-home". Thanks to Funklord ( http://www.xlntfunk.com/ ) for figuring out how to compile the code and doing the first draft of the Makefile. --- This plug-in currently recognises files by their extension, which must be .it, .xm, .s3m or .mod. However, it will try all loaders on any files it recognises as its own, so files that have been renamed to have the wrong extension (grr) will not foil it. There are no dialogue boxes of any kind. Sorry. The plug-in crashes XMMS ever so occasionally when stopping a piece of music. I don't know why this is. It seems to happen after the plug-in's stop() function returns. If you feel like debugging for me, I shan't complain :) --- Ben Davis - entheh@users.sf.net audacious-dumb-0.82/COPYING0000644000000000000000000004310512013141414014070 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. audacious-dumb-0.82/audacious-dumb.h0000644000000000000000000001235512013141414016113 0ustar rootroot/* Audacious-DUMB Plug-in to enable audacious to use DUMB for IT/XM/S3M/MOD files * Copyright (C) 2006-2011 Christian Birchinger * Audacious port based on previous plugins for XMMS and BMP * Copyright (C) 2002-2003 Ben Davis * Incorporates code from the wav plug-in, * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies * * 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. */ #ifndef INC_DUMB_audacious_H #define INC_DUMB_audacious_H #include #if DUMB_VERSION < 903 #error You must get DUMB v0.9.3 or later. Prior versions do #error not have the thread safety required by this plug-in. #endif #define VERSION "0.82" #define VERSIONSTRING "DUMB Audio Plugin " VERSION #include #include #include #include #include #include #include #include #include #include extern InputPlugin duh_ip; typedef struct { DUH *duh; DUH_SIGRENDERER *file; short channels, bits_per_sample; long samples_per_sec; int seek_to; int eof; pid_t pid; } DuhFile; static gboolean duh_init(void); static void duh_cleanup(void); static int is_our_file_from_vfs(const gchar *filename, VFSFile *file); static gboolean play_start(InputPlayback *playback, const gchar *filename, VFSFile *file, gint start_time, gint stop_time, gboolean pause); static void stop(InputPlayback *data); static void mseek(InputPlayback *data, gint time); static void duh_pause(InputPlayback *data, gboolean p); static Tuple *duh_probe_for_tuple(const gchar *filename, VFSFile *fd); static void file_info_box(const gchar *filename); static void duh_about(void); static PluginPreferences preferences; /* duh_universal_load_vfs() */ #define UNIREAD_MOD (1 << 0) #define UNIREAD_DUH (1 << 1) #define UNIREAD_ALL (UNIREAD_MOD | UNIREAD_DUH) typedef DUH *(*uniread_func_t)(DUMBFILE *filedumb); typedef struct { const uniread_func_t read; const char *ext; const short testmask; const char *description; } uniread_struct_t; const uniread_struct_t uniread[] = { {read_duh, "duh", UNIREAD_DUH, "DUMB Tracker Module"}, {dumb_read_it, "it", UNIREAD_MOD, "ImpulseTracker Module"}, {dumb_read_xm, "xm", UNIREAD_MOD, "FastTracker Extended Module"}, {dumb_read_s3m, "s3m", UNIREAD_MOD, "ScreamTracker 3 Module"}, {dumb_read_mod, "mod", UNIREAD_MOD, "Sound/Noise/Protracker Module"} }; enum { COL_N = 0, COL_NAME, COL_FILE, NUM_COLS }; typedef struct { gboolean disable_amiga_mods; gint output_frequency; gboolean use_custom_title; } dumb_config_t; extern dumb_config_t dumb_config; /* Module files have their magic deep inside the file, at offset 1080; source: http://www.onicos.com/staff/iz/formats/mod.html and information by Michael Doering from UADE */ #define MOD_MAGIC_PROTRACKER4 (unsigned char [4]) { 0x4D, 0x2E, 0x4B, 0x2E } // "M.K." - Protracker 4 channel #define MOD_MAGIC_PROTRACKER4X (unsigned char [4]) { 0x4D, 0x21, 0x4B, 0x21 } // "M!K!" - Protracker 4 channel #define MOD_MAGIC_NOISETRACKER (unsigned char [4]) { 0x4D, 0x26, 0x4B, 0x21 } // "M&K!" - Noisetracker 1.3 by Kaktus & Mahoney #define MOD_MAGIC_STARTRACKER4 (unsigned char [4]) { 0x46, 0x4C, 0x54, 0x34 } // "FLT4" - Startracker 4 channel (Startrekker/AudioSculpture) #define MOD_MAGIC_STARTRACKER8 (unsigned char [4]) { 0x46, 0x4C, 0x54, 0x38 } // "FLT8" - Startracker 8 channel (Startrekker/AudioSculpture) #define MOD_MAGIC_STARTRACKER4X (unsigned char [4]) { 0x45, 0x58, 0x30, 0x34 } // "EX04" - Startracker 4 channel (Startrekker/AudioSculpture) #define MOD_MAGIC_STARTRACKER8X (unsigned char [4]) { 0x45, 0x58, 0x30, 0x38 } // "EX08" - Startracker 8 channel (Startrekker/AudioSculpture) #define MOD_MAGIC_FASTTRACKER4 (unsigned char [4]) { 0x34, 0x43, 0x48, 0x4E } // "4CHN" - Fasttracker 4 channel #define MOD_MAGIC_FASTTRACKER6 (unsigned char [4]) { 0x36, 0x43, 0x48, 0x4E } // "6CHN" - Fasttracker 6 channel #define MOD_MAGIC_FASTTRACKER8 (unsigned char [4]) { 0x38, 0x43, 0x48, 0x4E } // "8CHN" - Fasttracker 8 channel #define S3M_MAGIC (unsigned char [4]) { 0x53, 0x43, 0x52, 0x4D } /* This is the SCRM string at offset 44 to 47 in the S3M header */ /* These nicer formats have the magic bytes at the front of the file where they belong */ #define XM_MAGIC (unsigned char [4]) { 0x45, 0x78, 0x74, 0x65 } /* Exte(nded Module) */ #define IT_MAGIC (unsigned char [4]) { 0x49, 0x4D, 0x50, 0x4D } /* IMPM */ #endif /* INC_DUMB_audacious_H */