Permalink
Browse files

Added Player_GetRow and Player_GetOrder functions. Fixed XCode project

  • Loading branch information...
1 parent b081973 commit fba052badc8a69adf8cbeb04288f9b154b2ee502 realtech committed Mar 30, 2005
Showing with 81 additions and 10 deletions.
  1. +4 −2 include/mikmod.h.in
  2. +2 −0 macosx/libmikmod.export
  3. +1 −0 macosx/libmikmod.xcode/project.pbxproj
  4. +41 −3 macosx/mikmod.h
  5. +22 −1 playercode/mplayer.c
  6. +6 −2 win32/mikmod.def
  7. +5 −2 win32/mikmod.h
View
6 include/mikmod.h.in
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod.h.in,v 1.1 2005/03/30 01:30:40 raphassenat Exp $
+ $Id: mikmod.h.in,v 1.2 2005/03/30 17:57:38 realtech Exp $
MikMod sound library include file
@@ -603,7 +603,9 @@ MIKMODAPI extern void Player_Mute(SLONG,...);
MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
-MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_GetRow(void);
+MIKMODAPI extern int Player_GetOrder(void);
typedef void (*MikMod_player_t)(void);
typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
View
2 macosx/libmikmod.export
@@ -95,6 +95,8 @@ _Player_ToggleMute
_Player_GetChannelVoice
_Player_GetChannelPeriod
_Player_QueryVoices
+_Player_GetRow
+_Player_GetOrder
_MikMod_RegisterPlayer
_md_volume
_md_musicvolume
View
1 macosx/libmikmod.xcode/project.pbxproj
@@ -8,6 +8,7 @@
014CEA440018CDF011CA2923 = {
buildSettings = {
COPY_PHASE_STRIP = NO;
+ GCC_ALTIVEC_EXTENSIONS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
View
44 macosx/mikmod.h
@@ -18,6 +18,14 @@
02111-1307, USA.
*/
+/*==============================================================================
+
+ $Id: mikmod.h,v 1.2 2005/03/30 17:57:41 realtech Exp $
+
+ MikMod sound library include file
+
+==============================================================================*/
+
#ifndef _MIKMOD_H_
#define _MIKMOD_H_
@@ -77,7 +85,7 @@ typedef char CHAR;
-#if defined(__arch64__) || defined(__alpha)
+#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__)
/* 64 bit architectures */
typedef signed char SBYTE; /* 1 byte, signed */
@@ -240,6 +248,11 @@ MIKMODAPI extern BOOL MikMod_InitThreads(void);
MIKMODAPI extern void MikMod_Lock(void);
MIKMODAPI extern void MikMod_Unlock(void);
+MIKMODAPI extern void* MikMod_malloc(size_t);
+MIKMODAPI extern void* MikMod_calloc(size_t,size_t);
+MIKMODAPI extern void* MikMod_realloc(void *, size_t);
+MIKMODAPI extern void MikMod_free(void*);
+
/*
* ========== Reader, Writer
*/
@@ -250,6 +263,8 @@ typedef struct MREADER {
BOOL (*Read)(struct MREADER*,void*,size_t);
int (*Get)(struct MREADER*);
BOOL (*Eof)(struct MREADER*);
+ long iobase;
+ long prev_iobase;
} MREADER;
typedef struct MWRITER {
@@ -326,12 +341,20 @@ typedef struct SAMPLE {
UBYTE divfactor; /* for sample scaling, maintains proper period slides */
ULONG seekpos; /* seek position in file */
SWORD handle; /* sample handle used by individual drivers */
+ void (*onfree)(void *ctx); /* called from Sample_Free if not NULL */
+ void *ctx; /* context passed to previous function*/
} SAMPLE;
/* Sample functions */
+MIKMODAPI extern SAMPLE *Sample_LoadRaw(CHAR *,ULONG rate, ULONG channel, ULONG flags);
+MIKMODAPI extern SAMPLE *Sample_LoadRawFP(FILE *fp,ULONG rate,ULONG channel, ULONG flags);
+MIKMODAPI extern SAMPLE *Sample_LoadRawMem(const char *buf, int len, ULONG rate, ULONG channel, ULONG flags);
+MIKMODAPI extern SAMPLE *Sample_LoadRawGeneric(MREADER*reader,ULONG rate, ULONG channel, ULONG flags);
+
MIKMODAPI extern SAMPLE *Sample_Load(CHAR*);
MIKMODAPI extern SAMPLE *Sample_LoadFP(FILE*);
+MIKMODAPI extern SAMPLE *Sample_LoadMem(const char *buf, int len);
MIKMODAPI extern SAMPLE *Sample_LoadGeneric(MREADER*);
MIKMODAPI extern void Sample_Free(SAMPLE*);
MIKMODAPI extern SBYTE Sample_Play(SAMPLE*,ULONG,UBYTE);
@@ -533,6 +556,7 @@ MIKMODAPI extern struct MLOADER load_asy; /* ASYLUM Music Format 1.0 */
MIKMODAPI extern struct MLOADER load_dsm; /* DSIK internal module format */
MIKMODAPI extern struct MLOADER load_far; /* Farandole Composer (by Daniel Potter) */
MIKMODAPI extern struct MLOADER load_gdm; /* General DigiMusic (by Edward Schlunder) */
+MIKMODAPI extern struct MLOADER load_gt2; /* Graoumf tracker */
MIKMODAPI extern struct MLOADER load_it; /* Impulse Tracker (by Jeffrey Lim) */
MIKMODAPI extern struct MLOADER load_imf; /* Imago Orpheus (by Lutz Roeder) */
MIKMODAPI extern struct MLOADER load_med; /* Amiga MED modules (by Teijo Kinnunen) */
@@ -553,9 +577,13 @@ MIKMODAPI extern struct MLOADER load_xm; /* FastTracker 2 (by Triton) */
MIKMODAPI extern MODULE* Player_Load(CHAR*,int,BOOL);
MIKMODAPI extern MODULE* Player_LoadFP(FILE*,int,BOOL);
+MIKMODAPI extern MODULE* Player_LoadMem(const char *buffer,int len,int maxchan,BOOL curious);
MIKMODAPI extern MODULE* Player_LoadGeneric(MREADER*,int,BOOL);
MIKMODAPI extern CHAR* Player_LoadTitle(CHAR*);
MIKMODAPI extern CHAR* Player_LoadTitleFP(FILE*);
+MIKMODAPI extern CHAR* Player_LoadTitleMem(const char *buffer,int len);
+MIKMODAPI extern CHAR* Player_LoadTitleGeneric(MREADER*);
+
MIKMODAPI extern void Player_Free(MODULE*);
MIKMODAPI extern void Player_Start(MODULE*);
MIKMODAPI extern BOOL Player_Active(void);
@@ -576,9 +604,11 @@ MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_GetRow(void);
+MIKMODAPI extern int Player_GetOrder(void);
-typedef void (MikMod_player)(void);
-typedef MikMod_player *MikMod_player_t;
+typedef void (*MikMod_player_t)(void);
+typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
MIKMODAPI extern MikMod_player_t MikMod_RegisterPlayer(MikMod_player_t);
@@ -612,6 +642,8 @@ enum {
#define DMODE_SURROUND 0x0100 /* enable surround sound */
#define DMODE_INTERP 0x0200 /* enable interpolation */
#define DMODE_REVERSE 0x0400 /* reverse stereo */
+#define DMODE_SIMDMIXER 0x0800 /* enable SIMD mixing */
+#define DMODE_NOISEREDUCTION 0x1000 /* Low pass filtering */
struct SAMPLOAD;
typedef struct MDRIVER {
@@ -687,6 +719,7 @@ MIKMODAPI extern struct MDRIVER drv_aix; /* AIX audio device */
MIKMODAPI extern struct MDRIVER drv_alsa; /* Advanced Linux Sound Architecture (ALSA) */
MIKMODAPI extern struct MDRIVER drv_esd; /* Enlightened sound daemon (EsounD) */
MIKMODAPI extern struct MDRIVER drv_hp; /* HP-UX audio device */
+MIKMODAPI extern struct MDRIVER drv_nas; /* Network Audio System (NAS) */
MIKMODAPI extern struct MDRIVER drv_oss; /* OpenSound System (Linux,FreeBSD...) */
MIKMODAPI extern struct MDRIVER drv_sgi; /* SGI audio library */
MIKMODAPI extern struct MDRIVER drv_sun; /* Sun/NetBSD/OpenBSD audio device */
@@ -700,6 +733,11 @@ MIKMODAPI extern struct MDRIVER drv_win; /* Win32 multimedia API driver */
MIKMODAPI extern struct MDRIVER drv_mac; /* Macintosh Sound Manager driver */
MIKMODAPI extern struct MDRIVER drv_osx; /* MacOS X CoreAudio Driver */
+MIKMODAPI extern struct MDRIVER drv_gp32; /* GP32 Sound driver */
+
+MIKMODAPI extern struct MDRIVER drv_wss; /* DOS WSS driver */
+MIKMODAPI extern struct MDRIVER drv_sb; /* DOS SB driver */
+
/*========== Virtual channel mixer interface (for user-supplied drivers only) */
MIKMODAPI extern BOOL VC_Init(void);
View
23 playercode/mplayer.c
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mplayer.c,v 1.1 2005/03/30 01:31:04 raphassenat Exp $
+ $Id: mplayer.c,v 1.2 2005/03/30 17:57:43 realtech Exp $
The Protracker Player Driver
@@ -3334,6 +3334,27 @@ MIKMODAPI BOOL Player_Paused(void)
return result;
}
+
+// Get current module order
+MIKMODAPI int Player_GetOrder(void)
+{
+ int ret;
+ MUTEX_LOCK(vars);
+ ret = pf ? pf->positions[pf->sngpos ? pf->sngpos-1 : 0]: 0;
+ MUTEX_UNLOCK(vars);
+ return ret;
+}
+
+// Get current module row
+MIKMODAPI int Player_GetRow(void)
+{
+ int ret;
+ MUTEX_LOCK(vars);
+ ret = pf ? pf->patpos : 0;
+ MUTEX_UNLOCK(vars);
+ return ret;
+}
+
MIKMODAPI void Player_TogglePause(void)
{
MUTEX_LOCK(vars);
View
8 win32/mikmod.def
@@ -1,4 +1,4 @@
-DESCRIPTION "libmikmod (win32) 3.1.10"
+DESCRIPTION "libmikmod (win32) 3.2.2"
EXPORTS
MikMod_GetVersion @1
@@ -111,7 +111,7 @@ EXPORTS
load_uni @125
load_xm @126
load_gdm @127
- load_okt @128
+ load_okt @128
VC_Init @141
VC_Exit @142
@@ -136,4 +136,8 @@ EXPORTS
VC_VoiceGetFrequency @161
VC_VoiceGetPanning @162
VC_SetCallback @163
+
+ Player_GetRow @164
+ Player_GetOrder @165
+
View
7 win32/mikmod.h
@@ -20,7 +20,7 @@
/*==============================================================================
- $Id: mikmod.h,v 1.1 2005/03/30 01:31:07 raphassenat Exp $
+ $Id: mikmod.h,v 1.2 2005/03/30 17:57:45 realtech Exp $
MikMod sound library include file
@@ -604,7 +604,10 @@ MIKMODAPI extern void Player_Mute(SLONG,...);
MIKMODAPI extern void Player_ToggleMute(SLONG,...);
MIKMODAPI extern int Player_GetChannelVoice(UBYTE);
MIKMODAPI extern UWORD Player_GetChannelPeriod(UBYTE);
-MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_QueryVoices(UWORD numvoices, VOICEINFO *vinfo);
+MIKMODAPI extern int Player_GetRow(void);
+MIKMODAPI extern int Player_GetOrder(void);
+
typedef void (*MikMod_callback_t)(unsigned char *data, size_t len);
typedef void (*MikMod_player_t)(void);

0 comments on commit fba052b

Please sign in to comment.