changeset 2542:7591d7534eb8

Automated merge with ssh://hg.atheme.org//hg/audacious-plugins
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 28 Apr 2008 18:24:46 +0300
parents 12d34c4303d7 (current diff) d137e1c827ba (diff)
children a4c855226874
files src/modplug/load_j2b.cxx src/modplug/modplug.h
diffstat 11 files changed, 14 insertions(+), 190 deletions(-) [+]
line wrap: on
line diff
--- a/src/modplug/Makefile	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/Makefile	Mon Apr 28 18:24:46 2008 +0300
@@ -32,7 +32,6 @@
        load_ams.cxx		\
        load_amf.cxx		\
        load_669.cxx		\
-       load_j2b.cxx		\
        load_mt2.cxx		\
        load_psm.cxx		\
        archive/archive.cxx	\
--- a/src/modplug/archive/archive.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/archive/archive.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -69,8 +69,6 @@
 		return true;
 	if (lExt == ".xm")
 		return true;
-	if (lExt == ".j2b")
-		return true;
 	if (lExt == ".mt2")
 		return true;
 	if (lExt == ".psm")
--- a/src/modplug/load_j2b.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-/*
- * This source code is public domain.
- *
- * Authors: Olivier Lapicque <olivierl@jps.net>
-*/
-
-
-///////////////////////////////////////////////////
-//
-// J2B module loader
-//
-///////////////////////////////////////////////////
-#include "stdafx.h"
-#include "sndfile.h"
-
--- a/src/modplug/load_s3m.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/load_s3m.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -91,7 +91,7 @@
 	case 'S':	command = CMD_S3MCMDEX; break;
 	case 'T':	command = CMD_TEMPO; break;
 	case 'U':	command = CMD_FINEVIBRATO; break;
-	case 'V':	command = CMD_GLOBALVOLUME; break;
+	case 'V':	command = CMD_GLOBALVOLUME; if (!bIT) param *= 2; break;
 	case 'W':	command = CMD_GLOBALVOLSLIDE; break;
 	case 'X':	command = CMD_PANNING8; break;
 	case 'Y':	command = CMD_PANBRELLO; break;
@@ -131,7 +131,7 @@
 	case CMD_S3MCMDEX:			command = 'S'; break;
 	case CMD_TEMPO:				command = 'T'; break;
 	case CMD_FINEVIBRATO:		command = 'U'; break;
-	case CMD_GLOBALVOLUME:		command = 'V'; break;
+	case CMD_GLOBALVOLUME:		command = 'V'; if (!bIT) param >>= 1;break;
 	case CMD_GLOBALVOLSLIDE:	command = 'W'; break;
 	case CMD_PANNING8:			
 		command = 'X';
--- a/src/modplug/load_xm.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/load_xm.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -391,6 +391,9 @@
 		penv->VolEnv.nNodes = xmsh.vnum;
 		if (!xmsh.vnum) penv->dwFlags &= ~ENV_VOLUME;
 		if (!xmsh.pnum) penv->dwFlags &= ~ENV_PANNING;
+		if (!(penv->dwFlags & ENV_VOLUME) && !penv->nFadeOut) {
+			penv->nFadeOut = 8192;
+		}
 		penv->PanEnv.nNodes = xmsh.pnum;
 		penv->VolEnv.nSustainStart = penv->VolEnv.nSustainEnd = xmsh.vsustain;
 		if (xmsh.vsustain >= 12) penv->dwFlags &= ~ENV_VOLSUSTAIN;
