Initial community commit

This commit is contained in:
Jef 2024-09-24 14:54:57 +02:00
parent 537bcbc862
commit fc06254474
16440 changed files with 4239995 additions and 2 deletions

View file

@ -0,0 +1,391 @@
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_PREFS DIALOGEX 0, 0, 293, 205
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
CONTROL "Tab1",MM_PREFTAB,"SysTabControl32",WS_TABSTOP,4,3,285,180
DEFPUSHBUTTON "OK",IDOK,185,188,50,13
PUSHBUTTON "Cancel",IDCANCEL,239,188,50,13
END
IDD_ID3EDIT DIALOGEX 0, 0, 273, 239
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Module Info"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT IDC_ID3_FN,4,4,265,12,ES_AUTOHSCROLL | ES_READONLY
RTEXT "Title",IDC_STATIC,4,22,14,8
EDITTEXT IDC_TITLE,22,21,133,12,ES_AUTOHSCROLL | ES_READONLY
RTEXT "Type",IDC_STATIC,160,22,15,8
EDITTEXT IDC_TYPE,180,21,89,12,ES_AUTOHSCROLL | ES_READONLY
GROUPBOX "Header Info",IDC_STATIC,4,38,130,57
LTEXT "File Size:\nLength:\nChannels:\nSamples:\nInstruments:",IDC_STATIC,8,49,45,40
LTEXT "",IDC_INFOLEFT,61,49,70,40
GROUPBOX "Player Info",IDC_STATIC,139,38,130,57
LTEXT "BPM:\nSong Spd:\nPosition:\nRow:\nVoices:",IDC_STATIC,142,49,45,40
LTEXT "",IDC_INFORIGHT,195,49,70,40
CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,4,99,265,120
CONTROL "Track song",IDC_TRACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,224,52,10
DEFPUSHBUTTON "Close",IDOK,227,223,42,13
END
IDD_INSTRUMENTS DIALOGEX 0, 0, 262, 103
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LISTBOX IDC_INSTLIST,2,3,128,98,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Instrument Header",IDC_STATIC,134,0,125,101
LTEXT "Def. Volume:\nAuto-Vibrato:\nFade out:",IDC_STATIC,138,9,44,24
LTEXT "",IDC_INSTHEAD,190,9,64,24
GROUPBOX "Envelopes",IDC_STATIC,134,34,125,67
LTEXT "Volume:\nPanning:\nPitch:",IDC_STATIC,138,42,44,24
LTEXT "",IDC_INSTENV,190,42,64,24
GROUPBOX "Samples Used",IDC_STATIC,134,67,125,34
EDITTEXT TB_SAMPLELIST,137,77,119,21,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL
END
IDD_SAMPLES DIALOGEX 0, 0, 262, 103
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LISTBOX IDC_SAMPLIST,2,3,128,98,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Sample Header",IDC_STATIC,134,0,125,68
LTEXT "Length:\nFormat:\nQuality:\nLooping:\nAuto-Vibrato:\nVolume:\nPanning:",IDC_STATIC,139,8,45,56
LTEXT "",IDC_SAMPINFO,190,8,66,56
END
IDD_COMMENT DIALOGEX 0, 0, 262, 103
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
EDITTEXT CEMENT_BOX,2,3,258,98,ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_HSCROLL
END
IDD_PREFTAB_DECODER DIALOGEX 0, 0, 282, 163
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "Song Looping",IDC_STATIC,4,1,273,64
CONTROL "Slider1",IDC_LOOPS,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,7,15,127,12
LTEXT "",IDC_LOOPTEXT,141,15,129,12
CONTROL "Unconditional Looping\n(Forces all songs to loop even if they lack specific loop information)",IDC_LOOPALL,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,9,32,126,27
CONTROL "Continue Play After Loop\n(useful for some games' modules, that contain several songs indeed)",IDC_CONT_LOOP,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,144,32,127,27
CONTROL "Play Unlisted Patterns\n(Otherwise-unplayed pattern data is tacked onto the end of the song)",IDC_PLAYALL,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_DISABLED | WS_TABSTOP,9,69,130,27
CONTROL "Use Resonant Lowpass Filters\n(Used by some Impulse Tracker songs; CPU intensive)",IDC_RESONANCE,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,144,69,131,27
CONTROL "Strip Trailing Silence\n(May cause some songs to end or loop a few seconds prematurely)",IDC_STRIPSILENCE,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,8,100,130,26
CONTROL "Seek by orders (as opposed to seek by seconds; song length will be displayed in orders, too)",IDC_SEEKBYORDERS,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,144,100,131,27
LTEXT "Stereo Separation",IDC_STATIC,4,140,42,18
LTEXT "0%",IDC_STATIC,48,132,17,9
LTEXT "100%",IDC_STATIC,102,132,21,9
LTEXT "400%",IDC_STATIC,159,132,22,9
CONTROL "Slider1",IDC_PANSEP,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,48,145,123,9
CONTROL "Fadeout for...",IDC_FADECHECK,"Button",BS_AUTOCHECKBOX | BS_TOP | WS_TABSTOP,205,132,69,10
EDITTEXT IDC_FADEOUT,205,145,49,12,ES_RIGHT | ES_AUTOHSCROLL | WS_DISABLED
CONTROL "Spin1",IDC_FADESPIN,"msctls_updown32",UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS,248,145,8,13
LTEXT "sec.",IDC_FADESEC,260,148,14,10,WS_DISABLED
END
IDD_PREFTAB_MIXER DIALOGEX 0, 0, 282, 163
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Output Mode",IDC_STATIC,4,1,134,47
CONTROL "Reverse Stereo",OUTMODE_REVERSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,15,72,10
LTEXT "Max voices:",IDC_STATIC,12,31,39,8
COMBOBOX IDC_VOICES,60,29,42,88,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Streaming",IDC_STATIC,4,49,134,29
CONTROL "Prompt to save to disk",IDC_SAVESTR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,61,85,11
GROUPBOX "Output Quality",IDC_STATIC,143,1,134,149
LTEXT "Mixing Rate:",IDC_STATIC,149,17,41,9
COMBOBOX OQ_QUALITY,195,15,66,76,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Interpolation\n(Disable for lower-quality sound and 20% improvement in mixer efficiency)",OQ_INTERP,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,149,33,121,35
CONTROL "FIR interpolation (high quality)",OQ_CUBIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,149,71,109,10
CONTROL "Micro Volume-Ramping\n(Helps remove clicks and pops from interpolated sound)",OQ_NOCLICK,
"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,149,86,124,27
LTEXT "Note: Try lower sample rates before disabling interpolation for slower machines. It sounds better that way.",IDC_STATIC,150,116,121,30
END
IDD_PREFTAB_LOADER DIALOGEX 0, 0, 282, 163
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_TRANSPARENT | WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
LTEXT "Available Loaders:",IDC_STATIC,4,2,80,9
LISTBOX IDLDR_LIST,4,11,118,59,LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Default Panning",IDC_STATIC,4,72,118,88
LTEXT "Mono",IDC_STATIC,8,81,19,8
LTEXT "Full Stereo",IDC_STATIC,83,81,34,9
CONTROL "Slider1",IDLDR_PANPOS,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,14,92,96,12
CTEXT "Default panning is only set at load-time and can be overridden by the song during replay",IDC_STATIC,8,111,108,25
PUSHBUTTON "Reset",IDC_DEFPAN,30,141,65,13
LTEXT "",IDLDR_DESCRIPTION,133,4,143,34
CONTROL "Enabled\n(When disabled, this filetype is ignored by Mikamp)",IDLDR_ENABLED,
"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,133,42,137,27
GROUPBOX "Advanced Effects Options",IDC_STATIC,128,72,149,88
CONTROL "Disable DMP Panning Effects (8xx)\n(Select this for songs that seem to incorrectly pan to the left speaker)",IDLDR_EFFOPT1,
"Button",BS_3STATE | BS_TOP | BS_MULTILINE | WS_TABSTOP,133,84,137,25
CONTROL "Disable Resonance Filter Effects (Zxx)",IDLDR_EFFOPT2,
"Button",BS_3STATE | BS_TOP | WS_TABSTOP,133,113,138,10
CTEXT "It is not recommended to change the advanced options unless you really\nknow what you are doing",IDC_ADV_TEXT_INFO,132,129,138,25,WS_DISABLED
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"#include ""version.rc2""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
IDD_PREFS, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 289
TOPMARGIN, 3
BOTTOMMARGIN, 201
END
IDD_ID3EDIT, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 269
TOPMARGIN, 2
BOTTOMMARGIN, 236
END
IDD_INSTRUMENTS, DIALOG
BEGIN
LEFTMARGIN, 2
RIGHTMARGIN, 259
TOPMARGIN, 3
BOTTOMMARGIN, 101
END
IDD_SAMPLES, DIALOG
BEGIN
LEFTMARGIN, 2
RIGHTMARGIN, 259
TOPMARGIN, 3
BOTTOMMARGIN, 101
END
IDD_COMMENT, DIALOG
BEGIN
LEFTMARGIN, 2
RIGHTMARGIN, 260
TOPMARGIN, 3
BOTTOMMARGIN, 100
END
IDD_PREFTAB_DECODER, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 278
TOPMARGIN, 1
BOTTOMMARGIN, 159
END
IDD_PREFTAB_MIXER, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 278
BOTTOMMARGIN, 159
END
IDD_PREFTAB_LOADER, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 277
TOPMARGIN, 2
BOTTOMMARGIN, 160
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_NULLSOFT_MODULE_DECODER "Nullsoft Module Decoder v%s"
65535 "{A1A39D49-671A-4c2f-AE42-BEA134EAF6A9}"
END
STRINGTABLE
BEGIN
IDS_NULLSOFT_MODULE_DECODER_OLD "Nullsoft Module Decoder"
IDS_PROTRACKER_AND_CLONES
"Protracker and clones [mod]:\nIncludes Protracker, Fasttracker 1, Taketracker, Startrekker. Limited to 31 samples."
IDS_OLD_SKOOL_AMIGA_MODULES
"Old-skool Amiga Modules [mod]:\nSoundtracker, Ultimate Soundtracker. Very old and extremely limited in many ways (4 channels, 15 samples)"
IDS_SCREAM_TRACKER_2XX "Scream Tracker 2.xx [stm]:\nSimilar to ST3 modules, but limited to 4 channels; Various format quirks."
IDS_SCREAM_TRACKER_3XX "Scream Tracker 3.xx [s3m]:\nUp to 32 channels; Features a wavetable/FM combo (albeit rarely used)."
IDS_IMPULSE_TRACKER "Impulse Tracker (all versions) [it]:\nSupports 64 channels, new note actions, and resonance filters."
IDS_FASTTRACKER_2XX "Fasttracker 2.xx [xm]:\nSupports 32 channels, 128 instruments, and volume/panning envelopes."
IDS_MULTITRACKER "Multitracker [mtm]:\nA ""superfied"" Protracker-based format, features std effects /w 32 channels."
IDS_ULTRA_TRACKER "Ultra Tracker [ult]:\nDesigned specifically for the Gravis Ultrasound, features 32 channels and two effects per row."
IDS_COMPOSER_669 "Composer 669/UNIS 669 [669]:\nOne of the first PC trackers. 8 channels, up to 64 samples, few effects."
IDS_FARANDOLE_COMPOSER "Farandole Composer [far]:\nYet another composer. The 16 channel version of the Composer 669, but with more messy effects."
IDS_DIGITAL_SOUND_AND_MUSIC_INTERFACE
"Digital Sound and Music Interface [amf]:\nAdvanced Module Format... May be even too advanced to support it... Anyway, here it goes."
IDS_AMIGA_OKTALYZER "Amiga Oktalyzer [okt]:\n4-8 voices, 36 samples (usually), rather strange effects. The source code is about 20000 lines!"
IDS_POLYTRACKER "PolyTracker [ptm]:\nA Scream Tracker 3 clone (with ""protrac- kerized"" effects and some extra features), created by Lone Ranger / AcmE."
IDS_MULTIPLE_ITEMS_SELECTED "Multiple items selected..."
IDS_MUSIC_MODULES "Music Modules"
END
STRINGTABLE
BEGIN
IDS_MIXER "Mixer"
IDS_PLAYER "Player"
IDS_LOADERS "Loaders"
IDS_DEFAULT " (default)"
IDS_SELECT_ANY_LOADER "Select any loader(s) to edit their properties..."
IDS_DO_NOT_LOOP "Do not loop"
IDS_LOOP_FOREVER "Loop forever"
IDS_LOOP_X_TIMES "Loop %d times"
IDS_PREFERENCES_TITLE "%s Preferences"
IDS_SAMPLES "Samples"
IDS_INSTRUMENTS "Instruments"
IDS_COMMENT "Comment"
IDS_YES "Yes"
IDS_NO "No"
IDS_SUSTAIN "Sustain"
END
STRINGTABLE
BEGIN
IDS_FINETUNE "(finetune)"
IDS_HZ_SIGNED "Hz signed"
IDS_HZ_UNSIGNED "Hz unsigned"
IDS_PING_PONG "Ping-Pong"
IDS_REVERSE "Reverse"
IDS_FORWARD "Forward"
IDS_SUSTAIN_PING_PONG "Sustain Ping-Pong"
IDS_NONE "None"
IDS_X_X_X_OF_X_NOT_PLAYING "%d\n%d\n0 of %d\n\nNot Playing..."
IDS_X_X_X_OF_X_X_OF_X_X_OF_X "%d\n%d\n%d of %d (%d)\n%d of %d\n%d (%d)"
IDS_X_BTYES_X_OF_X_MINUTES "%d bytes\n%d:%02d minutes\n%d\n%d\n%d"
IDS_URLS_ONLY_SUPPORTED_IN_2_10_PLUS "URLs only supported in Winamp 2.10+"
IDS_MOD_PLUGIN_ERROR "Module Plug-in Error"
IDS_SAVE_MODULE "Save Module"
IDS_ALL_FILES "All files"
IDS_RETRIEVING_MODULE "Retrieving Module"
END
STRINGTABLE
BEGIN
IDS_ERROR_KILLING_DECODING_THREAD "Error killing decoding thread."
IDS_LOOP "Loop"
IDS_ON "On"
IDS_OFF "Off"
IDS_BYTES "bytes"
IDS_BITS "bits"
IDS_FAMILY_STRING_COMPOSER_669 "Composer 669"
IDS_FAMILY_STRING_DSMI_AMF "DSMI AMF"
IDS_FAMILY_STRING_FARANDOLE_COMPOSER "Farandole Composer"
IDS_FAMILY_STRING_IMPULSETRACKER "Impulsetracker"
IDS_FAMILY_STRING_SOUNDTRACKER "Soundtracker (15-inst)"
IDS_FAMILY_STRING_PROTRACKER "Protracker"
IDS_FAMILY_STRING_MULTITRACKER "Multitracker"
IDS_FAMILY_STRING_AMIGA_OKTALYZER "Amiga Oktalyzer"
IDS_FAMILY_STRING_POLYTRACKER "PolyTracker"
IDS_FAMILY_STRING_SCREAMTRACKER3 "Screamtracker 3"
END
STRINGTABLE
BEGIN
IDS_FAMILY_STRING_SCREAMTRACKER2 "Screamtracker 2"
IDS_FAMILY_STRING_ULTRATRACKER "Ultratracker"
IDS_FAMILY_STRING_FASTRACKER2 "Fasttracker 2"
IDS_FAMILY_STRING_NOISETRACKER "NoiseTracker Module"
IDS_X_MODULE "%s Module"
IDS_X_COMPRESSED_MODULE "%s Compressed Module"
IDS_ABOUT_TEXT "%s\n© 1998-2014 Winamp SA\nWritten by: Justin Frankel & Jake Stine\nBuild date: %hs\n\nMikamp - Nullsoft Module Decoder plug-in\nbased on the Mikmod Sound System\n\nModule loading & rendering by: Jake Stine\nThanks to Jeffrey Lim for additional Impulse Tracker info.\nAdditional code by: Peter Pawlowski & X-Fixer"
IDS_CORRUPT_UNSUPPORTED_TYPE "Corrupt file or unsupported module type."
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#include "version.rc2"
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View file

