[SCM] pd-readanysf/master: Imported Upstream version 0.43
zmoelnig-guest at users.alioth.debian.org
zmoelnig-guest at users.alioth.debian.org
Thu Jun 27 16:47:01 UTC 2013
The following commit has been merged in the master branch:
commit f3db15c74594a70a658a1c44bf9ab3ed66cdee38
Author: IOhannes m zmölnig <zmoelnig at iem.at>
Date: Thu Jun 27 18:15:45 2013 +0200
Imported Upstream version 0.43
diff --git a/.svn/all-wcprops b/.svn/all-wcprops
new file mode 100644
index 0000000..57ebfd7
--- /dev/null
+++ b/.svn/all-wcprops
@@ -0,0 +1,65 @@
+K 25
+svn:wc:ra_dav:version-url
+V 67
+/svnroot/pure-data/!svn/ver/15685/trunk/externals/august/readanysf~
+END
+anysndfiler.pd
+K 25
+svn:wc:ra_dav:version-url
+V 82
+/svnroot/pure-data/!svn/ver/13732/trunk/externals/august/readanysf~/anysndfiler.pd
+END
+readanysf~-meta.pd
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/readanysf~-meta.pd
+END
+screengrab0.40.png
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/svnroot/pure-data/!svn/ver/13732/trunk/externals/august/readanysf~/screengrab0.40.png
+END
+embed-MacOSX-dependencies.sh
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/svnroot/pure-data/!svn/ver/15660/trunk/externals/august/readanysf~/embed-MacOSX-dependencies.sh
+END
+readanysf~-help.pd
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/svnroot/pure-data/!svn/ver/14251/trunk/externals/august/readanysf~/readanysf~-help.pd
+END
+jamesdunn_buzz_stresstest.pd
+K 25
+svn:wc:ra_dav:version-url
+V 96
+/svnroot/pure-data/!svn/ver/15685/trunk/externals/august/readanysf~/jamesdunn_buzz_stresstest.pd
+END
+Makefile.win
+K 25
+svn:wc:ra_dav:version-url
+V 80
+/svnroot/pure-data/!svn/ver/15685/trunk/externals/august/readanysf~/Makefile.win
+END
+Makefile
+K 25
+svn:wc:ra_dav:version-url
+V 76
+/svnroot/pure-data/!svn/ver/16185/trunk/externals/august/readanysf~/Makefile
+END
+README
+K 25
+svn:wc:ra_dav:version-url
+V 74
+/svnroot/pure-data/!svn/ver/13732/trunk/externals/august/readanysf~/README
+END
+READMEmacpkg.txt
+K 25
+svn:wc:ra_dav:version-url
+V 84
+/svnroot/pure-data/!svn/ver/13732/trunk/externals/august/readanysf~/READMEmacpkg.txt
+END
diff --git a/.svn/entries b/.svn/entries
new file mode 100644
index 0000000..2c32750
--- /dev/null
+++ b/.svn/entries
@@ -0,0 +1,371 @@
+10
+
+dir
+16184
+https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/august/readanysf~
+https://pure-data.svn.sourceforge.net/svnroot/pure-data
+
+
+
+2011-10-30T18:02:26.448014Z
+15685
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+df7eb9d6-776f-4174-a42d-0ffd8d5d5b5d
+
+READMEmacpkg.txt
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+d2476addcfcb4021f09459959d39789c
+2010-07-28T09:14:17.977129Z
+13732
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+322
+
+anysndfiler.pd
+file
+
+
+
+
+2012-08-30T14:46:58.247399Z
+9d68d7c21f3089a3e42a058d54d6280f
+2010-07-28T09:14:17.977129Z
+13732
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3400
+
+readanysf~-meta.pd
+file
+
+
+
+
+2012-08-30T14:46:58.247399Z
+9904b2b5b954437256a34940f980ece6
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+201
+
+screengrab0.40.png
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+711a0a0a4108145f68b80eb688b9898c
+2010-07-28T09:14:17.977129Z
+13732
+augmentus
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+31276
+
+embed-MacOSX-dependencies.sh
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+6ac408ad51fe9a295f3b05a0f3462284
+2011-10-27T02:07:29.056739Z
+15660
+eighthave
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2773
+
+readanysf~-help.pd
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+ab4db7375ba78eab3d0c330ed630e42f
+2010-11-01T05:18:52.115446Z
+14251
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3767
+
+jamesdunn_buzz_stresstest.pd
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+f388c53d4e0dcaaf65e13e44c1779edf
+2011-10-30T18:02:26.448014Z
+15685
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1337
+
+src
+dir
+
+Makefile.win
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+b8e6dc83535a5a1c2f7573b418e8a477
+2011-10-30T18:02:26.448014Z
+15685
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1765
+
+Makefile
+file
+16185
+
+
+
+2012-08-30T15:17:17.292419Z
+539195709e2efecd631b370dbd864d84
+2012-08-30T15:32:17.066167Z
+16185
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3568
+
+README
+file
+
+
+
+
+2012-08-30T14:46:58.251399Z
+bbc8d4fde6875910b53564799aa10772
+2010-07-28T09:14:17.977129Z
+13732
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1532
+
diff --git a/.svn/prop-base/embed-MacOSX-dependencies.sh.svn-base b/.svn/prop-base/embed-MacOSX-dependencies.sh.svn-base
new file mode 100644
index 0000000..869ac71
--- /dev/null
+++ b/.svn/prop-base/embed-MacOSX-dependencies.sh.svn-base
@@ -0,0 +1,5 @@
+K 14
+svn:executable
+V 1
+*
+END
diff --git a/.svn/prop-base/screengrab0.40.png.svn-base b/.svn/prop-base/screengrab0.40.png.svn-base
new file mode 100644
index 0000000..5e9587e
--- /dev/null
+++ b/.svn/prop-base/screengrab0.40.png.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
diff --git a/Makefile b/.svn/text-base/Makefile.svn-base
similarity index 54%
copy from Makefile
copy to .svn/text-base/Makefile.svn-base
index 080b55e..ea36077 100644
--- a/Makefile
+++ b/.svn/text-base/Makefile.svn-base
@@ -1,73 +1,71 @@
# Edit these two variables to suit your system.
# You need both gavl and gmerlin_avdec libs to compile
-#
-GAVLPATH=/usr/local/include
-PDPATH=/usr/local/include
+GAVLPREFIX=/usr/local
+#GAVLPREFIX=/opt/gmerlin
+PD_INCLUDES=/usr/include
-VERSION=0.42
-UNAME := $(shell uname)
-ifeq ($(UNAME), Linux)
-TARGET=pd_linux
-else
-# assume darwin here
-GAVLPATH=/sw/include
-PDPATH=/Applications/Pd-extended.app/Contents/Resources/include/
-TARGET=pd_darwin
-endif
+# SHOULDN'T REALLY NEED TO EDIT BELOW HERE
-##############################################
-LBITS := $(shell getconf LONG_BIT)
-ifeq ($(LBITS),64)
- # do 64 bit stuff here, like set some CFLAGS
-CFLAGS = -fPIC -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
-else
- # do 32 bit stuff here
-CFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
-endif
+VERSION=0.43
+UNAME := $(shell uname)
+ifneq ($(UNAME), Darwin)
+# simplistic approach to handle Debians non-linux architectures (kFreeBSD,
+# kHurd) the same as linux
+UNAME=Linux
+endif
ifeq ($(UNAME), Linux)
+TARGET=pd_linux
STRIP=strip --strip-unneeded
-# optimizations?
-#CFLAGS += -O1 -funroll-loops -fomit-frame-pointer \
-# -Wall -W -Wshadow \
-# -Wno-unused -Wno-parentheses -Wno-switch
-LDFLAGS = -L/usr/local/lib -lpthread -lgavl -lgmerlin_avdec
+PD_LDFLAGS = -L$(GAVLPREFIX)/lib -lgavl -lgmerlin_avdec -lpthread
+GAVLPATH=$(GAVLPREFIX)/include
+CXXFLAGS=-Wall
+PD_CXXFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES)
else
# assume darwin here
+GAVLPATH=/sw/include
+PD_INCLUDES=/Applications/Pd-extended.app/Contents/Resources/include/
+TARGET=pd_darwin
STRIP=strip -x
-CFLAGS += -I/sw/include -fast -fPIC
-LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
-#LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
-# -L/sw/lib -weak_framework Carbon -lc -L/sw/lib -lgavl -lgmerlin_avdec
+PD_CXXFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES)
+PD_CXXFLAGS += -I/sw/include -fast
+PD_LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
+#PD_LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
+# -L/sw/lib -weak_framework Carbon -lc -L/sw/lib -lgavl -lgmerlin_avdec
# os 10.4
-#CFLAGS += -mmacosx-version-min=10.4 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-#LDFLAGS = -L/sw/lib -lgavl -lgmerlin_avdec \
+#PD_CXXFLAGS += -mmacosx-version-min=10.4 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+#PD_LDFLAGS = -L/sw/lib -lgavl -lgmerlin_avdec \
# -dynamiclib -undefined dynamic_lookup -lsupc++ -mmacosx-version-min=10.4 \
-# -lSystem.B -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+# -lSystem.B -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif
+##############################################
+PD_CXXFLAGS += -fPIC
-
+PD_CXXFLAGS += $(CXXFLAGS)
+PD_LDFLAGS += $(LDFLAGS)
all: $(TARGET)
pd_linux: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
- g++ -shared -o readanysf~.pd_linux $(CFLAGS) $(LDFLAGS) \
+ $(CXX) -shared -o readanysf~.pd_linux $(PD_CXXFLAGS) \
src/readanysf~.cpp \
objs/FifoAudioFrames.o \
objs/FifoVideoFrames.o \
- objs/ReadMedia.o
+ objs/ReadMedia.o \
+ $(PD_LDFLAGS)
$(STRIP) readanysf~.pd_linux
pd_darwin: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
- g++ $(LDFLAGS) -o readanysf~.pd_darwin $(CFLAGS) \
+ $(CXX) -o readanysf~.pd_darwin $(PD_CXXFLAGS) \
src/readanysf~.cpp \
objs/FifoAudioFrames.o \
objs/FifoVideoFrames.o \
- objs/ReadMedia.o
+ objs/ReadMedia.o \
+ $(PD_LDFLAGS)
$(STRIP) readanysf~.pd_darwin
mkdir -p readanysf~$(VERSION)_MacOSX-Intel
mkdir -p readanysf~$(VERSION)_MacOSX-Intel/readanysf~
@@ -78,16 +76,21 @@ pd_darwin: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o obj
tar -cvf readanysf~$(VERSION)_MacOSX-Intel.tar readanysf~$(VERSION)_MacOSX-Intel/
gzip readanysf~$(VERSION)_MacOSX-Intel.tar
-objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
- g++ -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
+objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o objs/
+ $(CXX) -c -o objs/ReadMedia.o src/ReadMedia.cpp $(PD_CXXFLAGS)
-objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h
- g++ -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
+objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h objs/
+ $(CXX) -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(PD_CXXFLAGS)
-objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h
- g++ -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
+objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h objs/
+ $(CXX) -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(PD_CXXFLAGS)
clean:
if [ -d readanysf~$(VERSION)_MacOSX-Intel ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel; fi;
if [ -f readanysf~$(VERSION)_MacOSX-Intel.tar.gz ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel.tar.gz; fi;
- rm -f objs/*.o readanysf~.pd_*
+ rm -f objs/*.o readanysf~.pd_*
+ rm -rf objs
+
+objs/:
+ mkdir $@
+
diff --git a/.svn/text-base/Makefile.win.svn-base b/.svn/text-base/Makefile.win.svn-base
new file mode 100644
index 0000000..b9c2ad9
--- /dev/null
+++ b/.svn/text-base/Makefile.win.svn-base
@@ -0,0 +1,47 @@
+GAVLPREFIX=/usr/local
+PD_INCLUDES=/usr/local/include
+GMERLIN_LIBS= -lgmerlin_avdec -lgavl.dll -lpng -lz -lintl -liconv -lws2_32 -lflac -lwsock32 -lregex -ldl \
+ -logg -lvorbis -lvorbisenc -la52 -ldca -lspeex -ltiff -ltheora -lfaad
+
+
+# SHOULDN'T REALLY NEED TO EDIT BELOW HERE
+
+VERSION=0.43
+
+PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)
+GAVLPATH=$(GAVLPREFIX)/include
+
+STRIP=strip --strip-unneeded -R .note -R .comment
+
+LDFLAGS = -s -shared -Wl,--enable-auto-import
+LDFLAGS += -L$(GAVLPREFIX)/lib -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
+LDFLAGS += -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 -lpthreadGC2 $(GMERLIN_LIBS)
+
+
+CFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES) \
+ -Wall -Wno-unused -Wunused-variable -Wno-trigraphs -g -I. -mms-bitfields -DNT -DPD -fPIC
+
+
+all: pd_win
+
+pd_win: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
+ g++ -o readanysf~.dll \
+ src/readanysf~.cpp \
+ objs/FifoAudioFrames.o \
+ objs/FifoVideoFrames.o \
+ objs/ReadMedia.o $(CFLAGS) $(LDFLAGS)
+ $(STRIP) readanysf~.dll
+
+objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
+ g++ -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
+
+objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h
+ g++ -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
+
+objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h
+ g++ -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
+
+clean:
+ if [ -d readanysf~$(VERSION)_MacOSX-Intel ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel; fi;
+ if [ -f readanysf~$(VERSION)_MacOSX-Intel.tar.gz ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel.tar.gz; fi;
+ rm
diff --git a/README b/.svn/text-base/README.svn-base
similarity index 100%
copy from README
copy to .svn/text-base/README.svn-base
diff --git a/READMEmacpkg.txt b/.svn/text-base/READMEmacpkg.txt.svn-base
similarity index 100%
copy from READMEmacpkg.txt
copy to .svn/text-base/READMEmacpkg.txt.svn-base
diff --git a/anysndfiler.pd b/.svn/text-base/anysndfiler.pd.svn-base
similarity index 100%
copy from anysndfiler.pd
copy to .svn/text-base/anysndfiler.pd.svn-base
diff --git a/embed-MacOSX-dependencies.sh b/.svn/text-base/embed-MacOSX-dependencies.sh.svn-base
old mode 100755
new mode 100644
similarity index 79%
copy from embed-MacOSX-dependencies.sh
copy to .svn/text-base/embed-MacOSX-dependencies.sh.svn-base
index 0612b0c..ac49914
--- a/embed-MacOSX-dependencies.sh
+++ b/.svn/text-base/embed-MacOSX-dependencies.sh.svn-base
@@ -4,7 +4,6 @@
# current folder so that it becomes a libdir to be installed into /Library/Pd.
# <hans at at.or.at>
-LIB_DIR=/Library/Pd/readanysf~
PD_APP_LIB=$1
echo " "
@@ -17,8 +16,8 @@ for pd_darwin in `find . -name '*.pd_darwin'`; do
echo " $lib"
install -vp /sw/lib/$lib $PD_APP_LIB
new_lib=`echo $lib | sed 's|.*/\(.*\.dylib\)|\1|'`
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $pd_darwin
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $pd_darwin
done
echo " "
fi
@@ -36,8 +35,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
@@ -56,8 +55,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
@@ -76,8 +75,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
diff --git a/.svn/text-base/jamesdunn_buzz_stresstest.pd.svn-base b/.svn/text-base/jamesdunn_buzz_stresstest.pd.svn-base
new file mode 100644
index 0000000..77d0ca1
--- /dev/null
+++ b/.svn/text-base/jamesdunn_buzz_stresstest.pd.svn-base
@@ -0,0 +1,53 @@
+#N canvas 560 185 516 458 10;
+#X obj 100 192 readanysf~ 2;
+#X msg 40 106 open Gunfire.wav;
+#X obj 100 411 dac~;
+#X obj 101 373 *~;
+#X obj 134 374 *~;
+#X msg 104 162 play;
+#X msg 145 162 stop;
+#X obj 199 281 vsl 15 50 0 1 0 0 empty empty empty 0 -9 0 10 -257985
+-1 -1 1470 1;
+#X msg 199 339 \$1 50;
+#X obj 198 358 line~;
+#X obj 396 247 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 169 216 route ready samplerate length cache float bang;
+#X obj 40 23 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
+;
+#X obj 178 245 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 40 60 metro 300;
+#X obj 386 42 loadbang;
+#X msg 349 98 \; pd dsp 1;
+#X msg 421 102 0.3;
+#X msg 259 42 1;
+#X floatatom 318 301 0 0 0 0 - - -;
+#X obj 318 276 + 1;
+#X obj 261 277 float;
+#X connect 0 0 3 0;
+#X connect 0 1 4 0;
+#X connect 0 2 11 0;
+#X connect 1 0 0 0;
+#X connect 3 0 2 0;
+#X connect 4 0 2 1;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 4 1;
+#X connect 9 0 3 1;
+#X connect 11 0 13 0;
+#X connect 11 5 10 0;
+#X connect 12 0 14 0;
+#X connect 13 0 5 0;
+#X connect 13 0 21 0;
+#X connect 14 0 1 0;
+#X connect 15 0 16 0;
+#X connect 15 0 17 0;
+#X connect 15 0 18 0;
+#X connect 17 0 7 0;
+#X connect 18 0 12 0;
+#X connect 20 0 19 0;
+#X connect 20 0 21 1;
+#X connect 21 0 20 0;
diff --git a/.svn/text-base/readanysf~-help.pd.svn-base b/.svn/text-base/readanysf~-help.pd.svn-base
new file mode 100644
index 0000000..a5eff59
--- /dev/null
+++ b/.svn/text-base/readanysf~-help.pd.svn-base
@@ -0,0 +1,117 @@
+#N canvas 13 56 842 642 10;
+#X obj 28 367 dac~;
+#X obj 28 332 *~ 0;
+#X obj 69 332 *~ 0;
+#X obj 651 106 vsl 15 50 0.01 1.3 1 0 empty empty empty 0 -8 0 8 -241291
+-1 -1 4411 0;
+#X msg 112 140 play;
+#X msg 193 139 pause;
+#X msg 348 121 speed \$1;
+#X floatatom 348 98 5 0 0 0 - - -;
+#X obj 588 15 loadbang;
+#X msg 390 75 1;
+#X msg 601 51 \; pd dsp 1 \;;
+#X floatatom 662 160 5 0 0 0 - - -;
+#X msg 12 126 open \$1;
+#X obj 12 98 openpanel;
+#X obj 12 66 bng 25 250 50 0 empty empty empty 17 7 0 10 -4032 -1 -1
+;
+#X msg 152 139 stop;
+#X floatatom 345 173 16 0 0 0 - - -;
+#X msg 345 193 pcm_seek \$1;
+#X obj 348 150 hsl 128 15 0 7.368e+06 0 0 empty empty empty -2 -8 0
+10 -260818 -1 -1 0 1;
+#X msg 348 74 0.21;
+#X msg 78 73 open http://www.fro.at:8008/fro-64.ogg.m3u;
+#X floatatom 262 552 5 0 0 0 - - -;
+#X floatatom 308 504 5 0 0 0 - - -;
+#X floatatom 217 582 5 0 0 0 - - -;
+#X msg 722 253 loop \$1;
+#X obj 722 233 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+1;
+#X floatatom 353 467 5 0 0 0 - - -;
+#X obj 444 404 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 217 378 route ready samplerate length cache float bang;
+#X floatatom 399 435 5 0 0 0 - - -;
+#X text 262 581 ready: status for when a file is loaded and ready;
+#X text 306 594 to play. If you load a file from disk or;
+#X text 306 608 from the net \, it may take a while to load;
+#X text 305 621 depending on disk activity and net bandwidth.;
+#X text 394 466 cache: percentage (0.0->1.0) of;
+#X text 435 479 cache being used.;
+#X text 469 405 bang: end of file.;
+#X msg 588 87 0.8;
+#X obj 29 269 readanysf~ 4 32 256;
+#X obj 651 179 s v;
+#X obj 38 294 r v;
+#X obj 108 332 *~ 0;
+#X obj 149 332 *~ 0;
+#X text 671 130 Volume;
+#X text 217 300 <- readanysf~ has 3 possible creation args 1) number
+of channels (all channels will be up or down mixed accordingly) default
+is 2 channels. 2) number of "frames" in the internal buffer. Default=24
+3) number of samples per frame in internal buffer. Default is your
+blocksize.;
+#X msg 98 96 open http://wnycam.streamguys.com;
+#X floatatom 494 176 16 0 0 0 - - -;
+#X obj 497 153 hsl 128 15 0 500 0 0 empty empty empty -2 -8 0 10 -260818
+-1 -1 0 1;
+#X msg 494 196 time_seek \$1;
+#X msg 329 242 tick 100;
+#X text 404 231 send cache \, length output every X ticks;
+#X text 402 244 "tick 1" sends out every single dsp cycle;
+#X text 720 214 loop on/off;
+#X text 441 434 float: position of file in seconds;
+#X text 482 447 relative to the file's samplerate;
+#X text 347 503 length: total duration of file in seconds;
+#X text 394 529 (will be empty for network streams);
+#X text 396 516 relative to file's internal samplerate;
+#X text 320 553 The samplerate of the file being played.;
+#X text 168 5 readanysf~ by August Black;
+#X text 170 40 august at alien.mur.at;
+#X text 172 26 please send comments \, suggest \, bugs \, donations
+->;
+#X connect 1 0 0 0;
+#X connect 2 0 0 1;
+#X connect 3 0 11 0;
+#X connect 3 0 39 0;
+#X connect 4 0 38 0;
+#X connect 5 0 38 0;
+#X connect 6 0 38 0;
+#X connect 7 0 6 0;
+#X connect 8 0 37 0;
+#X connect 8 0 10 0;
+#X connect 9 0 7 0;
+#X connect 12 0 38 0;
+#X connect 13 0 12 0;
+#X connect 14 0 13 0;
+#X connect 15 0 38 0;
+#X connect 16 0 17 0;
+#X connect 17 0 38 0;
+#X connect 18 0 16 0;
+#X connect 19 0 7 0;
+#X connect 20 0 38 0;
+#X connect 24 0 38 0;
+#X connect 25 0 24 0;
+#X connect 28 0 23 0;
+#X connect 28 1 21 0;
+#X connect 28 2 22 0;
+#X connect 28 3 26 0;
+#X connect 28 4 29 0;
+#X connect 28 5 27 0;
+#X connect 37 0 3 0;
+#X connect 38 0 1 0;
+#X connect 38 1 2 0;
+#X connect 38 2 41 0;
+#X connect 38 3 42 0;
+#X connect 38 4 28 0;
+#X connect 40 0 1 1;
+#X connect 40 0 2 1;
+#X connect 40 0 41 1;
+#X connect 40 0 42 1;
+#X connect 45 0 38 0;
+#X connect 46 0 48 0;
+#X connect 47 0 46 0;
+#X connect 48 0 38 0;
+#X connect 49 0 38 0;
diff --git a/readanysf~-meta.pd b/.svn/text-base/readanysf~-meta.pd.svn-base
similarity index 100%
copy from readanysf~-meta.pd
copy to .svn/text-base/readanysf~-meta.pd.svn-base
diff --git a/screengrab0.40.png b/.svn/text-base/screengrab0.40.png.svn-base
similarity index 100%
copy from screengrab0.40.png
copy to .svn/text-base/screengrab0.40.png.svn-base
diff --git a/Makefile b/Makefile
index 080b55e..ea36077 100644
--- a/Makefile
+++ b/Makefile
@@ -1,73 +1,71 @@
# Edit these two variables to suit your system.
# You need both gavl and gmerlin_avdec libs to compile
-#
-GAVLPATH=/usr/local/include
-PDPATH=/usr/local/include
+GAVLPREFIX=/usr/local
+#GAVLPREFIX=/opt/gmerlin
+PD_INCLUDES=/usr/include
-VERSION=0.42
-UNAME := $(shell uname)
-ifeq ($(UNAME), Linux)
-TARGET=pd_linux
-else
-# assume darwin here
-GAVLPATH=/sw/include
-PDPATH=/Applications/Pd-extended.app/Contents/Resources/include/
-TARGET=pd_darwin
-endif
+# SHOULDN'T REALLY NEED TO EDIT BELOW HERE
-##############################################
-LBITS := $(shell getconf LONG_BIT)
-ifeq ($(LBITS),64)
- # do 64 bit stuff here, like set some CFLAGS
-CFLAGS = -fPIC -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
-else
- # do 32 bit stuff here
-CFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PDPATH) -Wall
-endif
+VERSION=0.43
+UNAME := $(shell uname)
+ifneq ($(UNAME), Darwin)
+# simplistic approach to handle Debians non-linux architectures (kFreeBSD,
+# kHurd) the same as linux
+UNAME=Linux
+endif
ifeq ($(UNAME), Linux)
+TARGET=pd_linux
STRIP=strip --strip-unneeded
-# optimizations?
-#CFLAGS += -O1 -funroll-loops -fomit-frame-pointer \
-# -Wall -W -Wshadow \
-# -Wno-unused -Wno-parentheses -Wno-switch
-LDFLAGS = -L/usr/local/lib -lpthread -lgavl -lgmerlin_avdec
+PD_LDFLAGS = -L$(GAVLPREFIX)/lib -lgavl -lgmerlin_avdec -lpthread
+GAVLPATH=$(GAVLPREFIX)/include
+CXXFLAGS=-Wall
+PD_CXXFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES)
else
# assume darwin here
+GAVLPATH=/sw/include
+PD_INCLUDES=/Applications/Pd-extended.app/Contents/Resources/include/
+TARGET=pd_darwin
STRIP=strip -x
-CFLAGS += -I/sw/include -fast -fPIC
-LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
-#LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
-# -L/sw/lib -weak_framework Carbon -lc -L/sw/lib -lgavl -lgmerlin_avdec
+PD_CXXFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES)
+PD_CXXFLAGS += -I/sw/include -fast
+PD_LDFLAGS = -bundle -undefined dynamic_lookup -L/sw/lib -lgavl -lgmerlin_avdec
+#PD_LDFLAGS += -bundle -bundle_loader $(pd_src)/bin/pd -undefined dynamic_lookup \
+# -L/sw/lib -weak_framework Carbon -lc -L/sw/lib -lgavl -lgmerlin_avdec
# os 10.4
-#CFLAGS += -mmacosx-version-min=10.4 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-#LDFLAGS = -L/sw/lib -lgavl -lgmerlin_avdec \
+#PD_CXXFLAGS += -mmacosx-version-min=10.4 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+#PD_LDFLAGS = -L/sw/lib -lgavl -lgmerlin_avdec \
# -dynamiclib -undefined dynamic_lookup -lsupc++ -mmacosx-version-min=10.4 \
-# -lSystem.B -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
+# -lSystem.B -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif
+##############################################
+PD_CXXFLAGS += -fPIC
-
+PD_CXXFLAGS += $(CXXFLAGS)
+PD_LDFLAGS += $(LDFLAGS)
all: $(TARGET)
pd_linux: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
- g++ -shared -o readanysf~.pd_linux $(CFLAGS) $(LDFLAGS) \
+ $(CXX) -shared -o readanysf~.pd_linux $(PD_CXXFLAGS) \
src/readanysf~.cpp \
objs/FifoAudioFrames.o \
objs/FifoVideoFrames.o \
- objs/ReadMedia.o
+ objs/ReadMedia.o \
+ $(PD_LDFLAGS)
$(STRIP) readanysf~.pd_linux
pd_darwin: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
- g++ $(LDFLAGS) -o readanysf~.pd_darwin $(CFLAGS) \
+ $(CXX) -o readanysf~.pd_darwin $(PD_CXXFLAGS) \
src/readanysf~.cpp \
objs/FifoAudioFrames.o \
objs/FifoVideoFrames.o \
- objs/ReadMedia.o
+ objs/ReadMedia.o \
+ $(PD_LDFLAGS)
$(STRIP) readanysf~.pd_darwin
mkdir -p readanysf~$(VERSION)_MacOSX-Intel
mkdir -p readanysf~$(VERSION)_MacOSX-Intel/readanysf~
@@ -78,16 +76,21 @@ pd_darwin: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o obj
tar -cvf readanysf~$(VERSION)_MacOSX-Intel.tar readanysf~$(VERSION)_MacOSX-Intel/
gzip readanysf~$(VERSION)_MacOSX-Intel.tar
-objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
- g++ -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
+objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o objs/
+ $(CXX) -c -o objs/ReadMedia.o src/ReadMedia.cpp $(PD_CXXFLAGS)
-objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h
- g++ -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
+objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h objs/
+ $(CXX) -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(PD_CXXFLAGS)
-objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h
- g++ -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
+objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h objs/
+ $(CXX) -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(PD_CXXFLAGS)
clean:
if [ -d readanysf~$(VERSION)_MacOSX-Intel ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel; fi;
if [ -f readanysf~$(VERSION)_MacOSX-Intel.tar.gz ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel.tar.gz; fi;
- rm -f objs/*.o readanysf~.pd_*
+ rm -f objs/*.o readanysf~.pd_*
+ rm -rf objs
+
+objs/:
+ mkdir $@
+
diff --git a/Makefile.win b/Makefile.win
new file mode 100644
index 0000000..b9c2ad9
--- /dev/null
+++ b/Makefile.win
@@ -0,0 +1,47 @@
+GAVLPREFIX=/usr/local
+PD_INCLUDES=/usr/local/include
+GMERLIN_LIBS= -lgmerlin_avdec -lgavl.dll -lpng -lz -lintl -liconv -lws2_32 -lflac -lwsock32 -lregex -ldl \
+ -logg -lvorbis -lvorbisenc -la52 -ldca -lspeex -ltiff -ltheora -lfaad
+
+
+# SHOULDN'T REALLY NEED TO EDIT BELOW HERE
+
+VERSION=0.43
+
+PD_PATH = $(shell cd "$(PROGRAMFILES)"/pd && pwd)
+GAVLPATH=$(GAVLPREFIX)/include
+
+STRIP=strip --strip-unneeded -R .note -R .comment
+
+LDFLAGS = -s -shared -Wl,--enable-auto-import
+LDFLAGS += -L$(GAVLPREFIX)/lib -L"$(PD_PATH)/src" -L"$(PD_PATH)/bin" -L"$(PD_PATH)/obj"
+LDFLAGS += -lpd -lwsock32 -lkernel32 -luser32 -lgdi32 -lpthreadGC2 $(GMERLIN_LIBS)
+
+
+CFLAGS = -I./ -I$(GAVLPATH) -I$(GAVLPATH)/gavl -I$(GAVLPATH)/gmerlin -I$(PD_INCLUDES) \
+ -Wall -Wno-unused -Wunused-variable -Wno-trigraphs -g -I. -mms-bitfields -DNT -DPD -fPIC
+
+
+all: pd_win
+
+pd_win: src/readanysf~.cpp objs/FifoVideoFrames.o objs/FifoAudioFrames.o objs/ReadMedia.o
+ g++ -o readanysf~.dll \
+ src/readanysf~.cpp \
+ objs/FifoAudioFrames.o \
+ objs/FifoVideoFrames.o \
+ objs/ReadMedia.o $(CFLAGS) $(LDFLAGS)
+ $(STRIP) readanysf~.dll
+
+objs/ReadMedia.o: src/ReadMedia.cpp src/ReadMedia.h objs/FifoAudioFrames.o objs/FifoVideoFrames.o
+ g++ -c -o objs/ReadMedia.o src/ReadMedia.cpp $(CFLAGS)
+
+objs/FifoAudioFrames.o: src/FifoAudioFrames.cpp src/FifoAudioFrames.h
+ g++ -c -o objs/FifoAudioFrames.o src/FifoAudioFrames.cpp $(CFLAGS)
+
+objs/FifoVideoFrames.o: src/FifoVideoFrames.cpp src/FifoVideoFrames.h
+ g++ -c -o objs/FifoVideoFrames.o src/FifoVideoFrames.cpp $(CFLAGS)
+
+clean:
+ if [ -d readanysf~$(VERSION)_MacOSX-Intel ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel; fi;
+ if [ -f readanysf~$(VERSION)_MacOSX-Intel.tar.gz ]; then rm -rf readanysf~$(VERSION)_MacOSX-Intel.tar.gz; fi;
+ rm
diff --git a/embed-MacOSX-dependencies.sh b/embed-MacOSX-dependencies.sh
index 0612b0c..ac49914 100755
--- a/embed-MacOSX-dependencies.sh
+++ b/embed-MacOSX-dependencies.sh
@@ -4,7 +4,6 @@
# current folder so that it becomes a libdir to be installed into /Library/Pd.
# <hans at at.or.at>
-LIB_DIR=/Library/Pd/readanysf~
PD_APP_LIB=$1
echo " "
@@ -17,8 +16,8 @@ for pd_darwin in `find . -name '*.pd_darwin'`; do
echo " $lib"
install -vp /sw/lib/$lib $PD_APP_LIB
new_lib=`echo $lib | sed 's|.*/\(.*\.dylib\)|\1|'`
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $pd_darwin
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $pd_darwin
done
echo " "
fi
@@ -36,8 +35,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
@@ -56,8 +55,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
@@ -76,8 +75,8 @@ for dylib in $PD_APP_LIB/*.dylib; do
else
install -vp /sw/lib/$lib $PD_APP_LIB
fi
- install_name_tool -id $LIB_DIR/$new_lib $PD_APP_LIB/$new_lib
- install_name_tool -change /sw/lib/$lib $LIB_DIR/$new_lib $dylib
+ install_name_tool -id @loader_path/$new_lib $PD_APP_LIB/$new_lib
+ install_name_tool -change /sw/lib/$lib @loader_path/$new_lib $dylib
done
echo " "
fi
diff --git a/jamesdunn_buzz_stresstest.pd b/jamesdunn_buzz_stresstest.pd
new file mode 100644
index 0000000..77d0ca1
--- /dev/null
+++ b/jamesdunn_buzz_stresstest.pd
@@ -0,0 +1,53 @@
+#N canvas 560 185 516 458 10;
+#X obj 100 192 readanysf~ 2;
+#X msg 40 106 open Gunfire.wav;
+#X obj 100 411 dac~;
+#X obj 101 373 *~;
+#X obj 134 374 *~;
+#X msg 104 162 play;
+#X msg 145 162 stop;
+#X obj 199 281 vsl 15 50 0 1 0 0 empty empty empty 0 -9 0 10 -257985
+-1 -1 1470 1;
+#X msg 199 339 \$1 50;
+#X obj 198 358 line~;
+#X obj 396 247 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 169 216 route ready samplerate length cache float bang;
+#X obj 40 23 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
+;
+#X obj 178 245 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+-1 -1;
+#X obj 40 60 metro 300;
+#X obj 386 42 loadbang;
+#X msg 349 98 \; pd dsp 1;
+#X msg 421 102 0.3;
+#X msg 259 42 1;
+#X floatatom 318 301 0 0 0 0 - - -;
+#X obj 318 276 + 1;
+#X obj 261 277 float;
+#X connect 0 0 3 0;
+#X connect 0 1 4 0;
+#X connect 0 2 11 0;
+#X connect 1 0 0 0;
+#X connect 3 0 2 0;
+#X connect 4 0 2 1;
+#X connect 5 0 0 0;
+#X connect 6 0 0 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 4 1;
+#X connect 9 0 3 1;
+#X connect 11 0 13 0;
+#X connect 11 5 10 0;
+#X connect 12 0 14 0;
+#X connect 13 0 5 0;
+#X connect 13 0 21 0;
+#X connect 14 0 1 0;
+#X connect 15 0 16 0;
+#X connect 15 0 17 0;
+#X connect 15 0 18 0;
+#X connect 17 0 7 0;
+#X connect 18 0 12 0;
+#X connect 20 0 19 0;
+#X connect 20 0 21 1;
+#X connect 21 0 20 0;
diff --git a/readanysf~-help.pd b/readanysf~-help.pd
index 90d6dd9..a5eff59 100644
--- a/readanysf~-help.pd
+++ b/readanysf~-help.pd
@@ -1,96 +1,98 @@
-#N canvas 676 30 736 649 10;
-#X obj 28 356 dac~;
-#X obj 28 321 *~ 0;
-#X obj 69 321 *~ 0;
-#X obj 579 94 vsl 15 50 0.01 1.3 1 0 empty empty empty 0 -8 0 8 -241291
+#N canvas 13 56 842 642 10;
+#X obj 28 367 dac~;
+#X obj 28 332 *~ 0;
+#X obj 69 332 *~ 0;
+#X obj 651 106 vsl 15 50 0.01 1.3 1 0 empty empty empty 0 -8 0 8 -241291
-1 -1 4411 0;
-#X msg 112 104 play;
-#X msg 193 103 pause;
-#X msg 276 109 speed \$1;
-#X floatatom 276 86 5 0 0 0 - - -;
-#X obj 516 8 loadbang;
-#X msg 318 63 1;
-#X msg 529 39 \; pd dsp 1 \;;
-#X floatatom 590 148 5 0 0 0 - - -;
-#X msg 12 115 open \$1;
-#X obj 12 87 openpanel;
-#X obj 12 63 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
--1;
-#X msg 152 103 stop;
-#X floatatom 273 161 16 0 0 0 - - -;
-#X msg 273 181 pcm_seek \$1;
-#X obj 276 138 hsl 128 15 0 7.368e+06 0 0 empty empty empty -2 -8 0
+#X msg 112 140 play;
+#X msg 193 139 pause;
+#X msg 348 121 speed \$1;
+#X floatatom 348 98 5 0 0 0 - - -;
+#X obj 588 15 loadbang;
+#X msg 390 75 1;
+#X msg 601 51 \; pd dsp 1 \;;
+#X floatatom 662 160 5 0 0 0 - - -;
+#X msg 12 126 open \$1;
+#X obj 12 98 openpanel;
+#X obj 12 66 bng 25 250 50 0 empty empty empty 17 7 0 10 -4032 -1 -1
+;
+#X msg 152 139 stop;
+#X floatatom 345 173 16 0 0 0 - - -;
+#X msg 345 193 pcm_seek \$1;
+#X obj 348 150 hsl 128 15 0 7.368e+06 0 0 empty empty empty -2 -8 0
10 -260818 -1 -1 0 1;
-#X msg 276 62 0.21;
-#X msg 105 8 open http://www.fro.at:8008/fro-64.ogg.m3u;
-#X floatatom 270 534 5 0 0 0 - - -;
-#X floatatom 323 494 5 0 0 0 - - -;
-#X floatatom 217 587 5 0 0 0 - - -;
-#X msg 650 241 loop \$1;
-#X obj 650 221 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
+#X msg 348 74 0.21;
+#X msg 78 73 open http://www.fro.at:8008/fro-64.ogg.m3u;
+#X floatatom 262 552 5 0 0 0 - - -;
+#X floatatom 308 504 5 0 0 0 - - -;
+#X floatatom 217 582 5 0 0 0 - - -;
+#X msg 722 253 loop \$1;
+#X obj 722 233 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
-#X floatatom 376 463 5 0 0 0 - - -;
-#X obj 482 398 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
+#X floatatom 353 467 5 0 0 0 - - -;
+#X obj 444 404 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
-#X obj 217 367 route ready samplerate length cache float bang;
-#X floatatom 429 421 5 0 0 0 - - -;
-#X text 262 586 ready: status for when a file is loaded and ready;
-#X text 319 599 to play. If you load a file from disk or;
-#X text 319 613 from the net \, it may take a while to load;
-#X text 318 626 depending on disk activity and net bandwidth.;
-#X text 329 534 samplerate of the file being played. The;
-#X text 371 496 length: length of file in seconds;
-#X text 372 509 (will be empty for network streams);
-#X text 424 463 cache: percentage (0.0->1.0) of;
-#X text 474 476 cache being used.;
-#X text 475 422 float: length in seconds;
-#X text 525 435 that have been;
-#X text 527 445 played so far.;
-#X text 508 398 bang: end of file.;
-#X msg 516 75 0.8;
-#X obj 29 258 readanysf~ 4 32 256;
-#X obj 579 167 s v;
-#X obj 38 283 r v;
-#X obj 108 321 *~ 0;
-#X obj 149 321 *~ 0;
-#X text 599 118 Volume;
-#X text 217 289 <- readanysf~ has 3 possible creation args 1) number
+#X obj 217 378 route ready samplerate length cache float bang;
+#X floatatom 399 435 5 0 0 0 - - -;
+#X text 262 581 ready: status for when a file is loaded and ready;
+#X text 306 594 to play. If you load a file from disk or;
+#X text 306 608 from the net \, it may take a while to load;
+#X text 305 621 depending on disk activity and net bandwidth.;
+#X text 394 466 cache: percentage (0.0->1.0) of;
+#X text 435 479 cache being used.;
+#X text 469 405 bang: end of file.;
+#X msg 588 87 0.8;
+#X obj 29 269 readanysf~ 4 32 256;
+#X obj 651 179 s v;
+#X obj 38 294 r v;
+#X obj 108 332 *~ 0;
+#X obj 149 332 *~ 0;
+#X text 671 130 Volume;
+#X text 217 300 <- readanysf~ has 3 possible creation args 1) number
of channels (all channels will be up or down mixed accordingly) default
is 2 channels. 2) number of "frames" in the internal buffer. Default=24
3) number of samples per frame in internal buffer. Default is your
blocksize.;
-#X msg 108 29 open http://wnycam.streamguys.com;
-#X floatatom 422 164 16 0 0 0 - - -;
-#X obj 425 141 hsl 128 15 0 500 0 0 empty empty empty -2 -8 0 10 -260818
+#X msg 98 96 open http://wnycam.streamguys.com;
+#X floatatom 494 176 16 0 0 0 - - -;
+#X obj 497 153 hsl 128 15 0 500 0 0 empty empty empty -2 -8 0 10 -260818
-1 -1 0 1;
-#X msg 422 184 time_seek \$1;
-#X msg 257 230 tick 100;
-#X text 332 219 send cache \, length output every X ticks;
-#X text 330 232 "tick 1" sends out every single dsp cycle;
-#X text 648 202 loop on/off;
-#X floatatom 75 502 0 0 0 0 - - -;
-#X obj 75 439 env~ 16384 8192;
+#X msg 494 196 time_seek \$1;
+#X msg 329 242 tick 100;
+#X text 404 231 send cache \, length output every X ticks;
+#X text 402 244 "tick 1" sends out every single dsp cycle;
+#X text 720 214 loop on/off;
+#X text 441 434 float: position of file in seconds;
+#X text 482 447 relative to the file's samplerate;
+#X text 347 503 length: total duration of file in seconds;
+#X text 394 529 (will be empty for network streams);
+#X text 396 516 relative to file's internal samplerate;
+#X text 320 553 The samplerate of the file being played.;
+#X text 168 5 readanysf~ by August Black;
+#X text 170 40 august at alien.mur.at;
+#X text 172 26 please send comments \, suggest \, bugs \, donations
+->;
#X connect 1 0 0 0;
#X connect 2 0 0 1;
#X connect 3 0 11 0;
-#X connect 3 0 45 0;
-#X connect 4 0 44 0;
-#X connect 5 0 44 0;
-#X connect 6 0 44 0;
+#X connect 3 0 39 0;
+#X connect 4 0 38 0;
+#X connect 5 0 38 0;
+#X connect 6 0 38 0;
#X connect 7 0 6 0;
-#X connect 8 0 43 0;
+#X connect 8 0 37 0;
#X connect 8 0 10 0;
#X connect 9 0 7 0;
-#X connect 12 0 44 0;
+#X connect 12 0 38 0;
#X connect 13 0 12 0;
#X connect 14 0 13 0;
-#X connect 15 0 44 0;
+#X connect 15 0 38 0;
#X connect 16 0 17 0;
-#X connect 17 0 44 0;
+#X connect 17 0 38 0;
#X connect 18 0 16 0;
#X connect 19 0 7 0;
-#X connect 20 0 44 0;
-#X connect 24 0 44 0;
+#X connect 20 0 38 0;
+#X connect 24 0 38 0;
#X connect 25 0 24 0;
#X connect 28 0 23 0;
#X connect 28 1 21 0;
@@ -98,20 +100,18 @@ blocksize.;
#X connect 28 3 26 0;
#X connect 28 4 29 0;
#X connect 28 5 27 0;
-#X connect 43 0 3 0;
-#X connect 44 0 1 0;
-#X connect 44 1 2 0;
-#X connect 44 2 47 0;
-#X connect 44 3 48 0;
-#X connect 44 4 28 0;
-#X connect 46 0 1 1;
-#X connect 46 0 2 1;
-#X connect 46 0 47 1;
-#X connect 46 0 48 1;
-#X connect 51 0 44 0;
-#X connect 52 0 54 0;
-#X connect 53 0 52 0;
-#X connect 54 0 44 0;
-#X connect 55 0 44 0;
-#X connect 60 0 59 0;
-#X connect 60 0 59 0;
+#X connect 37 0 3 0;
+#X connect 38 0 1 0;
+#X connect 38 1 2 0;
+#X connect 38 2 41 0;
+#X connect 38 3 42 0;
+#X connect 38 4 28 0;
+#X connect 40 0 1 1;
+#X connect 40 0 2 1;
+#X connect 40 0 41 1;
+#X connect 40 0 42 1;
+#X connect 45 0 38 0;
+#X connect 46 0 48 0;
+#X connect 47 0 46 0;
+#X connect 48 0 38 0;
+#X connect 49 0 38 0;
diff --git a/src/.svn/all-wcprops b/src/.svn/all-wcprops
new file mode 100644
index 0000000..24ef52e
--- /dev/null
+++ b/src/.svn/all-wcprops
@@ -0,0 +1,47 @@
+K 25
+svn:wc:ra_dav:version-url
+V 71
+/svnroot/pure-data/!svn/ver/15685/trunk/externals/august/readanysf~/src
+END
+FifoVideoFrames.h
+K 25
+svn:wc:ra_dav:version-url
+V 89
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/src/FifoVideoFrames.h
+END
+ReadMedia.h
+K 25
+svn:wc:ra_dav:version-url
+V 83
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/src/ReadMedia.h
+END
+FifoAudioFrames.cpp
+K 25
+svn:wc:ra_dav:version-url
+V 91
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/src/FifoAudioFrames.cpp
+END
+FifoAudioFrames.h
+K 25
+svn:wc:ra_dav:version-url
+V 89
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/src/FifoAudioFrames.h
+END
+FifoVideoFrames.cpp
+K 25
+svn:wc:ra_dav:version-url
+V 91
+/svnroot/pure-data/!svn/ver/14200/trunk/externals/august/readanysf~/src/FifoVideoFrames.cpp
+END
+readanysf~.cpp
+K 25
+svn:wc:ra_dav:version-url
+V 86
+/svnroot/pure-data/!svn/ver/15685/trunk/externals/august/readanysf~/src/readanysf~.cpp
+END
+ReadMedia.cpp
+K 25
+svn:wc:ra_dav:version-url
+V 85
+/svnroot/pure-data/!svn/ver/14578/trunk/externals/august/readanysf~/src/ReadMedia.cpp
+END
diff --git a/src/.svn/entries b/src/.svn/entries
new file mode 100644
index 0000000..e1cb089
--- /dev/null
+++ b/src/.svn/entries
@@ -0,0 +1,266 @@
+10
+
+dir
+16184
+https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/august/readanysf~/src
+https://pure-data.svn.sourceforge.net/svnroot/pure-data
+
+
+
+2011-10-30T18:02:26.448014Z
+15685
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+df7eb9d6-776f-4174-a42d-0ffd8d5d5b5d
+
+FifoVideoFrames.h
+file
+
+
+
+
+2012-08-30T14:46:58.247399Z
+783ced77021730d99c32afd3510499ad
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1699
+
+ReadMedia.h
+file
+
+
+
+
+2012-08-30T14:46:58.243399Z
+0edd71c9b3302df0aa1d0bcf17cff326
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5569
+
+FifoAudioFrames.cpp
+file
+
+
+
+
+2012-08-30T14:46:58.243399Z
+1e2b8ba1a1721a89a6762b9c02bd1c39
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4639
+
+FifoAudioFrames.h
+file
+
+
+
+
+2012-08-30T14:46:58.243399Z
+26f947dfd1691fdba9303f1159344d2d
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+1630
+
+FifoVideoFrames.cpp
+file
+
+
+
+
+2012-08-30T14:46:58.243399Z
+c874c63b61e8a034c7023e3c0ea1c64c
+2010-10-05T22:52:49.783687Z
+14200
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4377
+
+readanysf~.cpp
+file
+
+
+
+
+2012-08-30T14:46:58.243399Z
+a9ba8e0d7f80999e201f57ccc2ae70c6
+2011-10-30T18:02:26.448014Z
+15685
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+17806
+
+ReadMedia.cpp
+file
+
+
+
+
+2012-08-30T14:46:58.247399Z
+c58f78dda8d506518d2eb5fb19a25168
+2010-12-08T22:26:44.463684Z
+14578
+augmentus
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+32630
+
diff --git a/src/FifoAudioFrames.cpp b/src/.svn/text-base/FifoAudioFrames.cpp.svn-base
similarity index 100%
copy from src/FifoAudioFrames.cpp
copy to src/.svn/text-base/FifoAudioFrames.cpp.svn-base
diff --git a/src/FifoAudioFrames.h b/src/.svn/text-base/FifoAudioFrames.h.svn-base
similarity index 100%
copy from src/FifoAudioFrames.h
copy to src/.svn/text-base/FifoAudioFrames.h.svn-base
diff --git a/src/FifoVideoFrames.cpp b/src/.svn/text-base/FifoVideoFrames.cpp.svn-base
similarity index 100%
copy from src/FifoVideoFrames.cpp
copy to src/.svn/text-base/FifoVideoFrames.cpp.svn-base
diff --git a/src/FifoVideoFrames.h b/src/.svn/text-base/FifoVideoFrames.h.svn-base
similarity index 100%
copy from src/FifoVideoFrames.h
copy to src/.svn/text-base/FifoVideoFrames.h.svn-base
diff --git a/src/ReadMedia.cpp b/src/.svn/text-base/ReadMedia.cpp.svn-base
similarity index 99%
copy from src/ReadMedia.cpp
copy to src/.svn/text-base/ReadMedia.cpp.svn-base
index 1d1b40b..1ca7b90 100644
--- a/src/ReadMedia.cpp
+++ b/src/.svn/text-base/ReadMedia.cpp.svn-base
@@ -207,7 +207,7 @@ int ReadMedia::decodeAudio( gavl_audio_frame_t * af ) {
signalA();
return 0;
} else {
- //printf("Couldn't get an audio frame, audiofifo is %f full.\n", m_fifoaudio->getSizePercentage()); // this can only happen if the fifo is empty
+ printf("Couldn't get an audio frame, audiofifo is %f full.\n", m_fifoaudio->getSizePercentage()); // this can only happen if the fifo is empty
unlockState();
signalA();
return -1;
diff --git a/src/ReadMedia.h b/src/.svn/text-base/ReadMedia.h.svn-base
similarity index 100%
copy from src/ReadMedia.h
copy to src/.svn/text-base/ReadMedia.h.svn-base
diff --git a/src/readanysf~.cpp b/src/.svn/text-base/readanysf~.cpp.svn-base
similarity index 92%
copy from src/readanysf~.cpp
copy to src/.svn/text-base/readanysf~.cpp.svn-base
index e07c7b6..f6482bc 100644
--- a/src/readanysf~.cpp
+++ b/src/.svn/text-base/readanysf~.cpp.svn-base
@@ -36,6 +36,9 @@
#define MAXSFCHANS 64 // got this from d_soundfile.c in pd/src
+#define OPENCB_READY 1
+#define OPENCB_BADFILE 2
+
static t_class *readanysf_class;
@@ -51,6 +54,7 @@ typedef struct readanysf {
unsigned int tick; // how often to send outlet info
bool play;
bool is_opening;
+ unsigned int spit_out_info;
unsigned int count;
float src_factor;
@@ -91,10 +95,10 @@ void m_play(t_readanysf *x) {
x->play = true; // this is the only place where play is true
} else {
if (x->is_opening ) {
- post("Current file is still starting.");
+ post("readanysf~: Current file is still starting.");
post("This probably means that it is a stream and it needs to buffer in from the network.");
} else {
- post("Current file is either invalid or an unsupported codec.");
+ post("readanysf~: Current file is either invalid or an unsupported codec.");
}
}
pthread_mutex_unlock(&x->mut);
@@ -160,10 +164,6 @@ void m_init_audio( t_readanysf *x) {
gavl_audio_frame_destroy(x->tmp_audio_frame);
x->tmp_audio_frame = gavl_audio_frame_create(&x->tmp_audio_format);
- /* m_out_audio_format.samples_per_frame = (m_out_audio_format.samplerate / (double)m_get_audio_format.samplerate) *
- m_get_audio_format.samples_per_frame + 10;
- */
-
if (x->i2t_audio_converter == NULL)
x->i2t_audio_converter = gavl_audio_converter_create( );
x->do_i2t_audio_convert = gavl_audio_converter_init( x->i2t_audio_converter, &x->in_audio_format, &x->tmp_audio_format);
@@ -172,7 +172,7 @@ void m_init_audio( t_readanysf *x) {
x->t2o_audio_converter = gavl_audio_converter_create( );
x->do_t2o_audio_convert = gavl_audio_converter_init_resample( x->t2o_audio_converter, &x->out_audio_format);
- // FIXME: this should be protected
+ // this should be protected
x->src_factor = x->out_audio_format.samplerate / (float) x->in_audio_format.samplerate;
/*
printf("in audio format: \n");
@@ -186,41 +186,27 @@ void m_init_audio( t_readanysf *x) {
void m_open_callback( void * data) {
- t_atom lst;
t_readanysf * x = (t_readanysf *)data;
pthread_mutex_lock(&x->mut);
x->is_opening = true; // set it here again just to be safe
-
+ pthread_mutex_unlock(&x->mut);
+
if (x->rm->isReady() && x->rm->getAudioStreamCount() ) {
+ pthread_mutex_lock(&x->mut);
m_init_audio(x);
+ x->is_opening=false;
+ x->spit_out_info = OPENCB_READY; // set variable so that dsp cycle can send out the right info
+ pthread_mutex_unlock(&x->mut);
- // FIXME: is it safe to call these here?
- SETFLOAT(&lst, (float)x->rm->getAudioSamplerate() );
- outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
-
- SETFLOAT(&lst, x->rm->getLengthInSeconds() );
- outlet_anything(x->outinfo, gensym("length"), 1, &lst);
-
- outlet_float(x->outinfo, 0.0);
-
- // ready should be last
- SETFLOAT(&lst, 1.0 );
- outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
- // set time to 0 again here just to be sure
+ // set time to 0 again here just to be sure
} else {
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("length"), 1, &lst);
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
- outlet_float(x->outinfo, 0.0);
- post("Invalid file or unsupported codec.");
+ pthread_mutex_lock(&x->mut);
+ x->is_opening=false;
+ x->spit_out_info = OPENCB_BADFILE;
+ pthread_mutex_unlock(&x->mut);
}
- x->is_opening=false;
- pthread_mutex_unlock(&x->mut);
}
void m_open(t_readanysf *x, t_symbol *s) {
@@ -259,7 +245,7 @@ void m_loop(t_readanysf *x, float f) {
x->rm->setLoop( false );
else
x->rm->setLoop( true );
- post("looping = %d", x->rm->getLoop());
+ post("readanysf~: looping = %d", x->rm->getLoop());
}
@@ -289,6 +275,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
x->tick = 1000;
x->play =false;
x->is_opening=false;
+ x->spit_out_info =0;
x->count = 0;
x->src_factor = 1.0;
x->do_t2o_audio_convert = false;
@@ -332,7 +319,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
outlet_float(x->outinfo, 0.0);
if (x->rm == NULL) {
x->rm = new ReadMedia ( ); // (int)sys_getsr(), x->num_channels, x->num_frames_in_fifo, x->num_samples_per_frame);
- post("Created new readanysf~ with %d channels and internal buffer of %d * %d = %d", x->num_channels,
+ post("Created new readanysf~ with %d channels and internal buffer of %d blocks of %d samples = %d", x->num_channels,
x->num_frames_in_fifo, x->num_samples_per_frame, x->num_frames_in_fifo * x->num_samples_per_frame);
}
x->rm->setOpenCallback( m_open_callback, (void *)x);
@@ -343,7 +330,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
int m_get_frame( t_readanysf *x ) {
int ret =0;
ret = x->rm->decodeAudio(x->in_audio_frame);
- if (ret != 1) // EOF
+ if (ret != 1) // EOF=0 or error=-1
return ret;
if (x->do_i2t_audio_convert) {
@@ -356,6 +343,7 @@ int m_get_frame( t_readanysf *x ) {
}
if ( x->do_t2o_audio_convert ) { // should be true all of the time
+ // protect src_factor here?
gavl_audio_converter_resample( x->t2o_audio_converter, x->tmp_audio_frame, x->out_audio_frame, x->src_factor );
// Don't know why, but on the first conversion, I get one extra sample
// THIS SHOULD NOT HAPPEN...this is a fix for now..check it out later.
@@ -382,8 +370,6 @@ int m_decode_block( t_readanysf * x ) {
while( samps_to_do > 0) {
if ( samps_to_do <= x->samplesleft) {
- //if (x->out_audio_frame->valid_samples < x->samplesleft)
- // printf("error\n");
// copy our samples out to the pd audio buffer
for (i = 0; i < x->num_channels; i++) {
for (j = 0; j < samps_to_do ; j++) {
@@ -395,8 +381,6 @@ int m_decode_block( t_readanysf * x ) {
samps_to_do = 0;
break;
} else if ( x->samplesleft > 0 ) {
- //if( x->out_audio_frame->valid_samples < x->samplesleft)
- // printf("valid_samples < samplesleft, shouldn't happen\n");
for (i = 0; i < x->num_channels; i++) {
for (j = 0; j < x->samplesleft; j++) {
x->x_outvec[i][samps_done + j] = x->out_audio_frame->channels.f[i][ x->out_audio_frame->valid_samples - x->samplesleft +j ];
@@ -407,10 +391,10 @@ int m_decode_block( t_readanysf * x ) {
x->samplesleft = 0;
} else { // samplesleft is zero
int ret = m_get_frame(x);
- if (ret == 0) {
+ if (ret == 0) { // EOF
return samps_done;
- } else if (ret == -1) {
- //printf("error getting frame...must be seeking\n");
+ } else if (ret == -1) { // error, file proly not ready
+ printf("error getting frame...must be seeking\n");
return ret;
}
}
@@ -424,7 +408,6 @@ static t_int *readanysf_perform(t_int *w) {
int samples_returned = 0;
t_atom lst;
-
if (x->play ) { // play protects the memory accessed in m_decode_block
samples_returned = m_decode_block( x );
if (samples_returned == 0 ) { // EOF
@@ -433,7 +416,7 @@ static t_int *readanysf_perform(t_int *w) {
} else if (samples_returned == -1) {
// error in getting audio, normally from seeking
samples_returned=0;
- }
+ }
}
for (i = 0; i < x->num_channels; i++) {
@@ -442,6 +425,29 @@ static t_int *readanysf_perform(t_int *w) {
}
}
+ if (x->spit_out_info == OPENCB_READY) {
+ SETFLOAT(&lst, (float)x->rm->getAudioSamplerate() );
+ outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
+ SETFLOAT(&lst, x->rm->getLengthInSeconds() );
+ outlet_anything(x->outinfo, gensym("length"), 1, &lst);
+ outlet_float(x->outinfo, 0.0);
+ // ready should be last
+ SETFLOAT(&lst, 1.0 );
+ outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
+ x->spit_out_info = 0;
+ }
+
+ if (x->spit_out_info == OPENCB_BADFILE) {
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("length"), 1, &lst);
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
+ outlet_float(x->outinfo, 0.0);
+ post("readanysf~: Invalid file or unsupported codec.");
+ x->spit_out_info = 0;
+ }
// just set some variables
if ( ++x->count > x->tick ) {
@@ -477,14 +483,13 @@ void readanysf_dsp(t_readanysf *x, t_signal **sp) {
x->out_audio_format.channel_locations[0] = GAVL_CHID_NONE; // Reset
// leave enough room in our out format and frame for resampling
- x->out_audio_format.samples_per_frame = x->num_samples_per_frame * SRC_MAX +10;
+ x->out_audio_format.samples_per_frame = ( x->num_samples_per_frame * SRC_MAX ) +10;
gavl_set_channel_setup (&x->out_audio_format); // Set channel locations
if(x->out_audio_frame != NULL)
gavl_audio_frame_destroy( x->out_audio_frame);
x->out_audio_frame = gavl_audio_frame_create(&x->out_audio_format);
- //printf("created new out frame in readanysf_dsp\n");
- post("pd blocksize=%d, spf=%d", x->blocksize, x->num_samples_per_frame);
+ //post("readanysf~: pd blocksize=%d, spf=%d", x->blocksize, x->num_samples_per_frame);
}
for (i = 0; i < x->num_channels; i++)
@@ -496,7 +501,6 @@ void readanysf_dsp(t_readanysf *x, t_signal **sp) {
static void readanysf_free(t_readanysf *x) {
// delete the readany objs
-
if (x->in_audio_frame != NULL) gavl_audio_frame_destroy(x->in_audio_frame);
if (x->tmp_audio_frame != NULL) gavl_audio_frame_destroy(x->tmp_audio_frame);
if (x->out_audio_frame != NULL) gavl_audio_frame_destroy(x->out_audio_frame);
diff --git a/src/ReadMedia.cpp b/src/ReadMedia.cpp
index 1d1b40b..1ca7b90 100644
--- a/src/ReadMedia.cpp
+++ b/src/ReadMedia.cpp
@@ -207,7 +207,7 @@ int ReadMedia::decodeAudio( gavl_audio_frame_t * af ) {
signalA();
return 0;
} else {
- //printf("Couldn't get an audio frame, audiofifo is %f full.\n", m_fifoaudio->getSizePercentage()); // this can only happen if the fifo is empty
+ printf("Couldn't get an audio frame, audiofifo is %f full.\n", m_fifoaudio->getSizePercentage()); // this can only happen if the fifo is empty
unlockState();
signalA();
return -1;
diff --git a/src/readanysf~.cpp b/src/readanysf~.cpp
index e07c7b6..f6482bc 100644
--- a/src/readanysf~.cpp
+++ b/src/readanysf~.cpp
@@ -36,6 +36,9 @@
#define MAXSFCHANS 64 // got this from d_soundfile.c in pd/src
+#define OPENCB_READY 1
+#define OPENCB_BADFILE 2
+
static t_class *readanysf_class;
@@ -51,6 +54,7 @@ typedef struct readanysf {
unsigned int tick; // how often to send outlet info
bool play;
bool is_opening;
+ unsigned int spit_out_info;
unsigned int count;
float src_factor;
@@ -91,10 +95,10 @@ void m_play(t_readanysf *x) {
x->play = true; // this is the only place where play is true
} else {
if (x->is_opening ) {
- post("Current file is still starting.");
+ post("readanysf~: Current file is still starting.");
post("This probably means that it is a stream and it needs to buffer in from the network.");
} else {
- post("Current file is either invalid or an unsupported codec.");
+ post("readanysf~: Current file is either invalid or an unsupported codec.");
}
}
pthread_mutex_unlock(&x->mut);
@@ -160,10 +164,6 @@ void m_init_audio( t_readanysf *x) {
gavl_audio_frame_destroy(x->tmp_audio_frame);
x->tmp_audio_frame = gavl_audio_frame_create(&x->tmp_audio_format);
- /* m_out_audio_format.samples_per_frame = (m_out_audio_format.samplerate / (double)m_get_audio_format.samplerate) *
- m_get_audio_format.samples_per_frame + 10;
- */
-
if (x->i2t_audio_converter == NULL)
x->i2t_audio_converter = gavl_audio_converter_create( );
x->do_i2t_audio_convert = gavl_audio_converter_init( x->i2t_audio_converter, &x->in_audio_format, &x->tmp_audio_format);
@@ -172,7 +172,7 @@ void m_init_audio( t_readanysf *x) {
x->t2o_audio_converter = gavl_audio_converter_create( );
x->do_t2o_audio_convert = gavl_audio_converter_init_resample( x->t2o_audio_converter, &x->out_audio_format);
- // FIXME: this should be protected
+ // this should be protected
x->src_factor = x->out_audio_format.samplerate / (float) x->in_audio_format.samplerate;
/*
printf("in audio format: \n");
@@ -186,41 +186,27 @@ void m_init_audio( t_readanysf *x) {
void m_open_callback( void * data) {
- t_atom lst;
t_readanysf * x = (t_readanysf *)data;
pthread_mutex_lock(&x->mut);
x->is_opening = true; // set it here again just to be safe
-
+ pthread_mutex_unlock(&x->mut);
+
if (x->rm->isReady() && x->rm->getAudioStreamCount() ) {
+ pthread_mutex_lock(&x->mut);
m_init_audio(x);
+ x->is_opening=false;
+ x->spit_out_info = OPENCB_READY; // set variable so that dsp cycle can send out the right info
+ pthread_mutex_unlock(&x->mut);
- // FIXME: is it safe to call these here?
- SETFLOAT(&lst, (float)x->rm->getAudioSamplerate() );
- outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
-
- SETFLOAT(&lst, x->rm->getLengthInSeconds() );
- outlet_anything(x->outinfo, gensym("length"), 1, &lst);
-
- outlet_float(x->outinfo, 0.0);
-
- // ready should be last
- SETFLOAT(&lst, 1.0 );
- outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
- // set time to 0 again here just to be sure
+ // set time to 0 again here just to be sure
} else {
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("length"), 1, &lst);
- SETFLOAT(&lst, 0.0 );
- outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
- outlet_float(x->outinfo, 0.0);
- post("Invalid file or unsupported codec.");
+ pthread_mutex_lock(&x->mut);
+ x->is_opening=false;
+ x->spit_out_info = OPENCB_BADFILE;
+ pthread_mutex_unlock(&x->mut);
}
- x->is_opening=false;
- pthread_mutex_unlock(&x->mut);
}
void m_open(t_readanysf *x, t_symbol *s) {
@@ -259,7 +245,7 @@ void m_loop(t_readanysf *x, float f) {
x->rm->setLoop( false );
else
x->rm->setLoop( true );
- post("looping = %d", x->rm->getLoop());
+ post("readanysf~: looping = %d", x->rm->getLoop());
}
@@ -289,6 +275,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
x->tick = 1000;
x->play =false;
x->is_opening=false;
+ x->spit_out_info =0;
x->count = 0;
x->src_factor = 1.0;
x->do_t2o_audio_convert = false;
@@ -332,7 +319,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
outlet_float(x->outinfo, 0.0);
if (x->rm == NULL) {
x->rm = new ReadMedia ( ); // (int)sys_getsr(), x->num_channels, x->num_frames_in_fifo, x->num_samples_per_frame);
- post("Created new readanysf~ with %d channels and internal buffer of %d * %d = %d", x->num_channels,
+ post("Created new readanysf~ with %d channels and internal buffer of %d blocks of %d samples = %d", x->num_channels,
x->num_frames_in_fifo, x->num_samples_per_frame, x->num_frames_in_fifo * x->num_samples_per_frame);
}
x->rm->setOpenCallback( m_open_callback, (void *)x);
@@ -343,7 +330,7 @@ static void *readanysf_new(t_float f, t_float f2, t_float f3 ) {
int m_get_frame( t_readanysf *x ) {
int ret =0;
ret = x->rm->decodeAudio(x->in_audio_frame);
- if (ret != 1) // EOF
+ if (ret != 1) // EOF=0 or error=-1
return ret;
if (x->do_i2t_audio_convert) {
@@ -356,6 +343,7 @@ int m_get_frame( t_readanysf *x ) {
}
if ( x->do_t2o_audio_convert ) { // should be true all of the time
+ // protect src_factor here?
gavl_audio_converter_resample( x->t2o_audio_converter, x->tmp_audio_frame, x->out_audio_frame, x->src_factor );
// Don't know why, but on the first conversion, I get one extra sample
// THIS SHOULD NOT HAPPEN...this is a fix for now..check it out later.
@@ -382,8 +370,6 @@ int m_decode_block( t_readanysf * x ) {
while( samps_to_do > 0) {
if ( samps_to_do <= x->samplesleft) {
- //if (x->out_audio_frame->valid_samples < x->samplesleft)
- // printf("error\n");
// copy our samples out to the pd audio buffer
for (i = 0; i < x->num_channels; i++) {
for (j = 0; j < samps_to_do ; j++) {
@@ -395,8 +381,6 @@ int m_decode_block( t_readanysf * x ) {
samps_to_do = 0;
break;
} else if ( x->samplesleft > 0 ) {
- //if( x->out_audio_frame->valid_samples < x->samplesleft)
- // printf("valid_samples < samplesleft, shouldn't happen\n");
for (i = 0; i < x->num_channels; i++) {
for (j = 0; j < x->samplesleft; j++) {
x->x_outvec[i][samps_done + j] = x->out_audio_frame->channels.f[i][ x->out_audio_frame->valid_samples - x->samplesleft +j ];
@@ -407,10 +391,10 @@ int m_decode_block( t_readanysf * x ) {
x->samplesleft = 0;
} else { // samplesleft is zero
int ret = m_get_frame(x);
- if (ret == 0) {
+ if (ret == 0) { // EOF
return samps_done;
- } else if (ret == -1) {
- //printf("error getting frame...must be seeking\n");
+ } else if (ret == -1) { // error, file proly not ready
+ printf("error getting frame...must be seeking\n");
return ret;
}
}
@@ -424,7 +408,6 @@ static t_int *readanysf_perform(t_int *w) {
int samples_returned = 0;
t_atom lst;
-
if (x->play ) { // play protects the memory accessed in m_decode_block
samples_returned = m_decode_block( x );
if (samples_returned == 0 ) { // EOF
@@ -433,7 +416,7 @@ static t_int *readanysf_perform(t_int *w) {
} else if (samples_returned == -1) {
// error in getting audio, normally from seeking
samples_returned=0;
- }
+ }
}
for (i = 0; i < x->num_channels; i++) {
@@ -442,6 +425,29 @@ static t_int *readanysf_perform(t_int *w) {
}
}
+ if (x->spit_out_info == OPENCB_READY) {
+ SETFLOAT(&lst, (float)x->rm->getAudioSamplerate() );
+ outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
+ SETFLOAT(&lst, x->rm->getLengthInSeconds() );
+ outlet_anything(x->outinfo, gensym("length"), 1, &lst);
+ outlet_float(x->outinfo, 0.0);
+ // ready should be last
+ SETFLOAT(&lst, 1.0 );
+ outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
+ x->spit_out_info = 0;
+ }
+
+ if (x->spit_out_info == OPENCB_BADFILE) {
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("samplerate"), 1, &lst);
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("length"), 1, &lst);
+ SETFLOAT(&lst, 0.0 );
+ outlet_anything(x->outinfo, gensym("ready"), 1, &lst);
+ outlet_float(x->outinfo, 0.0);
+ post("readanysf~: Invalid file or unsupported codec.");
+ x->spit_out_info = 0;
+ }
// just set some variables
if ( ++x->count > x->tick ) {
@@ -477,14 +483,13 @@ void readanysf_dsp(t_readanysf *x, t_signal **sp) {
x->out_audio_format.channel_locations[0] = GAVL_CHID_NONE; // Reset
// leave enough room in our out format and frame for resampling
- x->out_audio_format.samples_per_frame = x->num_samples_per_frame * SRC_MAX +10;
+ x->out_audio_format.samples_per_frame = ( x->num_samples_per_frame * SRC_MAX ) +10;
gavl_set_channel_setup (&x->out_audio_format); // Set channel locations
if(x->out_audio_frame != NULL)
gavl_audio_frame_destroy( x->out_audio_frame);
x->out_audio_frame = gavl_audio_frame_create(&x->out_audio_format);
- //printf("created new out frame in readanysf_dsp\n");
- post("pd blocksize=%d, spf=%d", x->blocksize, x->num_samples_per_frame);
+ //post("readanysf~: pd blocksize=%d, spf=%d", x->blocksize, x->num_samples_per_frame);
}
for (i = 0; i < x->num_channels; i++)
@@ -496,7 +501,6 @@ void readanysf_dsp(t_readanysf *x, t_signal **sp) {
static void readanysf_free(t_readanysf *x) {
// delete the readany objs
-
if (x->in_audio_frame != NULL) gavl_audio_frame_destroy(x->in_audio_frame);
if (x->tmp_audio_frame != NULL) gavl_audio_frame_destroy(x->tmp_audio_frame);
if (x->out_audio_frame != NULL) gavl_audio_frame_destroy(x->out_audio_frame);
--
pd-readanysf packaging
More information about the pkg-multimedia-commits
mailing list