--- a/src/modplug/modplug.h	Mon Apr 28 17:30:54 2008 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
- * This source code is public domain.
- *
- * Authors: Kenton Varda <temporal@gauge3d.org> (C interface wrapper)
- */
-
-#ifndef MODPLUG_H__INCLUDED
-#define MODPLUG_H__INCLUDED
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct _ModPlugFile;
-typedef struct _ModPlugFile ModPlugFile;
-
-struct _ModPlugNote {
-	unsigned char Note;
-	unsigned char Instrument;
-	unsigned char VolumeEffect;
-	unsigned char Effect;
-	unsigned char Volume;
-	unsigned char Parameter;
-};
-typedef struct _ModPlugNote ModPlugNote;
-
-typedef void (*ModPlugMixerProc)(int*, unsigned long, unsigned long);
-
-/* Load a mod file.  [data] should point to a block of memory containing the complete
- * file, and [size] should be the size of that block.
- * Return the loaded mod file on success, or NULL on failure. */
-ModPlugFile* ModPlug_Load(const void* data, int size);
-/* Unload a mod file. */
-void ModPlug_Unload(ModPlugFile* file);
-
-/* Read sample data into the buffer.  Returns the number of bytes read.  If the end
- * of the mod has been reached, zero is returned. */
-int  ModPlug_Read(ModPlugFile* file, void* buffer, int size);
-
-/* Get the name of the mod.  The returned buffer is stored within the ModPlugFile
- * structure and will remain valid until you unload the file. */
-const char* ModPlug_GetName(ModPlugFile* file);
-
-/* Get the length of the mod, in milliseconds.  Note that this result is not always
- * accurate, especially in the case of mods with loops. */
-int ModPlug_GetLength(ModPlugFile* file);
-
-/* Seek to a particular position in the song.  Note that seeking and MODs don't mix very
- * well.  Some mods will be missing instruments for a short time after a seek, as ModPlug
- * does not scan the sequence backwards to find out which instruments were supposed to be
- * playing at that time.  (Doing so would be difficult and not very reliable.)  Also,
- * note that seeking is not very exact in some mods -- especially those for which
- * ModPlug_GetLength() does not report the full length. */
-void ModPlug_Seek(ModPlugFile* file, int millisecond);
-
-enum _ModPlug_Flags
-{
-	MODPLUG_ENABLE_OVERSAMPLING     = 1 << 0,  /* Enable oversampling (*highly* recommended) */
-	MODPLUG_ENABLE_NOISE_REDUCTION  = 1 << 1,  /* Enable noise reduction */
-	MODPLUG_ENABLE_REVERB           = 1 << 2,  /* Enable reverb */
-	MODPLUG_ENABLE_MEGABASS         = 1 << 3,  /* Enable megabass */
-	MODPLUG_ENABLE_SURROUND         = 1 << 4   /* Enable surround sound. */
-};
-
-enum _ModPlug_ResamplingMode
-{
-	MODPLUG_RESAMPLE_NEAREST = 0,  /* No interpolation (very fast, extremely bad sound quality) */
-	MODPLUG_RESAMPLE_LINEAR  = 1,  /* Linear interpolation (fast, good quality) */
-	MODPLUG_RESAMPLE_SPLINE  = 2,  /* Cubic spline interpolation (high quality) */
-	MODPLUG_RESAMPLE_FIR     = 3   /* 8-tap fir filter (extremely high quality) */
-};
-
-typedef struct _ModPlug_Settings
-{
-	int mFlags;  /* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed */
-	
-	/* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then
-	 * down-mixes to the settings you choose. */
-	int mChannels;       /* Number of channels - 1 for mono or 2 for stereo */
-	int mBits;           /* Bits per sample - 8, 16, or 32 */
-	int mFrequency;      /* Sampling rate - 11025, 22050, or 44100 */
-	int mResamplingMode; /* One of MODPLUG_RESAMPLE_*, above */
-	
-	int mReverbDepth;    /* Reverb level 0(quiet)-100(loud)      */
-	int mReverbDelay;    /* Reverb delay in ms, usually 40-200ms */
-	int mBassAmount;     /* XBass level 0(quiet)-100(loud)       */
-	int mBassRange;      /* XBass cutoff in Hz 10-100            */
-	int mSurroundDepth;  /* Surround level 0(quiet)-100(heavy)   */
-	int mSurroundDelay;  /* Surround delay in ms, usually 5-40ms */
-	int mLoopCount;      /* Number of times to loop.  Zero prevents looping.
-	                        -1 loops forever. */
-} ModPlug_Settings;
-
-/* Get and set the mod decoder settings.  All options, except for channels, bits-per-sample,
- * sampling rate, and loop count, will take effect immediately.  Those options which don't
- * take effect immediately will take effect the next time you load a mod. */
-void ModPlug_GetSettings(ModPlug_Settings* settings);
-void ModPlug_SetSettings(const ModPlug_Settings* settings);
-
-/* New ModPlug API Functions */
-/* NOTE: Master Volume (1-512) */
-unsigned int ModPlug_GetMasterVolume(ModPlugFile* file) ;
-void ModPlug_SetMasterVolume(ModPlugFile* file,unsigned int cvol) ;
-
-int ModPlug_GetCurrentSpeed(ModPlugFile* file);
-int ModPlug_GetCurrentTempo(ModPlugFile* file);
-int ModPlug_GetCurrentOrder(ModPlugFile* file);
-int ModPlug_GetCurrentPattern(ModPlugFile* file);
-int ModPlug_GetCurrentRow(ModPlugFile* file);
-int ModPlug_GetPlayingChannels(ModPlugFile* file);
-
-void ModPlug_SeekOrder(ModPlugFile* file,int order);
-int ModPlug_GetModuleType(ModPlugFile* file);
-char* ModPlug_GetMessage(ModPlugFile* file);
-
-
-unsigned int ModPlug_NumInstruments(ModPlugFile* file);
-unsigned int ModPlug_NumSamples(ModPlugFile* file);
-unsigned int ModPlug_NumPatterns(ModPlugFile* file);
-unsigned int ModPlug_NumChannels(ModPlugFile* file);
-unsigned int ModPlug_SampleName(ModPlugFile* file, unsigned int qual, char* buff);
-unsigned int ModPlug_InstrumentName(ModPlugFile* file, unsigned int qual, char* buff);
-
-/*
- * Retrieve pattern note-data
- */
-ModPlugNote* ModPlug_GetPattern(ModPlugFile* file, int pattern, unsigned int* numrows);
-
-/*
- * =================
- * Mixer callback
- * =================
- *
- * Use this callback if you want to 'modify' the mixed data of LibModPlug.
- * 
- * void proc(int* buffer,unsigned long channels,unsigned long nsamples) ;
- *
- * 'buffer': A buffer of mixed samples
- * 'channels': N. of channels in the buffer
- * 'nsamples': N. of samples in the buffeer (without taking care of n.channels)
- *
- * (Samples are signed 32-bit integers)
- */
-void ModPlug_InitMixerCallback(ModPlugFile* file,ModPlugMixerProc proc) ;
-void ModPlug_UnloadMixerCallback(ModPlugFile* file) ;
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif
--- a/src/modplug/modplugbmp.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/modplugbmp.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -198,8 +198,6 @@
 		return true;
 	if (lExt == ".ult")
 		return true;