@ -0,0 +1,106 @@
#ifndef __MIKAMP_MAIN_H__
#define __MIKAMP_MAIN_H__
#include <windows.h>
#include <stdio.h>
#include "mikmod.h"
#include "mplayer.h"
#include "resource.h"
#include "in2.h"
#define INFO_CPAGES 3
#define CPLAYFLG_LOOPALL (1ul<<0) // disables selective looping - loop everything!
#define CPLAYFLG_PLAYALL (1ul<<1) // plays hidden patterns (tack onto end of the song)
#define CPLAYFLG_FADEOUT (1ul<<2) // Fadeout the song before the end cometh?
#define CPLAYFLG_STRIPSILENCE (1ul<<3) // Strip silence at the end of the song?
#define CPLAYFLG_SEEKBYORDERS (1ul<<4) // Seek by orders instead of seconds
#define CPLAYFLG_CONT_LOOP (1ul<<5) // continue after loop
typedef struct tag_dlghdr
{
HWND hwndTab; // tab control
HWND hwndDisplay; // current child dialog box
int left,top;
HWND apRes[INFO_CPAGES];
UNIMOD *module;
MPLAYER *seeker;
int maxv;
BOOL inUse, ownModule;
BOOL *suse;
} DLGHDR;
typedef struct INFOBOX
{
HWND hwnd;
DLGHDR dlg;
struct INFOBOX *next;
} INFOBOX;
#ifdef __cplusplus
extern "C" {
#endif
extern UBYTE config_nopan, config_savestr;
extern MD_DEVICE drv_amp;
extern MD_DEVICE drv_buffer;
extern In_Module mikmod;
extern UNIMOD *mf;
extern MPLAYER *mp;
// Defined in INFO.C
// -----------------
extern INFOBOX *infobox_list;
extern void infoDlg(HWND hwnd, UNIMOD *m, BOOL activate, BOOL primiary);
extern int config_info_x, config_info_y, config_track;
// Defined in INFO.C
// -----------------
// defined in config.c
extern UBYTE config_interp;
extern UBYTE config_panrev;
extern UBYTE config_cpu;
extern uint config_srate, config_voices, config_playflag;
extern int config_pansep, config_loopcount;
extern UBYTE config_samplesize;
extern UBYTE config_resonance;
extern int config_fadeout;
extern int config_tsel;
extern int paused;
// config.c shizat
// ---------------
extern void set_priority(void);
extern void __cdecl config(HWND hwndParent);
extern void __cdecl about(HWND hwndParent);
extern void config_read();
extern void config_write();
extern void info_killseeker(HWND hwnd);
int GetNumChannels();
int AllowSurround();
int GetThreadPriorityConfig();
BOOL GetTypeInfo(LPCWSTR pszType, LPWSTR pszDest, INT cchDest);
#ifdef __cplusplus
};
#endif
//#define PLUGIN_NAME "Nullsoft Module Decoder"
#define PLUGIN_VER L"2.94"
#endif

View file

@ -0,0 +1 @@
#include "../../../Winamp/in2.h"

Binary file not shown.

View file

