Update of /cvsroot/pure-data/externals/iemlib/iem_mp3/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16686/iemlib/iem_mp3/src
Added Files: iem_mp3.c iem_mp3.dsp iem_mp3.dsw iemlib.h makefile makefile_linux makefile_win mp3play~.c Log Message: // class_sethelpsymbol(); changed help-*.pd to *-help.pd chanded file structure to standard 1st step remove old
--- NEW FILE: makefile_linux --- current: all
.SUFFIXES: .pd_linux
INCLUDE = -I. -I/usr/local/src/pd/src
LDFLAGS = -export-dynamic -shared LIB = -ldl -lm -lpthread
#select either the DBG and OPT compiler flags below:
CFLAGS = -DPD -DUNIX -W -Werror -Wno-unused \ -Wno-parentheses -Wno-switch -O6 -funroll-loops -fomit-frame-pointer -fno-strict-aliasing \ -DDL_OPEN
SYSTEM = $(shell uname -m)
# the sources
SRC = mp3play~.c \ iem_mp3.c
TARGET = iem_mp3.pd_linux
OBJ = $(SRC:.c=.o)
# # ------------------ targets ------------------------------------ #
clean: rm $(TARGET) rm *.o
all: $(OBJ) @echo :: $(OBJ) $(LD) $(LDFLAGS) -o $(TARGET) *.o $(LIB) strip --strip-unneeded $(TARGET)
$(OBJ) : %.o : %.c $(CC) $(CFLAGS) $(INCLUDE) -c -o $*.o $*.c
--- NEW FILE: iem_mp3.dsp --- # Microsoft Developer Studio Project File - Name="iem_mp3" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) External Target" 0x0106
CFG=iem_mp3 - Win32 Debug !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "iem_mp3.mak". !MESSAGE !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "iem_mp3.mak" CFG="iem_mp3 - Win32 Debug" !MESSAGE !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE !MESSAGE "iem_mp3 - Win32 Release" (basierend auf "Win32 (x86) External Target") !MESSAGE "iem_mp3 - Win32 Debug" (basierend auf "Win32 (x86) External Target") !MESSAGE
# Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath ""
!IF "$(CFG)" == "iem_mp3 - Win32 Release"
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_mp3.exe" # PROP Bsc_Name "iem_mp3.bsc" # PROP Target_Dir ""
!ELSEIF "$(CFG)" == "iem_mp3 - Win32 Debug"
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Cmd_Line "NMAKE /f makefile_win" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "makefile_win.exe" # PROP BASE Bsc_Name "makefile_win.bsc" # PROP BASE Target_Dir "" # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Cmd_Line "NMAKE /f makefile_win" # PROP Rebuild_Opt "/a" # PROP Target_File "iem_mp3.exe" # PROP Bsc_Name "iem_mp3.bsc" # PROP Target_Dir ""
!ENDIF
# Begin Target
# Name "iem_mp3 - Win32 Release" # Name "iem_mp3 - Win32 Debug"
!IF "$(CFG)" == "iem_mp3 - Win32 Release"
!ELSEIF "$(CFG)" == "iem_mp3 - Win32 Debug"
!ENDIF
# Begin Source File
SOURCE=.\makefile_win # End Source File # End Target # End Project
--- NEW FILE: makefile_win --- all: ..\iem_mp3.dll
VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio\Vc98" PD_INST_PATH = "C:\Programme\pd-0.39-2" PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include PD_WIN_C_FLAGS = /nologo /W3 /WX /DMSW /DNT /DPD /DWIN32 /DWINDOWS /Ox -DPA_LITTLE_ENDIAN PD_WIN_L_FLAGS = /nologo
PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NODEFAULTLIB:uuid \ $(VIS_CPP_PATH)\lib\libc.lib \ $(VIS_CPP_PATH)\lib\oldnames.lib \ $(VIS_CPP_PATH)\lib\kernel32.lib \ $(VIS_CPP_PATH)\lib\wsock32.lib \ $(VIS_CPP_PATH)\lib\winmm.lib \ $(PD_INST_PATH)\bin\pthreadVC.lib \ $(PD_INST_PATH)\bin\pd.lib
SRC = mp3play~.c \ iem_mp3.c
OBJ = $(SRC:.c=.obj)
.c.obj: cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c
..\iem_mp3.dll: $(OBJ) link $(PD_WIN_L_FLAGS) /dll /export:iem_mp3_setup \ /out:..\iem_mp3.dll $(OBJ) $(PD_WIN_LIB)
clean: del *.obj
--- NEW FILE: makefile --- TARGET = iem_mp3
include ../../Make.include
--- NEW FILE: iem_mp3.dsw --- (This appears to be a binary file; contents omitted.)
--- NEW FILE: mp3play~.c --- /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
iem_mp3 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
/* mp3play~.c - Mpeg Layer III Player for PD Version:0.1 05-18-2000 written by Thomas Musil (musil_at_iem.at), Norbert Math (math_at_iem.kug.ac.at) IEM Graz
debugged for windows 013-03-2003
This MPEG Player is based on the mpglib 0.2 by Michael Hipp which comes with mpg123-0.59r
please see the README file for copyright notices!
*/ [...3820 lines suppressed...] }
void mp3play_tilde_setup(void) { mp3play_tilde_class = class_new(gensym("mp3play~"), (t_newmethod)mp3play_tilde_new, (t_method)mp3play_tilde_free, sizeof(t_mp3play_tilde), 0, 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_dsp, gensym("dsp"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_start, gensym("start"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_ft1, gensym("ft1"), A_FLOAT, 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_stop, gensym("stop"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_pause, gensym("pause"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_again_at, gensym("open_again_at"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open, gensym("open"), A_DEFSYM, 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_again, gensym("open_again"), 0); class_addmethod(mp3play_tilde_class, (t_method)mp3play_tilde_open_at, gensym("open_at"), A_DEFSYM, 0); // class_sethelpsymbol(mp3play_tilde_class, gensym("iemhelp/help-mp3play~")); /*post("\nmp3play~ written by thomas musil & norbert math\nV 0.1 iem graz austria 05 2000\n");*/ }
--- NEW FILE: iemlib.h --- /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
iemlib written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
#ifndef __IEMLIB_H__ #define __IEMLIB_H__
#define IS_A_POINTER(atom,index) ((atom+index)->a_type == A_POINTER) #define IS_A_FLOAT(atom,index) ((atom+index)->a_type == A_FLOAT) #define IS_A_SYMBOL(atom,index) ((atom+index)->a_type == A_SYMBOL) #define IS_A_DOLLAR(atom,index) ((atom+index)->a_type == A_DOLLAR) #define IS_A_DOLLSYM(atom,index) ((atom+index)->a_type == A_DOLLSYM) #define IS_A_SEMI(atom,index) ((atom+index)->a_type == A_SEMI) #define IS_A_COMMA(atom,index) ((atom+index)->a_type == A_COMMA)
#ifdef NT int sys_noloadbang; //t_symbol *iemgui_key_sym=0; #include <io.h> #else extern int sys_noloadbang; //extern t_symbol *iemgui_key_sym; #include <unistd.h> #endif
#define DEFDELVS 64 #define XTRASAMPS 4 #define SAMPBLK 4
#define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */
/* machine-dependent definitions. These ifdefs really should have been by CPU type and not by operating system! */ #ifdef IRIX /* big-endian. Most significant byte is at low address in memory */ #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #define int32 long /* a data type that has 32 bits */ #else #ifdef MSW /* little-endian; most significant byte is at highest address */ #define HIOFFSET 1 #define LOWOFFSET 0 #define int32 long #else #ifdef __FreeBSD__ #include <machine/endian.h> #if BYTE_ORDER == LITTLE_ENDIAN #define HIOFFSET 1 #define LOWOFFSET 0 #else #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #endif /* BYTE_ORDER */ #include <sys/types.h> #define int32 int32_t #endif #ifdef __linux__
#include <endian.h>
#if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) #error No byte order defined #endif
#if __BYTE_ORDER == __LITTLE_ENDIAN #define HIOFFSET 1 #define LOWOFFSET 0 #else #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #endif /* __BYTE_ORDER */
#include <sys/types.h> #define int32 int32_t
#else #ifdef __APPLE__ #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #define int32 int /* a data type that has 32 bits */
#endif /* __APPLE__ */ #endif /* __linux__ */ #endif /* MSW */ #endif /* SGI */
union tabfudge { double tf_d; int32 tf_i[2]; };
#ifdef __i386__ #define IEM_DENORMAL(f) ((((*(unsigned int*)&(f))&0x60000000)==0) || \ (((*(unsigned int*)&(f))&0x60000000)==0x60000000)) /* more stringent test: anything not between 1e-19 and 1e19 in absolute val */ #else
#define IEM_DENORMAL(f) 0
#endif
#endif
--- NEW FILE: iem_mp3.c --- /* For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution.
iem_mp3 written by Thomas Musil, Copyright (c) IEM KUG Graz Austria 2000 - 2006 */
#include "m_pd.h" #include "iemlib.h"
static t_class *iem_mp3_class;
static void *iem_mp3_new(void) { t_object *x = (t_object *)pd_new(iem_mp3_class);
return (x); }
void mp3play_tilde_setup(void);
/* ------------------------ setup routine ------------------------- */
void iem_mp3_setup(void) { iem_mp3_class = class_new(gensym("iem_mp3"), iem_mp3_new, 0, sizeof(t_object), CLASS_NOINLET, 0);
mp3play_tilde_setup();
post("iem_mp3 (R-1.17) library loaded! (c) Thomas Musil 11.2006"); post(" musil%ciem.at iem KUG Graz Austria", '@'); }