-	if (lExt == ".j2b")
-		return true;
 	if (lExt == ".mt2")
 		return true;
 
--- a/src/modplug/modplugbmp.h	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/modplugbmp.h	Mon Apr 28 18:24:46 2008 +0300
@@ -9,10 +9,7 @@
 
 #include <string>
 #include <glib.h>
-
-#ifndef __MODPLUGXMMS_STDDEFS_H__INCLUDED__
 #include "stddefs.h"
-#endif
 
 extern "C" {
 #include <audacious/plugin.h>
--- a/src/modplug/plugin.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/plugin.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -6,7 +6,6 @@
 
 // #define AUD_DEBUG 1
 
-#include "modplug.h"
 #include "gui/main.h"
 extern "C" {
 #include <audacious/plugin.h>
@@ -82,7 +81,7 @@
 }
 
 const gchar *fmts[] =
-    { "amf", "ams", "dbm", "dbf", "dsm", "far", "mdl", "stm", "ult", "j2b", "mt2",
+    { "amf", "ams", "dbm", "dbf", "dsm", "far", "mdl", "stm", "ult", "mt2",
       "mdz", "mdr", "mdgz", "mdbz", "mod", "s3z", "s3r", "s3gz", "s3m", "xmz", "xmr", "xmgz",
       "itz", "itr", "itgz", "dmf", "umx", "it", "669", "xm", "mtm", "psm", "ft2",
       "zip", "gz", "bz2", "rar", "rb",
--- a/src/modplug/tables.cxx	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/modplug/tables.cxx	Mon Apr 28 18:24:46 2008 +0300
@@ -7,10 +7,6 @@
 #include "stdafx.h"
 #include "sndfile.h"
 
-#ifndef MODPLUG_FASTSOUNDLIB
-//#pragma data_seg(".tables")
-#endif
-
 BYTE ImpulseTrackerPortaVolCmd[16] =
 {
 	0x00, 0x01, 0x04, 0x08, 0x10, 0x20, 0x40, 0x60,
--- a/src/sid/xmms-sid.c	Mon Apr 28 17:30:54 2008 +0300
+++ b/src/sid/xmms-sid.c	Mon Apr 28 18:24:46 2008 +0300
@@ -119,7 +119,7 @@
 void xs_reinit(void)
 {
     gint player;
-    gboolean isInitialized;
+    gboolean initialized;
 
     XSDEBUG("xs_reinit() thread = %p\n", g_thread_self());
 
@@ -160,30 +160,30 @@
     XSDEBUG("initializing emulator engine #%i...\n", xs_cfg.playerEngine);
 
     player = 0;
-    isInitialized = FALSE;
-    while ((player < xs_nplayerlist) && !isInitialized) {
+    initialized = FALSE;
+    while ((player < xs_nplayerlist) && !initialized) {
         if (xs_playerlist[player].plrIdent == xs_cfg.playerEngine) {
             if (xs_playerlist[player].plrInit(&xs_status)) {
-                isInitialized = TRUE;
+                initialized = TRUE;
                 xs_status.sidPlayer = (xs_player_t *) & xs_playerlist[player];
             }
         }
         player++;
     }
 
-    XSDEBUG("init#1: %s, %i\n", (isInitialized) ? "OK" : "FAILED", player);
+    XSDEBUG("init#1: %s, %i\n", (initialized) ? "OK" : "FAILED", player);
 
     player = 0;
-    while ((player < xs_nplayerlist) && !isInitialized) {
+    while ((player < xs_nplayerlist) && !initialized) {
         if (xs_playerlist[player].plrInit(&xs_status)) {
-            isInitialized = TRUE;
+            initialized = TRUE;
             xs_status.sidPlayer = (xs_player_t *) & xs_playerlist[player];
             xs_cfg.playerEngine = xs_playerlist[player].plrIdent;
         } else
             player++;
     }
 
-    XSDEBUG("init#2: %s, %i\n", (isInitialized) ? "OK" : "FAILED", player);
+    XSDEBUG("init#2: %s, %i\n", (initialized) ? "OK" : "FAILED", player);
 
 
     /* Get settings back, in case the chosen emulator backend changed them */