@ -0,0 +1,167 @@
# Microsoft Developer Studio Project File - Name="mikamp" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mikamp - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mikamp.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mikamp.mak" CFG="mikamp - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mikamp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mikamp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mikamp - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 1
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Z7 /Ox /Ow /Og /Oi /Os /Gf /Gy /I "." /I "include" /I "..\lib\mikmod\include" /I "..\lib\mmio\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /Gs0 /FD /c
# SUBTRACT CPP /Ot /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib int64.lib /nologo /dll /machine:I386 /out:"c:\program files\winamp\plugins\in_mod.dll" /opt:nowin98
# SUBTRACT LINK32 /pdb:none /nodefaultlib
!ELSEIF "$(CFG)" == "mikamp - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "." /I "include" /I "..\lib\mikmod\include" /I "..\lib\mmio\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /dll /debug /machine:I386 /out:"c:\program files\winamp\plugins\in_mod.dll" /pdbtype:sept
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
# Begin Target
# Name "mikamp - Win32 Release"
# Name "mikamp - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\src\config.c
# End Source File
# Begin Source File
SOURCE=.\src\drv_amp.c
# End Source File
# Begin Source File
SOURCE=.\src\info.c
# End Source File
# Begin Source File
SOURCE=.\src\main.c
# End Source File
# Begin Source File
SOURCE=.\src\rf_wrapper.c
# End Source File
# Begin Source File
SOURCE=.\src\tagz.cpp
!IF "$(CFG)" == "mikamp - Win32 Release"
# ADD CPP /GX-
!ELSEIF "$(CFG)" == "mikamp - Win32 Debug"
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\src\tagz.h
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\include\in2.h
# End Source File
# Begin Source File
SOURCE=.\include\main.h
# End Source File
# Begin Source File
SOURCE=.\include\out.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\Winamp\wa_ipc.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\resource.h
# End Source File
# Begin Source File
SOURCE=.\script1.rc
# End Source File
# End Group
# End Target
# End Project

View file

@ -0,0 +1,31 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "in_mod (mikamp)", "mikamp.vcproj", "{3580EE92-4F7B-4322-A04C-B2B7B5578879}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "in_mod (mikmod)", "..\lib\mikmod\mikmod.vcproj", "{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "in_mod (mmio)", "..\lib\mmio\mmio.vcproj", "{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3580EE92-4F7B-4322-A04C-B2B7B5578879}.Debug|Win32.ActiveCfg = Debug|Win32
{3580EE92-4F7B-4322-A04C-B2B7B5578879}.Debug|Win32.Build.0 = Debug|Win32
{3580EE92-4F7B-4322-A04C-B2B7B5578879}.Release|Win32.ActiveCfg = Release|Win32
{3580EE92-4F7B-4322-A04C-B2B7B5578879}.Release|Win32.Build.0 = Release|Win32
{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}.Debug|Win32.ActiveCfg = Debug|Win32
{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}.Debug|Win32.Build.0 = Debug|Win32
{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}.Release|Win32.ActiveCfg = Release|Win32
{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}.Release|Win32.Build.0 = Release|Win32
{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}.Debug|Win32.ActiveCfg = Debug|Win32
{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}.Debug|Win32.Build.0 = Debug|Win32
{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}.Release|Win32.ActiveCfg = Release|Win32
{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,416 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="in_mod (mikamp)"
ProjectGUID="{3580EE92-4F7B-4322-A04C-B2B7B5578879}"
RootNamespace="in_mod (mikamp)"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/mikamp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../Wasabi;.;include;..\lib\mikmod\include;..\lib\mmio\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/mikamp.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="comctl32.lib int64.lib shlwapi.lib ../../nsutil/nsutil.lib"
OutputFile="$(ProgramFiles)\winamp\plugins\in_mod.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/in_mod.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Debug/in_mod.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/mikamp.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="1"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="../../Wasabi;.;include;..\lib\mikmod\include;..\lib\mmio\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
ExceptionHandling="0"
RuntimeLibrary="2"
BufferSecurityCheck="false"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/mikamp.pch"
AssemblerListingLocation=".\Release/"
ObjectFile="$(IntDir)/"
ProgramDataBaseFileName=".\Release/"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="comctl32.lib int64.lib shlwapi.lib ../../nsutil/nsutil.lib"
OutputFile="$(ProgramFiles)\winamp\plugins\in_mod.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
GenerateManifest="false"
IgnoreDefaultLibraryNames="msvcprt.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
ImportLibrary=".\Release/in_mod.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{47FCA4AF-1F6B-4A1A-8AF2-1BD9E11672DD}"
RelativePathToProject="..\in_mod\lib\mikmod\mikmod.vcproj"
/>
<ProjectReference
ReferencedProjectIdentifier="{BE408A85-4302-4EB8-8DE3-E3F9A5B25715}"
RelativePathToProject="..\in_mod\lib\mmio\mmio.vcproj"
/>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="src\config.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
CompileAs="2"
/>
</FileConfiguration>
</File>
<File
RelativePath="src\drv_amp.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
/>
</FileConfiguration>
</File>
<File
RelativePath=".\src\drv_buffer.cpp"
>
</File>
<File
RelativePath=".\src\drv_buffer.h"
>
</File>
<File
RelativePath=".\src\ExtendedRead.cpp"
>
</File>
<File
RelativePath="src\info.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
CompileAs="2"
/>
</FileConfiguration>
</File>
<File
RelativePath="src\main.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"
CompileAs="2"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
CompileAs="2"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\playbackconfig.cpp"
>
</File>
<File
RelativePath="src\rf_wrapper.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;$(NoInherit)"
BasicRuntimeChecks="3"
BrowseInformation="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath=".\src\api.h"
>
</File>
<File
RelativePath="include\in2.h"
>
</File>
<File
RelativePath="include\main.h"
>
</File>
<File
RelativePath="include\out.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
<File
RelativePath=".\in_mod.rc"
>
</File>
<File
RelativePath="resource.h"
>
</File>
</Filter>
<File
RelativePath=".\int64.lib"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -0,0 +1,78 @@
#include "main.h"
#include "../winamp/wa_ipc.h"
#include <api/service/waServiceFactory.h>
#include "../../Agave/Config/api_config.h"
// {B6CB4A7C-A8D0-4c55-8E60-9F7A7A23DA0F}
static const GUID playbackConfigGroupGUID =
{ 0xb6cb4a7c, 0xa8d0, 0x4c55, { 0x8e, 0x60, 0x9f, 0x7a, 0x7a, 0x23, 0xda, 0xf } };
static api_config *configApi=0;
api_config *GetConfigAPI()
{
if (mikmod.service && !configApi)
{
waServiceFactory *sf = (waServiceFactory *)mikmod.service->service_getServiceByGuid(AgaveConfigGUID);
configApi = (api_config *)sf->getInterface();
}
return configApi;
}
extern "C"
int GetSampleSizeFlag()
{
api_config *config = GetConfigAPI();
int bits=16;
if (config)
bits = config->GetUnsigned(playbackConfigGroupGUID, L"bits", 16);
switch(bits)
{
case 8:
return 0;
case 24:
return DMODE_24BITS;
case 16:
default:
return DMODE_16BITS;
}
}
extern "C"
int GetNumChannels()
{
api_config *config = GetConfigAPI();
bool mono=false;
if (config)
mono = config->GetBool(playbackConfigGroupGUID, L"mono", false);
if (mono)
return 1;
else
return 2;
}
extern "C"
int AllowSurround()
{
api_config *config = GetConfigAPI();
bool surround=true;
if (config)
surround= config->GetBool(playbackConfigGroupGUID, L"surround", true);
return surround?1:0;
}
extern "C"
int GetThreadPriorityConfig()
{
api_config *config = GetConfigAPI();
int priority=THREAD_PRIORITY_HIGHEST;
if (config)
priority = config->GetInt(playbackConfigGroupGUID, L"priority", THREAD_PRIORITY_HIGHEST);
return priority;
}

View file

@ -0,0 +1,149 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by script1.rc
//
#define IDS_NULLSOFT_MODULE_DECODER_OLD 0
#define IDS_PROTRACKER_AND_CLONES 1
#define IDS_OLD_SKOOL_AMIGA_MODULES 2
#define IDS_SCREAM_TRACKER_2XX 3
#define IDS_SCREAM_TRACKER_3XX 4
#define IDS_IMPULSE_TRACKER 5
#define IDS_FASTTRACKER_2XX 6
#define IDS_MULTITRACKER 7
#define IDS_ULTRA_TRACKER 8
#define IDS_COMPOSER_669 9
#define IDS_FARANDOLE_COMPOSER 10
#define IDS_DIGITAL_SOUND_AND_MUSIC_INTERFACE 11
#define IDS_AMIGA_OKTALYZER 12
#define IDS_POLYTRACKER 13
#define IDS_MULTIPLE_ITEMS_SELECTED 14
#define IDS_MUSIC_MODULES 15
#define IDS_MIXER 16
#define IDS_PLAYER 17
#define IDS_LOADERS 18
#define IDS_DEFAULT 19
#define IDS_SELECT_ANY_LOADER 20
#define IDS_DO_NOT_LOOP 21
#define IDS_LOOP_FOREVER 22
#define IDS_LOOP_X_TIMES 23
#define IDS_PREFERENCES_TITLE 24
#define IDS_SAMPLES 26
#define IDS_INSTRUMENTS 27
#define IDS_COMMENT 28
#define IDS_YES 29
#define IDS_NO 30
#define IDS_SUSTAIN 31
#define IDS_FINETUNE 32
#define IDS_HZ_SIGNED 33
#define IDS_HZ_UNSIGNED 34
#define IDS_PING_PONG 35
#define IDS_REVERSE 36
#define IDS_FORWARD 37
#define IDS_SUSTAIN_PING_PONG 38
#define IDS_NONE 39
#define IDS_X_X_X_OF_X_NOT_PLAYING 40
#define IDS_X_X_X_OF_X_X_OF_X_X_OF_X 41
#define IDS_X_BTYES_X_OF_X_MINUTES 42
#define IDS_URLS_ONLY_SUPPORTED_IN_2_10_PLUS 43
#define IDS_MOD_PLUGIN_ERROR 44
#define IDS_SAVE_MODULE 45
#define IDS_ALL_FILES 46
#define IDS_RETRIEVING_MODULE 47
#define IDS_ERROR_KILLING_DECODING_THREAD 48
#define IDS_LOOP 49
#define IDS_ON 50
#define IDS_OFF 51
#define IDS_BYTES 52
#define IDS_BYTES2 53
#define IDS_BITS 53
#define IDS_FAMILY_STRING_COMPOSER_669 54
#define IDS_FAMILY_STRING_DSMI_AMF 55
#define IDS_FAMILY_STRING_FARANDOLE_COMPOSER 56
#define IDS_FAMILY_STRING_IMPULSETRACKER 57
#define IDS_FAMILY_STRING_SOUNDTRACKER 58
#define IDS_FAMILY_STRING_PROTRACKER 59
#define IDS_FAMILY_STRING_MULTITRACKER 60
#define IDS_FAMILY_STRING_AMIGA_OKTALYZER 61
#define IDS_FAMILY_STRING_POLYTRACKER 62
#define IDS_FAMILY_STRING_SCREAMTRACKER3 63
#define IDS_FAMILY_STRING_SCREAMTRACKER2 64
#define IDS_FAMILY_STRING_ULTRATRACKER 65
#define IDS_FAMILY_STRING_FASTRACKER2 66
#define IDS_FAMILY_STRING_NOISETRACKER 67
#define IDS_X_MODULE 68
#define IDS_X_COMPRESSED_MODULE 69
#define IDS_ABOUT_TEXT 70
#define IDS_CORRUPT_UNSUPPORTED_TYPE 71
#define IDS_NULLSOFT_DS_OUTPUT 72
#define IDD_ID3EDIT 101
#define IDD_SAMPLES 108
#define IDD_COMMENT 109
#define IDD_INSTRUMENTS 111
#define IDD_PREFS 116
#define IDD_PREFTAB_DECODER 118
#define IDD_PREFTAB_MIXER 119
#define IDD_PREFTAB_LOADER 123
#define IDC_PREFS_PRIORITY_DECODE 1076
#define IDC_TYPE 1078
#define IDC_TITLE 1079
#define IDC_ID3_FN 1090
#define OQ_INTERP 1100
#define IDLDR_EFFOPT1 1102
#define OQ_NOCLICK 1103
#define IDC_SAVESTR 1105
#define IDC_VOICES 1106
#define IDC_INSTLIST 1108
#define TB_SAMPLELIST 1109
#define IDC_SAMPLIST 1110
#define IDC_INFORIGHT 1111
#define IDC_INFOLEFT 1112
#define IDC_TAB 1113
#define IDC_SAMPINFO 1115
#define CEMENT_BOX 1116
#define IDC_INSTENV 1118
#define IDC_INSTHEAD 1120
#define IDC_ID3FORMAT 1127
#define MM_PREFTAB 1132
#define IDC_PANSEP 1132
#define IDC_DEFPAN 1137
#define OQ_QUALITY 1139
#define IDLDR_LIST 1140
#define IDLDR_PANPOS 1141
#define IDLDR_ENABLED 1142
#define IDLDR_EFFOPT2 1144
#define IDLDR_DESCRIPTION 1145
#define IDC_LOOPALL 1146
#define IDC_CONT_LOOP 1147
#define IDC_FADEOUT 1148
#define IDC_FADESPIN 1149
#define IDC_PLAYALL 1150
#define IDC_RESONANCE 1151
#define IDC_FADECHECK 1152
#define IDC_FADESEC 1153
#define IDC_STRIPSILENCE 1154
#define IDC_SEEKBYORDERS 1155
#define IDC_TITLE_FORMAT 1156
#define IDC_TAGZ_HELP 1157
#define OQ_CUBIC 1158
#define IDC_TAGZ_DEF 1158
#define IDC_SAMPLESIZE 1159
#define IDC_TITLE_FORMAT2 1159
#define IDC_LOOPTEXT 1160
#define IDC_LOOPS 1161
#define IDC_TRACK 1162
#define IDC_ADV_TEXT_INFO 1163
#define OUTMODE_STEREO 1201
#define OUTMODE_SURROUND 1202
#define OUTMODE_REVERSE 1203
#define IDS_NULLSOFT_MODULE_DECODER 65534
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1164
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,123 @@
extern "C"
{
#include "main.h"
}
#include "drv_buffer.h"
#include <bfc/platform/types.h>
typedef struct
{
const char *cmd;
const char *file;
const char *title;
int titleLength;
int start;
int startUnit;
int loops;
int flags;
} PlayParams;
extern "C" int GetSampleSizeFlag();
extern "C" MMSTREAM *_mm_fopen_rf(const CHAR *fname); //rf_wrapper.c
BOOL GetPlayParams(const char *fileName, BOOL open, PlayParams *params);
BOOL InitPlayer(UNIMOD *mf, MPLAYER **ps, const PlayParams *params, BOOL quick);
// TODO; is there a way to get floating point out of this stuff?
extern "C"
{
__declspec(dllexport) intptr_t winampGetExtendedRead_open(const char *fn, int *size, int *bps, int *nch, int *srate)
{
PlayParams params;
if (!GetPlayParams(fn, FALSE, &params))
return 0;
int requested_channels = *nch;
int requested_bits = *bps;
int requested_srate = *srate;
uint md_mode = 0;
if (config_interp & 1) md_mode |= DMODE_INTERP;
if (config_interp & 2) md_mode |= DMODE_NOCLICK;
if (config_interp & 4) md_mode |= DMODE_FIR;
switch(requested_bits)
{
case 0:
md_mode |= GetSampleSizeFlag();
break;
case 16:
md_mode |= DMODE_16BITS;
break;
case 24:
md_mode |= DMODE_24BITS;
break;
}
if (requested_channels != 1 && requested_channels != 2) md_mode |= DMODE_SURROUND;
if (config_panrev) md_mode |= DMODE_REVERSE;
if (config_resonance) md_mode |= DMODE_RESONANCE;
MDRIVER *md = Mikmod_Init(requested_srate?requested_srate:config_srate, 0, 0, MD_STEREO, config_cpu, md_mode, &drv_buffer);
MPLAYER *mp;
MMSTREAM *fp;
fp = _mm_fopen_rf(params.file);
if (!fp)
{
Mikmod_Exit(md);
//CleanupTemp();
return 0;
}
UNIMOD *mf=Unimod_Load_FP(md, params.file,fp);
_mm_fclose(fp);
if (mf==NULL)
{
Mikmod_Exit(md);
// CleanupTemp();
return 0;
}
if (!InitPlayer(mf, &mp, &params, FALSE))
{
//CleanupTemp();
Unimod_Free(mf);
Mikmod_Exit(md);
return 0;
}
Player_Start(mp);
DecodeInfo *hwdata = (DecodeInfo *)md->device.local;
*bps = hwdata->bits;
*srate = hwdata->mixspeed;
*nch = hwdata->channels;
if (mf->songlen)
*size = MulDiv(mf->songlen, hwdata->mixspeed * hwdata->channels *hwdata->bits, 8*1000);
else
*size = -1;
return (intptr_t)mp;
}
__declspec(dllexport) size_t winampGetExtendedRead_getData(intptr_t handle, char *dest, size_t len, int *killswitch)
{
MPLAYER *mp = (MPLAYER *)handle;
DecodeInfo *hwdata = (DecodeInfo *)mp->mf->md->device.local;
if (!Player_Active(mp)) // check if we're done
return 0;
hwdata->buffer = dest;
hwdata->buffersize = len;
hwdata->bytesWritten = 0;
Mikmod_Update(mp->mf->md);
return hwdata->bytesWritten;
}
__declspec(dllexport) void winampGetExtendedRead_close(intptr_t handle)
{
MPLAYER *mp = (MPLAYER *)handle;
MDRIVER *md = mp->mf->md;
UNIMOD *mf = (UNIMOD *)mp->mf;
Player_Free(mp);
Unimod_Free(mf);
Mikmod_Exit(md);
}
}

View file

@ -0,0 +1,602 @@
#include "api.h"
#include "main.h"
#include "resource.h"
#include <commctrl.h>
#include "../../winamp/wa_ipc.h"
#include <strsafe.h>
static BOOL CALLBACK infoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
static BOOL CALLBACK tabProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,LPARAM lParam);
static void OnSelChanged(HWND hwndDlg);
INFOBOX *infobox_list = NULL;
int config_info_x = 0, config_info_y = 0;
BOOL config_track = FALSE;
// =====================================================================================
void infobox_delete(HWND hwnd)
// =====================================================================================
// This function is called with the handle of the infobox to destroy. It unloads the
// module if appropriate (care must be take not to unload a module which is in use!).
{
INFOBOX *cruise, *old;
old = cruise = infobox_list;
while(cruise)
{
if(cruise->hwnd == hwnd)
{
if(cruise == infobox_list)
infobox_list = cruise->next;
else old->next = cruise->next;
// Destroy the info box window, then unload the module, *if*
// the module is not actively playing!
info_killseeker(hwnd);
DestroyWindow(hwnd);
if (cruise->dlg.module!=mf && cruise->dlg.ownModule)
Unimod_Free(cruise->dlg.module);
free(cruise->dlg.suse);
free(cruise);
return;
}
old = cruise;
cruise = cruise->next;
}
}
// =====================================================================================
MPLAYER *get_player(UNIMOD *othermf)
// =====================================================================================
// Checks the current module against the one given. if they match the MP is returned,
// else it returns NULL.
{
if (mf == othermf)
return mp;
return NULL;
}
// =====================================================================================
static void infoTabInit(HWND hwndDlg, UNIMOD *m, DLGHDR *pHdr)
// =====================================================================================
{
DWORD dwDlgBase = GetDialogBaseUnits();
int cxMargin = LOWORD(dwDlgBase) / 4,
cyMargin = HIWORD(dwDlgBase) / 8;
TC_ITEM tie;
int tabCounter;
// Add a tab for each of the three child dialog boxes.
// and lock the resources for the child frames that appear within.
tie.mask = TCIF_TEXT | TCIF_IMAGE;
tie.iImage = -1;
tabCounter = 0;
if(m->numsmp)
{
tie.pszText = WASABI_API_LNGSTRING(IDS_SAMPLES);
TabCtrl_InsertItem(pHdr->hwndTab, tabCounter, &tie);
pHdr->apRes[tabCounter] = WASABI_API_CREATEDIALOGPARAM(IDD_SAMPLES, hwndDlg, tabProc, IDD_SAMPLES);
SendMessage(mikmod.hMainWindow,WM_WA_IPC,(WPARAM)pHdr->apRes[tabCounter],IPC_USE_UXTHEME_FUNC);
SetWindowPos(pHdr->apRes[tabCounter], HWND_TOP, pHdr->left+1, pHdr->top+15, 0, 0, SWP_NOSIZE);
ShowWindow(pHdr->apRes[tabCounter++], SW_HIDE);
}
if(m->numins)
{
tie.pszText = WASABI_API_LNGSTRING(IDS_INSTRUMENTS);
TabCtrl_InsertItem(pHdr->hwndTab, tabCounter, &tie);
pHdr->apRes[tabCounter] = WASABI_API_CREATEDIALOGPARAM(IDD_INSTRUMENTS, hwndDlg, tabProc, IDD_INSTRUMENTS);
SendMessage(mikmod.hMainWindow,WM_WA_IPC,(WPARAM)pHdr->apRes[tabCounter],IPC_USE_UXTHEME_FUNC);
SetWindowPos(pHdr->apRes[tabCounter], HWND_TOP, pHdr->left+1, pHdr->top+15, 0, 0, SWP_NOSIZE);
ShowWindow(pHdr->apRes[tabCounter++], SW_HIDE);
}
if(m->comment && m->comment[0])
{
tie.pszText = WASABI_API_LNGSTRING(IDS_COMMENT);
TabCtrl_InsertItem(pHdr->hwndTab, tabCounter, &tie);
pHdr->apRes[tabCounter] = WASABI_API_CREATEDIALOGPARAM(IDD_COMMENT, hwndDlg, tabProc, CEMENT_BOX);
SendMessage(mikmod.hMainWindow,WM_WA_IPC,(WPARAM)pHdr->apRes[tabCounter],IPC_USE_UXTHEME_FUNC);
SetWindowPos(pHdr->apRes[tabCounter], HWND_TOP, pHdr->left+1, pHdr->top+15, 0, 0, SWP_NOSIZE);
ShowWindow(pHdr->apRes[tabCounter++], SW_HIDE);
}
// Simulate selection of the LAST item
TabCtrl_SetCurSel(pHdr->hwndTab, tabCounter-1);
OnSelChanged(hwndDlg);
}
// =====================================================================================
static BOOL CALLBACK tabProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
// =====================================================================================
// This is the callback procedure used by each of the three forms under the
// tab control on the Module info dialog box (sample, instrument, comment
// info forms).
{
switch (uMsg)
{ case WM_INITDIALOG:
{
HWND hwndLB;
DLGHDR *pHdr = (DLGHDR *)GetWindowLong(GetParent(hwndDlg), GWL_USERDATA);
UNIMOD *m = pHdr->module;
char sbuf[10280] = {0};
switch(lParam)
{ case IDD_SAMPLES:
{
uint x;
hwndLB = GetDlgItem(hwndDlg, IDC_SAMPLIST);
for (x=0; x<m->numsmp; x++)
{
StringCbPrintfA(sbuf, sizeof(sbuf), "%02d: %s",x+1, m->samples[x].samplename ? m->samples[x].samplename : "");
SendMessage(hwndLB, LB_ADDSTRING, 0, (LPARAM) sbuf);
}
SendMessage(hwndLB, LB_SETCURSEL, 0, 0);
tabProc(hwndDlg, WM_COMMAND, (WPARAM)((LBN_SELCHANGE << 16) + IDC_SAMPLIST), (LPARAM)hwndLB);
}
return TRUE;
case IDD_INSTRUMENTS:
{
uint x;
hwndLB = GetDlgItem(hwndDlg, IDC_INSTLIST);
for (x=0; x<m->numins; x++)
{
StringCbPrintfA(sbuf, sizeof(sbuf), "%02d: %s",x+1, m->instruments[x].insname ? m->instruments[x].insname : "");
SendMessage(hwndLB, LB_ADDSTRING, 0, (LPARAM) sbuf);
}
SendMessage(hwndLB, LB_SETCURSEL, 0, 0);
tabProc(hwndDlg, WM_COMMAND, (WPARAM)((LBN_SELCHANGE << 16) + IDC_INSTLIST), (LPARAM)hwndLB);
}
return TRUE;
case CEMENT_BOX:
if(m->comment && m->comment[0])
{
uint x,i;
hwndLB = GetDlgItem(hwndDlg, CEMENT_BOX);
// convert all CRs to CR/LF pairs. That's the way the edit box likes them!
for(x=0, i=0; x<strlen(m->comment) && i < sizeof(sbuf)-1; x++)
{
sbuf[i++] = m->comment[x];
if(m->comment[x]==0x0d && m->comment[x+1]!=0x0a)
sbuf[i++] = 0x0a;
}
sbuf[i] = 0;
SetWindowText(hwndLB, sbuf);
}
return TRUE;
}
}
break;
case WM_COMMAND:
if(HIWORD(wParam) == LBN_SELCHANGE)
{ // Processes the events for the sample and instrument list boxes, namely updating
// the samp/inst info upon a WM_COMMAND issuing a listbox selection change.
int moo = SendMessage((HWND)lParam, LB_GETCURSEL, 0, 0);
char sbuf[1024] = {0}, st1[128] = {0}, st2[64] = {0}, st3[64] = {0};
char tmp1[32] = {0}, tmp2[32] = {0}, tmp3[32] = {0};
DLGHDR *pHdr = (DLGHDR *)GetWindowLong(GetParent(hwndDlg), GWL_USERDATA);
UNIMOD *m = pHdr->module;
switch (LOWORD(wParam))
{ case IDC_INSTLIST:
{ INSTRUMENT *inst = &m->instruments[moo];
uint x;
size_t cnt;
char *sbuf_p;
// --------------------
// Part 1: General instrument header info
// default volume, auto-vibrato, fadeout (in that order).
{
StringCbPrintfA(sbuf, sizeof(sbuf), "%d%%\n%s\n%s", (inst->globvol * 400) / 256,
WASABI_API_LNGSTRING_BUF((inst->vibdepth ? IDS_YES : IDS_NO),tmp1,sizeof(tmp1)/sizeof(*tmp1)),
WASABI_API_LNGSTRING_BUF((inst->volfade ? IDS_YES : IDS_NO),tmp2,sizeof(tmp2)/sizeof(*tmp2)));
SetWindowText(GetDlgItem(hwndDlg, IDC_INSTHEAD), sbuf);
}
//(inst->nnatype == NNA_CONTINUE) ? "Continue" : (inst->nnatype == NNA_OFF) ? "Off" : (inst->nnatype == NNA_FADE) ? "Fade" : "Cut");
// --------------------
// Part 2: The instrument envelope info (vol/pan/pitch)
// Wow this is ugly, but it works: Make a set of strings that have the
// '(loop / sustain)' string. Tricky, cuz the '/' is only added if it
// is needed of course.
if(inst->volflg & (EF_LOOP | EF_SUSTAIN))
{
StringCbPrintfA(st1, sizeof(st1), "(%s%s%s)",
(inst->volflg & EF_LOOP) ? WASABI_API_LNGSTRING(IDS_LOOP) : "",
((inst->volflg & EF_LOOP) && (inst->volflg & EF_SUSTAIN)) ? " / " : "",
(inst->volflg & EF_SUSTAIN) ? WASABI_API_LNGSTRING_BUF(IDS_SUSTAIN,tmp1,sizeof(tmp1)/sizeof(*tmp1)) : "");
} else st1[0] = 0;
if(inst->panflg & (EF_LOOP | EF_SUSTAIN))
{
StringCbPrintfA(st2, sizeof(st2), "(%s%s%s)",
(inst->panflg & EF_LOOP) ? WASABI_API_LNGSTRING(IDS_LOOP) : "",
((inst->panflg & EF_LOOP) && (inst->panflg & EF_SUSTAIN)) ? " / " : "",
(inst->panflg & EF_SUSTAIN) ? WASABI_API_LNGSTRING_BUF(IDS_SUSTAIN,tmp1,sizeof(tmp1)/sizeof(*tmp1)) : "");
} else st2[0] = 0;
if(inst->pitflg & (EF_LOOP | EF_SUSTAIN))
{
StringCchPrintfA(st3,sizeof(st3), "(%s%s%s)",
(inst->pitflg & EF_LOOP) ? WASABI_API_LNGSTRING(IDS_LOOP) : "",
((inst->pitflg & EF_LOOP) && (inst->pitflg & EF_SUSTAIN)) ? " / " : "",
(inst->pitflg & EF_SUSTAIN) ? WASABI_API_LNGSTRING_BUF(IDS_SUSTAIN,tmp1,sizeof(tmp1)/sizeof(*tmp1)) : "");
} else st3[0] = 0;
{
StringCbPrintfA(sbuf, sizeof(sbuf), "%s %s\n%s %s\n%s %s",
WASABI_API_LNGSTRING_BUF(((inst->volflg & EF_ON) ? IDS_ON : IDS_OFF),tmp1,sizeof(tmp1)/sizeof(*tmp1)),
st1[0] ? st1 : "",
WASABI_API_LNGSTRING_BUF(((inst->panflg & EF_ON) ? IDS_ON : IDS_OFF),tmp2,sizeof(tmp2)/sizeof(*tmp2)),
st2[0] ? st2 : "",
WASABI_API_LNGSTRING_BUF(((inst->pitflg & EF_ON) ? IDS_ON : IDS_OFF),tmp3,sizeof(tmp3)/sizeof(*tmp3)),
st3[0] ? st3 : "");
}
SetWindowText(GetDlgItem(hwndDlg, IDC_INSTENV), sbuf);
// --------------------
// Part 3: List of samples used by this instrument!
// the trick here is that that we have to figure out what samples are used from the
// sample index table in inst->samplenumber.
memset(pHdr->suse,0,m->numsmp*sizeof(BOOL));
for(x=0; x<120; x++)
if(inst->samplenumber[x] != 65535)
pHdr->suse[inst->samplenumber[x]] = 1;
sbuf[0] = 0; cnt = sizeof(sbuf)/sizeof(*sbuf);
sbuf_p = sbuf;
for (x=0; x<m->numsmp; x++)
{
if(pHdr->suse[x])
{
StringCbPrintfExA(sbuf_p, cnt, &sbuf_p, &cnt, 0, "%02d: %s\r\n",x+1, m->samples[x].samplename);
}
}
if (cnt < sizeof(sbuf)/sizeof(*sbuf))
{
sbuf[sizeof(sbuf)/sizeof(*sbuf) - cnt - 2] = 0; // cut off the final CR/LF set
}
SetWindowText(GetDlgItem(hwndDlg, TB_SAMPLELIST), sbuf);
}
break;
case IDC_SAMPLIST:
{ UNISAMPLE *samp = &m->samples[moo];
EXTSAMPLE *es = NULL;
if(m->extsamples) es = &m->extsamples[moo];
// Display sampe header info...
// Length, Format, Quality, Looping, Auto-vibrato, Volume, Panning (in that order).
{
char yn[64] = {0}, pp[64] = {0};
StringCbPrintfA(sbuf, sizeof(sbuf), "%d %s\n%d %s\n%s %s\n%s\n%s\n%d\n%d",
samp->length * (samp->format&SF_16BITS ? 2 : 1), WASABI_API_LNGSTRING_BUF(IDS_BYTES, tmp1, sizeof(tmp1)/sizeof(*tmp1)),
samp->speed, WASABI_API_LNGSTRING_BUF((m->flags&UF_XMPERIODS ? IDS_FINETUNE : (samp->format&SF_SIGNED ? IDS_HZ_SIGNED : IDS_HZ_UNSIGNED)),tmp2,sizeof(tmp2)/sizeof(*tmp2)),
samp->format & SF_16BITS ? "16" : "8", WASABI_API_LNGSTRING_BUF(IDS_BITS, tmp3, sizeof(tmp3)/sizeof(*tmp3)),
WASABI_API_LNGSTRING_BUF((samp->flags&SL_LOOP ? ( samp->flags&SL_BIDI ? IDS_PING_PONG : (samp->flags&SL_REVERSE ? IDS_REVERSE : IDS_FORWARD )) : samp->flags&SL_SUSTAIN_LOOP ? ( samp->flags&SL_SUSTAIN_BIDI ? IDS_SUSTAIN_PING_PONG : IDS_SUSTAIN ) : IDS_NONE),pp,sizeof(pp)/sizeof(*pp)),
WASABI_API_LNGSTRING_BUF(((es && es->vibdepth) ? IDS_YES : IDS_NO),yn,sizeof(yn)/sizeof(*yn)),
samp->volume, samp->panning);
}
SetWindowText(GetDlgItem(hwndDlg, IDC_SAMPINFO), sbuf);
}
break;
}
}
break;
}
return 0;
}
// =====================================================================================
static void OnSelChanged(HWND hwndDlg)
// =====================================================================================
{
DLGHDR *pHdr = (DLGHDR *) GetWindowLong(hwndDlg, GWL_USERDATA);
int iSel = TabCtrl_GetCurSel(pHdr->hwndTab);
if(pHdr->hwndDisplay) ShowWindow(pHdr->hwndDisplay,SW_HIDE);
ShowWindow(pHdr->apRes[iSel],SW_SHOW);
pHdr->hwndDisplay = pHdr->apRes[iSel];
// Note to self: Despite their inhernet use in interfaces, coding tab controls
// apparently REALLY sucks, and it should never ever be done again by myself
// or anyone else whom I respect as a sane individual and I would like to have
// remain that way. As for me, it is too late. Bruhahahaha!K!J!lkjgkljASBfkJBdglkn.
}
// =====================================================================================
static void CALLBACK UpdateInfoRight(HWND hwnd, UINT uMsg, UINT ident, DWORD systime)
// =====================================================================================
{
char str[256] = {0};
DLGHDR *pHdr = (DLGHDR *)GetWindowLong(hwnd, GWL_USERDATA);
MPLAYER *mp;
// Player info update .. BPM, sngspeed, position, row, voices.
// Only update if our mf struct is the same as the one currently loaded into the player.
if ((mp = get_player(pHdr->module)) == NULL)
{
// clean up
if (pHdr->inUse)
{
UNIMOD *m = pHdr->module;
pHdr->inUse = FALSE;
StringCbPrintfA(str, sizeof(str), WASABI_API_LNGSTRING(IDS_X_X_X_OF_X_NOT_PLAYING),
m->inittempo, m->initspeed, m->numpos);
SetDlgItemText(hwnd, IDC_INFORIGHT, str);
if (pHdr->seeker)
{
if (pHdr->seeker != mp)
Player_Free(pHdr->seeker);
pHdr->seeker = NULL;
}
}
// "track song" mode
if (mf && IsDlgButtonChecked(hwnd, IDC_TRACK)==BST_CHECKED)
{
SendMessage(hwnd, WM_USER+10, 0, 0);
infoDlg(GetParent(hwnd), mf, GetActiveWindow()==hwnd, FALSE);
PostMessage(hwnd, WM_CLOSE, 0, 0);
}
}
else
{
MPLAYER *seeker;
long acv;
if (!pHdr->inUse)
{
assert(pHdr->seeker == NULL);
pHdr->inUse = TRUE;
// create our new player instance specifically for seeking
if (!(config_playflag & CPLAYFLG_SEEKBYORDERS))
{
if ((pHdr->seeker = Player_Dup(mp)) == NULL)
return;
// steal statelist from the original player
// (this will not require special handling,
// because of a smart allocation system)
pHdr->seeker->statelist = mp->statelist;
pHdr->seeker->statecount = mp->statecount;
}
else pHdr->seeker = NULL;
}
// Seek to our new song time, using a bastardized version of Player_SetPosTime code:
if (pHdr->seeker)
{
long curtime = mikmod.GetOutputTime() * 64;
seeker = pHdr->seeker;
if (seeker->statelist)
{
int t = 0;
while (t<seeker->statecount &&
seeker->statelist[t].curtime &&
curtime>=seeker->statelist[t].curtime)
t++;
if (t)
Player_Restore(seeker, t - 1);
else Player_Cleaner(seeker);
}
else Player_Cleaner(seeker);
while(!seeker->ended && seeker->state.curtime<curtime)
Player_PreProcessRow(seeker, NULL);
}
else seeker = mp;
// Display all the goodie info we have collected:
// ---------------------------------------------
acv = Mikmod_GetActiveVoices(mp->vs->md);
if (acv > pHdr->maxv) pHdr->maxv = acv;
StringCbPrintfA(str, sizeof(str), WASABI_API_LNGSTRING(IDS_X_X_X_OF_X_X_OF_X_X_OF_X),
seeker->state.bpm, seeker->state.sngspd, seeker->state.sngpos,
seeker->mf->numpos, seeker->mf->positions[seeker->state.sngpos],
seeker->state.patpos, seeker->state.numrow, acv, pHdr->maxv);
SetWindowText(GetDlgItem(hwnd,IDC_INFORIGHT), str);
}
}
// =====================================================================================
void infoDlg(HWND hwnd, UNIMOD *m, BOOL activate, BOOL primiary)
// =====================================================================================
{
INFOBOX *box;
HWND dialog, hwndPrev;
char str[256] = {0};
if (!m) return;
//
// create local dataplace
//
box = (INFOBOX*)calloc(1, sizeof(INFOBOX));
if (!box) return;
box->dlg.left = 7;
box->dlg.top = 168;
box->dlg.module = m;
box->dlg.ownModule = primiary;
box->next = infobox_list;
infobox_list = box;
//
// create dialog
//
hwndPrev = GetActiveWindow();
box->hwnd = dialog = WASABI_API_CREATEDIALOG(IDD_ID3EDIT, hwnd, infoProc);
box->dlg.hwndTab = GetDlgItem(dialog, IDC_TAB);
SetWindowLong(dialog, GWL_USERDATA, (LONG)&box->dlg);
SetDlgItemText(dialog, IDC_ID3_FN, m->filename);
// IDC_INFOLEFT contains static module information:
// File Size, Length (in mins), channels, samples, instruments.
StringCbPrintfA(str, sizeof(str), WASABI_API_LNGSTRING(IDS_X_BTYES_X_OF_X_MINUTES),
m->filesize, m->songlen/60000,(m->songlen%60000)/1000, m->numchn, m->numsmp, m->numins);
SetDlgItemText(dialog, IDC_INFOLEFT, str);
SetDlgItemText(dialog, IDC_TITLE, m->songname);
SetDlgItemText(dialog, IDC_TYPE, m->modtype);
// IDC_INFORIGHT - contains player information
StringCbPrintfA(str, sizeof(str), WASABI_API_LNGSTRING(IDS_X_X_X_OF_X_NOT_PLAYING),
m->inittempo, m->initspeed, m->numpos);
SetDlgItemText(dialog, IDC_INFORIGHT, str);
// pHdr->suse is a samples-used block, allocated if this module uses
// instruments, and used to display the sampels that each inst uses
if (m->numins)
box->dlg.suse = (BOOL*)calloc(m->numsmp, sizeof(BOOL));
CheckDlgButton(dialog, IDC_TRACK, config_track ? BST_CHECKED : BST_UNCHECKED);
infoTabInit(dialog, m, &box->dlg);
SetTimer(dialog, 1, 50, UpdateInfoRight);
ShowWindow(dialog, SW_SHOW);
if (!activate) SetActiveWindow(hwndPrev); // do not steal focus
}
// =====================================================================================
void info_killseeker(HWND hwnd)
// =====================================================================================
{
DLGHDR *pHdr = (DLGHDR *)GetWindowLong(hwnd, GWL_USERDATA);
if (pHdr->seeker)
{
assert(pHdr->inUse);
if (pHdr->seeker != mp)
Player_Free(pHdr->seeker);
pHdr->seeker = NULL;
}
pHdr->inUse = FALSE;
}
// =====================================================================================
static BOOL CALLBACK infoProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
// =====================================================================================
{
UNIMOD *m = NULL;
switch (uMsg)
{
case WM_INITDIALOG:
{
RECT rect, wrect;
if (GetWindowRect(mikmod.hMainWindow, &wrect) && GetWindowRect(hwndDlg, &rect))
{
wrect.left += config_info_x;
wrect.top += config_info_y;
if (wrect.left>=0 && wrect.top>=0 &&
wrect.left<GetSystemMetrics(SM_CXFULLSCREEN)-16 &&
wrect.top<GetSystemMetrics(SM_CYFULLSCREEN)-16)
MoveWindow(hwndDlg, wrect.left, wrect.top, rect.right-rect.left, rect.bottom-rect.top, FALSE);
}
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDOK:
case IDCANCEL:
SendMessage(hwndDlg, WM_CLOSE, 0, 0);
break;
case IDC_TRACK:
config_track = IsDlgButtonChecked(hwndDlg, IDC_TRACK) == BST_CHECKED;
break;
}
break;
case WM_USER + 10:
case WM_CLOSE:
// save offset
{
RECT rect, wrect;
if (GetWindowRect(mikmod.hMainWindow, &wrect) && GetWindowRect(hwndDlg, &rect))
{
config_info_x = rect.left - wrect.left;
config_info_y = rect.top - wrect.top;
}
}
config_track = IsDlgButtonChecked(hwndDlg, IDC_TRACK) == BST_CHECKED;
// clean up
if (uMsg != WM_CLOSE)
break;
KillTimer(hwndDlg, 1);
infobox_delete(hwndDlg);
config_write();
break;
case WM_NOTIFY:
{
NMHDR *notice = (NMHDR*)lParam;
switch(notice->code)
{
case TCN_SELCHANGE:
OnSelChanged(hwndDlg);
break;
}
}
return TRUE;
}
return 0;
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,11 @@
#ifndef NULLSOFT_API_H
#define NULLSOFT_API_H
#include <api/service/waServiceFactory.h>
#include "../Agave/Language/api_language.h"
#include <api/application/api_application.h>
#define WASABI_API_APP applicationApi
#endif

View file

@ -0,0 +1,254 @@
#include <windows.h>
#include <malloc.h>
#include "mikmod.h"
#include "virtch.h"
#include "main.h"
#include <io.h>
#include <sys/stat.h>
#include <fcntl.h>
#define BUFSIZE 28
typedef struct AMP_LOCALINFO
{
uint mode;
uint mixspeed;
uint channels;
SBYTE RAW_DMABUF[(BUFSIZE*1024*2) + 64]; // added 64 for mmx mixer (it's not exact :)
int block_len, bits,ismono, bytes_per_sec;
} AMP_LOCALINFO;
extern int decode_pos; // from main.c
// =====================================================================================
static BOOL RAW_IsThere(void)
// =====================================================================================
{
return 1;
}
// =====================================================================================
static BOOL RAW_Init(MDRIVER *md, uint latency, void *optstr)
// =====================================================================================
{
AMP_LOCALINFO *hwdata;
hwdata = (AMP_LOCALINFO *)MikMod_calloc(md->allochandle, 1, sizeof(AMP_LOCALINFO));
md->device.vc = VC_Init();
if(!md->device.vc)
{ mikmod.outMod->Close();
return 1;
}
hwdata->mode = DMODE_16BITS | DMODE_INTERP | DMODE_NOCLICK;
hwdata->mixspeed = 48000;
hwdata->channels = 2;
md->device.local = hwdata;
return 0;
}
// =====================================================================================
static void RAW_Exit(MDRIVER *md)
// =====================================================================================
{
VC_Exit(md->device.vc);
mikmod.outMod->Close();
}
// =====================================================================================
static void RAW_Update(MDRIVER *md)
// =====================================================================================
{
AMP_LOCALINFO *hwdata = md->device.local;
int l;
char * vis;
int visbits;
if ((l=mikmod.outMod->CanWrite()) > hwdata->block_len*16) l = hwdata->block_len*16;
if (mikmod.dsp_isactive()) l>>=1;
if (l > hwdata->block_len)
{ int o=0;
l -= l % hwdata->block_len;
VC_WriteBytes(md, hwdata->RAW_DMABUF, l);
while (o < l)
{
int a = min(hwdata->block_len,l-o);
if (mikmod.dsp_isactive())
{ int t;
int k = (hwdata->bits>>3)*(hwdata->ismono?1:2);
t = mikmod.dsp_dosamples((short *)(hwdata->RAW_DMABUF+o),a / k,hwdata->bits,(hwdata->ismono?1:2),hwdata->mixspeed) * k;
mikmod.outMod->Write(hwdata->RAW_DMABUF+o,t);
} else
mikmod.outMod->Write(hwdata->RAW_DMABUF+o,a);
vis=hwdata->RAW_DMABUF+o;
visbits=hwdata->bits;
if (visbits > 16)
{
uint n = 576 * 2>>hwdata->ismono;
const uint d = visbits >> 3;
WORD *const visbuf = (WORD*)alloca(n * sizeof(WORD));
char *ptr = vis + d - 2;
WORD *vp = visbuf;
for (;n;n--)
{
*vp++ = *(WORD*)ptr;
ptr += d;
}
vis=(char*)visbuf;
visbits=16;
}
mikmod.SAAddPCMData(vis,hwdata->ismono ? 1 : 2, visbits, decode_pos/64);
mikmod.VSAAddPCMData(vis,hwdata->ismono ? 1 : 2, visbits, decode_pos/64);
decode_pos += (a*1000*64) / hwdata->bytes_per_sec;
o+=a;
}
} else Sleep(6);
}
// =====================================================================================
static BOOL RAW_SetMode(MDRIVER *md, uint mixspeed, uint mode, uint channels, uint cpumode)
// =====================================================================================
{
AMP_LOCALINFO *hwdata = md->device.local;
// Check capabilities...
// [...]
// Set the new mode of play
if (mixspeed) hwdata->mixspeed = mixspeed;
if(!(mode & DMODE_DEFAULT)) hwdata->mode = mode;
switch(channels)
{ case MD_MONO:
hwdata->channels = 1;
break;
default:
hwdata->channels = 2;
channels = MD_STEREO;
break;
}
VC_SetMode(md->device.vc, hwdata->mixspeed, hwdata->mode, channels, cpumode);
{
int bits = (hwdata->mode & DMODE_16BITS) ? 16: ((hwdata->mode & DMODE_24BITS) ? 24 : 8);
int z;
int a = 576*2*(bits>>3);
hwdata->bits = bits;
hwdata->ismono = (hwdata->channels == 1) ? 1 : 0;
if (hwdata->ismono) a/=2;
hwdata->block_len = a;
hwdata->bytes_per_sec = hwdata->mixspeed * (hwdata->bits>>3) * (hwdata->ismono ? 1 : 2);
z = mikmod.outMod->Open(hwdata->mixspeed,hwdata->channels,bits,-1,-1);
if (z < 0) return 1;
mikmod.SAVSAInit(z,hwdata->mixspeed);
mikmod.VSASetInfo(hwdata->mixspeed,hwdata->channels);
mikmod.outMod->SetVolume(-666);
}
return 0;
}
// =====================================================================================
static BOOL AMP_SetSoftVoices(MDRIVER *md, uint voices)
// =====================================================================================
{
return VC_SetSoftVoices(md->device.vc, voices);
}
// =====================================================================================
static void AMP_GetMode(MDRIVER *md, uint *mixspeed, uint *mode, uint *channels, uint *cpumode)
// =====================================================================================
{
VC_GetMode(md->device.vc, mixspeed, mode, channels, cpumode);
}
// =====================================================================================
MD_DEVICE drv_amp =
// =====================================================================================
{
"win32au",
BLAH("Nullsoft win32 output driver v0.700"),
0, VC_MAXVOICES,
NULL,
NULL,
NULL,
// Sample Loading
VC_SampleAlloc,
VC_SampleGetPtr,
VC_SampleLoad,
VC_SampleUnload,
VC_SampleSpace,
VC_SampleLength,
// Detection and Initialization
RAW_IsThere,
RAW_Init,
RAW_Exit,
RAW_Update,
VC_Preempt,
NULL,
AMP_SetSoftVoices,
RAW_SetMode,
AMP_GetMode,
VC_SetVolume,
VC_GetVolume,
// Voice control and Voie information
VC_GetActiveVoices,
VC_VoiceSetVolume,
VC_VoiceGetVolume,
VC_VoiceSetFrequency,
VC_VoiceGetFrequency,
VC_VoiceSetPosition,
VC_VoiceGetPosition,
VC_VoiceSetSurround,
VC_VoiceSetResonance,
VC_VoicePlay,
VC_VoiceResume,
VC_VoiceStop,
VC_VoiceStopped,
VC_VoiceReleaseSustain,
VC_VoiceRealVolume,
};

View file

@ -0,0 +1,176 @@
#include <windows.h>
#include <malloc.h>
#include "mikmod.h"
#include "virtch.h"
#include "main.h"
#include <io.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "drv_buffer.h"
#define BUFSIZE 28
// =====================================================================================
static BOOL Decode_IsThere(void)
// =====================================================================================
{
return 1;
}
// =====================================================================================
static BOOL Decode_Init(MDRIVER *md, uint latency, void *optstr)
// =====================================================================================
{
DecodeInfo *hwdata;
hwdata = (DecodeInfo *)MikMod_calloc(md->allochandle, 1, sizeof(DecodeInfo));
md->device.vc = VC_Init();
if(!md->device.vc)
{
hwdata->error = 1;
return 1;
}
hwdata->mode = DMODE_16BITS | DMODE_INTERP | DMODE_NOCLICK;
hwdata->mixspeed = 48000;
hwdata->channels = 2;
md->device.local = hwdata;
return 0;
}
// =====================================================================================
static void Decode_Exit(MDRIVER *md)
// =====================================================================================
{
DecodeInfo *hwdata = (DecodeInfo *)md->device.local;
VC_Exit(md->device.vc);
}
// =====================================================================================
static void Decode_Update(MDRIVER *md)
// =====================================================================================
{
DecodeInfo *hwdata = (DecodeInfo *)md->device.local;
hwdata->bytesWritten = VC_WriteBytes(md, (SBYTE *)hwdata->buffer, hwdata->buffersize);
}
// =====================================================================================
static BOOL Decode_SetMode(MDRIVER *md, uint mixspeed, uint mode, uint channels, uint cpumode)
// =====================================================================================
{
DecodeInfo *hwdata = (DecodeInfo *)md->device.local;
// Check capabilities...
// [...]
// Set the new mode of play
if (mixspeed) hwdata->mixspeed = mixspeed;
if(!(mode & DMODE_DEFAULT)) hwdata->mode = mode;
switch(channels)
{
case MD_MONO:
hwdata->channels = 1;
break;
default:
hwdata->channels = 2;
channels = MD_STEREO;
break;
}
VC_SetMode(md->device.vc, hwdata->mixspeed, hwdata->mode, channels, cpumode);
int bits = (hwdata->mode & DMODE_16BITS) ? 16: ((hwdata->mode & DMODE_24BITS) ? 24 : 8);
hwdata->bits = bits;
hwdata->frame_size = MulDiv(hwdata->channels, bits, 8);
return 0;
}
// =====================================================================================
static BOOL Decode_SetSoftVoices(MDRIVER *md, uint voices)
// =====================================================================================
{
return VC_SetSoftVoices(md->device.vc, voices);
}
// =====================================================================================
static void Decode_GetMode(MDRIVER *md, uint *mixspeed, uint *mode, uint *channels, uint *cpumode)
// =====================================================================================
{
VC_GetMode(md->device.vc, mixspeed, mode, channels, cpumode);
}
// =====================================================================================
extern "C" MD_DEVICE drv_buffer =
// =====================================================================================
{
"ExtendedRead",
BLAH("Nullsoft Extended Read decode driver v0.1"),
0, VC_MAXVOICES,
NULL,
NULL,
NULL,
// Sample Loading
VC_SampleAlloc,
VC_SampleGetPtr,
VC_SampleLoad,
VC_SampleUnload,
VC_SampleSpace,
VC_SampleLength,
// Detection and Initialization
Decode_IsThere,
Decode_Init,
Decode_Exit,
Decode_Update,
VC_Preempt,
NULL,
Decode_SetSoftVoices,
Decode_SetMode,
Decode_GetMode,
VC_SetVolume,
VC_GetVolume,
// Voice control and Voie information
VC_GetActiveVoices,
VC_VoiceSetVolume,
VC_VoiceGetVolume,
VC_VoiceSetFrequency,
VC_VoiceGetFrequency,
VC_VoiceSetPosition,
VC_VoiceGetPosition,
VC_VoiceSetSurround,
VC_VoiceSetResonance,
VC_VoicePlay,
VC_VoiceResume,
VC_VoiceStop,
VC_VoiceStopped,
VC_VoiceReleaseSustain,
VC_VoiceRealVolume,
};

View file

@ -0,0 +1,18 @@
#pragma once
#include "mikmod.h"
struct DecodeInfo
{
uint mode;
uint mixspeed;
uint channels;
void *buffer;
size_t buffersize;
int bits;
int frame_size; // cached channels*bits/8
int error;
size_t bytesWritten;
};
//extern MD_DEVICE drv_buffer;

View file

@ -0,0 +1,241 @@
#include <windows.h>
#include <mmio.h>
#include <shlwapi.h>
#include "../../winamp/wa_ipc.h"
#include "../../winamp/in2.h"
extern In_Module mikmod;
//big mess here
typedef struct // quick _thiscall hack
{
char *(_fastcall *GetDescription)(void*,int);
int (_fastcall *Open)(void*,int,char *url, int *killswitch);
int (_fastcall *Read)(void*,int,void *buffer, int length, int *killswitch);
int (_fastcall *GetLength)(void*);
int (_fastcall *CanSeek)(void*);
int (_fastcall *Seek)(void*,int,int position, int *killswitch);
char *(_fastcall *GetHeader)(void*,int,char *name);
void (_fastcall *Release)(void*,int,int); // rough ~WReader() hack
} RF_vtbl;
#define RF_Open(x,a,b) (*x)->Open(x,0,a,b)
#define RF_Read(x,a,b,c) (*x)->Read(x,0,a,b,c)
#define RF_GetLength(x) (*x)->GetLength(x)
#define RF_Seek(x,a,b) (*x)->Seek(x,0,a,b)
#define RF_Release(x) (*x)->Release(x,0,0)
#define READ_VER 0x100
typedef struct
{
int version;
char *description;
RF_vtbl ** (_cdecl *create)();
int (_cdecl *ismine)(char *url);
} reader_source;
typedef int (_cdecl *RF_entry)(HINSTANCE hIns,reader_source** s);
static int initialized,got_dll;
static HINSTANCE hRF;
typedef struct
{
RF_vtbl ** r;
UINT size,pos;
} RFstruct;
static RF_vtbl** (_cdecl *rf_create)();
static int rf_init()
{
wchar_t fn[MAX_PATH] = {0};
RF_entry rf_entry;
reader_source * source;
if (initialized) return got_dll;
initialized=1;
PathCombineW(fn, (wchar_t*)SendMessage(mikmod.hMainWindow, WM_WA_IPC, 0, IPC_GETSHAREDDLLDIRECTORYW), L"read_file.dll");
hRF=LoadLibraryW(fn);
if (!hRF) return 0;
rf_entry = (RF_entry)GetProcAddress(hRF,"readerSource");
if (!rf_entry)
{
FreeLibrary(hRF);
return 0;
}
rf_entry(hRF,&source);
if (source->version!=READ_VER)
{
FreeLibrary(hRF);
return 0;
}
rf_create=source->create;
got_dll=1;
return 1;
}
static void rf_quit()
{
if (got_dll)
{
FreeLibrary(hRF);
got_dll=0;
}
initialized=0;
}
static void * _cdecl rfopen(const char * fn)
{
int ks;
RF_vtbl ** r;
RFstruct * rs;
if (!got_dll) return 0;
r=rf_create();
if (!r) return 0;
ks=0;
if (RF_Open(r,(char*)fn,&ks))
{
RF_Release(r);
return 0;
}
rs=malloc(sizeof(RFstruct));
if (!rs)
{
RF_Release(r);
return 0;
}
rs->r=r;
rs->pos=0;
rs->size=RF_GetLength(r);
return rs;
}
static size_t _cdecl rfread( void *buffer, size_t size, size_t count, void *stream )
{
RFstruct * rs;
int ks,rv;
UINT siz;
rs=stream;
ks=0;
siz=size*count;
if (siz>rs->size-rs->pos) siz=rs->size-rs->pos;//just to be sure
rv=RF_Read(rs->r,buffer,siz,&ks);
if (rv>0) rs->pos+=rv;
return rv;
}
static size_t _cdecl rfwrite( const void *buffer, size_t size, size_t count, void *stream ) {return -1;}
static int _cdecl rfgetc( void *stream )
{
RFstruct * rs;
int rv,ks;
rv=0;
ks=0;
rs=stream;
if (RF_Read(rs->r,&rv,1,&ks)>0) rs->pos++;
else rv=EOF;
return rv;
}
static int _cdecl rfputc( int c, void *stream )
{
// not implemented
return -1;
}
static int _cdecl rfseek( void *stream, long offset, int origin )
{
RFstruct * rs;
int ks;
UINT new_pos;
ks=0;
rs=stream;
switch(origin)
{
case SEEK_CUR:
new_pos=rs->pos+offset;
break;
case SEEK_END:
new_pos=rs->size+offset;
break;
case SEEK_SET:
new_pos=offset;
break;
default:
return -1;
}
if (new_pos>rs->size) new_pos=rs->size;
if (RF_Seek(rs->r,new_pos,&ks))
{
return -1;
}
rs->pos=new_pos;
return 0;
}
static long _cdecl rftell(void * stream)
{
RFstruct * rs=stream;
return rs->pos;
}
static int _cdecl rfeof(void * stream)
{
RFstruct * rs=stream;
return rs->pos==rs->size;
}
static int _cdecl rfclose(void * stream)
{
RFstruct * rs=stream;
RF_Release(rs->r);
free(rs);
return 0;
}
static const MMSTREAM_CALLBACK callback_rf =
{
rfread,
rfwrite,
rfgetc,
rfputc,
rfseek,
rftell,
rfeof,
rfclose
};
MMSTREAM *_mm_fopen_rf(const CHAR *fname)
{
void * handle;
if (!rf_init()) return 0;
handle = rfopen(fname);
if (!handle) return _mm_fopen(fname,"rb");
return _mmstream_createfp_callback(handle,0,&callback_rf);
}

View file

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
#include "../../../../Winamp/buildType.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,94,0,0
PRODUCTVERSION WINAMP_PRODUCTVER
FILEFLAGSMASK 0x17L
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Winamp SA"
VALUE "FileDescription", "Winamp Input Plug-in"
VALUE "FileVersion", "2,94,0,0"
VALUE "InternalName", "Nullsoft Module Decoder"
VALUE "LegalCopyright", "Copyright © 1998-2014 Winamp SA"
VALUE "LegalTrademarks", "Nullsoft and Winamp are trademarks of Winamp SA"
VALUE "OriginalFilename", "in_mod.dll"
VALUE "ProductName", "Winamp"
VALUE "ProductVersion", STR_WINAMP_PRODUCTVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END