From e8482f24cfc00645607f8526fde38d39e0dcaa63 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Sun, 5 Mar 2000 19:03:21 +0000 Subject: [PATCH] Moved wxMMedia to contrib/src/mmedia Added contrib configure Made wxSocket sample compile Made OGL compile Modified main configure to pass some more parameter to children Changed the wxProcess doc according to the modification Still some win makefiles to come git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 2 +- configure | 641 +++++++------- configure.in | 9 +- contrib/Makefile.in | 13 + contrib/configure | 967 ++++++++++++++++++++++ contrib/configure.in | 44 + contrib/docs/latex/mmedia/back.gif | Bin 0 -> 225 bytes contrib/docs/latex/mmedia/books.bmp | Bin 0 -> 1222 bytes contrib/docs/latex/mmedia/bugs.tex | 11 + contrib/docs/latex/mmedia/bullet.bmp | Bin 0 -> 138 bytes contrib/docs/latex/mmedia/cdaudio.tex | 22 + contrib/docs/latex/mmedia/cdaudlnx.tex | 73 ++ contrib/docs/latex/mmedia/cdaudwin.tex | 77 ++ contrib/docs/latex/mmedia/cdtoc.tex | 118 +++ contrib/docs/latex/mmedia/changes.tex | 3 + contrib/docs/latex/mmedia/classes.tex | 8 + contrib/docs/latex/mmedia/contents.gif | Bin 0 -> 231 bytes contrib/docs/latex/mmedia/forward.gif | Bin 0 -> 164 bytes contrib/docs/latex/mmedia/intro.tex | 47 ++ contrib/docs/latex/mmedia/mmedia.tex | 46 + contrib/docs/latex/mmedia/ogl.hpj | 17 + contrib/docs/latex/mmedia/ogledit.bmp | Bin 0 -> 87670 bytes contrib/docs/latex/mmedia/ogledit.gif | Bin 0 -> 7163 bytes contrib/docs/latex/mmedia/sample.tex | 87 ++ contrib/docs/latex/mmedia/sndaiff.tex | 68 ++ contrib/docs/latex/mmedia/sndbase.tex | 288 +++++++ contrib/docs/latex/mmedia/sndcodec.tex | 39 + contrib/docs/latex/mmedia/sndesd.tex | 64 ++ contrib/docs/latex/mmedia/sndfg72x.tex | 87 ++ contrib/docs/latex/mmedia/sndfile.tex | 232 ++++++ contrib/docs/latex/mmedia/sndfpcm.tex | 104 +++ contrib/docs/latex/mmedia/sndfrmt.tex | 69 ++ contrib/docs/latex/mmedia/sndfulaw.tex | 74 ++ contrib/docs/latex/mmedia/sndg72x.tex | 54 ++ contrib/docs/latex/mmedia/sndoss.tex | 71 ++ contrib/docs/latex/mmedia/sndpcm.tex | 48 ++ contrib/docs/latex/mmedia/sndrter.tex | 59 ++ contrib/docs/latex/mmedia/sndulaw.tex | 49 ++ contrib/docs/latex/mmedia/sndwave.tex | 91 ++ contrib/docs/latex/mmedia/sndwin.tex | 140 ++++ contrib/docs/latex/mmedia/tex2rtf.ini | 35 + contrib/docs/latex/mmedia/texhelp.sty | 298 +++++++ contrib/docs/latex/mmedia/topics.tex | 161 ++++ contrib/docs/latex/mmedia/up.gif | Bin 0 -> 137 bytes contrib/docs/latex/mmedia/vidbase.tex | 173 ++++ contrib/docs/latex/mmedia/vidwin.tex | 147 ++++ contrib/docs/latex/mmedia/vidxanm.tex | 170 ++++ contrib/include/wx/mmedia/cdbase.h | 74 ++ contrib/include/wx/mmedia/cdunix.h | 58 ++ contrib/include/wx/mmedia/cdwin.h | 62 ++ contrib/include/wx/mmedia/internal/g72x.h | 123 +++ contrib/include/wx/mmedia/sndaiff.h | 46 + contrib/include/wx/mmedia/sndbase.h | 171 ++++ contrib/include/wx/mmedia/sndcodec.h | 32 + contrib/include/wx/mmedia/sndcpcm.h | 54 ++ contrib/include/wx/mmedia/sndesd.h | 53 ++ contrib/include/wx/mmedia/sndfile.h | 125 +++ contrib/include/wx/mmedia/sndg72x.h | 85 ++ contrib/include/wx/mmedia/sndmsad.h | 72 ++ contrib/include/wx/mmedia/sndoss.h | 55 ++ contrib/include/wx/mmedia/sndpcm.h | 57 ++ contrib/include/wx/mmedia/sndulaw.h | 67 ++ contrib/include/wx/mmedia/sndwav.h | 58 ++ contrib/include/wx/mmedia/sndwin.h | 65 ++ contrib/include/wx/mmedia/vidbase.h | 110 +++ contrib/include/wx/mmedia/vidwin.h | 101 +++ contrib/include/wx/mmedia/vidxanm.h | 136 +++ contrib/samples/Makefile.in | 10 + contrib/samples/mmedia/Makefile.in | 36 + contrib/samples/mmedia/descrip.mms | 30 + contrib/samples/mmedia/eject.xpm | 24 + contrib/samples/mmedia/mmbman.cpp | 512 ++++++++++++ contrib/samples/mmedia/mmbman.h | 84 ++ contrib/samples/mmedia/mmboard.cpp | 570 +++++++++++++ contrib/samples/mmedia/mmboard.def | 7 + contrib/samples/mmedia/mmboard.h | 57 ++ contrib/samples/mmedia/mmboard.rc | 6 + contrib/samples/mmedia/mmboard.rc0 | 6 + contrib/samples/mmedia/mondrian.ico | Bin 0 -> 766 bytes contrib/samples/mmedia/mondrian.xpm | 44 + contrib/samples/mmedia/mondros2.ico | Bin 0 -> 996 bytes contrib/samples/mmedia/pause.xpm | 23 + contrib/samples/mmedia/play.xpm | 23 + contrib/samples/mmedia/stop.xpm | 23 + contrib/src/Makefile.in | 12 + contrib/src/mmedia/cdbase.cpp | 68 ++ contrib/src/mmedia/cdunix.cpp | 218 +++++ contrib/src/mmedia/cdwin.cpp | 225 +++++ contrib/src/mmedia/g711.cpp | 285 +++++++ contrib/src/mmedia/g721.cpp | 175 ++++ contrib/src/mmedia/g723_24.cpp | 159 ++++ contrib/src/mmedia/g723_40.cpp | 179 ++++ contrib/src/mmedia/g72x.cpp | 608 ++++++++++++++ contrib/src/mmedia/sndaiff.cpp | 207 +++++ contrib/src/mmedia/sndbase.cpp | 134 +++ contrib/src/mmedia/sndcodec.cpp | 47 ++ contrib/src/mmedia/sndcpcm.cpp | 443 ++++++++++ contrib/src/mmedia/sndesd.cpp | 319 +++++++ contrib/src/mmedia/sndfile.cpp | 421 ++++++++++ contrib/src/mmedia/sndg72x.cpp | 309 +++++++ contrib/src/mmedia/sndmsad.cpp | 168 ++++ contrib/src/mmedia/sndoss.cpp | 387 +++++++++ contrib/src/mmedia/sndpcm.cpp | 98 +++ contrib/src/mmedia/sndulaw.cpp | 185 +++++ contrib/src/mmedia/sndwav.cpp | 363 ++++++++ contrib/src/mmedia/sndwin.cpp | 776 +++++++++++++++++ contrib/src/mmedia/vidbase.cpp | 74 ++ contrib/src/mmedia/vidwin.cpp | 251 ++++++ contrib/src/mmedia/vidxanm.cpp | 511 ++++++++++++ contrib/src/ogl/Makefile.in | 7 +- docs/latex/wx/process.tex | 21 +- samples/configure | 17 +- samples/configure.in | 8 + utils/configure | 12 +- utils/configure.in | 3 - utils/wxMMedia2/lib/sndwin.cpp | 288 ++++--- 116 files changed, 14252 insertions(+), 491 deletions(-) create mode 100644 contrib/Makefile.in create mode 100755 contrib/configure create mode 100644 contrib/configure.in create mode 100644 contrib/docs/latex/mmedia/back.gif create mode 100644 contrib/docs/latex/mmedia/books.bmp create mode 100644 contrib/docs/latex/mmedia/bugs.tex create mode 100644 contrib/docs/latex/mmedia/bullet.bmp create mode 100644 contrib/docs/latex/mmedia/cdaudio.tex create mode 100644 contrib/docs/latex/mmedia/cdaudlnx.tex create mode 100644 contrib/docs/latex/mmedia/cdaudwin.tex create mode 100644 contrib/docs/latex/mmedia/cdtoc.tex create mode 100644 contrib/docs/latex/mmedia/changes.tex create mode 100644 contrib/docs/latex/mmedia/classes.tex create mode 100644 contrib/docs/latex/mmedia/contents.gif create mode 100644 contrib/docs/latex/mmedia/forward.gif create mode 100644 contrib/docs/latex/mmedia/intro.tex create mode 100644 contrib/docs/latex/mmedia/mmedia.tex create mode 100644 contrib/docs/latex/mmedia/ogl.hpj create mode 100644 contrib/docs/latex/mmedia/ogledit.bmp create mode 100644 contrib/docs/latex/mmedia/ogledit.gif create mode 100644 contrib/docs/latex/mmedia/sample.tex create mode 100644 contrib/docs/latex/mmedia/sndaiff.tex create mode 100644 contrib/docs/latex/mmedia/sndbase.tex create mode 100644 contrib/docs/latex/mmedia/sndcodec.tex create mode 100644 contrib/docs/latex/mmedia/sndesd.tex create mode 100644 contrib/docs/latex/mmedia/sndfg72x.tex create mode 100644 contrib/docs/latex/mmedia/sndfile.tex create mode 100644 contrib/docs/latex/mmedia/sndfpcm.tex create mode 100644 contrib/docs/latex/mmedia/sndfrmt.tex create mode 100644 contrib/docs/latex/mmedia/sndfulaw.tex create mode 100644 contrib/docs/latex/mmedia/sndg72x.tex create mode 100644 contrib/docs/latex/mmedia/sndoss.tex create mode 100644 contrib/docs/latex/mmedia/sndpcm.tex create mode 100644 contrib/docs/latex/mmedia/sndrter.tex create mode 100644 contrib/docs/latex/mmedia/sndulaw.tex create mode 100644 contrib/docs/latex/mmedia/sndwave.tex create mode 100644 contrib/docs/latex/mmedia/sndwin.tex create mode 100644 contrib/docs/latex/mmedia/tex2rtf.ini create mode 100644 contrib/docs/latex/mmedia/texhelp.sty create mode 100644 contrib/docs/latex/mmedia/topics.tex create mode 100644 contrib/docs/latex/mmedia/up.gif create mode 100644 contrib/docs/latex/mmedia/vidbase.tex create mode 100644 contrib/docs/latex/mmedia/vidwin.tex create mode 100644 contrib/docs/latex/mmedia/vidxanm.tex create mode 100644 contrib/include/wx/mmedia/cdbase.h create mode 100644 contrib/include/wx/mmedia/cdunix.h create mode 100644 contrib/include/wx/mmedia/cdwin.h create mode 100644 contrib/include/wx/mmedia/internal/g72x.h create mode 100644 contrib/include/wx/mmedia/sndaiff.h create mode 100644 contrib/include/wx/mmedia/sndbase.h create mode 100644 contrib/include/wx/mmedia/sndcodec.h create mode 100644 contrib/include/wx/mmedia/sndcpcm.h create mode 100644 contrib/include/wx/mmedia/sndesd.h create mode 100644 contrib/include/wx/mmedia/sndfile.h create mode 100644 contrib/include/wx/mmedia/sndg72x.h create mode 100644 contrib/include/wx/mmedia/sndmsad.h create mode 100644 contrib/include/wx/mmedia/sndoss.h create mode 100644 contrib/include/wx/mmedia/sndpcm.h create mode 100644 contrib/include/wx/mmedia/sndulaw.h create mode 100644 contrib/include/wx/mmedia/sndwav.h create mode 100644 contrib/include/wx/mmedia/sndwin.h create mode 100644 contrib/include/wx/mmedia/vidbase.h create mode 100644 contrib/include/wx/mmedia/vidwin.h create mode 100644 contrib/include/wx/mmedia/vidxanm.h create mode 100644 contrib/samples/Makefile.in create mode 100644 contrib/samples/mmedia/Makefile.in create mode 100644 contrib/samples/mmedia/descrip.mms create mode 100644 contrib/samples/mmedia/eject.xpm create mode 100644 contrib/samples/mmedia/mmbman.cpp create mode 100644 contrib/samples/mmedia/mmbman.h create mode 100644 contrib/samples/mmedia/mmboard.cpp create mode 100644 contrib/samples/mmedia/mmboard.def create mode 100644 contrib/samples/mmedia/mmboard.h create mode 100644 contrib/samples/mmedia/mmboard.rc create mode 100644 contrib/samples/mmedia/mmboard.rc0 create mode 100644 contrib/samples/mmedia/mondrian.ico create mode 100644 contrib/samples/mmedia/mondrian.xpm create mode 100644 contrib/samples/mmedia/mondros2.ico create mode 100644 contrib/samples/mmedia/pause.xpm create mode 100644 contrib/samples/mmedia/play.xpm create mode 100644 contrib/samples/mmedia/stop.xpm create mode 100644 contrib/src/Makefile.in create mode 100644 contrib/src/mmedia/cdbase.cpp create mode 100644 contrib/src/mmedia/cdunix.cpp create mode 100644 contrib/src/mmedia/cdwin.cpp create mode 100644 contrib/src/mmedia/g711.cpp create mode 100644 contrib/src/mmedia/g721.cpp create mode 100644 contrib/src/mmedia/g723_24.cpp create mode 100644 contrib/src/mmedia/g723_40.cpp create mode 100644 contrib/src/mmedia/g72x.cpp create mode 100644 contrib/src/mmedia/sndaiff.cpp create mode 100644 contrib/src/mmedia/sndbase.cpp create mode 100644 contrib/src/mmedia/sndcodec.cpp create mode 100644 contrib/src/mmedia/sndcpcm.cpp create mode 100644 contrib/src/mmedia/sndesd.cpp create mode 100644 contrib/src/mmedia/sndfile.cpp create mode 100644 contrib/src/mmedia/sndg72x.cpp create mode 100644 contrib/src/mmedia/sndmsad.cpp create mode 100644 contrib/src/mmedia/sndoss.cpp create mode 100644 contrib/src/mmedia/sndpcm.cpp create mode 100644 contrib/src/mmedia/sndulaw.cpp create mode 100644 contrib/src/mmedia/sndwav.cpp create mode 100644 contrib/src/mmedia/sndwin.cpp create mode 100644 contrib/src/mmedia/vidbase.cpp create mode 100644 contrib/src/mmedia/vidwin.cpp create mode 100644 contrib/src/mmedia/vidxanm.cpp diff --git a/Makefile.in b/Makefile.in index 5d672513e2..338b740dd5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1166,6 +1166,6 @@ clean: $(RM) *.d $(RM) parser.c $(RM) lexer.c - $(RM) ./lib/* + $(RM) -r ./lib/* cleanall: clean diff --git a/configure b/configure index 3339cf9936..2ae874d2b3 100755 --- a/configure +++ b/configure @@ -40,7 +40,7 @@ # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.14 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -604,7 +604,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.14" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -7770,7 +7770,6 @@ else /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname(); -char (*f)(); int main() { @@ -7780,12 +7779,12 @@ int main() { #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else -f = gethostbyname; +gethostbyname(); #endif ; return 0; } EOF -if { (eval echo configure:7789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -7806,7 +7805,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:7810: checking for gethostbyname in -lnsl" >&5 +echo "configure:7809: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7814,7 +7813,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7855,12 +7854,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:7859: checking for connect" >&5 +echo "configure:7858: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -7905,7 +7903,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:7909: checking for connect in -lsocket" >&5 +echo "configure:7907: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -7913,7 +7911,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -7948,12 +7946,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:7952: checking for remove" >&5 +echo "configure:7950: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:7978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -7998,7 +7995,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:8002: checking for remove in -lposix" >&5 +echo "configure:7999: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8006,7 +8003,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8041,12 +8038,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:8045: checking for shmat" >&5 +echo "configure:8042: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -8091,7 +8087,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:8095: checking for shmat in -lipc" >&5 +echo "configure:8091: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8099,7 +8095,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8143,7 +8139,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:8147: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:8143: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -8151,7 +8147,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -8200,7 +8196,7 @@ fi COMPILED_X_PROGRAM=0 echo $ac_n "checking for Motif/Lesstif headers""... $ac_c" 1>&6 -echo "configure:8204: checking for Motif/Lesstif headers" >&5 +echo "configure:8200: checking for Motif/Lesstif headers" >&5 ac_find_includes= for ac_dir in $SEARCH_INCLUDE; @@ -8215,7 +8211,7 @@ for ac_dir in $SEARCH_INCLUDE; echo "$ac_t""found $ac_find_includes" 1>&6 else cat > conftest.$ac_ext < @@ -8228,7 +8224,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""found in default search path" 1>&6 @@ -8249,7 +8245,7 @@ rm -f conftest* if test "$COMPILED_X_PROGRAM" = 0; then echo $ac_n "checking for Motif/Lesstif library""... $ac_c" 1>&6 -echo "configure:8253: checking for Motif/Lesstif library" >&5 +echo "configure:8249: checking for Motif/Lesstif library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -8288,7 +8284,7 @@ for ac_dir in $SEARCH_LIB; echo "$ac_t""found at $ac_find_libraries" 1>&6 else cat > conftest.$ac_ext < @@ -8301,7 +8297,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8301: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""found in default search path" 1>&6 @@ -8324,7 +8320,7 @@ rm -f conftest* XPM_LINK="" echo $ac_n "checking for Xpm library""... $ac_c" 1>&6 -echo "configure:8328: checking for Xpm library" >&5 +echo "configure:8324: checking for Xpm library" >&5 ac_find_libraries= for ac_dir in $SEARCH_LIB; @@ -8356,7 +8352,7 @@ EOF echo "$ac_t""found at $ac_find_libraries" 1>&6 else cat > conftest.$ac_ext < @@ -8369,7 +8365,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:8373: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8369: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* XPM_LINK="-lXpm " @@ -8642,17 +8638,17 @@ for ac_hdr in strings.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8646: checking for $ac_hdr" >&5 +echo "configure:8642: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8656: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8652: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8682,17 +8678,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8686: checking for $ac_hdr" >&5 +echo "configure:8682: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8722,17 +8718,17 @@ for ac_hdr in wchar.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8726: checking for $ac_hdr" >&5 +echo "configure:8722: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8762,17 +8758,17 @@ for ac_hdr in wcstr.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8766: checking for $ac_hdr" >&5 +echo "configure:8762: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8776: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8772: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8802,17 +8798,17 @@ for ac_hdr in fnmatch.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8806: checking for $ac_hdr" >&5 +echo "configure:8802: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8844,17 +8840,17 @@ if test "$wxUSE_GUI" = "yes"; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:8848: checking for $ac_hdr" >&5 +echo "configure:8844: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8884,12 +8880,12 @@ fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:8888: checking for ANSI C header files" >&5 +echo "configure:8884: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -8897,7 +8893,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:8901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:8897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -8914,7 +8910,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -8932,7 +8928,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -8953,7 +8949,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -8964,7 +8960,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:8968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:8964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -8988,12 +8984,12 @@ EOF fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:8992: checking for mode_t" >&5 +echo "configure:8988: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9021,12 +9017,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:9025: checking for off_t" >&5 +echo "configure:9021: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9054,12 +9050,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:9058: checking for pid_t" >&5 +echo "configure:9054: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9087,12 +9083,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:9091: checking for size_t" >&5 +echo "configure:9087: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -9120,12 +9116,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:9124: checking for uid_t in sys/types.h" >&5 +echo "configure:9120: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -9156,13 +9152,13 @@ fi echo $ac_n "checking for pw_gecos in struct passwd""... $ac_c" 1>&6 -echo "configure:9160: checking for pw_gecos in struct passwd" >&5 +echo "configure:9156: checking for pw_gecos in struct passwd" >&5 if eval "test \"`echo '$''{'wx_cv_struct_pw_gecos'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -9173,7 +9169,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:9177: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_struct_pw_gecos=yes @@ -9200,12 +9196,12 @@ echo "$ac_t""$wx_cv_struct_pw_gecos" 1>&6 echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:9204: checking for working const" >&5 +echo "configure:9200: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -9275,21 +9271,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:9279: checking for inline" >&5 +echo "configure:9275: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -9316,7 +9312,7 @@ esac echo $ac_n "checking size of char""... $ac_c" 1>&6 -echo "configure:9320: checking size of char" >&5 +echo "configure:9316: checking size of char" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9324,7 +9320,7 @@ else ac_cv_sizeof_char=1 else cat > conftest.$ac_ext < main() @@ -9335,7 +9331,7 @@ main() exit(0); } EOF -if { (eval echo configure:9339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char=`cat conftestval` else @@ -9355,7 +9351,7 @@ EOF echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:9359: checking size of short" >&5 +echo "configure:9355: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9363,7 +9359,7 @@ else ac_cv_sizeof_short=2 else cat > conftest.$ac_ext < main() @@ -9374,7 +9370,7 @@ main() exit(0); } EOF -if { (eval echo configure:9378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -9394,7 +9390,7 @@ EOF echo $ac_n "checking size of int *""... $ac_c" 1>&6 -echo "configure:9398: checking size of int *" >&5 +echo "configure:9394: checking size of int *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9402,7 +9398,7 @@ else ac_cv_sizeof_int_p=4 else cat > conftest.$ac_ext < main() @@ -9413,7 +9409,7 @@ main() exit(0); } EOF -if { (eval echo configure:9417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int_p=`cat conftestval` else @@ -9433,7 +9429,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:9437: checking size of int" >&5 +echo "configure:9433: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9441,7 +9437,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < main() @@ -9452,7 +9448,7 @@ main() exit(0); } EOF -if { (eval echo configure:9456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -9472,7 +9468,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:9476: checking size of long" >&5 +echo "configure:9472: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9480,7 +9476,7 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < main() @@ -9491,7 +9487,7 @@ main() exit(0); } EOF -if { (eval echo configure:9495: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -9511,7 +9507,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:9515: checking size of long long" >&5 +echo "configure:9511: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9519,7 +9515,7 @@ else ac_cv_sizeof_long_long=0 else cat > conftest.$ac_ext < main() @@ -9530,7 +9526,7 @@ main() exit(0); } EOF -if { (eval echo configure:9534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -9551,14 +9547,14 @@ EOF echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:9555: checking whether byte ordering is bigendian" >&5 +echo "configure:9551: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -9569,11 +9565,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:9573: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -9584,7 +9580,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:9588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9584: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -9604,7 +9600,7 @@ if test "$cross_compiling" = yes; then ac_cv_c_bigendian=unknown else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:9617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -9664,17 +9660,17 @@ cross_compiling=$ac_cv_prog_cxx_cross do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:9668: checking for $ac_hdr" >&5 +echo "configure:9664: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:9678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:9674: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -9722,7 +9718,7 @@ cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking if C++ compiler supports bool""... $ac_c" 1>&6 -echo "configure:9726: checking if C++ compiler supports bool" >&5 +echo "configure:9722: checking if C++ compiler supports bool" >&5 if eval "test \"`echo '$''{'wx_cv_cpp_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -9737,7 +9733,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9749: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF @@ -9791,13 +9787,13 @@ EOF echo $ac_n "checking if you need GNU extensions""... $ac_c" 1>&6 -echo "configure:9795: checking if you need GNU extensions" >&5 +echo "configure:9791: checking if you need GNU extensions" >&5 if eval "test \"`echo '$''{'wx_cv_gnu_extensions'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -9810,7 +9806,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:9814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:9810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_gnu_extensions=yes else @@ -9835,7 +9831,7 @@ fi echo $ac_n "checking for wcslen in -lc""... $ac_c" 1>&6 -echo "configure:9839: checking for wcslen in -lc" >&5 +echo "configure:9835: checking for wcslen in -lc" >&5 ac_lib_var=`echo c'_'wcslen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9843,7 +9839,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9880,7 +9876,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for wcslen in -lw""... $ac_c" 1>&6 -echo "configure:9884: checking for wcslen in -lw" >&5 +echo "configure:9880: checking for wcslen in -lw" >&5 ac_lib_var=`echo w'_'wcslen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -9888,7 +9884,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lw $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -9930,12 +9926,12 @@ fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:9934: checking for vprintf" >&5 +echo "configure:9930: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:9958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -9983,12 +9978,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:9987: checking for _doprnt" >&5 +echo "configure:9982: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -10040,12 +10034,12 @@ fi for ac_func in vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10044: checking for $ac_func" >&5 +echo "configure:10038: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10109,7 +10102,7 @@ cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for vsscanf""... $ac_c" 1>&6 -echo "configure:10113: checking for vsscanf" >&5 +echo "configure:10106: checking for vsscanf" >&5 if eval "test \"`echo '$''{'wx_cv_func_vsscanf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -10119,7 +10112,7 @@ else else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:10143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF @@ -10182,12 +10175,12 @@ if test "$TOOLKIT" != "MSW"; then for ac_func in vfork do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10186: checking for $ac_func" >&5 +echo "configure:10179: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10239,12 +10231,12 @@ done for ac_func in timegm do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10243: checking for $ac_func" >&5 +echo "configure:10235: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10263: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10307,12 +10298,12 @@ if test "$HAVE_SOME_SLEEP_FUNC" != 1; then for ac_func in nanosleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10311: checking for $ac_func" >&5 +echo "configure:10302: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10361,7 +10351,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6 -echo "configure:10365: checking for nanosleep in -lposix4" >&5 +echo "configure:10355: checking for nanosleep in -lposix4" >&5 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10369,7 +10359,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10408,12 +10398,12 @@ else for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10412: checking for $ac_func" >&5 +echo "configure:10402: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10476,12 +10465,12 @@ fi for ac_func in uname gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10480: checking for $ac_func" >&5 +echo "configure:10469: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10533,12 +10521,12 @@ done for ac_func in strtok_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10537: checking for $ac_func" >&5 +echo "configure:10525: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10591,12 +10578,12 @@ INET_LINK= for ac_func in inet_addr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10595: checking for $ac_func" >&5 +echo "configure:10582: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10645,7 +10631,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_addr in -lnsl""... $ac_c" 1>&6 -echo "configure:10649: checking for inet_addr in -lnsl" >&5 +echo "configure:10635: checking for inet_addr in -lnsl" >&5 ac_lib_var=`echo nsl'_'inet_addr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10653,7 +10639,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10683,7 +10669,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_addr in -lresolv""... $ac_c" 1>&6 -echo "configure:10687: checking for inet_addr in -lresolv" >&5 +echo "configure:10673: checking for inet_addr in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_addr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10691,7 +10677,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10735,12 +10721,12 @@ done for ac_func in inet_aton do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:10739: checking for $ac_func" >&5 +echo "configure:10725: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -10789,7 +10774,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -l$INET_LINK""... $ac_c" 1>&6 -echo "configure:10793: checking for inet_aton in -l$INET_LINK" >&5 +echo "configure:10778: checking for inet_aton in -l$INET_LINK" >&5 ac_lib_var=`echo $INET_LINK'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10797,7 +10782,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$INET_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10915,7 +10900,7 @@ fi if test "$wxUSE_THREADS" = "yes" ; then echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:10919: checking for pthread_create in -lpthread" >&5 +echo "configure:10904: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10923,7 +10908,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -10957,7 +10942,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:10961: checking for pthread_create in -lc_r" >&5 +echo "configure:10946: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -10965,7 +10950,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:10965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11000,17 +10985,17 @@ else ac_safe=`echo "sys/prctl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/prctl.h""... $ac_c" 1>&6 -echo "configure:11004: checking for sys/prctl.h" >&5 +echo "configure:10989: checking for sys/prctl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:10999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11050,12 +11035,12 @@ if test "$wxUSE_THREADS" = "yes" ; then for ac_func in thr_setconcurrency do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:11054: checking for $ac_func" >&5 +echo "configure:11039: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -11109,17 +11093,17 @@ done do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:11113: checking for $ac_hdr" >&5 +echo "configure:11097: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11147,7 +11131,7 @@ done echo $ac_n "checking for sched_yield in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:11151: checking for sched_yield in -l$THREADS_LINK" >&5 +echo "configure:11135: checking for sched_yield in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11155,7 +11139,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11188,7 +11172,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for sched_yield in -l"posix4"""... $ac_c" 1>&6 -echo "configure:11192: checking for sched_yield in -l"posix4"" >&5 +echo "configure:11176: checking for sched_yield in -l"posix4"" >&5 ac_lib_var=`echo "posix4"'_'sched_yield | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11196,7 +11180,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l"posix4" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11237,7 +11221,7 @@ fi echo $ac_n "checking for pthread_attr_getschedpolicy in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:11241: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5 +echo "configure:11225: checking for pthread_attr_getschedpolicy in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11245,7 +11229,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11278,7 +11262,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for pthread_attr_getschedpolicy in -l"posix4"""... $ac_c" 1>&6 -echo "configure:11282: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5 +echo "configure:11266: checking for pthread_attr_getschedpolicy in -l"posix4"" >&5 ac_lib_var=`echo "posix4"'_'pthread_attr_getschedpolicy | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11286,7 +11270,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l"posix4" $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11327,7 +11311,7 @@ fi echo $ac_n "checking for pthread_cancel in -l$THREADS_LINK""... $ac_c" 1>&6 -echo "configure:11331: checking for pthread_cancel in -l$THREADS_LINK" >&5 +echo "configure:11315: checking for pthread_cancel in -l$THREADS_LINK" >&5 ac_lib_var=`echo $THREADS_LINK'_'pthread_cancel | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11335,7 +11319,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$THREADS_LINK $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11372,13 +11356,13 @@ fi echo $ac_n "checking for pthread_cleanup_push/pop""... $ac_c" 1>&6 -echo "configure:11376: checking for pthread_cleanup_push/pop" >&5 +echo "configure:11360: checking for pthread_cleanup_push/pop" >&5 if eval "test \"`echo '$''{'wx_cv_func_pthread_cleanup_push'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -11388,7 +11372,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:11392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:11376: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_func_pthread_cleanup_push=yes @@ -11429,7 +11413,7 @@ EOF else if test "$ac_cv_func_strtok_r" = "yes"; then echo $ac_n "checking if -D_REENTRANT is needed""... $ac_c" 1>&6 -echo "configure:11433: checking if -D_REENTRANT is needed" >&5 +echo "configure:11417: checking if -D_REENTRANT is needed" >&5 if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then CFLAGS="${CFLAGS} -D_REENTRANT" CXXFLAGS="${CXXFLAGS} -D_REENTRANT" @@ -11560,17 +11544,17 @@ EOF ZLIB_LINK= ac_safe=`echo "zlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for zlib.h""... $ac_c" 1>&6 -echo "configure:11564: checking for zlib.h" >&5 +echo "configure:11548: checking for zlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11587,7 +11571,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:11591: checking for deflate in -lz" >&5 +echo "configure:11575: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11595,7 +11579,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11653,17 +11637,17 @@ EOF PNG_LINK= ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for png.h""... $ac_c" 1>&6 -echo "configure:11657: checking for png.h" >&5 +echo "configure:11641: checking for png.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11680,7 +11664,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for png_check_sig in -lpng""... $ac_c" 1>&6 -echo "configure:11684: checking for png_check_sig in -lpng" >&5 +echo "configure:11668: checking for png_check_sig in -lpng" >&5 ac_lib_var=`echo png'_'png_check_sig | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11688,7 +11672,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpng -lz -lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11744,17 +11728,17 @@ EOF JPEG_LINK= ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6 -echo "configure:11748: checking for jpeglib.h" >&5 +echo "configure:11732: checking for jpeglib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11771,7 +11755,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6 -echo "configure:11775: checking for jpeg_read_header in -ljpeg" >&5 +echo "configure:11759: checking for jpeg_read_header in -ljpeg" >&5 ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11779,7 +11763,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ljpeg $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11832,17 +11816,17 @@ fi if test "$wxUSE_OPENGL" = "yes"; then ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6 -echo "configure:11836: checking for GL/gl.h" >&5 +echo "configure:11820: checking for GL/gl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:11846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:11830: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -11868,7 +11852,7 @@ EOF EOF echo $ac_n "checking for glFlush in -lGL""... $ac_c" 1>&6 -echo "configure:11872: checking for glFlush in -lGL" >&5 +echo "configure:11856: checking for glFlush in -lGL" >&5 ac_lib_var=`echo GL'_'glFlush | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11876,7 +11860,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lGL $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -11909,7 +11893,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for glFlush in -lMesaGL""... $ac_c" 1>&6 -echo "configure:11913: checking for glFlush in -lMesaGL" >&5 +echo "configure:11897: checking for glFlush in -lMesaGL" >&5 ac_lib_var=`echo MesaGL'_'glFlush | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -11917,7 +11901,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lMesaGL $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:11916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12123,12 +12107,12 @@ if test "$wxUSE_TIMEDATE" = "yes"; then for ac_func in strptime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12127: checking for $ac_func" >&5 +echo "configure:12111: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12178,13 +12161,13 @@ done echo $ac_n "checking for timezone variable in ""... $ac_c" 1>&6 -echo "configure:12182: checking for timezone variable in " >&5 +echo "configure:12165: checking for timezone variable in " >&5 if eval "test \"`echo '$''{'wx_cv_var_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -12196,7 +12179,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_var_timezone=__timezone @@ -12207,7 +12190,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -12219,7 +12202,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_var_timezone=_timezone @@ -12230,7 +12213,7 @@ else rm -rf conftest* cat > conftest.$ac_ext < @@ -12242,7 +12225,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12229: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_var_timezone=timezone @@ -12277,12 +12260,12 @@ EOF for ac_func in localtime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12281: checking for $ac_func" >&5 +echo "configure:12264: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12333,13 +12315,13 @@ done if test "$ac_cv_func_localtime" = "yes"; then echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6 -echo "configure:12337: checking for tm_gmtoff in struct tm" >&5 +echo "configure:12319: checking for tm_gmtoff in struct tm" >&5 if eval "test \"`echo '$''{'wx_cv_struct_tm_has_gmtoff'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -12351,7 +12333,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12355: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_struct_tm_has_gmtoff=yes @@ -12377,12 +12359,12 @@ echo "$ac_t""$wx_cv_struct_tm_has_gmtoff" 1>&6 for ac_func in gettimeofday ftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12381: checking for $ac_func" >&5 +echo "configure:12363: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12433,7 +12414,7 @@ done if test "$ac_cv_func_gettimeofday" = "yes"; then echo $ac_n "checking whether gettimeofday takes two arguments""... $ac_c" 1>&6 -echo "configure:12437: checking whether gettimeofday takes two arguments" >&5 +echo "configure:12418: checking whether gettimeofday takes two arguments" >&5 if eval "test \"`echo '$''{'wx_cv_func_gettimeofday_has_2_args'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12448,7 +12429,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < @@ -12462,7 +12443,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12466: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12447: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_func_gettimeofday_has_2_args=yes else @@ -12470,7 +12451,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -12483,7 +12464,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_func_gettimeofday_has_2_args=no else @@ -12529,12 +12510,12 @@ if test "$TOOLKIT" != "MSW"; then if test "$wxUSE_SOCKETS" = "yes"; then echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:12533: checking for socket" >&5 +echo "configure:12514: checking for socket" >&5 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_socket=yes" else @@ -12576,7 +12556,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:12580: checking for socket in -lsocket" >&5 +echo "configure:12560: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12584,7 +12564,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12629,7 +12609,7 @@ fi if test "$wxUSE_SOCKETS" = "yes" ; then echo $ac_n "checking what is the type of the third argument of getsockname""... $ac_c" 1>&6 -echo "configure:12633: checking what is the type of the third argument of getsockname" >&5 +echo "configure:12613: checking what is the type of the third argument of getsockname" >&5 if eval "test \"`echo '$''{'wx_cv_type_getsockname3'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -12644,7 +12624,7 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext < @@ -12657,7 +12637,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_type_getsockname3=socklen_t else @@ -12665,7 +12645,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -12678,7 +12658,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12682: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_type_getsockname3=size_t else @@ -12686,7 +12666,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -12699,7 +12679,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:12703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:12683: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* wx_cv_type_getsockname3=int else @@ -12757,17 +12737,17 @@ if test "$wxUSE_JOYSTICK" = 1; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:12761: checking for $ac_hdr" >&5 +echo "configure:12741: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:12771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:12751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -12818,12 +12798,12 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then for ac_func in dlopen do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12822: checking for $ac_func" >&5 +echo "configure:12802: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -12875,7 +12854,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:12879: checking for dlopen in -ldl" >&5 +echo "configure:12858: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -12883,7 +12862,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -12923,12 +12902,12 @@ else for ac_func in shl_load do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:12927: checking for $ac_func" >&5 +echo "configure:12906: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:12934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -13183,17 +13161,17 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:13187: checking for $ac_hdr" >&5 +echo "configure:13165: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:13197: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:13175: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -13625,7 +13603,7 @@ fi LD_LIBS="\${top_builddir}/lib/${WX_LIBRARY_NAME_STATIC} $EXTRA_LIBS" -INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE" +INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include -I\${top_srcdir}/contrib/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE" if test "$GXX" = yes ; then CXXWARNINGS="-Wall" @@ -13726,7 +13704,7 @@ SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:13730: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:13708: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -13767,7 +13745,10 @@ fi if test "$wxUSE_GUI" = "yes"; then wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS - subdirs="demos samples utils" + wx_cv_path_ifs=$PATH_IFS + wx_cv_program_ext=$PROGRAM_EXT + wx_cv_target_library=$WX_TARGET_LIBRARY + subdirs="demos samples utils contrib" fi @@ -13861,7 +13842,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.14" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -14303,7 +14284,7 @@ if test "$no_recursion" != yes; then esac done - for ac_config_dir in demos samples utils; do + for ac_config_dir in demos samples utils contrib; do # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. diff --git a/configure.in b/configure.in index b67c054f52..86abcc7fc5 100644 --- a/configure.in +++ b/configure.in @@ -3489,7 +3489,7 @@ dnl makefile system without libtool LD_LIBS="\${top_builddir}/lib/${WX_LIBRARY_NAME_STATIC} $EXTRA_LIBS" dnl all -I options we must pass to the compiler -INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE" +INCLUDES="-I. -I\${top_builddir}/include -I\${top_srcdir}/include -I\${top_srcdir}/contrib/include $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE" dnl C/C++ compiler options used to compile wxWindows if test "$GXX" = yes ; then @@ -3636,10 +3636,13 @@ AC_CONFIG_HEADER(setup.h:setup.h.in) dnl some more GUI only things if test "$wxUSE_GUI" = "yes"; then - dnl we need to pass SAMPLES_SUBDIRS to the configure in + dnl we need to pass SAMPLES_SUBDIRS (and some other) to the configure in dnl samples and the only way to do it is, again, use the cache wx_cv_path_samplesubdirs=$SAMPLES_SUBDIRS - AC_CONFIG_SUBDIRS(demos samples utils) + wx_cv_path_ifs=$PATH_IFS + wx_cv_program_ext=$PROGRAM_EXT + wx_cv_target_library=$WX_TARGET_LIBRARY + AC_CONFIG_SUBDIRS(demos samples utils contrib) fi dnl from wxUSE_GUI diff --git a/contrib/Makefile.in b/contrib/Makefile.in new file mode 100644 index 0000000000..163174b4b9 --- /dev/null +++ b/contrib/Makefile.in @@ -0,0 +1,13 @@ +# +# Makefile : Builds wxWindows utils for Unix. +# + +all: + cd src; make + +clean: + cd src; make clean + cd samples; make clean + +samples: + cd samples; make diff --git a/contrib/configure b/contrib/configure new file mode 100755 index 0000000000..ecbf3c7f42 --- /dev/null +++ b/contrib/configure @@ -0,0 +1,967 @@ +#! /bin/sh + +# From configure.in Id +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=Makefile.in + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + + +ESD_LINK= +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:531: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:552: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +ac_safe=`echo "esd.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for esd.h""... $ac_c" 1>&6 +echo "configure:612: checking for esd.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + echo $ac_n "checking for esd_close in -lesd""... $ac_c" 1>&6 +echo "configure:640: checking for esd_close in -lesd" >&5 +ac_lib_var=`echo esd'_'esd_close | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lesd $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + + ESD_LINK="-lesd" + +else + echo "$ac_t""no" 1>&6 +fi + + +else + echo "$ac_t""no" 1>&6 +fi + + +if test ! -z $ESD_LINK; then + echo "ESound detected" +fi + + +PATH_IFS=$wx_cv_path_ifs +WX_TARGET_LIBRARY=$wx_cv_target_library + + + + + + + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -fr `echo " + Makefile + src/Makefile + src/ogl/Makefile + src/mmedia/Makefile + samples/Makefile + samples/mmedia/Makefile + " | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CPP@%$CPP%g +s%@PATH_IFS@%$PATH_IFS%g +s%@ESD_LINK@%$ESD_LINK%g +s%@WX_TARGET_LIBRARY@%$WX_TARGET_LIBRARY%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/contrib/configure.in b/contrib/configure.in new file mode 100644 index 0000000000..b68893cfbf --- /dev/null +++ b/contrib/configure.in @@ -0,0 +1,44 @@ +dnl Process this file with autoconf to produce a configure script. +AC_REVISION($Id$)dnl + +AC_INIT(Makefile.in) + +dnl --------------- +dnl MMedia specific +dnl --------------- + +dnl Check for ESD + +ESD_LINK= +AC_CHECK_HEADER(esd.h, [ + AC_CHECK_LIB(esd, esd_close, [ + ESD_LINK="-lesd" + ]) +]) + +if test ! -z $ESD_LINK; then + echo "ESound detected" +fi + +dnl ----------- +dnl Final subst + +PATH_IFS=$wx_cv_path_ifs +WX_TARGET_LIBRARY=$wx_cv_target_library + +AC_SUBST(PATH_IFS) +AC_SUBST(ESD_LINK) +AC_SUBST(WX_TARGET_LIBRARY) + +dnl ----------- +dnl File output + + +AC_OUTPUT([ + Makefile + src/Makefile + src/ogl/Makefile + src/mmedia/Makefile + samples/Makefile + samples/mmedia/Makefile + ]) diff --git a/contrib/docs/latex/mmedia/back.gif b/contrib/docs/latex/mmedia/back.gif new file mode 100644 index 0000000000000000000000000000000000000000..8a61076d3ba74bdedc1d24f60c3d1f5a361a6cee GIT binary patch literal 225 zcmV<703QEGNk%v~VLt#E0Pz3-zrVld=jU&4Z(9HWEC2ui06zd20008IjE||y?GK}z zNf>~$-n{z{YJwGn=81mem9{RpmcUHc_KoNIPRH~B4DyD9p%LJl6@Sa4^Epcbno6kk zD5XxT&EQg7>t<(Iwfoo literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/books.bmp b/contrib/docs/latex/mmedia/books.bmp new file mode 100644 index 0000000000000000000000000000000000000000..cf1e148734c807052ec6359ad2eb1a3e8d43d43d GIT binary patch literal 1222 zcmb7?v2KGf5Qg0-f^PH?BCA8E<{c_a$x@Y}nZr;qXR5NnfE2boQZn^-S4x_%j?%%`Rfz!C$uHnGuoYEAr~D;JxHUzQYZhY(}{X$xY0SE&#JC# z5a%D|9QDv}6Qc3-Wv8+GlQ-*8<`8epNC>=NSLPUH1b$st*H{R=IXD*!fgA8x5Dt6l zUCo=!AsqI8={C$E9QGLr_q_i zFK;h=LxQhf>;v~gWIyoy(Zu$`w=UNZZuYl$t>-8&*n94Z?RTzqLWjlGhdMVK;w1@P zgX#l^|MHTQ1q9k0=J>%Sz9`L#Hix;bEVz#^(qoBse!qj(7b literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/bugs.tex b/contrib/docs/latex/mmedia/bugs.tex new file mode 100644 index 0000000000..d66f64e613 --- /dev/null +++ b/contrib/docs/latex/mmedia/bugs.tex @@ -0,0 +1,11 @@ +\chapter{Bugs}\label{bugs}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} + +These are the known bugs. + +\begin{itemize}\itemsep=0pt +\item In the OGLEdit sample, .dia files are output double-spaced +due to an unidentified bug in the way a stream is converted to a file. +\end{itemize} + diff --git a/contrib/docs/latex/mmedia/bullet.bmp b/contrib/docs/latex/mmedia/bullet.bmp new file mode 100644 index 0000000000000000000000000000000000000000..aad8fc793edd54ffb5910e67b2470659c95448b7 GIT binary patch literal 138 zcmZumxe>rH2vhFtK1GJ`9PYi2Yw9con_&SdBlI1b>qTKR2Gu`ZXgNITWj7;KP=JJL V1)UXU1`*-lNw`O&c<~DR!2u5s7-j$f literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/cdaudio.tex b/contrib/docs/latex/mmedia/cdaudio.tex new file mode 100644 index 0000000000..65d06f80f4 --- /dev/null +++ b/contrib/docs/latex/mmedia/cdaudio.tex @@ -0,0 +1,22 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/cdbase.h at 26/Feb/00 14:52:12 +% + + +\section{\class{wxCDAudio}}\label{wxcdaudio} + +\wxheading{Derived from} + +\helpref{wxObject}{wxobject} + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef struct wxCDtime { + wxUint8 track +\end{verbatim}} +{\small \begin{verbatim} +typedef enum { PLAYING, PAUSED, STOPPED } CDstatus +\end{verbatim}} + diff --git a/contrib/docs/latex/mmedia/cdaudlnx.tex b/contrib/docs/latex/mmedia/cdaudlnx.tex new file mode 100644 index 0000000000..286116b229 --- /dev/null +++ b/contrib/docs/latex/mmedia/cdaudlnx.tex @@ -0,0 +1,73 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/cdunix.h at 26/Feb/00 14:52:10 +% + + +\section{\class{wxCDAudioLinux}}\label{wxcdaudiolinux} + + + +\wxheading{Derived from} + +\helpref{wxCDAudio}{wxcdaudio} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxCDAudioLinux::wxCDAudioLinux}\label{wxcdaudiolinuxwxcdaudiolinux} + +\func{}{wxCDAudioLinux}{\void} + + +\membersection{wxCDAudioLinux::wxCDAudioLinux}\label{wxcdaudiolinuxwxcdaudiolinux} + +\func{}{wxCDAudioLinux}{\param{const char* }{dev\_name}} + + +\membersection{wxCDAudioLinux::\destruct{wxCDAudioLinux}}\label{wxcdaudiolinuxdtor} + +\func{}{\destruct{wxCDAudioLinux}}{\void} + + +\membersection{wxCDAudioLinux::Play}\label{wxcdaudiolinuxplay} + +\func{bool}{Play}{\param{const wxCDtime\& }{beg\_time}, \param{const wxCDtime\& }{end\_time}} + + +\membersection{wxCDAudioLinux::Pause}\label{wxcdaudiolinuxpause} + +\func{bool}{Pause}{\void} + + +\membersection{wxCDAudioLinux::Resume}\label{wxcdaudiolinuxresume} + +\func{bool}{Resume}{\void} + + +\membersection{wxCDAudioLinux::GetStatus}\label{wxcdaudiolinuxgetstatus} + +\func{CDstatus}{GetStatus}{\void} + + +\membersection{wxCDAudioLinux::GetTime}\label{wxcdaudiolinuxgettime} + +\func{wxCDtime}{GetTime}{\void} + + +\membersection{wxCDAudioLinux::GetToc}\label{wxcdaudiolinuxgettoc} + +\func{CDtoc\&}{GetToc}{\void} + + +\membersection{wxCDAudioLinux::Ok}\label{wxcdaudiolinuxok} + +\constfunc{bool}{Ok}{\void} + + +\membersection{wxCDAudioLinux::OpenDevice}\label{wxcdaudiolinuxopendevice} + +\func{void}{OpenDevice}{\param{const char* }{dev\_name}} + diff --git a/contrib/docs/latex/mmedia/cdaudwin.tex b/contrib/docs/latex/mmedia/cdaudwin.tex new file mode 100644 index 0000000000..81e2219a14 --- /dev/null +++ b/contrib/docs/latex/mmedia/cdaudwin.tex @@ -0,0 +1,77 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/cdwin.h at 26/Feb/00 14:52:15 +% + + +\section{\class{wxCDAudioWin}}\label{wxcdaudiowin} + + + +\wxheading{Derived from} + +\helpref{wxCDAudio}{wxcdaudio} + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef struct CDAW\_Internal { + MCIDEVICEID dev\_id +\end{verbatim}} +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxCDAudioWin::wxCDAudioWin}\label{wxcdaudiowinwxcdaudiowin} + +\func{}{wxCDAudioWin}{\void} + + +\membersection{wxCDAudioWin::wxCDAudioWin}\label{wxcdaudiowinwxcdaudiowin} + +\func{}{wxCDAudioWin}{\param{const char* }{dev\_name}} + + +\membersection{wxCDAudioWin::\destruct{wxCDAudioWin}}\label{wxcdaudiowindtor} + +\func{}{\destruct{wxCDAudioWin}}{\void} + + +\membersection{wxCDAudioWin::Play}\label{wxcdaudiowinplay} + +\func{bool}{Play}{\param{const wxCDtime\& }{beg\_time}, \param{const wxCDtime\& }{end\_time}} + + +\membersection{wxCDAudioWin::Pause}\label{wxcdaudiowinpause} + +\func{bool}{Pause}{\void} + + +\membersection{wxCDAudioWin::Resume}\label{wxcdaudiowinresume} + +\func{bool}{Resume}{\void} + + +\membersection{wxCDAudioWin::GetStatus}\label{wxcdaudiowingetstatus} + +\func{CDstatus}{GetStatus}{\void} + + +\membersection{wxCDAudioWin::GetTime}\label{wxcdaudiowingettime} + +\func{wxCDtime}{GetTime}{\void} + + +\membersection{wxCDAudioWin::GetToc}\label{wxcdaudiowingettoc} + +\func{const CDtoc\&}{GetToc}{\void} + + +\membersection{wxCDAudioWin::Ok}\label{wxcdaudiowinok} + +\constfunc{bool}{Ok}{\void} + + +\membersection{wxCDAudioWin::PrepareToc}\label{wxcdaudiowinpreparetoc} + +\func{void}{PrepareToc}{\void} + diff --git a/contrib/docs/latex/mmedia/cdtoc.tex b/contrib/docs/latex/mmedia/cdtoc.tex new file mode 100644 index 0000000000..465c495c33 --- /dev/null +++ b/contrib/docs/latex/mmedia/cdtoc.tex @@ -0,0 +1,118 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/cdbase.h at 26/Feb/00 14:52:12 +% + + +\section{\class{CDtoc}}\label{cdtoc} + + +Table of contents manager + +\wxheading{Derived from} + +No base class + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{CDtoc::CDtoc}\label{cdtoccdtoc} + +\func{}{CDtoc}{\param{wxCDtime\& }{tot\_tm}, \param{wxCDtime* }{trks\_tm}, \param{wxCDtime* }{trks\_pos}} + + +\membersection{CDtoc::GetTrackTime}\label{cdtocgettracktime} + +\constfunc{wxCDtime}{GetTrackTime}{\param{wxUint8 }{track}} + +Returns the length of the specified track +track: track to get length + + +\membersection{CDtoc::GetTrackPos}\label{cdtocgettrackpos} + +\constfunc{wxCDtime}{GetTrackPos}{\param{wxUint8 }{track}} + +Returns the position of the specified track +track: track to get position + + +\membersection{CDtoc::GetTotalTime}\label{cdtocgettotaltime} + +\constfunc{wxCDtime}{GetTotalTime}{\void} + +Returns the total time + + +\membersection{wxCDAudio::wxCDAudio}\label{wxcdaudiowxcdaudio} + +\func{}{wxCDAudio}{\void} + + +\membersection{wxCDAudio::\destruct{wxCDAudio}}\label{wxcdaudiodtor} + +\func{}{\destruct{wxCDAudio}}{\void} + + +\membersection{wxCDAudio::Play}\label{wxcdaudioplay} + +\func{bool}{Play}{\param{const wxCDtime\& }{beg\_play}, \param{const wxCDtime\& }{end\_play}} + +Play audio at the specified position + + +\membersection{wxCDAudio::Play}\label{wxcdaudioplay} + +\func{bool}{Play}{\param{const wxCDtime\& }{beg\_play}} + +Play audio from the specified to the end of the CD audio + + +\membersection{wxCDAudio::Play}\label{wxcdaudioplay} + +\func{bool}{Play}{\param{wxUint8 }{beg\_track}, \param{wxUint8 }{end\_track = 0}} + + +\membersection{wxCDAudio::Pause}\label{wxcdaudiopause} + +\func{bool}{Pause}{\void} + +Pause the audio playing + + +\membersection{wxCDAudio::Resume}\label{wxcdaudioresume} + +\func{bool}{Resume}{\void} + +Resume a paused audio playing + + +\membersection{wxCDAudio::GetStatus}\label{wxcdaudiogetstatus} + +\func{CDstatus}{GetStatus}{\void} + +Get the current CD status + + +\membersection{wxCDAudio::GetTime}\label{wxcdaudiogettime} + +\func{wxCDtime}{GetTime}{\void} + +Get the current playing time + + +\membersection{wxCDAudio::GetToc}\label{wxcdaudiogettoc} + +\func{const CDtoc\&}{GetToc}{\void} + +Returns the table of contents + + +\membersection{wxCDAudio::Ok}\label{wxcdaudiook} + +\constfunc{bool}{Ok}{\void} + +CD ok + diff --git a/contrib/docs/latex/mmedia/changes.tex b/contrib/docs/latex/mmedia/changes.tex new file mode 100644 index 0000000000..f1101f4454 --- /dev/null +++ b/contrib/docs/latex/mmedia/changes.tex @@ -0,0 +1,3 @@ +\chapter{Change log} +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} diff --git a/contrib/docs/latex/mmedia/classes.tex b/contrib/docs/latex/mmedia/classes.tex new file mode 100644 index 0000000000..b99bb25a97 --- /dev/null +++ b/contrib/docs/latex/mmedia/classes.tex @@ -0,0 +1,8 @@ +chapter{Class reference}\label{classref} +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} + +These are the main \mmedia\ classes. + +\input sndbase.tex +\input sndfile.tex diff --git a/contrib/docs/latex/mmedia/contents.gif b/contrib/docs/latex/mmedia/contents.gif new file mode 100644 index 0000000000000000000000000000000000000000..3dddfa3dd5f0c652e8b27cd6c29e1fdd49ced5a8 GIT binary patch literal 231 zcmVG0Pz3-zrVld=jU&4Z(9HWEC2ui06_p40008OjE||y?GK}z zO&EZ)-n{z{a)K3v=81;mmA0S4Fj_r^UyThZDG{h6k9m zHI_(7spd!5_$SH6m{Q-cu3}3Ku`2^Nfa3dZ+VyHW%gtsZ`jV7k@%j8Ij}~W) zc{NUP6)X3OWa^|{8nl?rh|gZ1@{(qofnsWu+nmFHSnaq>lB41zSVC9`a)_v*xHx0L S5h*!IS!o$ynW>ps0028gDN7ju literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/intro.tex b/contrib/docs/latex/mmedia/intro.tex new file mode 100644 index 0000000000..eb6c25f061 --- /dev/null +++ b/contrib/docs/latex/mmedia/intro.tex @@ -0,0 +1,47 @@ +\chapter{Introduction} +\pagenumbering{arabic}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} + +The MMedia wxWindows extension is a wxWindows library which provides you +a full set of multimedia classes including sound recording/playing, +cd audio playing and video playing. The API is portable and can be used +on any supported systems with the insurance the behaviour will be the +same. + +\section{File structure} + +These are the files that comprise the \mmedia\ library. + +\begin{description}\itemsep=0pt +\item[sndbase.h] Header for wxSoundStream base class and wxSoundFormat base class. +\item[sndbase.cpp] Basic objects implementation. +\item[sndfile.h] wxSoundFileStream base class header. +\item[sndfile.cpp] wxSoundFileStream base class implementation. +\item[sndpcm.h] wxSoundFormatPcm class header. +\item[sndpcm.cpp] wxSoundFormatPcm class implementation. +\item[sndcpcm.h] wxSoundCodecPcm class header (PCM converter). +\item[sndcpcm.cpp] wxSoundCodecPcm class implementation (PCM converter). +\item[sndulaw.h] +\item[sndulaw.cpp] +\item[sndg72x.h] +\item[sndg72x.cpp] +\item[sndoss.h] +\item[sndoss.cpp] +\item[sndesd.h] +\item[sndesd.cpp] +\item[sndwin.h] +\item[sndwin.cpp] +\item[cdbase.h] +\item[cdbase.cpp] +\item[cdunix.h] +\item[cdunix.cpp] +\item[cdwin.h] +\item[cdwin.cpp] +\item[vidbase.h] +\item[vidbase.cpp] +\item[vidxanm.h] +\item[vidxanm.cpp] +\item[vidwin.h] +\item[vidwin.cpp] +\end{description} diff --git a/contrib/docs/latex/mmedia/mmedia.tex b/contrib/docs/latex/mmedia/mmedia.tex new file mode 100644 index 0000000000..c9c9c215f3 --- /dev/null +++ b/contrib/docs/latex/mmedia/mmedia.tex @@ -0,0 +1,46 @@ +\documentstyle[a4,makeidx,verbatim,texhelp,fancyhea,mysober,mytitle]{report} +\newcommand{\ogl}[0]{{OGL}}% +\definecolour{black}{0}{0}{0}% +\definecolour{cyan}{0}{255}{255}% +\definecolour{green}{0}{255}{0}% +\definecolour{magenta}{255}{0}{255}% +\definecolour{red}{255}{0}{0}% +\definecolour{blue}{0}{0}{200}% +\definecolour{yellow}{255}{255}{0}% +\definecolour{white}{255}{255}{255}% +\input psbox.tex +\parindent 0pt +\parskip 11pt +\title{Object Graphics Library 3.0} +\author{Julian Smart} +\date{September 1998} + +\makeindex +\begin{document} +\maketitle + +\pagestyle{fancyplain} +\bibliographystyle{plain} +\pagenumbering{roman} +\setheader{{\it CONTENTS}}{}{}{}{}{{\it CONTENTS}} +\setfooter{\thepage}{}{}{}{}{\thepage} +\tableofcontents% + +\input{intro.tex} +% +\input{sample.tex} +% +\input{classes.tex} +% +\input{topics.tex} +% +\input{bugs.tex} +% +\input{changes.tex} + +% +\addcontentsline{toc}{chapter}{Index} +\setheader{{\it INDEX}}{}{}{}{}{{\it INDEX}} +\setfooter{\thepage}{}{}{}{}{\thepage}% +\printindex +\end{document} diff --git a/contrib/docs/latex/mmedia/ogl.hpj b/contrib/docs/latex/mmedia/ogl.hpj new file mode 100644 index 0000000000..5db5ace6f0 --- /dev/null +++ b/contrib/docs/latex/mmedia/ogl.hpj @@ -0,0 +1,17 @@ +[OPTIONS] +BMROOT=d:\wx2\wxwind~1\docs\latex\ogl ; Assume that bitmaps are where the source is +TITLE=OGL Manual +CONTENTS=Contents +COMPRESS=HIGH + +[FILES] +ogl.rtf + +[CONFIG] +CreateButton("Up", "&Up", "JumpId(`ogl.hlp', `Contents')") +BrowseButtons() + +[MAP] + +[BITMAPS] + diff --git a/contrib/docs/latex/mmedia/ogledit.bmp b/contrib/docs/latex/mmedia/ogledit.bmp new file mode 100644 index 0000000000000000000000000000000000000000..e7cf417cf5d40022505909a5653ac5f30b6aa6e3 GIT binary patch literal 87670 zcmeI5&1x*U8HQ`%fH@p+XKo>@A)DO75DrWT1n+VQA*-Yb!*uWZ1Onr%e74?ZIV$>276a|zfYwqNhMWDDoOR@mfh8=pDydE=aWjRc31!5&p-U-tBTSOczlD$ z|1kRrkFTnCw79C8^_2Zh^PqfH{mj4B&p%TR5BwnW%P+rFpFVxUlA3?3x~3c+_@PBK zc?0QqyYU2vr^B|>@y##}RmhhWrn3M#9A58kUw^cD+=~i&#kKU)X@%(^ihekpZeQ>0 zj9fvFS1(jeKdn$Bip)jF1R`Io9yP`lYCIiUMu>EJygIDh;}t@XWV&N@-!ZP#W7RO8 zoUvMUj4Q2=AYhLNXRL0=b}}OV^v*k-XnSe7si#hs&)M)+Eudjy6tvV^vSo)*bJGreSYL?iuUp2>KmH|;No!` zCNCZ@9@laN#9K9&c6BYjT;;rYbRC&>Ex&kNmoHaoFCJY-Cdcw!j-B#87vu4K&c?Wy z{_3vICUPkrVKJM?rFbNXxkN6+BRk9`av>gt!b~EU;juB8N#rs-N`dk@?P+8Y9$SBH zCMo11Ja+oJTtdnvcvS2u*>sRg@TkgD^QkBo;8Am@%_M?cfJa@OK9_`YevgJZV>Sik z{2onl=KOTZ***5W^%hKqoZI8MudTmiBIVp3EkMad&g{|3W8t1;a%PWK94q()%6UCH zXsqP%kn?(Uz&OxjDQETQWO1-ZLeA>ZiQW10SKg=&*KQi;1LLeoX_J3#K<8Cp`6X*D8tAx2!Nc;BM{CNCKV>t4%6yP z_kTH8XWR;Aha16+9t3a7xjZt#j;1@%oRQnnyR7ssB=S6}OeS(Jj|{-?s}dt|sf_$K z9Ulg7Spyr+e@Yu7KJ>DcBe**gFM zh4Sj_BNHG(9SMBSb&i*~7td558G+9oR$bJtCev8YRUbzg(rK(`^EeiZ=`_yhaX1(g zYMjyIu*ifO=kz!vGNr~jJ!2?##bABX=lpG>=?{TXXu|WdUh-qT)EA&IoD;!erRy-bG;^r+TF$v9Rghb0n9ca*xEL`)E_fgZKG z*g|&Y>F35I(kohfZAROV4P4t`WG2j`B~l4=pb+B{sep0^@>wr**Z*@4xm+u7n%f0l z2e4{HiM`q~V~|IOMyE(Wi3BMiBnmCjl7w`j3^NAR zM~6m-NMDIW!vZn8GgKSJ778T324Fa;N7>)wV5m01%B4_uFAA4x+Ct*n9LCbVJ7)eK2Q`XdJ-`2q zf0Rl^WZ6#xc^(6#_51eq{vJITaltU3L@u&`91B!&2wIWe9!Elzf)!V{Keq=jQ-&bD zG%6y!J&rS;-xpw{v#6iO!$FEn=n;tb_j13PG}3N8HFhGsJ&sgIG&+2uD!}Ngu@&j< zahx%uI(66H8e5UR9!INVuREufD`h^M(bwa082v+42J8AfhBIC~cJ*j6u^LbvWuxQk zakN=AhgaRYr!-(OYu z*;o5!IS(;|Jw6CJD`V+cC0le70V)4n9l(npdd3s4!|HI4lJP+VDzrX)5qYdBTOT_{ zMp9U@#$*hrkB!GK)rSvwfDRMNQ`}P9^WX}vq|47---r=o0QNvgAs$smB~Rf>sU%~CZvmqAhT0g>{(u(W$ccGE z=XEV(h)03qoR(xHNiwl9IYZCg0uieL9-VN_in$n7JkEDlCIzFf$MYCrsqy2vhcvJt z%;Pc`(OiZxo@=lJoWL=pA#wU{J20yFZJ;~%(EL{kpL4TLBKiOU^>Iif-vlQso7{N>V?ccz5J|PMP_#xchIn*~ zB)&q?8o?Ok(N!Zwqk5L%l=sQXr zhBJnFtcO3RQzTjgD&$_+5AfY4Xboo!^oUPCnOAc(E`_(NL5Xwz!P=B2)FU9Z z?#_dTIP$;!X<)rYHlbPvd&G%QfqXE<>BwoI%)R)Elw}L|2uONIm6GlA$a2SK!4l4U zij*2-JW^>f-bS*OyF_=#Ph@+vV?5f>x@84UAYLL{jj;$ytxbak<(+AXbsm` z=k%DPa~`2F@cuai72Ccl;;7qqB$vkQFt5kt(Hf&Mx5v;^nbhTaj?tL8KBA~mrE(!g zY0U01?Fl6AfMu?a5E6InttJEeaB?46&yV7d#2tKDK;=31Xyx~qE?Q#`RsoNxqBT}y z{&tmOEwUadVM^IpjrrSEE@*V|6wGLiWjrQ{*7)O8qCP^#^k|LOSjgjq$|R#TUSpy9 zh@QZNG7{zljm11pDkK=E9HK(?abhW_9ibDa!x2|!PsaO{dy0{CX;QRK(O9fL;#f_n zQq!8{avmqtsR>7i;;>wOoY1yTiqu^1BRgtwq>sp#wS_3@F}AxiQDeFDqd2ND#ht3L zXnh1`OnGCDOB<(@DcP>l-wQtr#2gm-OI<2kAMtmCtpvZIgKKiS$J;K+8?*FYF>yg? zcW1grqdsXjh#F@{8Icr$Ei zF7$Sl;PCC!nHl|0ASoi%JU;^N4kJktnbD*F2_!|Nn&S@Eh<}I7&FJaJb2CeLYKzSC zBWYxjSv^v;dN}gfM1yh6nDr6=)QSX=c^T{7`7?U2{Ks6AT_TNUyDBu2$jpqmVLLv< z{4|tyi8Pw$$6}22IAfCY28FL#A4|n5{}bwnM@RJvUToIKLTwIxaqj)D5Tof4U4R1T z4ydT`MHqz`O^;>z02FTcLX$#_J&#>q&ef(*T`rqTM9fgL`Xsjtu7BnWdLALN>60JP z+sTo-vKM0Pd%TrnEA#yi}Yp-=0UUj@e_iy+56{ zZNSXj^-(LTol)B)W~Mx&ULUnGtBiZT$KVz2aK`r^e-DYTJ9xSQ)G9es`cd$CxMez8`Z<~kmq*;U4k~fyGrwCA zX#2#B;jx0k#|n(q<29bI#XR+ZihJaHD~ecE!qqIl&%D71!l&z}3e&22e!?@QWQ+mz zk^JH21GvX2ZXJoc4yKA#VtnKu@tmA7pgwY|Llg0kQy+KgHipMX#HwU`#7Kl{CPp?{ zJ<`ZY6v?cQc^JD`ZG2vnMQOu=WHjpI zUYvUP#wIGG8f+8uMyx`ZBjxfa_e-)i!>D^~G~!~*mKgQ=xJ|~3$BE60_2uQ;9NlC4 zRkVX`PICfnPozNM`@LI{dJD@l>h-a?fv~vg@Ibpthrmb}S^A~&jD|;XAEvBMM1{SAXda z@A8*0`PTMVfaJ~OT3*rJFdVAOGnyWicvEAQM5uritP+q>C8InJSj!u<8?`%jGFI36 z)d1Na2^{tJH}83D%VK)$VimCb-C%&IND+TESmSX5<0JRPyN+El#sH5zV8jSgiAL~| zC_FlkVgs>+SMj>;&^bLm=^FEmJG!#;J&J)bO}jQnG%T3nj{Q7rrg601<`ARO5W5+# zuRDpz&EZigCm#u_qk2Xz=!VbjHr=Z7jQ;fzA*!dg{B5RNFSoUMm@g0>p7=>7e2v~x$C3uG0#6Cm1orJqs}!8SQgGtSG3vO31oCzA7%KfW3ghI` z`|ZH+s1|24jHX8gax;u!9zDLtMmb3KZ24FX@Q5PI%cl0y`z` zN{jWFh>vztp3&E1I>_>jdVQpS1`r8M>bWBw;_My^U+eJercB<-@F@3pzIdDxy0h2E zH|OyriIYAr%VYNIM=t5a1_%2n&nU)-)SU~JynQ0t?kyfKR}jPWBV_bV;2DnB@M`u<~%v;dFzbX4;$pzubVH= z*z1$io#gs$PLGkSD!)JgmShBG$7JTpGxqxA{5jiRyJ}@bznncf6zM$#ONI2}61kA_DsyJSR&TGKKaQ2~P)`TV#dM*O4SIHQ#( zZs8oUiu!k9jML?O)v`RcEo{=v42)`@obp{db=j1;*JPh*@GX^4r1Z&?Irp6#A4+!zizGZHrFOw2Uu;a=nb-(zOaDz5BMA zdDk+2e^l95pfQy}x^?gO29O~*)=JKRj5epwIOuVJ(baS;zdru!>#y(jfBl=a&EWtht%C_syO1`A`ZucBuqX^#i+|e-(f-HEY?AEyZITWi$iq+L7YW*nf#8drF vE@(YAD`u@xxel-F=j7V|6876La_!vgyq7z literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/ogledit.gif b/contrib/docs/latex/mmedia/ogledit.gif new file mode 100644 index 0000000000000000000000000000000000000000..9784681b2d44f95979f6b95e5b699f94e115e85a GIT binary patch literal 7163 zcmVNk%w1VZ#A{0kZ%A0002L0002L0KdNg006(g0KWjgzreu2fPjGi00030 z0RR60009600RI60|NsC0A^8LW008v>EC2ui0K)-*0RRO4@W@H4y*TU5yZ>M)j$~<` zXsWJk`vJ!z&vb3yc&_h!@BhG{a7Zi~kI1BQ$!zuzu!n0(ty-_xtai)omY^}OcuX#v z&**d&EIkn3@VINH@w9CxR&d<iO*aW?8ZwSJ}#m5fGaW&^Oa58c>xijhS@X_tcx%Bw?`h3LM}XbEiWDtcTt|`PMU4LO_T5t_vZTp;{V@D{IB;OWiW34- zka+-M%}>AJ-N3l9r@f6KJ=PNn6sSI*CzC2=mh!?%7#5&zvqqEVOj`O}QolAF9QwvWoNZkc_%tqpOU2 zcjnrigA4ETnL_9adkx0?YdWhpj0kwm5FkK-0s*XM%S{{9G54`}a$_FfyS&lwz=x|} zKc_h0TLATr_6rc|Rc_8fJ%|n`Om*wm!T$EzR+<&~m22RkW!YurHOSk8h@mGNdlXjK z7fUX^*M@yF%~v0N_npRz9DD(2od9NerPf+qEw&hK6Nc9!d1Xz;TVnDEXyK0RP16#G zPyI;KRNC+*B1~|!_P~GEnZo0fP)3P}d!A5vpOt~(lnZOCQ71raQidt!nBfs)=9y^T zg65iL^0gnEYZ{p!YBB6U=AC$oDde7f?)gTaKVl_Vj&|m0=%I*Ka%7^6HtMJ)r>P<7 zq?A@_>7|(ZgA)sjWa{aspoS`{2!e5{$f&5Ms_LqembyZxti~$qthB1&stT~ys_U-2 z_Ij&d1i`=|26Vi*PDOUe7ZV1<{`TtZv(Res>$0M4P%K)<&Y^64+eYi{x8R~MEw{*V zaIG}i%F%7JBj#T*6a)n>+6hU~^G@W8u{3vhhGQj2eUab<*T zjC!?1Zo>8jOz_1RqiXQ56lb__JMA4S86EusOtHclr>rul8<(4K2KlBtGQ{*g)UM4H zudMUVmbTpC%QjaKGbAD-t8LByA{_M6JU8w17(UlqAG^gGwy)7~l#C(5_df0Q*H;)^ zLaroO4EEV*i#so{U0bWKih4vPWCmuZZTH?7a8xJL#X*{-zbCK!@GihXi+U({2&suXhdf$(TQkuA{4VC#fY^n16Cvs7Qfg-G0KdH zcqC)UxHvO9nvr#B3?v$B0w-d`k8TpX;Q@0v$1*x{h~m@Z5hsbqJ7$rLS7XK*1bwa znag4_Z+14YpnH7D0bq{LEwF&wlZa`|YPv6YhpZt>KHyC1J%gIo4Cm|CsLTyiOmY(F zrZ<}bPI0;ufY{`v2B?Sub*@v1fPAMuVMoqvmJXfKQ{5EuxzBO=p%Bez6C~P36;u>2XVQj6+o{o#27#l)limrGw4Z}~G;J6)sZ5E0 z(omk@rN)_tL#~0-v&D3#K>YzB3+Ydfu2iROFcVUVB&8t-Tx>ud9jjBJoz+aIX*qT(fut`1a$`Y&Cs517mZM+2#*fm+e zB-N=+B}Qu3h&Rr5cBY@*D=$TB3&~QH0@Ikm1Xgo7$hr2lGL0=?LmLFrngC8CJqT@q z{@YpMs+G8-wXI)oklbr5m$`~{t}kwNT^<;>x?A`yb|I==$8xW`JNPbmvmoB_KD4~E zEv|Iei-q>Occ1W$Z*)mXU-qK+zCq0|cje39{sIobc+D?#Ys=q4I{3j5jouX0VD^yoUd_n7l83Zj5y? zUmCl>zBe{zhtKd zai+}WcMdtsGd97KeVpVnr_sx3hH?ow#4dC)uFY;9q?MD3WiX#Wa&}%Ep7YH9L^yx% z&-4;jpbIx>Lc{RPhgNfr}J6eKRlQ{=Y&b6*TxoRDVdL}YX^PHJO>zi5Bz5pPHvX{;5W;^@Y&c3yy zTMdvR?^etgmG%vi4ef4w``gUcHlcrA?G(#-1apfrvcb*nc0XI(Zl?A_tesA5uVCHo z&bPkd9q&EsH`v#<_u=?G18(d4;NT`WmF3NE^$PsB3QrBfC+_WtE1BH$Hg~`u4sjwF zoZ=u~w#9GEaC(24jo$DZ& zI@rT*bsNaL-06iQ+DD-FweP#_Zf|-hsaoo}hoJ6ucemIP{C2DQ{qJ56{KN-Oc)g!| z1aTHK;1!>6ysrl9DFs2~wLJNKf1T}?*RA6>|9Er$rPeP90qRAt=+$>!eA;LC|{t!an55{`}o%?{7YrUZuA`wF`8Qh2GaU@hcC0^od`4wkE$`=lqvd zGSoGX5xXiA3zogWue9xV-~35CJ@z|31mW-70qz$(@r&PAKmK3;LzGrDsyp4Toc&B{ z{>OhgGl1HMG6M*JxW|8A0DZt05Ysn%)t6=Ww>0BdZ2PBZ_u_vp!7;LiY6p0M6sUX? zqkupIG&RS76lZYp$8L-VU}R@_6ZnB77=i&KgC;nG9+-e77=kE6gFd)_C-{4d=YRrH zbr6VoeU@%jWNI^LgFnbLPWXXIBY?PPfjBsV2PlO%_2vA zCvE{lda5@{Qv-<#Rfe>3h=|y1U^reo2XOUvc#eaD{+C#Bia2_%#&gH#iIy0OE$4^Y z^=~pKY@SFBps0$8$ck2$b>7uuv1na;NQ=>Ci^3&Oj95>*SR}pZi{UnktvD@#D0jsu zi^qtJt9XR1*ilnMhGr9MYo>rA*n>4gIkO0V191#RNQB(xfW|P6=@@+ID30w&4wVIqjiDET_BUtq)Pr?qPG19f>Ii=a zNs$A&jzxHp@YoU}r;N9ldE9i5k%%)L_=f1GkBAkH2kDOjd66uskuCX))Od^5XnSWE zfG5+9J1B$vIEyc-f&nRx8rhCtw}SDAU1DhdeGJKIIk|>v$Td&-H2pY{?r4$gD3n!c zjv0xO@0gCj_+s@(0*&-2$CK!mQ2ZwO{jyE#xtoXa$N~_ zM+saCDVBfch89?o;&+mFX;*3~jb8bcpaqwT^o+dNg^DSY3HgVl=ZK~!PRmYvMVc zq%croe0T850!xIRJ2>w56fN z>5*>aOgM`wBec_u9?plITxPl^OMdZjPapNsXGL$##x37$XtrAI)f zq2s2o)tgHNp#w3X1S+Cz3Z}ROr@>{W%2}t)iKlt$aeOK|g_==W%AMXBoNGF$wqQ+R zdTHe5V89uuaObGHaHy}Nss8vSr=WRZUW%!>woja@Pm}6%p(?62P^z)Rs^OHVpxUUa zI;9Zhs@9a0YBsAlV5_~utGV=-=%%YR5UCmEt4n64D`2eHrL4ZgtZ(M2Ea0r2C9S<$ zX1F?M!b+?_MXiqpt;wpZ+?qV$>O$9AHma(vWHqi31gxwls_MEt@5*Y(ssiy^tnP)b z@>q?ISvrG?udh|F+EcE<%BBFDJq3GA-b$|odt(Q?JObOUK;tmnl&~ovvVml>A?scbd$IP3vhCxtpkuMTH-8e#Wib0WD?78ZceDP( zvza5aFA#b)OK3ie{y8}tw0Kvv5TvwA0JI*!wAur;o+PzLaI{Zrbwi7_2}ZIgK()%_ zwGsrjF*L6wyJ}f0v}EP99U!)?im7bt16I4Xm-eZ-n?~0~w~T8}lv}wcTX1hHxtiNzoXbi2 zNuyQfx63EG!aAjOI;_HQl=69>0!n*$o2wgkwgfx71!tm}6T7YByYyF+d5d79TerHq zoV**P$7`s%3%c_JV7S|_%Zt3PtGuoIyT_Zk&wH<{i)+(+bTgWXz{|YX>%4Tsz1_R3 z-|M+j3Z?7*%Q?WSz30nZ(VM>M<+bL^Ec9!?PEe)(8=*)bzxq3^#apYCNGSqQ1o^8M z)5^c@yDIf7dZ^n11w5<{yaa@(1_ZajQE@%IHaZb}!Mj>38%(xc`#UYM04lt~EUd!s zs{|GNP#KKCK)}JN%DgR{!#d2uA?#f-Y)~^?Dexx147{lUvBOA=#0d<;B8#ezzrR4m4Byu%Uv!?lXW zvg5_JOQLU_$4Wd}X1vAVLS|}wsWPg^gsj7XD93aB$2>s99SpyP{Kzd#W{6y@;R49D zi>>|@3dx$h!v9sqeY~pgV#yO6t(m;ZrrceVtWiNMDpMB7W!Jx^9Lo!^T&b+ep}Yf( ze8X)j%d)JWwQS4o(#n^7xJ}T;yd2BFTvDjVOv!3z2VBHCkjqkR1jc;K$o$E@i*DXn zvZ<%DPc+N}3#Hb~%gId1tfw$;h<~(3XIA)RQF*m@JIdcG&f`qZ*xbL`%q<{U)Y{df6 z-Yy*6@jc7({oZ-K0(3?2X+n%*pr7+mY%c3|`GdPT@t~ly z6fB8JecmIU-jD5ZuzlKNPUe<<+h`8xecpb9{>XTq=Ta@=+L`A525#bw4%~&Vh7KCBTVY0o}`Ly(5bHKL(b~0&c%!D*o)5Sv@YDX ze(TU8ZG>&!g5K-y&7_5{=Yv?sqfNmmZR~qIqZewr$^OJb)#*9?+Rz@!;5+T2?nJcQ zE8>RN&%W(qo*K!!-`c9|WWaC3{>qze?z6nA3Ch-U?XT?a1@5lvvL5f|j$RgeqMq!o zx0df)pm6Wrf+&9JQ--eguEn_f%$O3w@f~21j zH1PkM^4F`t{BG6d-s@mU^59-@J)6uRAEd?(yE5-WmmB`F0RO@j3iQ3(*v(GLy-VxH z`S6gsZ3b&&<4e9uf1ufm?dl!!jSi<#-$_o-JT?3DZz}ZG%hnY?$b+t_Sr57CC9a3O z@*oWM{X6xUeZr1x+OB%`WBO{n%7||N_H6(4U|sa{Jokrftak57k7~rlwfDuW_!tcL z2=43$I`~n$^Y>X?m49(9|Kn4P)s!!zolm0e$Gp}`^?{DZDGjiNFRoaq_zssFo45cA)T=%!BTA@2LTuf#t4`=HOnBj0N`pZ9OB z{LByTy^r@$3Z}!)>{jmD@QUm}eEqu`q-4DP*Zv;&Urg{xFQeEGzF3<1SU#)OF9e+_ z$wMmsuND2>`}w=s@c9V=;7wZX#aVCO{RhMCcu2EE4;2AS^@U@3ekJk7bA9Lg3jq2a zHsOY70VI@(W6}A9K2Ousf#srQwW?;+`vr$9z;3AgZ336dv)KJEQst{wX?vfw;d_4n z7ZlO+B1&3g0`yB%?2t>byRyTRgd_V9L>oFJ+q?{QYn-CPn#2PYU1ilo#84f4 zZKdrat%5|IjIHhU%|x=~^(Ef9#md!9EoN^1vl-@eo{n>zOIF^BrsnpWt=#VJK90oB z&I%V-4@;L`e;={7wyHbVhR0uQ2iwnY{w055&Yp~Z{tSXB=ocjFE8R#2>{Z zQnV$nl*336BVq*U<08M1+!_k>NU7w?KuCZE!<2?4vxXc~5}cWnLm6noD(dWYvffP? zBY|=|Lx{r537?uu==l^;kXM;_9{s1WicO+5uwreabj;YLPlrGqLiTJ^wq{{{T_yD4 zO`~v$=@DCYjMKDz(dzB%SM5)`i)x}wS+{Vnuz=e>7A*Kk-l&iVFHR)4BT>beX(hEB zI5427e;!$Z3s=)9U$7rsktTXjlRYHFyYsmheiTB{4h9%Ba=b^M8PS z^|6~OFS`B~+Ao6w#k0@70|!({9|qxQPr(NX^l3sd5`1kz3!ykr!}B7{aKnT4^AN%R z0KBh65sOGqMH7$VD#R5H`p(7fFx+m&5#O-!#o=PiQAZk&>+!}Df#gg`3I|bgloN}C zsK_RFs7p#CVMNlrDQR48%L|{>E=e!_k;qCPNkLJm_-l$G0}4#Wt6}9Dvbh1F)@7y6iOjQQ_^fc z<FY>pRbqdyS( z}_}Ck-2h-X+k!{O!$0|9th+C!UKK zn5QATzx&0aaIK+de|`P)=YN0y`LAE%;3tCzAi!{RaY5GZ7rp;AuzwG9U<4ufIxg7H zAz3J(0n?_a0E&-y(wm?JMHoU7j?jS}ykGqECcl(%upMe03*dh-#m<+X=%kHyPl;+Po6F5btG zheTu|6}d=8Hqw!ggrxHzIY~-Z(vp|NWF|EkIx)7ycIZImhEs(dwWiEBOOJ4TUm%jvNFoiixViwbw$3$i_0T2NI06Rl2pX2}l literal 0 HcmV?d00001 diff --git a/contrib/docs/latex/mmedia/sample.tex b/contrib/docs/latex/mmedia/sample.tex new file mode 100644 index 0000000000..4e0a437d39 --- /dev/null +++ b/contrib/docs/latex/mmedia/sample.tex @@ -0,0 +1,87 @@ +\chapter{OGLEdit: a sample OGL application}\label{ogledit}% +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} + +OGLEdit is a sample OGL application that allows the user to draw, edit, +save and load a few shapes. It should clarify aspects of OGL usage, and +can act as a template for similar applications. OGLEdit can be found in\rtfsp +{\tt samples/ogledit} in the OGL distribution. + +$$\image{10cm;0cm}{ogledit.eps}$$\par + +The wxWindows document/view model has been used in OGL, to reduce the amount of +housekeeping logic required to get it up and running. OGLEdit also provides +a demonstration of the Undo/Redo capability supported by the document/view classes, +and how a typical application might implement this feature. + +\section{OGLEdit files} + +OGLEdit comprises the following source files. + +\begin{itemize}\itemsep=0pt +\item doc.h, doc.cpp: MyDiagram, DiagramDocument, DiagramCommand, MyEvtHandler +classes related to diagram functionality and documents. +\item view.h, view.cpp: MyCanvas, DiagramView classes related to visualisation of +the diagram. +\item ogledit.h, ogledit.cpp: MyFrame, MyApp classes related to the overall application. +\item palette.h, palette.cpp: EditorToolPalette implementing the shape palette. +\end{itemize} + +\section{How OGLEdit works} + +OGLEdit defines a DiagramDocument class, each of instance of which holds a MyDiagram +member which itself contains the shapes. + +In order to implement specific mouse behaviour for shapes, a class MyEvtHandler is +defined which is `plugged into' each shape when it is created, instead of overriding each shape class +individually. This event handler class also holds a label string. + +The DiagramCommand class is the key to implementing Undo/Redo. Each instance of DiagramCommand +stores enough information about an operation (create, delete, change colour etc.) to allow +it to carry out (or undo) its command. In DiagramView::OnMenuCommand, when the user initiates the +command, a new DiagramCommand instance is created which is then sent to the document's +command processor (see wxWindows manual for more information about doc/view and command +processing). + +Apart from menu commands, another way commands are initiated is by the user left-clicking on +the canvas or right-dragging on a node. MyCanvas::OnLeftClick in view.cpp shows how +the appropriate wxClassInfo is passed to a DiagramCommand, to allow DiagramCommand::Do +to create a new shape given the wxClassInfo. + +The MyEvtHandler right-drag methods in doc.cpp implement drawing a line between +two shapes, detecting where the right mouse button was released and looking for a second +shape. Again, a new DiagramCommand instance is created and passed to the command +processor to carry out the command. + +DiagramCommand::Do and DiagramCommand::Undo embody much of the +interesting interaction with the OGL library. A complication of note +when implementing undo is the problem of deleting a node shape which has +one or more arcs attached to it. If you delete the node, the arc(s) +should be deleted too. But multiple arc deletion represents more information +that can be incorporated in the existing DiagramCommand scheme. OGLEdit +copes with this by treating each arc deletion as a separate command, and +sending Cut commands recursively, providing an undo path. Undoing such a +Cut will only undo one command at a time - not a one to one +correspondence with the original command - but it's a reasonable +compromise and preserves Do/Undo whilst keeping our DiagramCommand class +simple. + +\section{Possible enhancements} + +OGLEdit is very simplistic and does not employ the more advanced features +of OGL, such as: + +\begin{itemize}\itemsep=0pt +\item attachment points (arcs are drawn to particular points on a shape) +\item metafile and bitmaps shapes +\item divided rectangles +\item composite shapes, and constraints +\item creating labels in shape regions +\item arc labels (OGL has support for three movable labels per arc) +\item spline and multiple-segment line arcs +\item adding annotations to node and arc shapes +\item line-straightening (supported by OGL) and alignment (not supported directly by OGL) +\end{itemize} + +These could be added to OGLEdit, at the risk of making it a less +useful example for beginners. diff --git a/contrib/docs/latex/mmedia/sndaiff.tex b/contrib/docs/latex/mmedia/sndaiff.tex new file mode 100644 index 0000000000..fc909dd23a --- /dev/null +++ b/contrib/docs/latex/mmedia/sndaiff.tex @@ -0,0 +1,68 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndaiff.h at 26/Feb/00 14:52:29 +% + +\section{\class{wxSoundAiff}}\label{wxsoundaiff} + +AIFF codec + +\wxheading{Derived from} + +\helpref{wxSoundFileStream}{wxsoundfilestream} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundAiff::wxSoundAiff}\label{wxsoundaiffwxsoundaiff} + +\func{}{wxSoundAiff}{\param{wxInputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + +\func{}{wxSoundAiff}{\param{wxOutputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + +\membersection{wxSoundAiff::\destruct{wxSoundAiff}}\label{wxsoundaiffdtor} + +\func{}{\destruct{wxSoundAiff}}{\void} + + +\membersection{wxSoundAiff::CanRead}\label{wxsoundaiffcanread} + +\func{bool}{CanRead}{\void} + + +\membersection{wxSoundAiff::GetCodecName}\label{wxsoundaiffgetcodecname} + +\constfunc{wxString}{GetCodecName}{\void} + + +\membersection{wxSoundAiff::PrepareToPlay}\label{wxsoundaiffpreparetoplay} + +\func{bool}{PrepareToPlay}{\void} + + +\membersection{wxSoundAiff::PrepareToRecord}\label{wxsoundaiffpreparetorecord} + +\func{bool}{PrepareToRecord}{\param{wxUint32 }{time}} + + +\membersection{wxSoundAiff::FinishRecording}\label{wxsoundaifffinishrecording} + +\func{bool}{FinishRecording}{\void} + + +\membersection{wxSoundAiff::RepositionStream}\label{wxsoundaiffrepositionstream} + +\func{bool}{RepositionStream}{\param{wxUint32 }{position}} + + +\membersection{wxSoundAiff::GetData}\label{wxsoundaiffgetdata} + +\func{wxUint32}{GetData}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundAiff::PutData}\label{wxsoundaiffputdata} + +\func{wxUint32}{PutData}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + diff --git a/contrib/docs/latex/mmedia/sndbase.tex b/contrib/docs/latex/mmedia/sndbase.tex new file mode 100644 index 0000000000..73e9ab84b9 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndbase.tex @@ -0,0 +1,288 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: sndbase.tex +%% Purpose: wxMMedia docs +%% Author: Guilhem Lavaux +%% Modified by: +%% Created: 2000 +%% RCS-ID: $Id$ +%% Copyright: (c) wxWindows team +%% Licence: wxWindows licence +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{\class{wxSoundStream}}\label{wxsoundstream} + +Base class for sound streams + +\wxheading{Derived from} + +No base class + +\wxheading{Include files} + + + +\wxheading{Data structures} + +%% +%% wxSoundStream errors +%% + +\wxheading{wxSoundStream errors} + +\twocolwidtha{7cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf wxSOUND\_NOERR}}{No error occured} +\twocolitem{{\bf wxSOUND\_IOERR}}{An input/output error occured, it may concern +either a driver or a file} +\twocolitem{{\bf wxSOUND\_INVFRMT}}{The sound format passed to the function is +invalid. Generally, it means that you passed out of range values to the codec +stream or you don't pass the right sound format object to the right sound codec +stream.} +\twocolitem{{\bf wxSOUND\_INVDEV}}{Invalid device. Generally, it means that the +sound stream didn't manage to open the device driver due to an invalid parameter +or to the fact that sound is not supported on this computer.} +\twocolitem{{\bf wxSOUND\_NOEXACT}}{No exact matching sound codec has been found for +this sound format. It means that the sound driver didn't manage to setup the sound +card with the specified values.} +\twocolitem{{\bf wxSOUND\_NOCODEC}}{No matching codec has been found. Generally, it +may happen when you call wxSoundRouterStream::SetSoundFormat().} +\twocolitem{{\bf wxSOUND\_MEMERR}}{Not enough memory.} +\end{twocollist} + +%% +%% C callback +%% + +\wxheading{C callback for wxSound event} + +When a sound event is generated, it may either call the internal sound event +processor (which can be inherited) or call a C function. Its definition is: + +\begin{verbatim} + typedef void (*wxSoundCallback)(wxSoundStream *stream, int evt, + void *cdata); +\end{verbatim} + +The {\bf stream} parameter represents the current wxSoundStream. + +The {\bf evt} parameter represents the sound event which is the cause of the calling. (See \helpref{wxSound events}{wxsoundstream}). + +The {\bf cdata} parameter represents the user callback data which were specified +when the user called \helpref{wxSoundStream::Register}{wxsoundstreamregister}. + +{\it Note:} There are two other ways to catch sound events: you can inherit the +sound stream and redefine \helpref{wxSoundStream::OnSoundEvent}{wxsoundstreamonsoundevent}, or you can reroute the events to another sound stream using \helpref{wxSoundStream::SetEventHandler}{wxsoundstreamseteventhandler}. + +%% +%% wxSoundStream streaming mode +%% + +\wxheading{wxSound streaming mode} + +The wxSoundStream object can work in three different modes. These modes are specified +at the call to \helpref{wxSoundStream::StartProduction}{wxsoundstreamstartproduction} +and cannot be changed until you call +\helpref{wxSoundStream::StopProduction}{wxsoundstreamstopproduction}. + +The {\bf wxSOUND\_INPUT} mode is the recording mode. It generates {\bf wxSOUND\_INPUT} +events and you cannot use wxSoundStream::Write(). + +The {\bf wxSOUND\_OUTPUT} mode is the playing mode. It generates {\bf wxSOUND\_OUTPUT} +events and you cannot use wxSoundStream::Read(). + +The {\bf wxSOUND\_DUPLEX} mode activates the full duplex mode. The full duplex requires +you to make synchronous call to \helpref{wxSoundStream::Read}{wxsoundstreamread} and +\helpref{wxSoundStream::Write}{wxsoundstreamwrite}. This means that you must be +careful with realtime problems. Each time you call Read you must call Write. + +%% +%% wxSoundStream events +%% + +\wxheading{wxSoundStream events} + +The sound events are generated when the sound driver (or the sound stream) completes +a previous sound buffer. There are two possible sound events and two meanings. + +The {\bf wxSOUND\_INPUT} event is generated when the sound stream has a new input +buffer ready to be read. You know that you can read a buffer of the size +\helpref{GetBestSize()}{wxsoundstreamgetbestsize} without blocking. + +The {\bf wxSOUND\_OUTPUT} event is generated when the sound stream has completed a +previous buffer. This buffer has been sent to the sound driver and it is ready to +process a new buffer. Consequently, \helpref{Write}{wxsoundstreamwrite} will not +block too. + +\latexignore{\rtfignore{\wxheading{Members}}} + +%% Ctor && Dtor + +\membersection{wxSoundStream::wxSoundStream}\label{wxsoundstreamwxsoundstream} + +\func{}{wxSoundStream}{\void} + +Default constructor. + +\membersection{wxSoundStream::\destruct{wxSoundStream}}\label{wxsoundstreamdtor} + +\func{}{\destruct{wxSoundStream}}{\void} + +Destructor. The destructor stops automatically all started production and destroys +any temporary buffer. + +%% +%% Read +%% + +\membersection{wxSoundStream::Read}\label{wxsoundstreamread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + +Reads {\it len} bytes from the sound stream. This call may block the user so +use it carefully when you need to intensively refresh the GUI. You may be +interested by sound events: see \helpref{wxSoundStream::OnSoundEvent}{wxsoundstreamonsoundevent}. + +It is better to use the size returned by \helpref{wxSoundStream::GetBestSize}{wxsoundstreamgetbestsize}: this may improve performance or accuracy of the +sound event system. + +\wxheading{Parameters} + +\docparam{len}{{\it len} is expressed in bytes. If you need to do conversions between bytes +and seconds use wxSoundFormat. +See \helpref{wxSoundFormatBase}{wxsoundformatbase}, \helpref{wxSoundStream::GetSoundFormat}{wxsoundstreamgetsoundformat}.} + +\docparam{data}{Data in \it{buffer} are coded using the sound format attached to this sound +stream. The format is specified with +\helpref{SetSoundFormat}{wxsoundstreamsetsoundformat}.} + +%% +%% Write +%% + +\membersection{wxSoundStream::Write}\label{wxsoundstreamwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + +Writes \it{len} bytes to the sound stream. This call may block the user so +use it carefully. You may be interested by sound events: see +\helpref{wxSoundStream::OnSoundEvent}{wxsoundstreamonsoundevent}. + +It is better to use the size returned by \helpref{wxSoundStream::GetBestSize}{wxsoundstreamgetbestsize}: this may improve performance or accuracy of the +sound event system. + +\wxheading{Parameters} + +\docparam{len}{This is expressed in bytes. If you need to do conversions between bytes +and seconds use wxSoundFormat. +See \helpref{wxSoundFormatBase}{wxsoundformatbase}, \helpref{wxSoundStream::GetSoundFormat}{wxsoundstreamgetsoundformat}.} + +\docparam{buffer}{Data in \it{buffer} are coded using the sound format attached to this sound +stream. The format is specified with +\helpref{SetSoundFormat}{wxsoundstreamsetsoundformat}.} + +%% +%% GetBestSize +%% + +\membersection{wxSoundStream::GetBestSize}\label{wxsoundstreamgetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + +This function returns the best size for IO calls. The best size provides you +a good alignment for data to be written (or read) to (or from) the sound stream. +So, when, for example, a sound event is sent, you are sure the sound stream +will not block for this buffer size. + +%% +%% wxSoundStream:SetSoundFormat +%% + +\membersection{wxSoundStream::SetSoundFormat}\label{wxsoundstreamsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + +SetSoundFormat is one of the key function of the wxSoundStream object. +It specifies the sound format the user needs. SetSoundFormat tries to +apply the format to the current sound stream (it can be a sound file or a +sound driver). Then, either it manages to apply it and it returns {\bf TRUE}, +or it could not and it returns {\bf FALSE}. In this case, you must check +the error with +\helpref{wxSoundStream::GetError}{wxsoundstreamgeterror}. See +\helpref{wxSoundStream errors section}{wxsoundstreamerrors} for more details. + + +\wxheading{Note} + +The {\bf format} object can be destroyed after the call. The object does not need it. + +\wxheading{Note} + +If the error is {\bf wxSOUND\_NOTEXACT}, the stream tries to find the best +approaching format and setups it. You can check the format which it applied +with \helpref{wxSoundStream::GetSoundFormat}{wxsoundstreamgetsoundformat}. + +%% +%% GetSoundFormat +%% +\membersection{wxSoundStream::GetSoundFormat}\label{wxsoundstreamgetsoundformat} +\constfunc{wxSoundFormatBase\&}{GetSoundFormat}{\void} + +It returns a reference to the current sound format of the stream represented by a +wxSoundFormatBase object. This object {\it must not} be destroyed by anyone except +the stream itself. + +%% +%% SetCallback +%% +\membersection{wxSoundStream::SetCallback}\label{wxsoundstreamregister} + +\func{void}{Register}{\param{int }{evt}, \param{wxSoundCallback }{cbk}, \param{void* }{cdata}} + +It installs a C callback for wxSoundStream events. The C callbacks are still +useful to avoid hard inheritance. You can install only one callback per event. +Each callback has its callback data. + +%% +%% StartProduction +%% +\membersection{wxSoundStream::StartProduction}\label{wxsoundstreamstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + +StartProduction starts the sound streaming. {\it evt} may be one of +{\bf wxSOUND\_INPUT}, {\bf wxSOUND\_OUTPUT} or {\bf wxSOUND\_DUPLEX}. +You cannot specify several flags at the same time. Starting the production +may automaticaly in position of buffer underrun (only in the case you activated +recording). Actually this may happen the sound IO queue is too short. +It is also advised that you fill quickly enough the sound IO queue when the +driver requests it (through a wxSoundEvent). + +\membersection{wxSoundStream::StopProduction}\label{wxsoundstreamstopproduction} +\func{bool}{StopProduction}{\void} + +I stops the async notifier and the sound streaming straightly. + +\membersection{wxSoundStream::SetEventHandler}\label{wxsoundstreamseteventhandler} +\func{void}{SetEventHandler}{\param{wxSoundStream* }{handler}} + +Sets the event handler: if it is non-null, all events are routed to it. + +\membersection{wxSoundStream::GetError}\label{wxsoundstreamgeterror} +\constfunc{wxSoundError}{GetError}{\void} + +It returns the last error which occured. + +\membersection{wxSoundStream::GetLastAccess}\label{wxsoundstreamgetlastaccess} +\constfunc{wxUint32}{GetLastAccess}{\void} + +It returns the number of bytes which were effectively written to/read from the sound stream. + +\membersection{wxSoundStream::QueueFilled}\label{wxsoundstreamqueuefilled} +\constfunc{bool}{QueueFilled}{\void} + +It returns whether the sound IO queue is full. When it is full, the next IO call will block +until the IO queue has at least one empty entry. + +\membersection{wxSoundStream::OnSoundEvent}\label{wxsoundstreamonsoundevent} +\func{void}{OnSoundEvent}{\param{int }{evt}} + +It is called by the wxSoundStream when a new sound event occured. diff --git a/contrib/docs/latex/mmedia/sndcodec.tex b/contrib/docs/latex/mmedia/sndcodec.tex new file mode 100644 index 0000000000..d836c0b728 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndcodec.tex @@ -0,0 +1,39 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndcodec.h at 26/Feb/00 14:26:29 +% + +\section{\class{wxSoundStreamCodec}}\label{wxsoundstreamcodec} + +\wxheading{Derived from} + +\helpref{wxSoundStream}{wxsoundstream} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxSoundStreamCodec::wxSoundStreamCodec}\label{wxsoundstreamcodecwxsoundstreamcodec} + +\func{}{wxSoundStreamCodec}{\param{wxSoundStream\& }{snd\_io}} + + +\membersection{wxSoundStreamCodec::\destruct{wxSoundStreamCodec}}\label{wxsoundstreamcodecdtor} + +\func{}{\destruct{wxSoundStreamCodec}}{\void} + + +\membersection{wxSoundStreamCodec::StartProduction}\label{wxsoundstreamcodecstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + + +\membersection{wxSoundStreamCodec::StopProduction}\label{wxsoundstreamcodecstopproduction} + +\func{bool}{StopProduction}{\void} + + +\membersection{wxSoundStreamCodec::GetBestSize}\label{wxsoundstreamcodecgetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + diff --git a/contrib/docs/latex/mmedia/sndesd.tex b/contrib/docs/latex/mmedia/sndesd.tex new file mode 100644 index 0000000000..4d860e2025 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndesd.tex @@ -0,0 +1,64 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndesd.h at 26/Feb/00 14:26:56 +% + +\section{\class{wxSoundStreamESD}}\label{wxsoundstreamesd} + +ESD output class + +\wxheading{Derived from} + +\helpref{wxSoundStream}{wxsoundstream} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamESD::wxSoundStreamESD}\label{wxsoundstreamesdwxsoundstreamesd} + +\func{}{wxSoundStreamESD}{\param{const wxString\& }{hostname = "localhost"}} + + +\membersection{wxSoundStreamESD::\destruct{wxSoundStreamESD}}\label{wxsoundstreamesddtor} + +\func{}{\destruct{wxSoundStreamESD}}{\void} + + +\membersection{wxSoundStreamESD::Read}\label{wxsoundstreamesdread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamESD::Write}\label{wxsoundstreamesdwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamESD::SetSoundFormat}\label{wxsoundstreamesdsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + + +\membersection{wxSoundStreamESD::StartProduction}\label{wxsoundstreamesdstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + + +\membersection{wxSoundStreamESD::StopProduction}\label{wxsoundstreamesdstopproduction} + +\func{bool}{StopProduction}{\void} + + +\membersection{wxSoundStreamESD::WakeUpEvt}\label{wxsoundstreamesdwakeupevt} + +\func{void}{WakeUpEvt}{\param{int }{evt}} + +You should not call this. + + +\membersection{wxSoundStreamESD::QueueFilled}\label{wxsoundstreamesdqueuefilled} + +\constfunc{bool}{QueueFilled}{\void} + diff --git a/contrib/docs/latex/mmedia/sndfg72x.tex b/contrib/docs/latex/mmedia/sndfg72x.tex new file mode 100644 index 0000000000..46d97f6f72 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndfg72x.tex @@ -0,0 +1,87 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndg72x.h at 26/Feb/00 14:52:19 +% + + +\section{\class{wxSoundFormatG72X}}\label{wxsoundformatg72x} + + +G72X format + +\wxheading{Derived from} + +\helpref{wxSoundFormatBase}{wxsoundformatbase} + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef enum { + wxSOUND\_G721, + wxSOUND\_G723\_24, + wxSOUND\_G723\_40 +} wxSoundG72XType +\end{verbatim}} + +{\small \begin{verbatim} +typedef struct g72x\_state g72state +\end{verbatim}} + +This fixes a bug in Mingw95 + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxSoundFormatG72X::wxSoundFormatG72X}\label{wxsoundformatg72xwxsoundformatg72x} + +\func{}{wxSoundFormatG72X}{\void} + + +\membersection{wxSoundFormatG72X::\destruct{wxSoundFormatG72X}}\label{wxsoundformatg72xdtor} + +\func{}{\destruct{wxSoundFormatG72X}}{\void} + + +\membersection{wxSoundFormatG72X::SetG72XType}\label{wxsoundformatg72xsetg72xtype} + +\func{void}{SetG72XType}{\param{wxSoundG72XType }{type}} + + +\membersection{wxSoundFormatG72X::GetG72XType}\label{wxsoundformatg72xgetg72xtype} + +\constfunc{wxSoundG72XType}{GetG72XType}{\void} + + +\membersection{wxSoundFormatG72X::SetSampleRate}\label{wxsoundformatg72xsetsamplerate} + +\func{void}{SetSampleRate}{\param{wxUint32 }{srate}} + + +\membersection{wxSoundFormatG72X::GetSampleRate}\label{wxsoundformatg72xgetsamplerate} + +\constfunc{wxUint32}{GetSampleRate}{\void} + + +\membersection{wxSoundFormatG72X::GetType}\label{wxsoundformatg72xgettype} + +\constfunc{wxSoundFormatType}{GetType}{\void} + + +\membersection{wxSoundFormatG72X::Clone}\label{wxsoundformatg72xclone} + +\constfunc{wxSoundFormatBase*}{Clone}{\void} + + +\membersection{wxSoundFormatG72X::GetTimeFromBytes}\label{wxsoundformatg72xgettimefrombytes} + +\constfunc{wxUint32}{GetTimeFromBytes}{\param{wxUint32 }{bytes}} + + +\membersection{wxSoundFormatG72X::GetBytesFromTime}\label{wxsoundformatg72xgetbytesfromtime} + +\constfunc{wxUint32}{GetBytesFromTime}{\param{wxUint32 }{time}} + + +\membersection{wxSoundFormatG72X::operator!=}\label{wxsoundformatg72xoperatorneq} + +\constfunc{bool}{operator!=}{\param{const wxSoundFormatBase\& }{frmt2}} + diff --git a/contrib/docs/latex/mmedia/sndfile.tex b/contrib/docs/latex/mmedia/sndfile.tex new file mode 100644 index 0000000000..6dbb0f847e --- /dev/null +++ b/contrib/docs/latex/mmedia/sndfile.tex @@ -0,0 +1,232 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: sndfile.tex +%% Purpose: wxMMedia docs +%% Author: Guilhem Lavaux +%% Modified by: +%% Created: 2000 +%% RCS-ID: $Id$ +%% Copyright: (c) wxWindows team +%% Licence: wxWindows licence +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\section{\class{wxSoundFileStream}}\label{wxsoundfilestream} + +Base class for file coders/decoders. This class is not constructor (it is an abstract +class). + +\wxheading{Derived from} + +\helpref{wxSoundStream}{wxsoundstream} + +\wxheading{Include file} + +wx/sndfile.h + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxSoundFileStream::wxSoundFileStream}\label{wxsoundfilestreamwxsoundfilestream} + +\func{}{wxSoundFileStream}{\param{wxInputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + +It constructs a new file decoder object which will send +audio data to the specified sound stream. +The {\it stream} is the input stream to be decoded. The +{\it io_sound} is the destination sound stream. +Once it has been constructed, you cannot change any of +the specified streams nor the direction of the stream. + +You will have access to the playback functions. + +\func{}{wxSoundFileStream}{\param{wxOutputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + +It constructs a new file coder object which will get +data to be recorded from the specified sound stream. +The {\it stream} is the output wxStream. The {\it io_sound} +is the source sound stream of the audio data. Once +it has been constructed, you cannot change any of +the specified streams nor the direction of the stream. + +\membersection{wxSoundFileStream::\destruct{wxSoundFileStream}}\label{wxsoundfilestreamdtor} +\func{}{\destruct{wxSoundFileStream}}{\void} + +It destroys the current sound file codec. + +\membersection{wxSoundFileStream::Play}\label{wxsoundfilestreamplay} +\func{bool}{Play}{\void} + +It starts playing the file. The playing begins, in background +in nearly all cases, after the return of the function. The +codec returns to a {\bf stopped} state when it reaches the +end of the file. +On success, it returns TRUE. + +\membersection{wxSoundFileStream::Record}\label{wxsoundfilestreamrecord} +\func{bool}{Record}{\param{wxUint32 }{time}} + +It starts recording data from the sound stream and writing them +to the output stream. You have to precise the recording length in +parameter. This length is expressed in seconds. If you want to +control the record length (using \helpref{Stop}{wxsoundfilestreamstop}), +you can set it to wxSOUND_INFINITE_TIME. + +On success, it returns TRUE. + +\membersection{wxSoundFileStream::Stop}\label{wxsoundfilestreamstop} +\func{bool}{Stop}{\void} + +It stops either recording or playing. Whatever happens (even unexpected +errors), the stream is stopped when the function returns. When you are +in recording mode, the file headers are updated and flushed if possible +(ie: if the output stream is seekable). + +On success, it returns TRUE. + +\membersection{wxSoundFileStream::Pause}\label{wxsoundfilestreampause} +\func{bool}{Pause}{\void} + +The file codec tries to pause the stream: it means that it stops audio +production but keep the file pointer at the place. + +If the file codec is already paused, it returns FALSE. + +On success, it returns TREE. + +\membersection{wxSoundFileStream::Resume}\label{wxsoundfilestreamresume} +\func{bool}{Resume}{\void} + +When the file codec has been paused using +\helpref{Pause}{wxsoundfilestreampause}, you could be interrested in +resuming it. This is the goal of this function. + +\membersection{wxSoundFileStream::IsStopped}\label{wxsoundfilestreamisstopped} +\constfunc{bool}{IsStopped}{\void} + +It returns TRUE when the stream is stopped, in another case it returns +FALSE. + +\membersection{wxSoundFileStream::IsPaused}\label{wxsoundfilestreamispaused} +\constfunc{bool}{IsPaused}{\void} + +It returns TRUE when the stream is paused, in another case it returns +FALSE. + +\membersection{wxSoundFileStream::StartProduction}\label{wxsoundfilestreamstartproduction} +\func{bool}{StartProduction}{\param{int }{evt}} + +It is really not advised you call this function. From the wxSoundFileStream +point of view it is an internal function. Internally, it is called after +the file stream has been prepared to be played or to receive audio data and +when it wants to start processing audio data. + +\membersection{wxSoundFileStream::StopProduction}\label{wxsoundfilestreamstopproduction} +\func{bool}{StopProduction}{\void} + +As for \helpref{StartProduction}{wxsoundfilestreamstopproduction}, it is not +advised for you to call this function. It is called by +\helpref{Stop}{wxsoundfilestreamstop} when it needs to stop the audio data +processing. + +\membersection{wxSoundFileStream::GetLength}\label{wxsoundfilestreamgetlength} +\func{wxUint32}{GetLength}{\void} + +It returns the audio data length of the file stream. This length is expressed +in bytes. If you need the length in seconds, you will need to use +\helpref{GetSoundFormat}{wxsoundstreamgetsoundformat} and +\helpref{GetTimeFromBytes}{wxsoundformatbasegettimefrombytes}. + +\membersection{wxSoundFileStream::GetPosition}\label{wxsoundfilestreamgetposition} +\func{wxUint32}{GetPosition}{\void} + +It returns the current position in the soundfile stream. The position +is expressed in bytes. If you need the length in seconds, you will need to use +\helpref{GetSoundFormat}{wxsoundstreamgetsoundformat} and +\helpref{GetTimeFromBytes}{wxsoundformatbasegettimefrombytes}. + +\membersection{wxSoundFileStream::SetPosition}\label{wxsoundfilestreamsetposition} +\func{wxUint32}{SetPosition}{\param{wxUint32 }{new\_position}} + +It sets the current in the soundfile stream. The position + {\it new\_position} must be expressed in bytes. You can get +a length/position in bytes from a time value using +\helpref{GetSoundFormat}{wxsoundstreamgetsoundformat} and +\helpref{GetTimeFromBytes}{wxsoundformatbasegettimefrombytes}. + +On success, it returns TRUE. + +\wxheading{Warning} + +Some wxStream may not be capable to support this function as +it may not support the seekable functionnality. If this happens, +it returns FALSE and leave the stream at the same position. + +\membersection{wxSoundFileStream::Read}\label{wxsoundfilestreamread} +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + +You can obtain the audio data encoded in the file using this function. +But it must be considered as an internal function. Used carelessly, it +may corrupt the current state of the stream. +Data are returned using in the original file coding (You must use a sound +format object to decode it). + +\membersection{wxSoundFileStream::Write}\label{wxsoundfilestreamwrite} +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + +You can put encoded audio data to the file using this function. +But it must be considered as an internal function. Used carelessly, it +may corrupt the current state of the stream. +Data must be coded with the specified file coding (You must use a sound +format object to do this). + +\membersection{wxSoundFileStream::SetSoundFormat}\label{wxsoundfilestreamsetsoundformat} +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + +\membersection{wxSoundFileStream::GetCodecName}\label{wxsoundfilestreamgetcodecname} +\constfunc{wxString}{GetCodecName}{\void} + +This function returns the Codec name. This is useful for those who +want to build a player (But also in some other case). + +\membersection{wxSoundFileStream::CanRead}\label{wxsoundfilestreamcanread} +\func{bool}{CanRead}{\void} + +You should use this function to test whether this file codec can read +the stream you passed to it. + + +\membersection{wxSoundFileStream::PrepareToPlay}\label{wxsoundfilestreampreparetoplay} +\func{bool}{PrepareToPlay}{\void} + + +\membersection{wxSoundFileStream::PrepareToRecord}\label{wxsoundfilestreampreparetorecord} +\func{bool}{PrepareToRecord}{\param{wxUint32 }{time}} + + +\membersection{wxSoundFileStream::FinishRecording}\label{wxsoundfilestreamfinishrecording} +\func{bool}{FinishRecording}{\void} + + +\membersection{wxSoundFileStream::RepositionStream}\label{wxsoundfilestreamrepositionstream} + +\func{bool}{RepositionStream}{\param{wxUint32 }{position}} + + +\membersection{wxSoundFileStream::FinishPreparation}\label{wxsoundfilestreamfinishpreparation} + +\func{void}{FinishPreparation}{\param{wxUint32 }{len}} + + +\membersection{wxSoundFileStream::GetData}\label{wxsoundfilestreamgetdata} + +\func{wxUint32}{GetData}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundFileStream::PutData}\label{wxsoundfilestreamputdata} + +\func{wxUint32}{PutData}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundFileStream::OnSoundEvent}\label{wxsoundfilestreamonsoundevent} + +\func{void}{OnSoundEvent}{\param{int }{evt}} + diff --git a/contrib/docs/latex/mmedia/sndfpcm.tex b/contrib/docs/latex/mmedia/sndfpcm.tex new file mode 100644 index 0000000000..9c14d08a9e --- /dev/null +++ b/contrib/docs/latex/mmedia/sndfpcm.tex @@ -0,0 +1,104 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndpcm.h at 26/Feb/00 14:26:33 +% + + +\section{\class{wxSoundFormatPcm}}\label{wxsoundformatpcm} + + +PCM specification class + +\wxheading{Derived from} + +\helpref{wxSoundFormatBase}{wxsoundformatbase} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundFormatPcm::wxSoundFormatPcm}\label{wxsoundformatpcmwxsoundformatpcm} + +\func{}{wxSoundFormatPcm}{\param{wxUint32 }{srate = 22500}, \param{wxUint8 }{bps = 8}, \param{wxUint16 }{channels = 2}, \param{bool }{sign = TRUE}, \param{int }{order = wxLITTLE\_ENDIAN}} + + +\membersection{wxSoundFormatPcm::\destruct{wxSoundFormatPcm}}\label{wxsoundformatpcmdtor} + +\func{}{\destruct{wxSoundFormatPcm}}{\void} + + +\membersection{wxSoundFormatPcm::SetSampleRate}\label{wxsoundformatpcmsetsamplerate} + +\func{void}{SetSampleRate}{\param{wxUint32 }{srate}} + + +\membersection{wxSoundFormatPcm::SetBPS}\label{wxsoundformatpcmsetbps} + +\func{void}{SetBPS}{\param{wxUint8 }{bps}} + + +\membersection{wxSoundFormatPcm::SetChannels}\label{wxsoundformatpcmsetchannels} + +\func{void}{SetChannels}{\param{wxUint16 }{nchannels}} + + +\membersection{wxSoundFormatPcm::SetOrder}\label{wxsoundformatpcmsetorder} + +\func{void}{SetOrder}{\param{int }{order}} + + +\membersection{wxSoundFormatPcm::Signed}\label{wxsoundformatpcmsigned} + +\func{void}{Signed}{\param{bool }{sign}} + + +\membersection{wxSoundFormatPcm::GetSampleRate}\label{wxsoundformatpcmgetsamplerate} + +\constfunc{wxUint32}{GetSampleRate}{\void} + + +\membersection{wxSoundFormatPcm::GetBPS}\label{wxsoundformatpcmgetbps} + +\constfunc{wxUint8}{GetBPS}{\void} + + +\membersection{wxSoundFormatPcm::GetChannels}\label{wxsoundformatpcmgetchannels} + +\constfunc{wxUint16}{GetChannels}{\void} + + +\membersection{wxSoundFormatPcm::GetOrder}\label{wxsoundformatpcmgetorder} + +\constfunc{int}{GetOrder}{\void} + + +\membersection{wxSoundFormatPcm::Signed}\label{wxsoundformatpcmgetsigned} + +\constfunc{bool}{Signed}{\void} + + +\membersection{wxSoundFormatPcm::GetType}\label{wxsoundformatpcmgettype} + +\constfunc{wxSoundFormatType}{GetType}{\void} + + +\membersection{wxSoundFormatPcm::Clone}\label{wxsoundformatpcmclone} + +\constfunc{wxSoundFormatBase*}{Clone}{\void} + + +\membersection{wxSoundFormatPcm::GetTimeFromBytes}\label{wxsoundformatpcmgettimefrombytes} + +\constfunc{wxUint32}{GetTimeFromBytes}{\param{wxUint32 }{bytes}} + + +\membersection{wxSoundFormatPcm::GetBytesFromTime}\label{wxsoundformatpcmgetbytesfromtime} + +\constfunc{wxUint32}{GetBytesFromTime}{\param{wxUint32 }{time}} + + +\membersection{wxSoundFormatPcm::operator!}\label{wxsoundformatpcmoperatornot} + +\constfunc{bool}{operator!}{\param{const wxSoundFormatBase\& }{frmt2}} + diff --git a/contrib/docs/latex/mmedia/sndfrmt.tex b/contrib/docs/latex/mmedia/sndfrmt.tex new file mode 100644 index 0000000000..388afc7fcd --- /dev/null +++ b/contrib/docs/latex/mmedia/sndfrmt.tex @@ -0,0 +1,69 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndbase.h at 26/Feb/00 14:23:29 +% + + +\section{\class{wxSoundFormatBase}}\label{wxsoundformatbase} + + +Base class for sound format specification + +\wxheading{Derived from} + +No base class + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef enum { + wxSOUND\_NOFORMAT, + wxSOUND\_PCM, + wxSOUND\_ULAW, + wxSOUND\_G72X, + wxSOUND\_MSADPCM +} wxSoundFormatType +\end{verbatim}} + +wxSoundFormatType: it specifies the format family of the sound data +which will be passed to the stream. + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxSoundFormatBase::wxSoundFormatBase}\label{wxsoundformatbasewxsoundformatbase} + +\func{}{wxSoundFormatBase}{\void} + + +\membersection{wxSoundFormatBase::\destruct{wxSoundFormatBase}}\label{wxsoundformatbasedtor} + +\func{}{\destruct{wxSoundFormatBase}}{\void} + + +\membersection{wxSoundFormatBase::GetType}\label{wxsoundformatbasegettype} + +\constfunc{wxSoundFormatType}{GetType}{\void} + +It returns a "standard" format type. + + +\membersection{wxSoundFormatBase::Clone}\label{wxsoundformatbaseclone} + +\constfunc{wxSoundFormatBase*}{Clone}{\void} + +It clones the current format. + + +\membersection{wxSoundFormatBase::GetTimeFromBytes}\label{wxsoundformatbasegettimefrombytes} + +\constfunc{wxUint32}{GetTimeFromBytes}{\param{wxUint32 }{bytes}} + + +\membersection{wxSoundFormatBase::GetBytesFromTime}\label{wxsoundformatbasegetbytesfromtime} + +\constfunc{wxUint32}{GetBytesFromTime}{\param{wxUint32 }{time}} + + +\membersection{wxSoundFormatBase::operator!=}\label{wxsoundformatbaseoperatorneq} + +\constfunc{bool}{operator!=}{\param{const wxSoundFormatBase\& }{frmt2}} diff --git a/contrib/docs/latex/mmedia/sndfulaw.tex b/contrib/docs/latex/mmedia/sndfulaw.tex new file mode 100644 index 0000000000..538257137f --- /dev/null +++ b/contrib/docs/latex/mmedia/sndfulaw.tex @@ -0,0 +1,74 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndulaw.h at 26/Feb/00 14:52:25 +% + + +\section{\class{wxSoundFormatUlaw}}\label{wxsoundformatulaw} + + +ULAW format + +\wxheading{Derived from} + +\helpref{wxSoundFormatBase}{wxsoundformatbase} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundFormatUlaw::wxSoundFormatUlaw}\label{wxsoundformatulawwxsoundformatulaw} + +\func{}{wxSoundFormatUlaw}{\void} + + +\membersection{wxSoundFormatUlaw::\destruct{wxSoundFormatUlaw}}\label{wxsoundformatulawdtor} + +\func{}{\destruct{wxSoundFormatUlaw}}{\void} + + +\membersection{wxSoundFormatUlaw::SetSampleRate}\label{wxsoundformatulawsetsamplerate} + +\func{void}{SetSampleRate}{\param{wxUint32 }{srate}} + + +\membersection{wxSoundFormatUlaw::GetSampleRate}\label{wxsoundformatulawgetsamplerate} + +\constfunc{wxUint32}{GetSampleRate}{\void} + + +\membersection{wxSoundFormatUlaw::SetChannels}\label{wxsoundformatulawsetchannels} + +\func{void}{SetChannels}{\param{wxUint8 }{channels}} + + +\membersection{wxSoundFormatUlaw::GetChannels}\label{wxsoundformatulawgetchannels} + +\constfunc{wxUint8}{GetChannels}{\void} + + +\membersection{wxSoundFormatUlaw::GetType}\label{wxsoundformatulawgettype} + +\constfunc{wxSoundFormatType}{GetType}{\void} + + +\membersection{wxSoundFormatUlaw::Clone}\label{wxsoundformatulawclone} + +\constfunc{wxSoundFormatBase*}{Clone}{\void} + + +\membersection{wxSoundFormatUlaw::GetTimeFromBytes}\label{wxsoundformatulawgettimefrombytes} + +\constfunc{wxUint32}{GetTimeFromBytes}{\param{wxUint32 }{bytes}} + + +\membersection{wxSoundFormatUlaw::GetBytesFromTime}\label{wxsoundformatulawgetbytesfromtime} + +\constfunc{wxUint32}{GetBytesFromTime}{\param{wxUint32 }{time}} + + +\membersection{wxSoundFormatUlaw::operator!=}\label{wxsoundformatulawoperatorneq} + +\constfunc{bool}{operator!=}{\param{const wxSoundFormatBase\& }{frmt2}} + diff --git a/contrib/docs/latex/mmedia/sndg72x.tex b/contrib/docs/latex/mmedia/sndg72x.tex new file mode 100644 index 0000000000..a9e61779a9 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndg72x.tex @@ -0,0 +1,54 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndg72x.h at 26/Feb/00 14:52:19 +% + + +\section{\class{wxSoundStreamG72X}}\label{wxsoundstreamg72x} + + +ULAW converter class + +\wxheading{Derived from} + +\helpref{wxSoundStreamCodec}{wxsoundstreamcodec} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamG72X::wxSoundStreamG72X}\label{wxsoundstreamg72xwxsoundstreamg72x} + +\func{}{wxSoundStreamG72X}{\param{wxSoundStream\& }{sndio}} + + +\membersection{wxSoundStreamG72X::\destruct{wxSoundStreamG72X}}\label{wxsoundstreamg72xdtor} + +\func{}{\destruct{wxSoundStreamG72X}}{\void} + + +\membersection{wxSoundStreamG72X::Read}\label{wxsoundstreamg72xread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamG72X::Write}\label{wxsoundstreamg72xwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamG72X::SetSoundFormat}\label{wxsoundstreamg72xsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + + +\membersection{wxSoundStreamG72X::PutBits}\label{wxsoundstreamg72xputbits} + +\func{void}{PutBits}{\param{wxUint8 }{bits}} + + +\membersection{wxSoundStreamG72X::GetBits}\label{wxsoundstreamg72xgetbits} + +\func{wxUint8}{GetBits}{\void} + diff --git a/contrib/docs/latex/mmedia/sndoss.tex b/contrib/docs/latex/mmedia/sndoss.tex new file mode 100644 index 0000000000..f086ca0bf1 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndoss.tex @@ -0,0 +1,71 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndoss.h at 26/Feb/00 14:26:53 +% + + +\section{\class{wxSoundStreamOSS}}\label{wxsoundstreamoss} + + +OSS output class + +\wxheading{Derived from} + +\helpref{wxSoundStream}{wxsoundstream} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamOSS::wxSoundStreamOSS}\label{wxsoundstreamosswxsoundstreamoss} + +\func{}{wxSoundStreamOSS}{\param{const wxString\& }{dev\_name = \_T("/dev/dsp")}} + + +\membersection{wxSoundStreamOSS::\destruct{wxSoundStreamOSS}}\label{wxsoundstreamossdtor} + +\func{}{\destruct{wxSoundStreamOSS}}{\void} + + +\membersection{wxSoundStreamOSS::Read}\label{wxsoundstreamossread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamOSS::Write}\label{wxsoundstreamosswrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamOSS::GetBestSize}\label{wxsoundstreamossgetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + + +\membersection{wxSoundStreamOSS::SetSoundFormat}\label{wxsoundstreamosssetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + + +\membersection{wxSoundStreamOSS::StartProduction}\label{wxsoundstreamossstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + + +\membersection{wxSoundStreamOSS::StopProduction}\label{wxsoundstreamossstopproduction} + +\func{bool}{StopProduction}{\void} + + +\membersection{wxSoundStreamOSS::QueueFilled}\label{wxsoundstreamossqueuefilled} + +\constfunc{bool}{QueueFilled}{\void} + + +\membersection{wxSoundStreamOSS::WakeUpEvt}\label{wxsoundstreamosswakeupevt} + +\func{void}{WakeUpEvt}{\param{int }{evt}} + +You should not call this. + diff --git a/contrib/docs/latex/mmedia/sndpcm.tex b/contrib/docs/latex/mmedia/sndpcm.tex new file mode 100644 index 0000000000..6e392208e6 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndpcm.tex @@ -0,0 +1,48 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndcpcm.h at 26/Feb/00 14:26:35 +% + + +\section{\class{wxSoundStreamPcm}}\label{wxsoundstreampcm} + + +PCM converter class + +\wxheading{Derived from} + +\helpref{wxSoundStreamCodec}{wxsoundstreamcodec} + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef void (*ConverterType)(const char *buf\_in, char *buf\_out, wxUint32 len) ConverterType +\end{verbatim}} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamPcm::wxSoundStreamPcm}\label{wxsoundstreampcmwxsoundstreampcm} + +\func{}{wxSoundStreamPcm}{\param{wxSoundStream\& }{sndio}} + + +\membersection{wxSoundStreamPcm::\destruct{wxSoundStreamPcm}}\label{wxsoundstreampcmdtor} + +\func{}{\destruct{wxSoundStreamPcm}}{\void} + + +\membersection{wxSoundStreamPcm::Read}\label{wxsoundstreampcmread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamPcm::Write}\label{wxsoundstreampcmwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamPcm::SetSoundFormat}\label{wxsoundstreampcmsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + diff --git a/contrib/docs/latex/mmedia/sndrter.tex b/contrib/docs/latex/mmedia/sndrter.tex new file mode 100644 index 0000000000..67d39bce7b --- /dev/null +++ b/contrib/docs/latex/mmedia/sndrter.tex @@ -0,0 +1,59 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndfile.h at 26/Feb/00 14:26:42 +% + + +\section{\class{wxSoundRouterStream}}\label{wxsoundrouterstream} + + +Codec router class + +\wxheading{Derived from} + +\helpref{wxSoundStreamCodec}{wxsoundstreamcodec} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundRouterStream::wxSoundRouterStream}\label{wxsoundrouterstreamwxsoundrouterstream} + +\func{}{wxSoundRouterStream}{\param{wxSoundStream\& }{sndio}} + + +\membersection{wxSoundRouterStream::\destruct{wxSoundRouterStream}}\label{wxsoundrouterstreamdtor} + +\func{}{\destruct{wxSoundRouterStream}}{\void} + + +\membersection{wxSoundRouterStream::Read}\label{wxsoundrouterstreamread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundRouterStream::Write}\label{wxsoundrouterstreamwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundRouterStream::SetSoundFormat}\label{wxsoundrouterstreamsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + + +\membersection{wxSoundRouterStream::StartProduction}\label{wxsoundrouterstreamstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + + +\membersection{wxSoundRouterStream::StopProduction}\label{wxsoundrouterstreamstopproduction} + +\func{bool}{StopProduction}{\void} + + +\membersection{wxSoundRouterStream::GetBestSize}\label{wxsoundrouterstreamgetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + diff --git a/contrib/docs/latex/mmedia/sndulaw.tex b/contrib/docs/latex/mmedia/sndulaw.tex new file mode 100644 index 0000000000..d091d63f30 --- /dev/null +++ b/contrib/docs/latex/mmedia/sndulaw.tex @@ -0,0 +1,49 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndulaw.h at 26/Feb/00 14:52:25 +% + + +\section{\class{wxSoundStreamUlaw}}\label{wxsoundstreamulaw} + + +ULAW converter class + +\wxheading{Derived from} + +\helpref{wxSoundStreamCodec}{wxsoundstreamcodec} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamUlaw::wxSoundStreamUlaw}\label{wxsoundstreamulawwxsoundstreamulaw} + +\func{}{wxSoundStreamUlaw}{\param{wxSoundStream\& }{sndio}} + + +\membersection{wxSoundStreamUlaw::\destruct{wxSoundStreamUlaw}}\label{wxsoundstreamulawdtor} + +\func{}{\destruct{wxSoundStreamUlaw}}{\void} + + +\membersection{wxSoundStreamUlaw::Read}\label{wxsoundstreamulawread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamUlaw::Write}\label{wxsoundstreamulawwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamUlaw::SetSoundFormat}\label{wxsoundstreamulawsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{const wxSoundFormatBase\& }{format}} + + +\membersection{wxSoundStreamUlaw::GetBestSize}\label{wxsoundstreamulawgetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + diff --git a/contrib/docs/latex/mmedia/sndwave.tex b/contrib/docs/latex/mmedia/sndwave.tex new file mode 100644 index 0000000000..f3c72f0b4e --- /dev/null +++ b/contrib/docs/latex/mmedia/sndwave.tex @@ -0,0 +1,91 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndwav.h at 26/Feb/00 14:26:40 +% + + +\section{\class{wxSoundWave}}\label{wxsoundwave} + + +WAVE codec + +\wxheading{Derived from} + +\helpref{wxSoundFileStream}{wxsoundfilestream} + +\wxheading{Data structures} + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundWave::wxSoundWave}\label{wxsoundwavewxsoundwave} + +\func{}{wxSoundWave}{\param{wxInputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + +\func{}{wxSoundWave}{\param{wxOutputStream\& }{stream}, \param{wxSoundStream\& }{io\_sound}} + + +\membersection{wxSoundWave::\destruct{wxSoundWave}}\label{wxsoundwavedtor} + +\func{}{\destruct{wxSoundWave}}{\void} + + +\membersection{wxSoundWave::CanRead}\label{wxsoundwavecanread} + +\func{bool}{CanRead}{\void} + + +\membersection{wxSoundWave::GetCodecName}\label{wxsoundwavegetcodecname} + +\constfunc{wxString}{GetCodecName}{\void} + + +\membersection{wxSoundWave::PrepareToPlay}\label{wxsoundwavepreparetoplay} + +\func{bool}{PrepareToPlay}{\void} + + +\membersection{wxSoundWave::PrepareToRecord}\label{wxsoundwavepreparetorecord} + +\func{bool}{PrepareToRecord}{\param{wxUint32 }{time}} + + +\membersection{wxSoundWave::FinishRecording}\label{wxsoundwavefinishrecording} + +\func{bool}{FinishRecording}{\void} + + +\membersection{wxSoundWave::RepositionStream}\label{wxsoundwaverepositionstream} + +\func{bool}{RepositionStream}{\param{wxUint32 }{position}} + + +\membersection{wxSoundWave::GetData}\label{wxsoundwavegetdata} + +\func{wxUint32}{GetData}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundWave::PutData}\label{wxsoundwaveputdata} + +\func{wxUint32}{PutData}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundWave::HandleOutputPCM}\label{wxsoundwavehandleoutputpcm} + +\func{bool}{HandleOutputPCM}{\param{wxDataInputStream\& }{data}, \param{wxUint16 }{channels}, \param{wxUint32 }{sample\_fq}, \param{wxUint32 }{byte\_p\_sec}, \param{wxUint16 }{byte\_p\_spl}, \param{wxUint16 }{bits\_p\_spl}} + + +\membersection{wxSoundWave::HandleOutputG721}\label{wxsoundwavehandleoutputg721} + +\func{bool}{HandleOutputG721}{\param{wxDataInputStream\& }{data}, \param{wxUint16 }{channels}, \param{wxUint32 }{sample\_fq}, \param{wxUint32 }{byte\_p\_sec}, \param{wxUint16 }{byte\_p\_spl}, \param{wxUint16 }{bits\_p\_spl}} + + +\membersection{wxSoundWave::HandleInputPCM}\label{wxsoundwavehandleinputpcm} + +\func{wxSoundFormatBase*}{HandleInputPCM}{\param{wxDataOutputStream\& }{data}} + + +\membersection{wxSoundWave::HandleInputG72X}\label{wxsoundwavehandleinputg72x} + +\func{wxSoundFormatBase*}{HandleInputG72X}{\param{wxDataOutputStream\& }{data}} + diff --git a/contrib/docs/latex/mmedia/sndwin.tex b/contrib/docs/latex/mmedia/sndwin.tex new file mode 100644 index 0000000000..b0fafe8bef --- /dev/null +++ b/contrib/docs/latex/mmedia/sndwin.tex @@ -0,0 +1,140 @@ +% +% automatically generated by HelpGen from +% /home/guilhem/PROJECTS/wxWindows/utils/wxMMedia2/lib/sndwin.h at 26/Feb/00 14:26:51 +% + + +\section{\class{wxSoundStreamWin}}\label{wxsoundstreamwin} + +\wxheading{Derived from} + +\helpref{wxSoundStream}{wxsoundstream} + +\wxheading{Data structures} + +{\small \begin{verbatim} +typedef struct \_wxSoundInternal wxSoundInternal +\end{verbatim}} + +{\small \begin{verbatim} +typedef struct \_wxSoundInfoHeader wxSoundInfoHeader +\end{verbatim}} +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxSoundStreamWin::wxSoundStreamWin}\label{wxsoundstreamwinwxsoundstreamwin} + +\func{}{wxSoundStreamWin}{\void} + + +\membersection{wxSoundStreamWin::\destruct{wxSoundStreamWin}}\label{wxsoundstreamwindtor} + +\func{}{\destruct{wxSoundStreamWin}}{\void} + + +\membersection{wxSoundStreamWin::Write}\label{wxsoundstreamwinwrite} + +\func{wxSoundStream\&}{Write}{\param{const void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamWin::Read}\label{wxsoundstreamwinread} + +\func{wxSoundStream\&}{Read}{\param{void* }{buffer}, \param{wxUint32 }{len}} + + +\membersection{wxSoundStreamWin::SetSoundFormat}\label{wxsoundstreamwinsetsoundformat} + +\func{bool}{SetSoundFormat}{\param{wxSoundFormatBase\& }{base}} + + +\membersection{wxSoundStreamWin::StartProduction}\label{wxsoundstreamwinstartproduction} + +\func{bool}{StartProduction}{\param{int }{evt}} + + +\membersection{wxSoundStreamWin::StopProduction}\label{wxsoundstreamwinstopproduction} + +\func{bool}{StopProduction}{\void} + + +\membersection{wxSoundStreamWin::QueueFilled}\label{wxsoundstreamwinqueuefilled} + +\constfunc{bool}{QueueFilled}{\void} + + +\membersection{wxSoundStreamWin::NotifyDoneBuffer}\label{wxsoundstreamwinnotifydonebuffer} + +\func{void}{NotifyDoneBuffer}{\param{wxUint32 }{dev\_handle}, \param{int }{flag}} + +Internal but defined as public + + +\membersection{wxSoundStreamWin::GetBestSize}\label{wxsoundstreamwingetbestsize} + +\constfunc{wxUint32}{GetBestSize}{\void} + + +\membersection{wxSoundStreamWin::CreateSndWindow}\label{wxsoundstreamwincreatesndwindow} + +\func{void}{CreateSndWindow}{\void} + + +\membersection{wxSoundStreamWin::DestroySndWindow}\label{wxsoundstreamwindestroysndwindow} + +\func{void}{DestroySndWindow}{\void} + + +\membersection{wxSoundStreamWin::OpenDevice}\label{wxsoundstreamwinopendevice} + +\func{bool}{OpenDevice}{\param{int }{mode}} + + +\membersection{wxSoundStreamWin::CloseDevice}\label{wxsoundstreamwinclosedevice} + +\func{void}{CloseDevice}{\void} + + +\membersection{wxSoundStreamWin::AllocHeader}\label{wxsoundstreamwinallocheader} + +\func{wxSoundInfoHeader*}{AllocHeader}{\param{int }{mode}} + + +\membersection{wxSoundStreamWin::FreeHeader}\label{wxsoundstreamwinfreeheader} + +\func{void}{FreeHeader}{\param{wxSoundInfoHeader* }{header}, \param{int }{mode}} + + +\membersection{wxSoundStreamWin::AllocHeaders}\label{wxsoundstreamwinallocheaders} + +\func{bool}{AllocHeaders}{\param{int }{mode}} + + +\membersection{wxSoundStreamWin::FreeHeaders}\label{wxsoundstreamwinfreeheaders} + +\func{void}{FreeHeaders}{\param{int }{mode}} + + +\membersection{wxSoundStreamWin::WaitFor}\label{wxsoundstreamwinwaitfor} + +\func{void}{WaitFor}{\param{wxSoundInfoHeader* }{info}} + + +\membersection{wxSoundStreamWin::AddToQueue}\label{wxsoundstreamwinaddtoqueue} + +\func{bool}{AddToQueue}{\param{wxSoundInfoHeader* }{info}} + + +\membersection{wxSoundStreamWin::ClearHeader}\label{wxsoundstreamwinclearheader} + +\func{void}{ClearHeader}{\param{wxSoundInfoHeader* }{info}} + + +\membersection{wxSoundStreamWin::NextFragmentOutput}\label{wxsoundstreamwinnextfragmentoutput} + +\func{wxSoundInfoHeader*}{NextFragmentOutput}{\void} + + +\membersection{wxSoundStreamWin::NextFragmentInput}\label{wxsoundstreamwinnextfragmentinput} + +\func{wxSoundInfoHeader*}{NextFragmentInput}{\void} + diff --git a/contrib/docs/latex/mmedia/tex2rtf.ini b/contrib/docs/latex/mmedia/tex2rtf.ini new file mode 100644 index 0000000000..41dd2cffa3 --- /dev/null +++ b/contrib/docs/latex/mmedia/tex2rtf.ini @@ -0,0 +1,35 @@ +; Last change: JS 8 Sep 98 2:54 pm +runTwice = yes +titleFontSize = 12 +authorFontSize = 10 +chapterFontSize = 12 +sectionFontSize = 12 +subsectionFontSize = 12 +headerRule = yes +footerRule = yes +useHeadingStyles = yes +listItemIndent=40 +generateHPJ = no +htmlBrowseButtons = bitmap +winHelpVersion = 3 +winHelpContents = yes +winHelpTitle = "OGL Manual" +truncateFilenames = yes +combineSubSections = yes +\overview [2] {\rtfonly{See also }\settransparency{on}\sethotspotcolour{off}\sethotspotunderline{on}\winhelponly{\image{}{books.bmp}\settransparency{off}} +\htmlonly{\image{}{books.gif}}\helpref{#1}{#2} +\sethotspotcolour{on}\sethotspotunderline{on}} +\docparam [2]{\parskip{0}{\it #1}\htmlignore{\par}\parskip{10}\indented{1cm}{#2}} +\wxheading [1]{{\bf \htmlignore{\fcol{blue}{#1}}\htmlonly{\fcol{red}{#1}}}} +\const [0] {{\bf const}} +\constfunc [3] {{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}} +\windowstyle [1] {{\bf #1}\index{#1}} + +;; +;; These two are for generating MS HTML Help project, contents and index files. +;; +htmlWorkshopFiles = true +htmlIndex = true +\pythonnote [1] {{\bf \fcol{blue}{wxPython note:}} #1} +%\pythonnote [1] {} + diff --git a/contrib/docs/latex/mmedia/texhelp.sty b/contrib/docs/latex/mmedia/texhelp.sty new file mode 100644 index 0000000000..af91bd531d --- /dev/null +++ b/contrib/docs/latex/mmedia/texhelp.sty @@ -0,0 +1,298 @@ +% LaTeX style file +% Name: texhelp.sty +% Author: Julian Smart +% +% Purpose +% ------- +% Style file to enable the simultaneous preparation of printed LaTeX and on-line +% hypertext manuals. +% Use in conjunction with Tex2RTF (see Tex2RTF documentation). +% +% Note that if a non-ASCII character starts a newline and there should be a space +% between the last word on the previous line and the first word on this line, +% you need to use \rtfsp to generate a space in Windows Help. \rtfsp is ignored +% in all other formats. +% +% Julian Smart +% Artificial Intelligence Applications Institute +% +% +% ============== C++/CLIPS Documentation Facilities ============== +% +% Each class definition should be typeset with e.g. +% +% \section{\class{Name}: Parent} +% +% followed by a description of the class. +% Each member should follow: +% +% \membersection{wxName::Member} +% +% with a description of what this member does. +% Then, one (or more if overloaded) member (function) in detail: +% +% \func{return type}{name}{args} +% or +% \member{type}{name} +% +% where args is a list of \param{type}{name}, ... + +% Function, e.g. +% e.g. to typeset +% +% void DoIt(char *string); +% +% write: +% +% \func{void}{DoIt}{\param{char *}{string}} +% + +\newcommand{\func}[3]{\hangafter=1\noindent\hangindent=10mm +{{\it #1} {\bf #2}\index{#2}}(#3)} + +% For function/type definition where the name is a pointer, +% e.g. to typeset +% +% typedef void (*wxFunction)(wxObject&) +% +% write: +% +% \pfunc{typedef void}{wxFunction}{param{wxObject&}} + +\newcommand{\pfunc}[3]{\hangafter=1\noindent\hangindent=10mm +{{\it #1} ({\bf *#2})\index{#2}}(#3)} + +% Use an ordinary \section command for class name definitions. + +% This is used for a member, such as wxBitmap: GetDepth +\newcommand{\membersection}[1]{\subsection*{#1}\index{#1}} + +% CLIPS function +\newcommand{\clipsfunc}[3]{\hangafter=1\noindent\hangindent=10mm +{{\bf #1} ({\bf #2}\index{#2}}#3)} + +\newcommand{\clipssection}[1]{\chapter{#1}} + +% This is used for a CLIPS function name +\newcommand{\functionsection}[1]{\subsection*{#1}} + +% Member: a type and a name +\newcommand{\member}[2]{{\bf #1 \it #2}} + +% C++ Parameter: a type and a name (no intervening space) +\newcommand{\param}[2]{{\it #1}{\bf #2}} + +% CLIPS Parameter: a type and a name (one intervening space) +\newcommand{\cparam}[2]{{\bf #1} {\it #2}} + +% Class: puts in index +\newcommand{\class}[1]{#1\index{#1}} + +%\newcommand{\docparam}[2]{\parskip=0pt {\it #1}\par\parskip=10pt\begin{indented}{1cm}{#2}\end{indented}} + +% Void type +\newcommand{\void}{{\it void}} + +% Typeset destructor +\newcommand{\destruct}[1]{{$\sim$}#1} + +% Typeset insert/extract operators +\newcommand{\cinsert}{$<<$} +\newcommand{\cextract}{$>>$} + + +% =================== Hypertext facilities =================== +% +% To insert hyperlinks (or references, in Latex), \label the sections +% or membersections \label{ref-label} immediately after the section, on the same line, +% and use \helpref{text-to-show}{ref-label} to make a reference. +% + +% Type text with section reference +\newcommand{\helpref}[2]{{\it #1} (p.\ \pageref{#2}) } + +% Type text with URL in verbatim mode +\newcommand{\urlref}[2]{#1 (\verb$#2$)} + +% Don't typeset section number in LaTeX +\newcommand{\helprefn}[2]{{\it #1}} + +% Like helpref, but popup text in WinHelp instead of hyperlinked +\newcommand{\popref}[2]{{\it #1}} + +% Like footnote, but popup text. +\newcommand{\footnotepopup}[2]{{\it #1}\footnote{#2}} + +% =================== On-line help specific macros =================== +% + +% Global document font size/family, help only. +\newcommand{\helpfontsize}[1]{} +\newcommand{\helpfontfamily}[1]{} + +% Ignore in all on-line help +\newcommand{\helpignore}[1]{#1} +% Only print in all on-line help +\newcommand{\helponly}[1]{} + +% Ignore in LaTeX +\newcommand{\latexignore}[1]{} +% Only print in LaTeX +\newcommand{\latexonly}[1]{#1} + +% Ignore in linear RTF +\newcommand{\rtfignore}[1]{#1} +% Only print in linear RTF +\newcommand{\rtfonly}[1]{} + +% Ignore in WinHelp RTF +\newcommand{\winhelpignore}[1]{#1} +% Only print in WinHelp RTF +\newcommand{\winhelponly}[1]{} + +% Ignore in wxHelp +\newcommand{\xlpignore}[1]{#1} +% Only print in wxHelp +\newcommand{\xlponly}[1]{} + +% Ignore in HTML +\newcommand{\htmlignore}[1]{#1} +% Only print in HTML +\newcommand{\htmlonly}[1]{} + +% Input a file only for help system (binder thickness is not a limitation +% in help systems!) +\newcommand{\helpinput}[1]{} + +\newcommand{\rtfsp}{ } % Force a space in RTF, ignore in Latex + +% =================== Miscellaneous macros =================== +% +% Headings consistent with generated ones +\newcommand{\myheading}[1]{\vspace*{25pt} +\begin{flushleft} +{\LARGE \bf #1} +\end{flushleft} +\vskip 20pt +} + +% Heading with entry in contents page. +\newcommand{\chapterheading}[1]{\myheading{#1} +\addcontentsline{toc}{chapter}{#1}} + +\newcommand{\sectionheading}[1]{\myheading{#1} +\addcontentsline{toc}{section}{#1}} + +% Glossary environment +\newenvironment{helpglossary}{\newpage\chapterheading{Glossary}\begin{description}}{\end{description}} + +% Glossary entry +\newcommand{\gloss}[1]{\item[#1]\index{#1}} + +% Image: EPS in Latex, BMP or MF (whatever's available) in RTF. Requires psbox. +\newcommand{\image}[2]{\psboxto(#1){#2}} + +% Image, left aligned (HTML) +\newcommand{\imager}[2]{\psboxto(#1){#2}} + +% Image, right aligned (HTML) +\newcommand{\imagel}[2]{\psboxto(#1){#2}} + +% Imagemap: principally for HTML only. In Latex, +% acts like \image. +\newcommand{\imagemap}[3]{\psboxto(#1){#2}} + +% Headers and footers +% \setheader{EvenPageLeft}{EvenPageCentre}{EvenPageRight} +% {OddPageLeft}{OddPageCentre}{OddPageRight} +\newcommand{\setheader}[6]{ +\lhead[\fancyplain{}{#1}]{\fancyplain{}{#4}} +\chead[\fancyplain{}{#2}]{\fancyplain{}{#5}} +\rhead[\fancyplain{}{#3}]{\fancyplain{}{#6}} +} + +% \setfooter{EvenPageLeft}{EvenPageCentre}{EvenPageRight} +% {OddPageLeft}{OddPageCentre}{OddPageRight} +\newcommand{\setfooter}[6]{ +\lfoot[\fancyplain{#1}{#1}]{\fancyplain{#4}{#4}} +\cfoot[\fancyplain{#2}{#2}]{\fancyplain{#5}{#5}} +\rfoot[\fancyplain{#3}{#3}]{\fancyplain{#6}{#6}} +} + +% Needed for telling RTF where margin paragraph should go +% in mirrored margins mode. +\newcommand{\marginpareven}[1]{\hspace*{0pt}\marginpar{#1}} +\newcommand{\marginparodd}[1]{\hspace*{0pt}\marginpar{#1}} + +% Environment for two-column table popular in WinHelp and manuals. +\newcommand{\twocolwidtha}[1]{\def\twocolwidthaval{#1}} +\newcommand{\twocolwidthb}[1]{\def\twocolwidthbval{#1}} +\newcommand{\twocolspacing}[1]{\def\twocolspacingval{#1}} + +\twocolwidtha{3cm} +\twocolwidthb{8.5cm} +\twocolspacing{2} + +\newcommand{\twocolitem}[2]{#1 & #2\\} +\newcommand{\twocolitemruled}[2]{#1 & #2\\\hline} + +\newenvironment{twocollist}{\renewcommand{\arraystretch}{\twocolspacingval}\begin{tabular}{lp{\twocolwidthbval}}}% +{\end{tabular}\renewcommand{\arraystretch}{1}} + +% Specifying table rows for RTF compatibility +\newcommand{\row}[1]{#1\\} + +% Use for the last ruled row for correct RTF generation. +\newcommand{\ruledrow}[1]{#1\\\hline} + +% Indentation environment. Arg1 is left margin size +\newenvironment{indented}[1]{\begin{list}{}{\leftmargin=#1}\item[]}% +{\end{list}} + +% Framed box of text, normal formatting. +\newcommand{\normalbox}[1]{\fbox{\vbox{#1}}} +% Double-framed box of text. +\newcommand{\normalboxd}[1]{\fbox{\fbox{\vbox{#1}}}} + +% WITHDRAWN -- can't do in RTF, easily. +% Framed box of text, horizontally centred. Ragged right within box. +% \newcommand{\centeredbox}[2]{\begin{center}\fbox{\parbox{#1}{\raggedright#2}}\end{center}} +% Double-framed box of text, horizontally centred. Ragged right within box. +% \newcommand{\centeredboxd}[2]{\begin{center}\fbox{\fbox{\parbox{#1}{\raggedright#2}}}\end{center}} + +% toocomplex environment: simply prints the argument in LaTeX, +% comes out verbatim in all generated formats. +\newenvironment{toocomplex}{}{} + +% Colour: dummy commands since LaTeX doesn't support colour. +% \definecolour{name}{red}{blue}{green} +% \fcol{name}{text} ; Foreground +% \bcol{name}{text} ; Background +\newcommand{\definecolour}[4]{} +\newcommand{\definecolor}[4]{} +\newcommand{\fcol}[2]{#2} +\newcommand{\bcol}[2]{#2} +\newcommand{\sethotspotcolour}[1]{} +\newcommand{\sethotspotunderline}[1]{} +\newcommand{\settransparency}[1]{} +\newcommand{\backslashraw}[0]{} +\newcommand{\lbraceraw}[0]{} +\newcommand{\rbraceraw}[0]{} +\newcommand{\registered}[0]{(r)} +\newcommand{\background}[1]{} +\newcommand{\textcolour}[1]{} +\newcommand{\overview}[2]{See \helpref{#1}{#2}.} +\newcommand{\docparam}[2]{{\it #1}\begin{list}{}{\leftmargin=1cm}\item[] +#2% +\end{list}} +\newcommand{\wxheading}[1]{{\bf #1}} +\newcommand{\const}[0]{{\bf const}} +\newcommand{\constfunc}[3]{{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}} +\newcommand{\windowstyle}[1]{{\bf #1}\index{#1}} + +\addtolength{\textwidth}{1in} +\addtolength{\oddsidemargin}{-0.5in} +\addtolength{\topmargin}{-0.5in} +\addtolength{\textheight}{1in} +\sloppy + diff --git a/contrib/docs/latex/mmedia/topics.tex b/contrib/docs/latex/mmedia/topics.tex new file mode 100644 index 0000000000..ece8016fce --- /dev/null +++ b/contrib/docs/latex/mmedia/topics.tex @@ -0,0 +1,161 @@ +\chapter{Topic overviews} +\setheader{{\it CHAPTER \thechapter}}{}{}{}{}{{\it CHAPTER \thechapter}}% +\setfooter{\thepage}{}{}{}{}{\thepage} + +The following sections describe particular topics. + +\section{OGL overview}\label{ogloverview} + +\helpref{wxShapeCanvas}{wxshapecanvas}, derived from {\bf wxCanvas}, is the drawing area +for a number of \helpref{wxShape}{wxshape} instances. Everything drawn on a +wxShapeCanvas is derived from wxShape, which provides virtual +member functions for redrawing, creating and destroying +resize/selection `handles', movement and erasing behaviour, mouse +click behaviour, calculating the bounding box of the shape, linking +nodes with arcs, and so on. + +The way a client application copes with `damage' to the canvas is to +erase (white out) anything should no longer be displayed, redraw the shape, +and then redraw everything on the canvas to repair any damage. If quick edit +mode is on for the canvas, the complete should be omitted by OGL and the +application. + +Selection handles (called control points in the code) are implemented as +wxRectangleShapes. + +Events are passed to shapes by the canvas in a high-level form, for example {\bf OnLeftClick}, +{\bf OnBeginDragLeft}, {\bf OnDragLeft}, {\bf OnEndDragLeft}. The canvas decides +what is a click and what is a drag, whether it is on a shape or the canvas itself, +and (by interrogating the shape) which attachment point the click is associated with. + +In order to provide event-handling flexibility, each shapes has an `event handler' associated with it, +which by default is the shape itself (all shapes derive from wxShapeEvtHandler). +An application can modify the event-handling behaviour simply by plugging a new +event handler into the shape. This can avoid the need for multiple inheritance when +new properties and behaviour are required for a number of different shape classes: instead +of overriding each class, one new event handler class can be defined and used for all +existing shape classes. + +A range of shapes have been predefined in the library, including rectangles, ellipses, +polygons. A client application can derive from these shapes and/or derive entirely +new shapes from wxShape. + +Instances of a class called \helpref{wxDiagram}{wxdiagram} organise collections of +shapes, providing default file input and output behaviour. + +\section{wxDividedShape overview}\label{dividedshapeoverview} + +Classes: \helpref{wxDividedShape}{wxdividedshape} + +A wxDividedShape is a rectangle with a number of vertical divisions. Each +division may have its text formatted with independent characteristics, and +the size of each division relative to the whole image may be specified. + +Once a wxDividedShape has been created, the user may move the divisions with the +mouse. By pressing Ctrl while right-clicking, the region attributes can be edited. + +Here are examples of creating wxDividedShape objects: + +{\small +\begin{verbatim} + /* + * Divided rectangle with 3 regions + * + */ + + wxDividedShape *dividedRect = new wxDividedShape(50, 60); + + wxShapeRegion *region = new wxShapeRegion; + region->SetProportions(0.0, 0.25); + dividedRect->AddRegion(region); + + region = new wxShapeRegion; + region->SetProportions(0.0, 0.5); + dividedRect->AddRegion(region); + + region = new wxShapeRegion; + region->SetProportions(0.0, 0.25); + dividedRect->AddRegion(region); + + dividedRect->SetSize(50, 60); // Allow it to calculate region sizes + dividedRect->SetPen(wxBLACK_PEN); + dividedRect->SetBrush(wxWHITE_BRUSH); + dividedRect->Show(TRUE); + dividedRect->NameRegions(); + + /* + * Divided rectangle with 3 regions, rounded + * + */ + + wxDividedShape *dividedRect3 = new wxDividedShape(50, 60); + dividedRect3->SetCornerRadius(-0.4); + + region = new wxShapeRegion; + region->SetProportions(0.0, 0.25); + dividedRect3->AddRegion(region); + + region = new wxShapeRegion; + region->SetProportions(0.0, 0.5); + dividedRect3->AddRegion(region); + + region = new wxShapeRegion; + region->SetProportions(0.0, 0.25); + dividedRect3->AddRegion(region); + + dividedRect3->SetSize(50, 60); // Allow it to calculate region sizes + dividedRect3->SetPen(wxBLACK_PEN); + dividedRect3->SetBrush(wxWHITE_BRUSH); + dividedRect3->Show(TRUE); + dividedRect3->NameRegions(); +\end{verbatim} +} + +\section{wxCompositeShape overview}\label{compositeshapeoverview} + +Classes: \helpref{wxCompositeShape}{wxcompositeshape}, \helpref{wxOGLConstraint}{wxoglconstraint} + +The wxCompositeShape allows fairly complex shapes to be created, and maintains +a set of constraints which specify the layout and proportions of child shapes. + +Add child shapes to a wxCompositeShape using \helpref{AddChild}{wxcompositeshapeaddchild}, and +add constraints using \helpref{AddConstraint}{wxcompositeshapeaddconstraint}. + +After children and shapes have been added, call \helpref{Recompute}{wxcompositeshaperecompute} which +will return TRUE is the constraints could be satisfied, FALSE otherwise. If +constraints have been correctly and consistently specified, this call will succeed. + +If there is more than one child, constraints must be specified: OGL cannot calculate +the size and position of children otherwise. Don't assume that children will simply +move relative to the parent without the use of constraints. + +To specify a constraint, you need three things: + +\begin{enumerate}\itemsep=0pt +\item a constraint type, such as gyCONSTRAINT\_CENTRED\_VERTICALLY; +\item a reference shape, with respect to which other shapes are going to be positioned - the\rtfsp +{\it constraining} shape; +\item a list of one or more shapes to be constrained: the {\it constrained} shapes. +\end{enumerate} + +The constraining shape can be either the parent of the constrained shapes, or a sibling. The +constrained shapes must all be siblings of each other. + +For an exhaustive list and description of the available constraint types, see the \helpref{wxOGLConstraint constructor}{wxoglconstraintconstr}. +Note that most constraints operate in one dimension only (vertically or horizontally), so you will +usually need to specify constraints in pairs. + +You can set the spacing between constraining and constrained shapes by +calling \helpref{wxOGLConstraint::SetSpacing}{wxoglconstraintsetspacing}. + +Finally, a wxCompositeShape can have {\it divisions}, which are special child shapes of class +wxDivisionShape (not to be confused with wxDividedShape). The purpose of this is to allow +the composite to be divided into user-adjustable regions (divisions) into which other shapes +can be dropped dynamically, given suitable application code. Divisons allow the child +shapes to have an identity of their own - they can be manipulated independently of their container - +but to behave as if they are contained with the division, moving with the parent shape. +Divisions boundaries can themselves be moved using the mouse. + +To create an initial division, call \helpref{wxCompositeShape::MakeContainer}{wxcompositeshapemakecontainer}. +Make further divisions by calling \helpref{wxDivisionShape::Divide}{wxdivisionshapedivide}. + diff --git a/contrib/docs/latex/mmedia/up.gif b/contrib/docs/latex/mmedia/up.gif new file mode 100644 index 0000000000000000000000000000000000000000..316d0d2a14b571bea2eb874efd04bfe509f53b34 GIT binary patch literal 137 zcmV;40CxXJNk%v~VHyA!0Pz3-zrVld=jU&4Z(9HWEC2ui02%-o0007FjE||ytzv+j zv|1owxcuhWh0?c)Avq0}dTQw^q7qBdoDA6WKJ*l>%gtCeAWZlgxpoy|ZDMRPr_m>p rx}08pS4?)u<%PW +#include +typedef struct CDAW_Internal { + MCIDEVICEID dev_id; +} CDAW_Internal; +#endif + +/// +class WXDLLEXPORT wxCDAudioWin : public wxCDAudio { + DECLARE_DYNAMIC_CLASS(wxCDAudioWin) +protected: + struct CDAW_Internal *m_internal; + wxCDtime *m_trksize, *m_trkpos; + CDtoc *m_toc; + bool m_ok; +public: + /// + wxCDAudioWin(void); + /// + wxCDAudioWin(const char *dev_name); + /// + virtual ~wxCDAudioWin(void); + + /// + virtual bool Play(const wxCDtime& beg_time, const wxCDtime& end_time); + /// + virtual bool Pause(void); + /// + virtual bool Resume(void); + /// + virtual CDstatus GetStatus(void); + /// + virtual wxCDtime GetTime(void); + /// + virtual const CDtoc& GetToc(void); + /// + virtual inline bool Ok(void) const { return m_ok; } +protected: + void PrepareToc(); +}; + +#endif diff --git a/contrib/include/wx/mmedia/internal/g72x.h b/contrib/include/wx/mmedia/internal/g72x.h new file mode 100644 index 0000000000..dbfd64fd5b --- /dev/null +++ b/contrib/include/wx/mmedia/internal/g72x.h @@ -0,0 +1,123 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +/* + * g72x.h + * + * Header file for CCITT conversion routines. + * + */ +#ifndef _G72X_H +#define _G72X_H + +#define AUDIO_ENCODING_ULAW (1) /* ISDN u-law */ +#define AUDIO_ENCODING_ALAW (2) /* ISDN A-law */ +#define AUDIO_ENCODING_LINEAR (3) /* PCM 2's-complement (0-center) */ + +/* + * The following is the definition of the state structure + * used by the G.721/G.723 encoder and decoder to preserve their internal + * state between successive calls. The meanings of the majority + * of the state structure fields are explained in detail in the + * CCITT Recommendation G.721. The field names are essentially indentical + * to variable names in the bit level description of the coding algorithm + * included in this Recommendation. + */ +struct g72x_state { + long yl; /* Locked or steady state step size multiplier. */ + short yu; /* Unlocked or non-steady state step size multiplier. */ + short dms; /* Short term energy estimate. */ + short dml; /* Long term energy estimate. */ + short ap; /* Linear weighting coefficient of 'yl' and 'yu'. */ + + short a[2]; /* Coefficients of pole portion of prediction filter. */ + short b[6]; /* Coefficients of zero portion of prediction filter. */ + short pk[2]; /* + * Signs of previous two samples of a partially + * reconstructed signal. + */ + short dq[6]; /* + * Previous 6 samples of the quantized difference + * signal represented in an internal floating point + * format. + */ + short sr[2]; /* + * Previous 2 samples of the quantized difference + * signal represented in an internal floating point + * format. + */ + char td; /* delayed tone detect, new in 1988 version */ +}; + +/* External function definitions. */ + +extern unsigned char linear2alaw (int pcm_val); /* 2's complement (16-bit range) */ +extern int alaw2linear (unsigned char a_val); +extern unsigned char linear2ulaw (int pcm_val); /* 2's complement (16-bit range) */ +extern int ulaw2linear (unsigned char u_val); +extern int predictor_zero (struct g72x_state *state_ptr); +extern int predictor_pole (struct g72x_state *state_ptr); +extern int step_size (struct g72x_state *state_ptr); +extern int quantize (int d, int y, short *table, int size); +extern int reconstruct (int sign, int dqln, int y); + +extern void update + ( int code_size, int y, int wi, int fi, int dq + , int sr, int dqsez, struct g72x_state *state_ptr); + +int tandem_adjust_alaw + (int sr, int se, int y, int i, int sign, short *qtab); + +int tandem_adjust_ulaw + (int sr, int se, int y, int i, int sign, short *qtab); + +extern void g72x_init_state (struct g72x_state *); +extern int g721_encoder( + int sample, + int in_coding, + struct g72x_state *state_ptr); +extern int g721_decoder( + int code, + int out_coding, + struct g72x_state *state_ptr); +extern int g723_24_encoder( + int sample, + int in_coding, + struct g72x_state *state_ptr); +extern int g723_24_decoder( + int code, + int out_coding, + struct g72x_state *state_ptr); +extern int g723_40_encoder( + int sample, + int in_coding, + struct g72x_state *state_ptr); +extern int g723_40_decoder( + int code, + int out_coding, + struct g72x_state *state_ptr); + +#endif /* !_G72X_H */ diff --git a/contrib/include/wx/mmedia/sndaiff.h b/contrib/include/wx/mmedia/sndaiff.h new file mode 100644 index 0000000000..df9b2f2fa7 --- /dev/null +++ b/contrib/include/wx/mmedia/sndaiff.h @@ -0,0 +1,46 @@ +// -------------------------------------------------------------------------- +// Name: sndaiff.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDAIFF_H +#define _WX_SNDAIFF_H + +#ifdef __GNUG__ +#pragma interface "sndaiff.h" +#endif + +#include "wx/defs.h" +#include "wx/stream.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndfile.h" + +// +// AIFF codec +// + +class wxSoundAiff: public wxSoundFileStream { +public: + wxSoundAiff(wxInputStream& stream, wxSoundStream& io_sound); + wxSoundAiff(wxOutputStream& stream, wxSoundStream& io_sound); + ~wxSoundAiff(); + + bool CanRead(); + wxString GetCodecName() const; + +protected: + bool PrepareToPlay(); + bool PrepareToRecord(wxUint32 time); + bool FinishRecording(); + bool RepositionStream(wxUint32 position); + + wxUint32 GetData(void *buffer, wxUint32 len); + wxUint32 PutData(const void *buffer, wxUint32 len); +protected: + off_t m_base_offset; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndbase.h b/contrib/include/wx/mmedia/sndbase.h new file mode 100644 index 0000000000..336a7d2f1b --- /dev/null +++ b/contrib/include/wx/mmedia/sndbase.h @@ -0,0 +1,171 @@ +// -------------------------------------------------------------------------- +// Name: sndbase.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDBASE_H +#define _WX_SNDBASE_H + +#ifdef __GNUG__ +#pragma interface "sndbase.h" +#endif + +#include "wx/defs.h" + +// ------------------------------------------------------------------------ +// DEFINITIONS + +// --------------------- +// Sound streaming mode: +// - wxSOUND_INPUT: simple recording mode +// - wxSOUND_OUTPUT: simple playing mode +// - wxSOUND_DUPLEX: full duplex record/play at the same time +// --------------------- +enum { + wxSOUND_INPUT = 1, + wxSOUND_OUTPUT = 2, + wxSOUND_DUPLEX = wxSOUND_INPUT | wxSOUND_OUTPUT, +}; + +// --------------------- +// wxSoundFormatType: it specifies the format family of the sound data +// which will be passed to the stream. +// --------------------- +typedef enum { + wxSOUND_NOFORMAT, + wxSOUND_PCM, + wxSOUND_ULAW, + wxSOUND_G72X, + wxSOUND_MSADPCM +} wxSoundFormatType; + +// --------------------- +// wxSoundError: +// - wxSOUND_NOERR: No error occured +// - wxSOUND_IOERR: an input/output error occured, it may concern either +// a driver or a file +// - wxSOUND_INVFRMT: the sound format passed to the function is invalid. +// Generally, it means that you passed out of range values +// to the codec stream or you don't pass the right sound +// format object to the right sound codec stream. +// - wxSOUND_INVDEV: Invalid device. Generally, it means that the sound stream +// didn't manage to open the device driver due to an invalid// parameter or to the fact that sound is not supported on +// this computer. +// - wxSOUND_NOEXACT: No exact matching sound codec has been found for +// this sound format. It means that the sound driver didn't +// manage to setup the sound card with the specified +// values. +// - wxSOUND_NOCODEC: No matching codec has been found. Generally, it +// may happen when you call +// wxSoundRouterStream::SetSoundFormat(). +// - wxSOUND_MEMERR: Not enough memory. +// - wxSOUND_NOTSTARTED: You did not start the production using +// StartProduction() +// --------------------- +typedef enum { + wxSOUND_NOERROR, + wxSOUND_IOERROR, + wxSOUND_INVFRMT, + wxSOUND_INVDEV, + wxSOUND_NOEXACT, + wxSOUND_INVSTRM, + wxSOUND_NOCODEC, + wxSOUND_MEMERROR, + wxSOUND_NOTSTARTED +} wxSoundError; + +class WXDLLEXPORT wxSoundStream; + +// --------------------- +// wxSoundCallback(stream, evt, cdata): C callback for sound event. +// - stream: current wxSoundStream +// - evt: the sound event which has occured, it may be wxSOUND_INPUT, +// wxSOUND_OUTPUT or wxSOUND_DUPLEX +// - cdata: User callback data +// --------------------- +typedef void (*wxSoundCallback)(wxSoundStream *stream, int evt, + void *cdata); + +// +// Base class for sound format specification +// + +class WXDLLEXPORT wxSoundFormatBase { + public: + wxSoundFormatBase(); + virtual ~wxSoundFormatBase(); + + // It returns a "standard" format type. + virtual wxSoundFormatType GetType() const { return wxSOUND_NOFORMAT; } + // It clones the current format. + virtual wxSoundFormatBase *Clone() const; + + virtual wxUint32 GetTimeFromBytes(wxUint32 bytes) const = 0; + virtual wxUint32 GetBytesFromTime(wxUint32 time) const = 0; + + virtual bool operator !=(const wxSoundFormatBase& frmt2) const; +}; + +// +// Base class for sound streams +// + +class wxSoundStream { + public: + wxSoundStream(); + virtual ~wxSoundStream(); + + // Reads "len" bytes from the sound stream. + virtual wxSoundStream& Read(void *buffer, wxUint32 len) = 0; + // Writes "len" byte to the sound stream. + virtual wxSoundStream& Write(const void *buffer, wxUint32 len) = 0; + // Returns the best size for IO calls + virtual wxUint32 GetBestSize() const { return 1024; } + + // SetSoundFormat returns TRUE when the format can be handled. + virtual bool SetSoundFormat(const wxSoundFormatBase& format); + + // GetSoundFormat returns the current sound format. + wxSoundFormatBase& GetSoundFormat() const { return *m_sndformat; } + + // Register a callback for a specified async event. + void SetCallback(int evt, wxSoundCallback cbk, void *cdata); + + // Starts the async notifier. After this call, the stream begins either + // recording or playing or the two at the same time. + virtual bool StartProduction(int evt) = 0; + // Stops the async notifier. + virtual bool StopProduction() = 0; + // Sets the event handler: if it is non-null, all events are routed to it. + void SetEventHandler(wxSoundStream *handler) { m_handler = handler; } + + wxSoundError GetError() const { return m_snderror; } + wxUint32 GetLastAccess() const { return m_lastcount; } + + // This is only useful for device (I think). + virtual bool QueueFilled() const { return TRUE; } + + protected: + // Current sound format + wxSoundFormatBase *m_sndformat; + + // Last error + wxSoundError m_snderror; + + // Last access + wxUint32 m_lastcount; + + // Event handler + wxSoundStream *m_handler; + + wxSoundCallback m_callback[2]; + void *m_cdata[2]; + + protected: + // Handles event + virtual void OnSoundEvent(int evt); +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndcodec.h b/contrib/include/wx/mmedia/sndcodec.h new file mode 100644 index 0000000000..1db887d3cf --- /dev/null +++ b/contrib/include/wx/mmedia/sndcodec.h @@ -0,0 +1,32 @@ +// -------------------------------------------------------------------------- +// Name: sndcodec.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDCODEC_H +#define _WX_SNDCODEC_H + +#ifdef __GNUG__ +#pragma interface "sndcodec.h" +#endif + +#include "wx/defs.h" +#include "wx/mmedia/sndbase.h" + +class wxSoundStreamCodec: public wxSoundStream { + public: + wxSoundStreamCodec(wxSoundStream& snd_io); + ~wxSoundStreamCodec(); + + bool StartProduction(int evt); + bool StopProduction(); + + wxUint32 GetBestSize() const; + + protected: + wxSoundStream *m_sndio; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndcpcm.h b/contrib/include/wx/mmedia/sndcpcm.h new file mode 100644 index 0000000000..2375e83733 --- /dev/null +++ b/contrib/include/wx/mmedia/sndcpcm.h @@ -0,0 +1,54 @@ +// -------------------------------------------------------------------------- +// Name: sndcpcm.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDCPCM_H +#define _WX_SNDCPCM_H + +#ifdef __GNUG__ +#pragma interface "sndcpcm.h" +#endif + +#include "wx/defs.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" + +// +// PCM converter class +// + +class wxSoundStreamPcm: public wxSoundStreamCodec { +public: + typedef void (*ConverterType)(const void *buf_in, void *buf_out, + wxUint32 len); + + wxSoundStreamPcm(wxSoundStream& sndio); + ~wxSoundStreamPcm(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + wxUint32 GetBestSize() const; + +protected: + wxUint32 GetReadSize(wxUint32 len) const; + wxUint32 GetWriteSize(wxUint32 len) const; + +protected: + ConverterType m_function_out, m_function_in; + + // Static temporary buffer + char *m_prebuffer; + wxUint32 m_prebuffer_size; + // Estimated best size to fit into the static buffer + wxUint32 m_best_size; + // Multiplier for IO buffer size + float m_multiplier_in, m_multiplier_out; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndesd.h b/contrib/include/wx/mmedia/sndesd.h new file mode 100644 index 0000000000..06cbce5f87 --- /dev/null +++ b/contrib/include/wx/mmedia/sndesd.h @@ -0,0 +1,53 @@ +// -------------------------------------------------------------------------- +// Name: sndesd.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDESD_H +#define _WX_SNDESD_H + +#ifdef __GNUG__ +#pragma interface "sndesd.h" +#endif + +#include "wx/defs.h" +#include "wx/string.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndpcm.h" + +// +// ESD output class +// + +class wxSoundStreamESD : public wxSoundStream { +public: + wxSoundStreamESD(const wxString& hostname = wxT("localhost")); + ~wxSoundStreamESD(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + bool StartProduction(int evt); + bool StopProduction(); + + // You should not call this. + void WakeUpEvt(int evt); + + bool QueueFilled() const { return m_q_filled; } +protected: + int m_fd_input, m_fd_output; // ESD fds + int m_tag_input, m_tag_output; // GLIB tags + bool m_esd_stop; // Stream started ? + bool m_esd_ok; // ESD detected + wxString m_hostname; // ESD host + bool m_q_filled; // queue filled + +private: + void DetectBest(wxSoundFormatPcm *pcm); +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndfile.h b/contrib/include/wx/mmedia/sndfile.h new file mode 100644 index 0000000000..65dc888510 --- /dev/null +++ b/contrib/include/wx/mmedia/sndfile.h @@ -0,0 +1,125 @@ +// -------------------------------------------------------------------------- +// Name: sndfile.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDFILE_H +#define _WX_SNDFILE_H + +#include "wx/defs.h" +#include "wx/stream.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" + +#define wxSOUND_INFINITE_TIME ((wxUint32)-1) + +// +// Codec router class +// + +class WXDLLEXPORT wxSoundRouterStream: public wxSoundStreamCodec { + public: + wxSoundRouterStream(wxSoundStream& sndio); + ~wxSoundRouterStream(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + bool StartProduction(int evt); + bool StopProduction(); + + wxUint32 GetBestSize() const; + + protected: + wxSoundStream *m_router; +}; + +typedef enum { + wxSOUND_FILE_STOPPED, + wxSOUND_FILE_PAUSED, + wxSOUND_FILE_PLAYING, + wxSOUND_FILE_RECORDING +} wxSoundFileState; + +// +// Base class for file coders/decoders +// + +class wxSoundFileStream: public wxSoundStream { +public: + wxSoundFileStream(wxInputStream& stream, wxSoundStream& io_sound); + wxSoundFileStream(wxOutputStream& stream, wxSoundStream& io_sound); + ~wxSoundFileStream(); + + // Usual sound file calls (Play, Stop, ...) + bool Play(); + bool Record(wxUint32 time); + bool Stop(); + bool Pause(); + bool Resume(); + + // Functions which return the current state + bool IsStopped() const { return m_state == wxSOUND_FILE_STOPPED; } + bool IsPaused() const { return m_state == wxSOUND_FILE_PAUSED; } + + // A user should not call these two functions. + // Several things must be done before calling them. + // Users should use Play(), ... + bool StartProduction(int evt); + bool StopProduction(); + + // These three functions deals with the length, the position in the sound file. + // All the values are expressed in bytes. If you need the values expressed + // in terms of time, you have to use GetSoundFormat().GetTimeFromBytes(...) + wxUint32 GetLength(); + wxUint32 GetPosition(); + wxUint32 SetPosition(wxUint32 new_position); + + // These two functions use the sound format specified by GetSoundFormat(). + // All samples must be encoded in that format. + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + // This function set the sound format of the file. !! It must be used only + // when you are in output mode (concerning the file) !! If you are in + // input mode (concerning the file) you can't use this function to modify + // the format of the samples returned by Read() ! + // For this action, you must use wxSoundRouterStream applied to wxSoundFileStream. + bool SetSoundFormat(const wxSoundFormatBase& format); + + // This function returns the Codec name. This is useful for those who want to build + // a player (But also in some other case). + virtual wxString GetCodecName() const; + + // You should use this function to test whether this file codec can read + // the stream you passed to it. + virtual bool CanRead() { return FALSE; } + +protected: + wxSoundRouterStream m_codec; + wxSoundStream *m_sndio; + wxInputStream *m_input; + wxOutputStream *m_output; + + wxSoundFileState m_state, m_oldstate; + wxUint32 m_length, m_bytes_left; + bool m_prepared; + +protected: + virtual bool PrepareToPlay() = 0; + virtual bool PrepareToRecord(wxUint32 time) = 0; + virtual bool FinishRecording() = 0; + virtual bool RepositionStream(wxUint32 position) = 0; + void FinishPreparation(wxUint32 len); + + virtual wxUint32 GetData(void *buffer, wxUint32 len) = 0; + virtual wxUint32 PutData(const void *buffer, wxUint32 len) = 0; + + void OnSoundEvent(int evt); +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndg72x.h b/contrib/include/wx/mmedia/sndg72x.h new file mode 100644 index 0000000000..61ef7d602f --- /dev/null +++ b/contrib/include/wx/mmedia/sndg72x.h @@ -0,0 +1,85 @@ +// -------------------------------------------------------------------------- +// Name: sndg72x.h +// Purpose: +// Date: 08/26/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDG72X_H +#define _WX_SNDG72X_H + +#ifdef __GNUG__ +#pragma interface "sndg72x.h" +#endif + +#include "wx/defs.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndbase.h" + +typedef enum { + wxSOUND_G721, + wxSOUND_G723_24, + wxSOUND_G723_40 +} wxSoundG72XType; + +// This fixes a bug in Mingw95 +typedef struct g72x_state g72state; + +// +// G72X format +// +class WXDLLEXPORT wxSoundFormatG72X: public wxSoundFormatBase { + public: + wxSoundFormatG72X(); + ~wxSoundFormatG72X(); + + void SetG72XType(wxSoundG72XType type); + wxSoundG72XType GetG72XType() const { return m_g72x_type; } + + void SetSampleRate(wxUint32 srate); + wxUint32 GetSampleRate() const; + + wxSoundFormatType GetType() const { return wxSOUND_G72X; } + wxSoundFormatBase *Clone() const; + + wxUint32 GetTimeFromBytes(wxUint32 bytes) const; + wxUint32 GetBytesFromTime(wxUint32 time) const; + + bool operator !=(const wxSoundFormatBase& frmt2) const; + + protected: + wxUint32 m_srate; + wxSoundG72XType m_g72x_type; +}; + +// +// ULAW converter class +// + +class WXDLLEXPORT wxSoundRouterStream; +class WXDLLEXPORT wxSoundStreamG72X: public wxSoundStreamCodec { + public: + wxSoundStreamG72X(wxSoundStream& sndio); + ~wxSoundStreamG72X(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + protected: + wxSoundRouterStream *m_router; + wxUint8 m_n_bits, m_current_mask, m_current_b_pos, m_current_byte; + wxUint8 *m_io_buffer; + g72state *m_state; + + int (*m_coder)(int code, int in_code, struct g72x_state *state); + int (*m_decoder)(int code, int out_code, struct g72x_state *state); + + protected: + void PutBits(wxUint8 bits); + wxUint8 GetBits(); +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndmsad.h b/contrib/include/wx/mmedia/sndmsad.h new file mode 100644 index 0000000000..7741acd2a0 --- /dev/null +++ b/contrib/include/wx/mmedia/sndmsad.h @@ -0,0 +1,72 @@ +// -------------------------------------------------------------------------- +// Name: sndmsad(pcm).h +// Purpose: MS ADPCM codec +// Date: 25/02/2000 +// Author: Guilhem Lavaux (C) 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDULAW_H +#define _WX_SNDULAW_H + +#ifdef __GNUG__ +#pragma interface "sndmsad.h" +#endif + +#include "wx/defs.h" +#include "wx/dynarray.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndbase.h" + +WX_DEFINE_EXPORTED_ARRAY(wxUint16, wxMSAdpcmCoeffs); + +// +// MSADPCM format +// +class WXDLLEXPORT wxSoundFormatMSAdpcm: public wxSoundFormatBase { + public: + wxSoundFormatMSAdpcm(); + ~wxSoundFormatMSAdpcm(); + + void SetSampleRate(wxUint32 srate); + wxUint32 GetSampleRate() const; + + void SetSamplesBlock(wxUint16 sampblock); + wxUint16 GetSamplesBlock() const; + + void SetCoefs(wxMSAdpcmCoefs& coefs); + wxMSAdpcmCoefs& GetCoefs() const; + + wxSoundFormatType GetType() const { return wxSOUND_ULAW; } + wxSoundFormatBase *Clone() const; + + wxUint32 GetTimeFromBytes(wxUint32 bytes) const; + wxUint32 GetBytesFromTime(wxUint32 time) const; + + bool operator !=(const wxSoundFormatBase& frmt2) const; + + protected: + wxUint32 m_srate; + wxMSAdpcmCoefs *m_coefs; +}; + +// +// MS ADPCM converter class +// +class WXDLLEXPORT wxSoundRouterStream; +class WXDLLEXPORT wxSoundStreamAdpcm: public wxSoundStreamCodec { +public: + wxSoundStreamAdpcm(wxSoundStream& sndio); + ~wxSoundStreamAdpcm(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + wxUint32 GetBestSize() const; + +protected: + wxSoundRouterStream *m_router; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndoss.h b/contrib/include/wx/mmedia/sndoss.h new file mode 100644 index 0000000000..24a1e2c9af --- /dev/null +++ b/contrib/include/wx/mmedia/sndoss.h @@ -0,0 +1,55 @@ +// -------------------------------------------------------------------------- +// Name: sndoss.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDOSS_H +#define _WX_SNDOSS_H + +#ifdef __GNUG__ +#pragma interface "sndoss.h" +#endif + +#include "wx/defs.h" +#include "wx/string.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndpcm.h" + +// +// OSS output class +// + +class wxSoundStreamOSS : public wxSoundStream { + public: + wxSoundStreamOSS(const wxString& dev_name = wxT("/dev/dsp")); + ~wxSoundStreamOSS(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + wxUint32 GetBestSize() const; + + bool SetSoundFormat(const wxSoundFormatBase& format); + + bool StartProduction(int evt); + bool StopProduction(); + + bool QueueFilled() const; + + // You should not call this. + void WakeUpEvt(int evt); + protected: + // OSS device + int m_fd; + wxUint32 m_bufsize; + int m_tag; + bool m_oss_stop, m_oss_ok, m_q_filled; + wxString m_devname; + + private: + bool SetupFormat(wxSoundFormatPcm *pcm); + void DetectBest(wxSoundFormatPcm *pcm); +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndpcm.h b/contrib/include/wx/mmedia/sndpcm.h new file mode 100644 index 0000000000..652687a0f4 --- /dev/null +++ b/contrib/include/wx/mmedia/sndpcm.h @@ -0,0 +1,57 @@ +// -------------------------------------------------------------------------- +// Name: sndpcm.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDPCM_H +#define _WX_SNDPCM_H + +#ifdef __GNUG__ +#pragma interface "sndpcm.h" +#endif + +#include "wx/defs.h" +#include "wx/mmedia/sndbase.h" + +// +// PCM specification class +// + +class wxSoundFormatPcm : public wxSoundFormatBase { +public: + wxSoundFormatPcm(wxUint32 srate = 22500, wxUint8 bps = 8, + wxUint16 channels = 2, bool sign = TRUE, + int order = wxLITTLE_ENDIAN); + ~wxSoundFormatPcm(); + + void SetSampleRate(wxUint32 srate); + void SetBPS(wxUint8 bps); + void SetChannels(wxUint16 nchannels); + void SetOrder(int order); + void Signed(bool sign); + + wxUint32 GetSampleRate() const { return m_srate; } + wxUint8 GetBPS() const { return m_bps; } + wxUint16 GetChannels() const { return m_nchan; } + int GetOrder() const { return m_order; } + bool Signed() const { return m_signed; } + + wxSoundFormatType GetType() const { return wxSOUND_PCM; } + wxSoundFormatBase *Clone() const; + + wxUint32 GetTimeFromBytes(wxUint32 bytes) const; + wxUint32 GetBytesFromTime(wxUint32 time) const; + + bool operator!=(const wxSoundFormatBase& frmt2) const; + +protected: + wxUint32 m_srate; + wxUint8 m_bps; + wxUint16 m_nchan; + int m_order; + bool m_signed; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndulaw.h b/contrib/include/wx/mmedia/sndulaw.h new file mode 100644 index 0000000000..c558bb4758 --- /dev/null +++ b/contrib/include/wx/mmedia/sndulaw.h @@ -0,0 +1,67 @@ +// -------------------------------------------------------------------------- +// Name: sndulaw.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDULAW_H +#define _WX_SNDULAW_H + +#ifdef __GNUG__ +#pragma interface "sndulaw.h" +#endif + +#include "wx/defs.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndbase.h" + +// +// ULAW format +// +class WXDLLEXPORT wxSoundFormatUlaw: public wxSoundFormatBase { +public: + wxSoundFormatUlaw(); + ~wxSoundFormatUlaw(); + + void SetSampleRate(wxUint32 srate); + wxUint32 GetSampleRate() const; + + void SetChannels(wxUint8 channels); + wxUint8 GetChannels() const; + + wxSoundFormatType GetType() const { return wxSOUND_ULAW; } + wxSoundFormatBase *Clone() const; + + wxUint32 GetTimeFromBytes(wxUint32 bytes) const; + wxUint32 GetBytesFromTime(wxUint32 time) const; + + bool operator !=(const wxSoundFormatBase& frmt2) const; + +protected: + wxUint32 m_srate; + wxUint8 m_channels; +}; + +// +// ULAW converter class +// + +class WXDLLEXPORT wxSoundRouterStream; +class WXDLLEXPORT wxSoundStreamUlaw: public wxSoundStreamCodec { +public: + wxSoundStreamUlaw(wxSoundStream& sndio); + ~wxSoundStreamUlaw(); + + wxSoundStream& Read(void *buffer, wxUint32 len); + wxSoundStream& Write(const void *buffer, wxUint32 len); + + bool SetSoundFormat(const wxSoundFormatBase& format); + + wxUint32 GetBestSize() const; + +protected: + wxSoundRouterStream *m_router; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndwav.h b/contrib/include/wx/mmedia/sndwav.h new file mode 100644 index 0000000000..766689e102 --- /dev/null +++ b/contrib/include/wx/mmedia/sndwav.h @@ -0,0 +1,58 @@ +// -------------------------------------------------------------------------- +// Name: sndwav.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDWAV_H +#define _WX_SNDWAV_H + +#ifdef __GNUG__ +#pragma interface "sndwav.h" +#endif + +#include "wx/defs.h" +#include "wx/string.h" +#include "wx/stream.h" +#include "wx/datstrm.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndfile.h" + +// +// WAVE codec +// + +class wxSoundWave: public wxSoundFileStream { +public: + wxSoundWave(wxInputStream& stream, wxSoundStream& io_sound); + wxSoundWave(wxOutputStream& stream, wxSoundStream& io_sound); + ~wxSoundWave(); + + bool CanRead(); + wxString GetCodecName() const; + +protected: + bool PrepareToPlay(); + bool PrepareToRecord(wxUint32 time); + bool FinishRecording(); + bool RepositionStream(wxUint32 position); + + wxUint32 GetData(void *buffer, wxUint32 len); + wxUint32 PutData(const void *buffer, wxUint32 len); + + bool HandleOutputPCM(wxDataInputStream& data, wxUint16 channels, + wxUint32 sample_fq, wxUint32 byte_p_sec, + wxUint16 byte_p_spl, wxUint16 bits_p_spl); + bool HandleOutputG721(wxDataInputStream& data, wxUint16 channels, + wxUint32 sample_fq, wxUint32 byte_p_sec, + wxUint16 byte_p_spl, wxUint16 bits_p_spl); + wxSoundFormatBase *HandleInputPCM(wxDataOutputStream& data); + wxSoundFormatBase *HandleInputG72X(wxDataOutputStream& data); + +protected: + off_t m_base_offset; +}; + +#endif diff --git a/contrib/include/wx/mmedia/sndwin.h b/contrib/include/wx/mmedia/sndwin.h new file mode 100644 index 0000000000..fed5126066 --- /dev/null +++ b/contrib/include/wx/mmedia/sndwin.h @@ -0,0 +1,65 @@ +// -------------------------------------------------------------------------- +// Name: sndwin.h +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifndef _WX_SNDWIN_H +#define _WX_SNDWIN_H + +#include "wx/defs.h" +#include "wx/mmedia/sndbase.h" + +typedef struct _wxSoundInternal wxSoundInternal; +typedef struct _wxSoundInfoHeader wxSoundInfoHeader; + +class wxSoundInternal; +class WXDLLEXPORT wxSoundStreamWin : public wxSoundStream { + public: + wxSoundStreamWin(); + ~wxSoundStreamWin(); + + wxSoundStream& Write(const void *buffer, wxUint32 len); + wxSoundStream& Read(void *buffer, wxUint32 len); + + bool SetSoundFormat(wxSoundFormatBase& base); + + bool StartProduction(int evt); + bool StopProduction(); + + bool QueueFilled() const; + + // Internal but defined as public + void NotifyDoneBuffer(wxUint32 dev_handle, int flag); + + wxUint32 GetBestSize() const { return 4096; } + + protected: + wxSoundInternal *m_internal; + wxUint32 m_current_frag_in, m_current_frag_out; + wxUint32 m_input_frag_in, m_output_frag_out; + wxSoundInfoHeader **m_headers_play, **m_headers_rec; + + bool m_production_started, m_queue_filled, m_waiting_for; + + protected: + void CreateSndWindow(); + void DestroySndWindow(); + bool OpenDevice(int mode); + void CloseDevice(); + + wxSoundInfoHeader *AllocHeader(int mode); + void FreeHeader(wxSoundInfoHeader *header, int mode); + bool AllocHeaders(int mode); + void FreeHeaders(int mode); + + void WaitFor(wxSoundInfoHeader *info); + bool AddToQueue(wxSoundInfoHeader *info); + void ClearHeader(wxSoundInfoHeader *info); + + wxSoundInfoHeader *NextFragmentOutput(); + wxSoundInfoHeader *NextFragmentInput(); +}; + +#endif diff --git a/contrib/include/wx/mmedia/vidbase.h b/contrib/include/wx/mmedia/vidbase.h new file mode 100644 index 0000000000..8d5d1d55ed --- /dev/null +++ b/contrib/include/wx/mmedia/vidbase.h @@ -0,0 +1,110 @@ +// ///////////////////////////////////////////////////////////////////////////// +// Name: vidbase.h +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// CVS: $Id$ +// License: wxWindows license +// ///////////////////////////////////////////////////////////////////////////// +/* Real -*- C++ -*- */ +#ifndef __VID_bdrv_H__ +#define __VID_bdrv_H__ + +#ifdef __GNUG__ +#pragma interface "vidbase.h" +#endif + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/stream.h" + #include "wx/string.h" + #include "wx/window.h" + #include "wx/frame.h" +#endif + +// ---------------------------------------------------------------------------- +// wxMMedia2 (video) types + +typedef enum { + wxVIDEO_MSAVI, + wxVIDEO_MPEG, + wxVIDEO_QT, + wxVIDEO_GIF, + wxVIDEO_JMOV, + wxVIDEO_FLI, + wxVIDEO_IFF, + wxVIDEO_SGI, + wxVIDEO_MPEG2 +} wxVideoType; + +// ---------------------------------------------------------------------------- +// Classes definition + +class WXDLLEXPORT wxVideoBaseDriver : public wxObject { + DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver) +protected: + wxWindow *m_video_output; +public: + // Ctors + wxVideoBaseDriver(); + wxVideoBaseDriver(wxInputStream& str); + wxVideoBaseDriver(const wxString& filename); + // Dtor + virtual ~wxVideoBaseDriver(); + + // Usual functions ... They all return FALSE in case of errors. + virtual bool Play() = 0; + virtual bool Stop() = 0; + virtual bool Pause() = 0; + virtual bool Resume() = 0; + + // Size management + virtual bool SetSize(wxSize size) = 0; + virtual bool GetSize(wxSize& size) const = 0; + + // Test the capability of the driver to handle the specified type + virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) const { return FALSE; } + + // Return the video codec name + virtual wxString GetMovieCodec() const = 0; + // Return the audio codec name + virtual wxString GetAudioCodec() const = 0; + // Return misc info about audio + virtual wxUint32 GetSampleRate() const = 0; + virtual wxUint8 GetChannels() const = 0; + virtual wxUint8 GetBPS() const = 0; + // Return frame rate + virtual double GetFrameRate() const = 0; + // Return number of frames + virtual wxUint32 GetNbFrames() const = 0; + + // Called when the movie finished + virtual void OnFinished() {} + + // Attaches the video output to a window. The video will be shown in that window. + virtual bool AttachOutput(wxWindow& output); + virtual void DetachOutput(); + + // They return the state of the movie. + virtual bool IsPaused() const = 0; + virtual bool IsStopped() const = 0; +}; + +WXDLLEXPORT wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv); + + +#endif diff --git a/contrib/include/wx/mmedia/vidwin.h b/contrib/include/wx/mmedia/vidwin.h new file mode 100644 index 0000000000..b8d0527f97 --- /dev/null +++ b/contrib/include/wx/mmedia/vidwin.h @@ -0,0 +1,101 @@ +// ---------------------------------------------------------------------------- +// Name: vidwin.h +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: February 1998 +// Updated: +// Copyright: (C) 1998, Guilhem Lavaux +// License: wxWindows license +// ---------------------------------------------------------------------------- + +#ifndef __VID_windows_H__ +#define __VID_windows_H__ + +#ifdef __GNUG__ + #pragma interface "vidwin.h" +#endif + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP + #include "wx/string.h" + #include "wx/stream.h" + #include "wx/window.h" +#endif + +// ---------------------------------------------------------------------------- +// wxMMedia2 headers + +#include "wx/mmedia/vidbase.h" + +// ---------------------------------------------------------------------------- +// System headers and private types + +#ifdef WXMMEDIA_INTERNAL +#include +#include + +typedef struct VIDW_Internal { + MCIDEVICEID m_dev_id; +} wxVIDWinternal; +#endif + +// ---------------------------------------------------------------------------- +// Class definition + +class WXDLLEXPORT wxVideoWindows : public wxVideoBaseDriver { + DECLARE_DYNAMIC_CLASS(wxVideoWindows) +protected: + struct VIDW_Internal *m_internal; + bool m_paused, m_stopped, m_remove_file; + wxString m_filename; + double m_frameRate; + wxUint8 m_bps; + + void OpenFile(); +public: + wxVideoWindows(void); + wxVideoWindows(wxInputStream& str); + wxVideoWindows(const wxString& fname); + ~wxVideoWindows(void); + + bool Play(); + bool Stop(); + bool Pause(); + bool Resume(); + + bool GetSize(wxSize& size) const; + bool SetSize(wxSize size); + + // Return codec name for each stream. + wxString GetMovieCodec() const; + wxString GetAudioCodec() const; + // Return misc. info about audio + wxUint32 GetSampleRate() const; + wxUint8 GetChannels() const; + wxUint8 GetBPS() const; + // Return the frame rate of the video (in frames/second) + double GetFrameRate() const; + // Return the total number of frames in the movie + wxUint32 GetNbFrames() const; + + bool IsCapable(wxVideoType v_type); + + bool AttachOutput(wxWindow& output); + void DetachOutput(void); + + bool IsPaused() const; + bool IsStopped() const; +}; + +#endif diff --git a/contrib/include/wx/mmedia/vidxanm.h b/contrib/include/wx/mmedia/vidxanm.h new file mode 100644 index 0000000000..ff2a14d50a --- /dev/null +++ b/contrib/include/wx/mmedia/vidxanm.h @@ -0,0 +1,136 @@ +// ///////////////////////////////////////////////////////////////////////////// +// Name: vidxanm.h +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// License: wxWindows license +// ///////////////////////////////////////////////////////////////////////////// +/* Real -*- C++ -*- */ +#ifndef __VID_xanim_H__ +#define __VID_xanim_H__ + +#ifdef __GNUG__ + #pragma interface "vidxanm.h" +#endif + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/string.h" + #include "wx/process.h" +#endif + +// ---------------------------------------------------------------------------- +// System dependent headers + +#if defined(WXMMEDIA_INTERNAL) && (defined(__X__) || defined(__WXGTK__)) +#include +#include +#endif + +// ---------------------------------------------------------------------------- +// wxMMedia2 headers + +#include "wx/mmedia/vidbase.h" + +// ---------------------------------------------------------------------------- +// Internal types + +#ifdef WXMMEDIA_INTERNAL +typedef struct wxXANIMinternal { + Display *xanim_dpy; + Window xanim_window; + Atom xanim_atom, xanim_ret; +} wxXANIMinternal; + +#ifndef __XANIM_COMMAND__ + #define __XANIM_COMMAND__ "/usr/X11R6/bin/xanim" +#endif + +#endif + +// ---------------------------------------------------------------------------- +// Class definition + +class WXDLLEXPORT wxVideoXANIM : public wxVideoBaseDriver { + DECLARE_DYNAMIC_CLASS(wxVideoXANIM) + protected: + // Remember the state of the subprocess + bool m_xanim_started, m_paused; + // Pure X11 variables + struct wxXANIMinternal *m_internal; + wxString m_filename; + wxProcess *m_xanim_detector; + // Remember to delete the temporary file when necessary + bool m_remove_file; + wxUint32 m_size[2]; + wxUint32 m_sampleRate; + wxUint8 m_channels; + wxUint8 m_bps; + wxUint32 m_frames; + double m_frameRate; + wxString m_movieCodec, m_audioCodec; + + public: + wxVideoXANIM(); + wxVideoXANIM(wxInputStream& str); + wxVideoXANIM(const wxString& filename); + ~wxVideoXANIM(); + + bool Play(); + bool Pause(); + bool Resume(); + bool Stop(); + + bool SetVolume(wxUint8 vol); + bool SetSize(wxSize size); + bool GetSize(wxSize& size) const; + + // Return the video codec name + wxString GetMovieCodec() const; + // Return the audio codec name + wxString GetAudioCodec() const; + // Return misc info about audio + wxUint32 GetSampleRate() const; + wxUint8 GetChannels() const; + wxUint8 GetBPS() const; + // Return frame rate + double GetFrameRate() const; + // Return number of frames in the movie + wxUint32 GetNbFrames() const; + + bool IsCapable(wxVideoType v_type) const; + + bool AttachOutput(wxWindow& output); + void DetachOutput(); + + bool IsPaused() const; + bool IsStopped() const; + + friend class wxVideoXANIMProcess; + +protected: + // Start the subprocess with the right parameters + bool RestartXANIM(); + // Send a command to the subprocess + bool SendCommand(const char *command,char **ret = NULL, + wxUint32 *size = NULL); + + // Collect informations from XAnim + bool CollectInfo(); +}; + +#endif diff --git a/contrib/samples/Makefile.in b/contrib/samples/Makefile.in new file mode 100644 index 0000000000..072d0a2d16 --- /dev/null +++ b/contrib/samples/Makefile.in @@ -0,0 +1,10 @@ +# +# Makefile : Builds wxWindows utils for Unix. +# + +all: + cd mmedia; make + +clean: + cd mmedia; make clean + diff --git a/contrib/samples/mmedia/Makefile.in b/contrib/samples/mmedia/Makefile.in new file mode 100644 index 0000000000..4ab3991589 --- /dev/null +++ b/contrib/samples/mmedia/Makefile.in @@ -0,0 +1,36 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1998 +# Updated: +# Copyright: (c) 1998 Julian Smart +# +# "%W% %G%" +# +# Makefile for minimal example (UNIX). + +top_srcdir = @top_srcdir@/.. +top_builddir = ../../.. +program_dir = contrib/samples/mmedia + +PROGRAM=mmboard + +OBJECTS=mmboard.o mmbman.o + +EXTRA_LIBS= $(top_builddir)/lib/libwxmmedia2.a @ESD_LIBS@ +# the comment at the end of the next line is needed because otherwise autoconf +# would remove this line completely - it contains a built-in hack to remove +# any VPATH assignment not containing ':' +VPATH = @PATH_IFS@$(top_srcdir)/contrib/samples/mmedia # ':' for autoconf + +include ../../../src/make.env + +.SUFFIXES: .o .cpp .c + +.cpp.o: + $(CC) -c $(CPPFLAGS) $(EXTRA_CPPFLAGS) -o $@ $< + +all: $(PROGRAM) + +mmboard: $(OBJECTS) + $(CC) $(LDFLAGS) -o mmboard $(OBJECTS) $(EXTRA_LIBS) $(LDLIBS) $(top_builddir)/lib/@WX_TARGET_LIBRARY@ diff --git a/contrib/samples/mmedia/descrip.mms b/contrib/samples/mmedia/descrip.mms new file mode 100644 index 0000000000..d7e86d2e6a --- /dev/null +++ b/contrib/samples/mmedia/descrip.mms @@ -0,0 +1,30 @@ +#***************************************************************************** +# * +# Make file for VMS * +# Author : J.Jansen (joukj@hrem.stm.tudelft.nl) * +# Date : 10 November 1999 * +# * +#***************************************************************************** +.first + define wx [--.include.wx] + +.ifdef __WXMOTIF__ +CXX_DEFINE = /define=(__WXMOTIF__=1) +.else +CXX_DEFINE = +.endif + +.suffixes : .cpp + +.cpp.obj : + cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp + +all : + $(MMS)$(MMSQUALIFIERS) minimal.exe + +minimal.exe : minimal.obj +.ifdef __WXMOTIF__ + cxxlink minimal,[--.lib]vms/opt +.endif + +minimal.obj : minimal.cpp diff --git a/contrib/samples/mmedia/eject.xpm b/contrib/samples/mmedia/eject.xpm new file mode 100644 index 0000000000..890cc6b53b --- /dev/null +++ b/contrib/samples/mmedia/eject.xpm @@ -0,0 +1,24 @@ +/* XPM */ +static char * eject_xpm[] = { +"15 16 5 1", +" c None", +". c #949594", +"+ c #000000", +"@ c #FFFFFF", +"# c #8E8E8E", +" . ", +" .+@ ", +" .+++@ ", +" .+++++@ ", +" .+++++++@ ", +" .+++++++++@ ", +" .+++++++++++@ ", +".+############@", +".@@@@@@@@@@@@@@", +" ", +"...............", +".++++++++++++#@", +".++++++++++++#@", +".++++++++++++#@", +".+############@", +".@@@@@@@@@@@@@@"}; diff --git a/contrib/samples/mmedia/mmbman.cpp b/contrib/samples/mmedia/mmbman.cpp new file mode 100644 index 0000000000..f84803f84b --- /dev/null +++ b/contrib/samples/mmedia/mmbman.cpp @@ -0,0 +1,512 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mmbman.cpp +// Purpose: Multimedia Board manager +// Author: Guilhem Lavaux, +// Modified by: +// Created: 13/02/2000 +// RCS-ID: $Id$ +// Copyright: (c) 2000, Guilhem Lavaux +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifdef __GNUG__ + #pragma implementation "mmbman.cpp" +#endif + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +// Personal headers + +#include "wx/stream.h" +#include "wx/wfstream.h" + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndwav.h" +#include "wx/mmedia/sndaiff.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndulaw.h" + +#ifdef __UNIX__ +#include "wx/mmedia/sndoss.h" +#include "wx/mmedia/sndesd.h" +#endif + +#ifdef __WIN32__ +#include "wx/mmedia/sndwin.h" +#endif + +#include "wx/mmedia/vidbase.h" +#ifdef __UNIX__ +#include "wx/mmedia/vidxanm.h" +#endif + +#ifdef __WIN32__ +#include "wx/mmedia/vidwin.h" +#endif + +#include "mmboard.h" +#include "mmbman.h" + +// ---------------------------------------------------------------------------- +// Private class definitions +// ---------------------------------------------------------------------------- + +class MMBoardSoundFile: public MMBoardFile { +public: + MMBoardSoundFile(const wxString& filename); + ~MMBoardSoundFile(); + + bool NeedWindow(); + + void SetWindow(wxWindow *window); + + void Play(); + void Pause(); + void Resume(); + void Stop(); + + MMBoardTime GetPosition(); + MMBoardTime GetLength(); + void SetPosition(MMBoardTime btime); + + bool IsStopped(); + bool IsPaused(); + + wxString GetStringType(); + wxString GetStringInformation(); + +protected: + wxSoundFileStream *GetDecoder(); + + wxSoundStream *m_output_stream; + wxInputStream *m_input_stream; + wxSoundFileStream *m_file_stream; + + MMBoardTime m_length; + wxUint8 m_file_type; +}; + +class MMBoardVideoFile: public MMBoardFile { +public: + MMBoardVideoFile(const wxString& filename); + ~MMBoardVideoFile(); + + bool NeedWindow(); + + void SetWindow(wxWindow *window); + + void Play(); + void Pause(); + void Resume(); + void Stop(); + + MMBoardTime GetPosition(); + MMBoardTime GetLength(); + void SetPosition(MMBoardTime btime); + + bool IsStopped(); + bool IsPaused(); + + wxString GetStringType(); + wxString GetStringInformation(); + +protected: + wxWindow *m_output_window; + wxVideoBaseDriver *m_video_driver; +}; + +// ---------------------------------------------------------------------------- +// Implementation +// ---------------------------------------------------------------------------- + +#define MMBoard_UNKNOWNTYPE 0 +#define MMBoard_WAVE 1 +#define MMBoard_AIFF 2 + +// ---------------------------------------------------------------------------- +// MMBoardSoundFile + +MMBoardSoundFile::MMBoardSoundFile(const wxString& filename) + : MMBoardFile() +{ + m_input_stream = new wxFileInputStream(filename); + m_output_stream = MMBoardManager::OpenSoundStream(); + + m_file_stream = GetDecoder(); + + if (!m_file_stream) { + SetError(MMBoard_UnknownFile); + return; + } + + // Compute length + wxUint32 length, seconds; + + length = m_file_stream->GetLength(); + seconds = m_file_stream->GetSoundFormat().GetTimeFromBytes(length); + m_length.seconds = seconds % 60; + m_length.minutes = (seconds / 60) % 60; + m_length.hours = seconds / 3600; +} + +MMBoardSoundFile::~MMBoardSoundFile() +{ + if (m_file_stream) + delete m_file_stream; + MMBoardManager::UnrefSoundStream(m_output_stream); + delete m_input_stream; +} + +wxSoundFileStream *MMBoardSoundFile::GetDecoder() +{ + wxSoundFileStream *f_stream; + + // First, we try a Wave decoder + f_stream = new wxSoundWave(*m_input_stream, *m_output_stream); + m_file_type = MMBoard_WAVE; + if (f_stream->CanRead()) + return f_stream; + delete f_stream; + + // Then, a AIFF decoder + f_stream = new wxSoundAiff(*m_input_stream, *m_output_stream); + m_file_type = MMBoard_AIFF; + if (f_stream->CanRead()) + return f_stream; + delete f_stream; + + m_file_type = MMBoard_UNKNOWNTYPE; + + // TODO: automate + + return NULL; +} + +MMBoardTime MMBoardSoundFile::GetLength() +{ + return m_length; +} + +bool MMBoardSoundFile::IsStopped() +{ + return m_file_stream->IsStopped(); +} + +bool MMBoardSoundFile::IsPaused() +{ + return m_file_stream->IsPaused(); +} + +MMBoardTime MMBoardSoundFile::GetPosition() +{ + wxUint32 length, seconds; + MMBoardTime file_time; + + file_time.seconds = file_time.minutes = file_time.hours = 0; + if (m_file_stream->IsStopped()) + return file_time; + + length = m_file_stream->GetPosition(); + seconds = m_file_stream->GetSoundFormat().GetTimeFromBytes(length); + file_time.seconds = seconds % 60; + file_time.minutes = (seconds / 60) % 60; + file_time.hours = seconds / 3600; + + return file_time; +} + +void MMBoardSoundFile::SetPosition(MMBoardTime btime) +{ + wxUint32 itime; + + itime = btime.seconds + btime.minutes * 60 + btime.hours; + + m_file_stream->SetPosition( + m_file_stream->GetSoundFormat().GetBytesFromTime(itime) + ); +} + +bool MMBoardSoundFile::NeedWindow() +{ + return FALSE; +} + +void MMBoardSoundFile::SetWindow(wxWindow *window) +{ +} + +void MMBoardSoundFile::Play() +{ + m_file_stream->Play(); +} + +void MMBoardSoundFile::Pause() +{ + m_file_stream->Pause(); +} + +void MMBoardSoundFile::Resume() +{ + m_file_stream->Resume(); +} + +void MMBoardSoundFile::Stop() +{ + m_file_stream->Stop(); +} + +wxString MMBoardSoundFile::GetStringType() +{ + switch (m_file_type) { + case MMBoard_WAVE: + return wxString(wxT("WAVE file")); + break; + case MMBoard_AIFF: + return wxString(wxT("AIFF file")); + break; + default: + return wxString(wxT("Unknown file")); + break; + } +} + +wxString MMBoardSoundFile::GetStringInformation() +{ + wxString info; + wxSoundFormatBase *format; + + format = &(m_file_stream->GetSoundFormat()); + + info = wxT("Data encoding: "); + switch (format->GetType()) { + case wxSOUND_PCM: { + wxSoundFormatPcm *pcm_format = (wxSoundFormatPcm *)format; + + info += wxString::Format(wxT("PCM %s %s\n"), + pcm_format->Signed() ? wxT("signed") : wxT("unsigned"), + pcm_format->GetOrder() == wxLITTLE_ENDIAN ? wxT("little endian") : wxT("big endian")); + info += wxString::Format(wxT("Sampling rate: %d\n") + wxT("Bits per sample: %d\n") + wxT("Number of channels: %d\n"), + pcm_format->GetSampleRate(), + pcm_format->GetBPS(), + pcm_format->GetChannels()); + + break; + } + case wxSOUND_ULAW: { + wxSoundFormatUlaw *ulaw_format = (wxSoundFormatUlaw *)format; + info += wxT("ULAW\n"); + info += wxString::Format(wxT("Sampling rate: %d\n"), ulaw_format->GetSampleRate()); + break; + } + default: + info += wxT("Unknown"); + break; + } + return info; +} + +// ---------------------------------------------------------------------------- + + +// ---------------------------------------------------------------------------- +// MMBoardVideoFile + +MMBoardVideoFile::MMBoardVideoFile(const wxString& filename) +{ + m_output_window = NULL; + +#if defined(__UNIX__) + m_video_driver = new wxVideoXANIM(filename); +#elif defined(__WIN32__) + m_video_driver = new wxVideoWindows(filename); +#else + m_video_driver = NULL; + SetError(MMBoard_UnknownFile); +#endif +} + +MMBoardVideoFile::~MMBoardVideoFile() +{ + if (m_video_driver) + delete m_video_driver; +} + +bool MMBoardVideoFile::NeedWindow() +{ + return TRUE; +} + +void MMBoardVideoFile::SetWindow(wxWindow *window) +{ + m_output_window = window; + m_video_driver->AttachOutput(*window); + + wxSize size; + m_video_driver->GetSize(size); + window->SetSize(size); + // BAD BAD + // and we remove + // window->GetParent()->GetSizer()->Fit(window->GetParent()); +} + +void MMBoardVideoFile::Play() +{ + m_video_driver->Play(); +} + +void MMBoardVideoFile::Pause() +{ + m_video_driver->Pause(); +} + +void MMBoardVideoFile::Resume() +{ + m_video_driver->Resume(); +} + +void MMBoardVideoFile::Stop() +{ + m_video_driver->Stop(); +} + +MMBoardTime MMBoardVideoFile::GetPosition() +{ + MMBoardTime btime; + + btime.seconds = btime.minutes = btime.hours = 0; + return btime; +} + +MMBoardTime MMBoardVideoFile::GetLength() +{ + MMBoardTime btime; + int frameTime; + + frameTime = (int)( m_video_driver->GetNbFrames() / m_video_driver->GetFrameRate()); + + btime.seconds = frameTime % 60; + btime.minutes = (frameTime / 60) % 60; + btime.hours = frameTime / 3600; + return btime; +} + +void MMBoardVideoFile::SetPosition(MMBoardTime btime) +{ +} + +bool MMBoardVideoFile::IsStopped() +{ + return m_video_driver->IsStopped(); +} + +bool MMBoardVideoFile::IsPaused() +{ + return m_video_driver->IsPaused(); +} + +wxString MMBoardVideoFile::GetStringType() +{ + return wxString(wxT("Video XANIM")); +} + +wxString MMBoardVideoFile::GetStringInformation() +{ + wxString info; + + info = wxT("Video codec: "); + info += m_video_driver->GetMovieCodec() + "\n"; + info += wxT("Audio codec: "); + info += m_video_driver->GetAudioCodec(); + info += wxString::Format(" Sample rate: %d Channels: %d\n", m_video_driver->GetSampleRate(), + m_video_driver->GetBPS()); + info += wxString::Format(" Frame rate: %.01f", m_video_driver->GetFrameRate()); + return info; +} + +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// MMBoardFile + +MMBoardFile::MMBoardFile() +{ + m_error = 0; +} + +MMBoardFile::~MMBoardFile() +{ +} + +// +// ---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- +// MMBoardManager + +MMBoardFile *MMBoardManager::Open(const wxString& filename) +{ + MMBoardFile *file; + + // Test the audio codec + file = new MMBoardSoundFile(filename); + if (!file->GetError()) + return file; + delete file; + + // Test the video codec + file = new MMBoardVideoFile(filename); + if (!file->GetError()) + return file; + delete file; + + // Arrrgh, we just could not see what is that file ... + return NULL; +} + +DECLARE_APP(MMBoardApp) + +wxSoundStream *MMBoardManager::OpenSoundStream() +{ +#ifdef __UNIX__ + if ((wxGetApp().m_caps & MM_SOUND_ESD) != 0) + return new wxSoundStreamESD(); + + if ((wxGetApp().m_caps & MM_SOUND_OSS) != 0) + return new wxSoundStreamOSS(); +#endif + +#ifdef __WIN32__ + if ((wxGetApp().m_caps & MM_SOUND_WIN) != 0) + return new wxSoundStreamWin(); +#endif + + wxMessageBox("You are trying to open a multimedia but you have not devices", "Error", wxOK | wxICON_ERROR, NULL); + + return NULL; +} + +void MMBoardManager::UnrefSoundStream(wxSoundStream *stream) +{ + delete stream; +} + +// ---------------------------------------------------------------------------- + diff --git a/contrib/samples/mmedia/mmbman.h b/contrib/samples/mmedia/mmbman.h new file mode 100644 index 0000000000..a74f115170 --- /dev/null +++ b/contrib/samples/mmedia/mmbman.h @@ -0,0 +1,84 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mmbman.h +// Purpose: Multimedia Board manager +// Author: Guilhem Lavaux, +// Modified by: +// Created: 13/02/2000 +// RCS-ID: $Id$ +// Copyright: (c) 2000, Guilhem Lavaux +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _MMBMAN_APP_H_ +#define _MMBMAN_APP_H_ + +#ifdef __GNUG__ + #pragma interface "mmbman.cpp" +#endif + +#include "wx/stream.h" +#include "wx/mmedia/sndbase.h" + +// ------------------------------------------------------------------------- +// Base structure definitions +// ------------------------------------------------------------------------- + +typedef struct { + wxUint8 seconds, minutes, hours; +} MMBoardTime; + +// ------------------------------------------------------------------------- +// Constants +// ------------------------------------------------------------------------- + +#define MMBoard_NoError 0 +#define MMBoard_UnknownFile 1 + +// ------------------------------------------------------------------------- +// Interface definition: MMBoardFile +// ------------------------------------------------------------------------- + +class MMBoardFile { + public: + MMBoardFile(); + virtual ~MMBoardFile(); + + virtual bool NeedWindow() = 0; + + virtual void SetWindow(wxWindow *window) = 0; + + virtual void Play() = 0; + virtual void Pause() = 0; + virtual void Resume() = 0; + virtual void Stop() = 0; + + virtual MMBoardTime GetPosition() = 0; + virtual MMBoardTime GetLength() = 0; + virtual void SetPosition(MMBoardTime btime) = 0; + + virtual bool IsStopped() = 0; + virtual bool IsPaused() = 0; + + virtual wxString GetStringType() = 0; + virtual wxString GetStringInformation() = 0; + + void SetError(wxUint8 error) { m_error = error; } + wxUint8 GetError() const { return m_error; } + + protected: + wxUint8 m_error; +}; + +// ------------------------------------------------------------------------- +// Main manager +// ------------------------------------------------------------------------- + +class MMBoardManager { + public: + static MMBoardFile *Open(const wxString& filename); + + static wxSoundStream *OpenSoundStream(); + static void UnrefSoundStream(wxSoundStream *stream); +}; + +#endif diff --git a/contrib/samples/mmedia/mmboard.cpp b/contrib/samples/mmedia/mmboard.cpp new file mode 100644 index 0000000000..61f3777975 --- /dev/null +++ b/contrib/samples/mmedia/mmboard.cpp @@ -0,0 +1,570 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mmboard.cpp +// Purpose: Multimedia Library sample +// Author: Guilhem Lavaux (created from minimal by J. Smart) +// Modified by: +// Created: 13/02/2000 +// RCS-ID: $Id$ +// Copyright: (c) Guilhem Lavaux +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +#ifdef __GNUG__ + #pragma implementation "mmboard.cpp" +#endif + +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers (this file is usually all you +// need because it includes almost all "standard" wxWindows headers +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +// ---------------------------------------------------------------------------- +// ressources +// ---------------------------------------------------------------------------- +// the application icon +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "mondrian.xpm" +#endif + +// include multimedia classes +#include "wx/mmedia/sndbase.h" +#ifdef __WIN32__ + #include "wx/mmedia/sndwin.h" +#endif +#ifdef __UNIX__ + #include "wx/mmedia/sndoss.h" + #include "wx/mmedia/sndesd.h" +#endif + +#include "wx/statline.h" +#include "wx/stattext.h" + +// include personnal classes +#include "mmboard.h" +#include "mmbman.h" + +#include "play.xpm" +#include "stop.xpm" +#include "eject.xpm" +#include "pause.xpm" + +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- + +// Main Multimedia Board frame +class MMBoardFrame : public wxFrame +{ +public: + // ctor(s) + MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size); + // dtor + ~MMBoardFrame(); + + // event handlers + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + void OnOpen(wxCommandEvent& event); + void OnPlay(wxCommandEvent& event); + void OnStop(wxCommandEvent& event); + void OnPause(wxCommandEvent& event); + void OnEject(wxCommandEvent& event); + void OnRefreshInfo(wxEvent& event); + void OnSetPosition(wxCommandEvent& event); + + void OpenVideoWindow(); + void CloseVideoWindow(); + +private: + // any class wishing to process wxWindows events must use this macro + DECLARE_EVENT_TABLE() + +private: + void UpdateMMedInfo(); + void UpdateInfoText(); + + MMBoardFile *m_opened_file; + + wxSlider *m_positionSlider; + wxBitmapButton *m_playButton, *m_pauseButton, *m_stopButton, *m_ejectButton; + wxStaticText *m_fileType, *m_infoText; + wxWindow *m_video_window; + + wxPanel *m_panel; + wxSizer *m_sizer; + + wxTimer *m_refreshTimer; +}; + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// IDs for the controls and the menu commands +enum +{ + // menu items + MMBoard_Quit = 1, + MMBoard_Open, + MMBoard_About, + MMBoard_PositionSlider, + MMBoard_PlayButton, + MMBoard_PauseButton, + MMBoard_ResumeButton, + MMBoard_StopButton, + MMBoard_EjectButton, + MMBoard_RefreshInfo +}; + +// ---------------------------------------------------------------------------- +// event tables and other macros for wxWindows +// ---------------------------------------------------------------------------- + +BEGIN_EVENT_TABLE(MMBoardFrame, wxFrame) + EVT_MENU(MMBoard_Quit, MMBoardFrame::OnQuit) + EVT_MENU(MMBoard_About, MMBoardFrame::OnAbout) + EVT_MENU(MMBoard_Open, MMBoardFrame::OnOpen) + EVT_BUTTON(MMBoard_PlayButton, MMBoardFrame::OnPlay) + EVT_BUTTON(MMBoard_StopButton, MMBoardFrame::OnStop) + EVT_BUTTON(MMBoard_PauseButton, MMBoardFrame::OnPause) + EVT_BUTTON(MMBoard_EjectButton, MMBoardFrame::OnEject) + EVT_SLIDER(MMBoard_PositionSlider, MMBoardFrame::OnSetPosition) + EVT_CUSTOM(wxEVT_TIMER, MMBoard_RefreshInfo, MMBoardFrame::OnRefreshInfo) +END_EVENT_TABLE() + +// --------------------------------------------------------------------------- +// Main board application launcher +// --------------------------------------------------------------------------- + +IMPLEMENT_APP(MMBoardApp) + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// the application class +// ---------------------------------------------------------------------------- + +bool MMBoardApp::OnInit() +{ + // create the main application window + MMBoardFrame *frame = new MMBoardFrame("Multimedia Board", + wxPoint(50, 50), wxSize(450, 340)); + + // and show it (the frames, unlike simple controls, are not shown when + // created initially) + frame->Show(TRUE); + + m_caps = TestMultimediaCaps(); + + if (!m_caps) { + wxMessageBox("Your system has no multimedia capabilities. We are exiting now.", "Major error !", wxOK | wxICON_ERROR, NULL); + return FALSE; + } + + wxString msg; + msg.Printf("Detected : %s%s%s", (m_caps & MM_SOUND_OSS) ? "OSS " : "", + (m_caps & MM_SOUND_ESD) ? "ESD " : "", + (m_caps & MM_SOUND_WIN) ? "WIN" : ""); + + wxMessageBox(msg, "Good !", wxOK | wxICON_INFORMATION, NULL); + + // success: wxApp::OnRun() will be called which will enter the main message + // loop and the application will run. If we returned FALSE here, the + // application would exit immediately. + return TRUE; +} + +wxUint8 MMBoardApp::TestMultimediaCaps() +{ + wxSoundStream *dev; + wxUint8 caps; + + caps = 0; + +#ifdef __UNIX__ + // We now test the ESD support + + dev = new wxSoundStreamESD(); + if (dev->GetError() == wxSOUND_NOERROR) + caps |= MM_SOUND_ESD; + delete dev; + + // We test the OSS (Open Sound System) support. + // WARNING: There is a conflict between ESD and ALSA + + dev = new wxSoundStreamOSS(); + if (dev->GetError() == wxSOUND_NOERROR) + caps |= MM_SOUND_OSS; + delete dev; +#endif + +#ifdef __WIN32__ + // We test the Windows sound support. + + dev = new wxSoundStreamWin(); + if (dev->GetError() == wxSOUND_NOERR) + caps |= MM_SOUND_WIN; + delete dev; +#endif + + return caps; +} + +// ---------------------------------------------------------------------------- +// main frame +// ---------------------------------------------------------------------------- + +// frame constructor +MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ +#ifdef __WXMAC__ + // we need this in order to allow the about menu relocation, since ABOUT is + // not the default id of the about menu + wxApp::s_macAboutMenuItemId = MMBoard_About; +#endif + + // set the frame icon + SetIcon(wxICON(mondrian)); + + // create a menu bar + wxMenu *menuFile = new wxMenu(wxT(""), wxMENU_TEAROFF); + + // the "About" item should be in the help menu + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(MMBoard_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); + + menuFile->Append(MMBoard_Open, wxT("&Open\tAlt-O"), wxT("Open file")); + menuFile->AppendSeparator(); + menuFile->Append(MMBoard_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar(); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); + + // ... and attach this menu bar to the frame + SetMenuBar(menuBar); + +#if wxUSE_STATUSBAR + // create a status bar just for fun (by default with 1 pane only) + CreateStatusBar(3); + SetStatusText(wxT("Welcome to wxWindows!")); +#endif // wxUSE_STATUSBAR + + // Misc variables + m_opened_file = NULL; + + m_panel = new wxPanel(this, -1); + + // Initialize main slider + m_positionSlider = new wxSlider( m_panel, MMBoard_PositionSlider, 0, 0, 60, + wxDefaultPosition, wxSize(300, -1), + wxSL_HORIZONTAL | wxSL_AUTOTICKS); + m_positionSlider->SetPageSize(60); // 60 secs + m_positionSlider->Enable(FALSE); + + // Initialize info panel + wxPanel *infoPanel = new wxPanel( m_panel, -1); + infoPanel->SetBackgroundColour(*wxBLACK); + infoPanel->SetForegroundColour(*wxWHITE); + + wxBoxSizer *infoSizer = new wxBoxSizer(wxVERTICAL); + + m_fileType = new wxStaticText(infoPanel, -1, wxT("")); + wxStaticLine *line = new wxStaticLine(infoPanel, -1); + m_infoText = new wxStaticText(infoPanel, -1, ""); + + UpdateInfoText(); + + infoSizer->Add(m_fileType, 0, wxGROW | wxALL, 1); + infoSizer->Add(line, 0, wxGROW | wxCENTRE, 20); + infoSizer->Add(m_infoText, 0, wxGROW | wxALL, 1); + + infoPanel->SetSizer(infoSizer); + infoPanel->SetAutoLayout(TRUE); + + // Bitmap button panel + wxBoxSizer *buttonSizer = new wxBoxSizer(wxHORIZONTAL); + + wxBitmap *play_bmp = new wxBitmap(play_back_xpm); + wxBitmap *stop_bmp = new wxBitmap(stop_back_xpm); + wxBitmap *eject_bmp = new wxBitmap(eject_xpm); + wxBitmap *pause_bmp = new wxBitmap(pause_xpm); + + m_playButton = new wxBitmapButton(m_panel, MMBoard_PlayButton, *play_bmp); + m_playButton->Enable(FALSE); + m_pauseButton = new wxBitmapButton(m_panel, MMBoard_PauseButton, *pause_bmp); + m_pauseButton->Enable(FALSE); + m_stopButton = new wxBitmapButton(m_panel, MMBoard_StopButton, *stop_bmp); + m_stopButton->Enable(FALSE); + m_ejectButton = new wxBitmapButton(m_panel, MMBoard_EjectButton, *eject_bmp); + m_ejectButton->Enable(FALSE); + + buttonSizer->Add(m_playButton, 0, wxALL, 2); + buttonSizer->Add(m_pauseButton, 0, wxALL, 2); + buttonSizer->Add(m_stopButton, 0, wxALL, 2); + buttonSizer->Add(m_ejectButton, 0, wxALL, 2); + + // Top sizer + m_sizer = new wxBoxSizer(wxVERTICAL); + m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(m_positionSlider, 0, wxCENTRE | wxGROW | wxALL, 2); + m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(buttonSizer, 0, wxALL, 0); + m_sizer->Add(new wxStaticLine(m_panel, -1), 0, wxGROW | wxCENTRE, 0); + m_sizer->Add(infoPanel, 1, wxCENTRE | wxGROW, 0); + + m_panel->SetSizer(m_sizer); + m_panel->SetAutoLayout(TRUE); + m_sizer->Fit(this); + m_sizer->SetSizeHints(this); + + // Timer + m_refreshTimer = new wxTimer(this, MMBoard_RefreshInfo); + + // Video window + m_video_window = NULL; + + // Multimedia file + m_opened_file = NULL; +} + +MMBoardFrame::~MMBoardFrame() +{ + if (m_opened_file) + delete m_opened_file; + + delete m_refreshTimer; +} + +void MMBoardFrame::OpenVideoWindow() +{ + if (m_video_window) + return; + + m_video_window = new wxWindow(m_panel, -1, wxDefaultPosition, wxSize(200, 200)); + m_video_window->SetBackgroundColour(*wxBLACK); + m_sizer->Prepend(m_video_window, 2, wxGROW | wxSHRINK | wxCENTRE, 1); + + m_sizer->Fit(this); +} + +void MMBoardFrame::CloseVideoWindow() +{ + if (!m_video_window) + return; + + m_sizer->Remove(m_video_window); + delete m_video_window; + m_video_window = NULL; + + m_sizer->Fit(this); +} + +// event handlers + +void MMBoardFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) +{ + // TRUE is to force the frame to close + Close(TRUE); +} + +void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) +{ + wxString msg; + msg.Printf( wxT("wxWindows Multimedia board v1.0a, wxMMedia v2.0a:\n") + wxT("an example of the capabilities of the wxWindows multimedia classes.\n") + wxT("Copyright 1999, 2000, Guilhem Lavaux.\n")); + + wxMessageBox(msg, "About MMBoard", wxOK | wxICON_INFORMATION, this); +} + +void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) +{ + wxString selected_file; + + if (m_opened_file) { + if (!m_opened_file->IsStopped()) { + wxCommandEvent event2; + OnStop(event2); + } + delete m_opened_file; + } + + // select a file to be opened + selected_file = wxLoadFileSelector("multimedia", "*", NULL, this); + if (selected_file.IsNull()) + return; + + m_opened_file = MMBoardManager::Open(selected_file); + + // Change the range values of the slider. + MMBoardTime length; + + length = m_opened_file->GetLength(); + m_positionSlider->SetRange(0, length.hours * 3600 + length.minutes * 60 + length.seconds); + + // Update misc info + UpdateMMedInfo(); + + SetStatusText(selected_file, 2); + + // Update info text + UpdateInfoText(); + + // Enable a few buttons + m_playButton->Enable(TRUE); + m_ejectButton->Enable(TRUE); + m_positionSlider->Enable(TRUE); + + if (m_opened_file->NeedWindow()) { + OpenVideoWindow(); + m_opened_file->SetWindow(m_video_window); + } else + CloseVideoWindow(); +} + +void MMBoardFrame::UpdateInfoText() +{ + wxString infotext1, infotext2; + + if (m_opened_file) { + infotext1 = wxT("File type:\n\t"); + infotext1 += m_opened_file->GetStringType() + wxT("\n"); + + infotext2 = wxT("File informations:\n\n"); + infotext2 += m_opened_file->GetStringInformation(); + } else { + infotext1 = wxT("File type: \n\tNo file opened"); + infotext2 = wxT("File informations:\nNo information\n\n\n\n\n"); + } + + m_fileType->SetLabel(infotext1); + m_infoText->SetLabel(infotext2); +} + +void MMBoardFrame::UpdateMMedInfo() +{ + wxString temp_string; + MMBoardTime current, length; + + if (m_opened_file) { + current = m_opened_file->GetPosition(); + length = m_opened_file->GetLength(); + } else { + current.hours = current.minutes = current.seconds = 0; + length = current; + } + + // We refresh the status bar + temp_string.Printf(wxT("%02d:%02d / %02d:%02d"), current.hours * 60 + current.minutes, + current.seconds, length.hours * 60 + length.minutes, length.seconds); + SetStatusText(temp_string, 1); + + // We set the slider position + m_positionSlider->SetValue(current.hours * 3600 + current.minutes * 60 + current.seconds); +} + +// ---------------------------------------------------------------------------- +// Playing management, refreshers, ... + +void MMBoardFrame::OnRefreshInfo(wxEvent& WXUNUSED(event)) +{ + UpdateMMedInfo(); + + if (m_opened_file->IsStopped()) { + m_refreshTimer->Stop(); + m_playButton->Enable(TRUE); + m_stopButton->Enable(FALSE); + m_pauseButton->Enable(FALSE); + } +} + +void MMBoardFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) +{ + m_stopButton->Enable(TRUE); + m_pauseButton->Enable(TRUE); + m_playButton->Enable(FALSE); + + if (m_opened_file->IsPaused()) { + m_opened_file->Resume(); + return; + } + + m_refreshTimer->Start(1000, FALSE); + + m_opened_file->Play(); + + m_stopButton->Enable(TRUE); + m_pauseButton->Enable(TRUE); + m_playButton->Enable(FALSE); +} + +void MMBoardFrame::OnStop(wxCommandEvent& WXUNUSED(event)) +{ + m_opened_file->Stop(); + m_refreshTimer->Stop(); + + m_stopButton->Enable(FALSE); + m_playButton->Enable(TRUE); + + UpdateMMedInfo(); +} + +void MMBoardFrame::OnPause(wxCommandEvent& WXUNUSED(event)) +{ + m_opened_file->Pause(); + + m_playButton->Enable(TRUE); + m_pauseButton->Enable(FALSE); +} + +void MMBoardFrame::OnEject(wxCommandEvent& WXUNUSED(event)) +{ + m_opened_file->Stop(); + + delete m_opened_file; + m_opened_file = NULL; + + m_playButton->Enable(FALSE); + m_pauseButton->Enable(FALSE); + m_stopButton->Enable(FALSE); + m_ejectButton->Enable(FALSE); + m_positionSlider->Enable(FALSE); + + UpdateInfoText(); + UpdateMMedInfo(); +} + +void MMBoardFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event)) +{ + wxUint32 itime; + MMBoardTime btime; + + itime = m_positionSlider->GetValue(); + btime.seconds = itime % 60; + btime.minutes = (itime / 60) % 60; + btime.hours = itime / 3600; + m_opened_file->SetPosition(btime); + + UpdateMMedInfo(); +} + diff --git a/contrib/samples/mmedia/mmboard.def b/contrib/samples/mmedia/mmboard.def new file mode 100644 index 0000000000..59f0db711d --- /dev/null +++ b/contrib/samples/mmedia/mmboard.def @@ -0,0 +1,7 @@ +NAME Minimal +DESCRIPTION 'Minimal wxWindows application' +EXETYPE WINDOWS +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 4048 +STACKSIZE 16000 diff --git a/contrib/samples/mmedia/mmboard.h b/contrib/samples/mmedia/mmboard.h new file mode 100644 index 0000000000..df2590bbb1 --- /dev/null +++ b/contrib/samples/mmedia/mmboard.h @@ -0,0 +1,57 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: mmboard.h +// Purpose: Multimedia Board header +// Author: Guilhem Lavaux, +// Modified by: +// Created: 13/02/2000 +// RCS-ID: $Id$ +// Copyright: (c) 2000, Guilhem Lavaux +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _MMBOARD_APP_H_ +#define _MMBOARD_APP_H_ + +#ifdef __GNUG__ + #pragma interface "mmboard.cpp" +#endif + +// for compilers that support precompilation, includes "wx/wx.h" +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// for all others, include the necessary headers +#ifndef WX_PRECOMP + #include "wx/wx.h" +#endif + +// -------------------------------------------------------------------------- +// constants +// -------------------------------------------------------------------------- + +#define MM_SOUND_OSS 0x01 +#define MM_SOUND_ESD 0x02 +#define MM_SOUND_WIN 0x04 + +// -------------------------------------------------------------------------- +// Class definitions +// -------------------------------------------------------------------------- + +// Define a new application type, each program should derive a class from wxApp +class MMBoardApp : public wxApp +{ +public: + wxUint8 m_caps; + + // override base class virtuals + // ---------------------------- + + virtual bool OnInit(); + + wxUint8 TestMultimediaCaps(); +}; + +#endif diff --git a/contrib/samples/mmedia/mmboard.rc b/contrib/samples/mmedia/mmboard.rc new file mode 100644 index 0000000000..3bf71d6da0 --- /dev/null +++ b/contrib/samples/mmedia/mmboard.rc @@ -0,0 +1,6 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/contrib/samples/mmedia/mmboard.rc0 b/contrib/samples/mmedia/mmboard.rc0 new file mode 100644 index 0000000000..96d3b9cc7b --- /dev/null +++ b/contrib/samples/mmedia/mmboard.rc0 @@ -0,0 +1,6 @@ +ICON 1 PRELOAD "mondros2.ico" +#include "H:\DEV\WX2\wxWindows\include\wx\os2\wx.rc" + +#define MINIMAL_QUIT 1 +#define MINIMAL_ABOUT 102 + diff --git a/contrib/samples/mmedia/mondrian.ico b/contrib/samples/mmedia/mondrian.ico new file mode 100644 index 0000000000000000000000000000000000000000..2310c5d275a87af295d5ea8dc79ea417a5e74c53 GIT binary patch literal 766 zcmZQzU<5)11px*Sc)`TLAO@s0fLH;D9e|jTfdxnc0Z total_time.track) { + wxCDtime dummy_time = {0, 0, 0, 0}; + return dummy_time; + } + return tracks_time[track]; +} + +wxCDtime wxCDAudio::CDtoc::GetTrackPos(wxUint8 track) const +{ + if (track > total_time.track) { + wxCDtime dummy_time = {0, 0, 0, 0}; + return dummy_time; + } + return tracks_pos[track]; +} + +bool wxCDAudio::Play(const wxCDtime& beg_play) +{ + return Play(beg_play, GetToc().GetTotalTime()); +} + +bool wxCDAudio::Play(wxUint8 beg_track, wxUint8 end_track) +{ + wxCDtime beg_play = GetToc().GetTrackPos(beg_track); + wxCDtime end_play; + + if (end_track) + end_play = GetToc().GetTrackPos(end_track); + else + end_play = GetToc().GetTotalTime(); + return Play(beg_play, end_play); +} diff --git a/contrib/src/mmedia/cdunix.cpp b/contrib/src/mmedia/cdunix.cpp new file mode 100644 index 0000000000..5a8f42de61 --- /dev/null +++ b/contrib/src/mmedia/cdunix.cpp @@ -0,0 +1,218 @@ +//////////////////////////////////////////////////////////////////////////////// +// Name: cdlinux.cpp +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// CVS Id: $Id$ +// License: wxWindows license +//////////////////////////////////////////////////////////////////////////////// +#ifdef __GNUG__ +#pragma implementation "cdunix.h" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// --------------------------------------------------------------------------- +// MMedia headers +// --------------------------------------------------------------------------- + +#include "wx/mmedia/cdbase.h" +#include "wx/mmedia/cdunix.h" + +// --------------------------------------------------------------------------- +// System headers +// --------------------------------------------------------------------------- + +#include +#include +#include +#include +#include + +#ifdef __linux__ +#include +#else +// For Solaris +#include +#endif + +// --------------------------------------------------------------------------- +// Implementation +// --------------------------------------------------------------------------- + +IMPLEMENT_DYNAMIC_CLASS(wxCDAudioLinux, wxCDAudio) + +wxCDAudioLinux::wxCDAudioLinux() + : wxCDAudio(), m_fd(-1) +{ + OpenDevice("/dev/cdrom"); +} + +wxCDAudioLinux::wxCDAudioLinux(const wxString& dev_name) + : wxCDAudio(), m_fd(-1) +{ + OpenDevice(dev_name); +} + +wxCDAudioLinux::~wxCDAudioLinux() +{ + if (m_fd != -1) { + close(m_fd); + wxDELETE(m_trksize); + wxDELETE(m_trkpos); + } +} + +void wxCDAudioLinux::OpenDevice(const wxString& dev_name) +{ + struct cdrom_tocentry entry, old_entry; + struct cdrom_tochdr diskinf; + struct cdrom_msf0 *msf = &entry.cdte_addr.msf, + *old_msf = &old_entry.cdte_addr.msf; + wxCDtime *the_track; + wxCDtime tot_tm; + wxUint8 nb_tracks, i; + int hour, minute, second; + + if (m_fd != -1) + return; + + m_fd = open(dev_name.mb_str(), O_RDONLY); + if (m_fd == -1) { + m_toc = NULL; + return; + } + m_status = STOPPED; + + ioctl(m_fd, CDROMREADTOCHDR, &diskinf); + + nb_tracks = diskinf.cdth_trk1-diskinf.cdth_trk0+1; + m_trksize = new wxCDtime[nb_tracks+1]; + m_trkpos = new wxCDtime[nb_tracks+1]; + + old_msf->minute = 0; + old_msf->second = 0; + for (i=diskinf.cdth_trk0;i<=diskinf.cdth_trk1;i++) { + entry.cdte_track = i; + entry.cdte_format = CDROM_MSF; + ioctl(m_fd, CDROMREADTOCENTRY, &entry); + + minute = msf->minute - old_msf->minute; + second = msf->second - old_msf->second; + if (second < 0) { + minute--; + second += 60; + } + + hour = minute / 60; + minute %= 60; + + the_track = &m_trksize[i-diskinf.cdth_trk0]; + the_track->track = i-diskinf.cdth_trk0; + the_track->hour = hour; + the_track->min = minute; + the_track->sec = second; + + the_track = &m_trkpos[i-diskinf.cdth_trk0]; + the_track->track = i-diskinf.cdth_trk0; + the_track->hour = old_msf->minute / 60; + the_track->min = old_msf->minute % 60; + the_track->sec = old_msf->second; + old_entry = entry; + } + + entry.cdte_track = CDROM_LEADOUT; + entry.cdte_format = CDROM_MSF; + ioctl(m_fd, CDROMREADTOCENTRY, &entry); + + tot_tm.track = nb_tracks; + tot_tm.hour = msf->minute / 60; + tot_tm.min = msf->minute % 60; + tot_tm.sec = msf->second % 60; + + m_trksize[nb_tracks].track = nb_tracks; + minute = msf->minute - old_msf->minute; + second = msf->second - old_msf->second; + if (second < 0) { + minute--; + second += 60; + } + hour = minute / 60; + minute %= 60; + + m_trksize[nb_tracks].hour = hour; + m_trksize[nb_tracks].min = minute; + m_trksize[nb_tracks].sec = second; + m_trkpos[nb_tracks].track = nb_tracks; + m_trkpos[nb_tracks].hour = old_msf->minute / 60; + m_trkpos[nb_tracks].min = old_msf->minute % 60; + m_trkpos[nb_tracks].sec = old_msf->second; + + m_toc = new CDtoc(tot_tm, m_trksize, m_trkpos); +} + +bool wxCDAudioLinux::Play(const wxCDtime& beg_time, const wxCDtime& end_time) +{ + struct cdrom_msf track_msf; + + track_msf.cdmsf_min0 = beg_time.hour * 60 + beg_time.min; + track_msf.cdmsf_sec0 = beg_time.sec; + track_msf.cdmsf_frame0 = 0; + track_msf.cdmsf_min1 = end_time.hour * 60 + end_time.min; + track_msf.cdmsf_sec1 = end_time.sec; + track_msf.cdmsf_frame1 = 0; + return (ioctl(m_fd, CDROMPLAYMSF, &track_msf) != -1); +} + +bool wxCDAudioLinux::Pause() +{ + return (ioctl(m_fd, CDROMPAUSE, 0) != -1); +} + +bool wxCDAudioLinux::Resume() +{ + return (ioctl(m_fd, CDROMRESUME, 0) != -1); +} + +wxCDAudio::CDstatus wxCDAudioLinux::GetStatus() +{ + struct cdrom_subchnl subchnl; + ioctl(m_fd, CDROMSUBCHNL, &subchnl); + switch (subchnl.cdsc_audiostatus) { + case CDROM_AUDIO_PLAY: return PLAYING; + case CDROM_AUDIO_PAUSED: return PAUSED; + case CDROM_AUDIO_COMPLETED: return STOPPED; + } + + return STOPPED; +} + +wxCDtime wxCDAudioLinux::GetTime() +{ + wxCDtime cdtime; + struct cdrom_subchnl subchnl; + + ioctl(m_fd, CDROMSUBCHNL, &subchnl); + cdtime.track = subchnl.cdsc_trk; + cdtime.min = subchnl.cdsc_reladdr.msf.minute; + cdtime.hour = cdtime.min / 60; + cdtime.min %= 60; + cdtime.sec = subchnl.cdsc_reladdr.msf.second; + + return cdtime; +} + +wxCDAudio::CDtoc& wxCDAudioLinux::GetToc() +{ + return *m_toc; +} diff --git a/contrib/src/mmedia/cdwin.cpp b/contrib/src/mmedia/cdwin.cpp new file mode 100644 index 0000000000..f99b691a83 --- /dev/null +++ b/contrib/src/mmedia/cdwin.cpp @@ -0,0 +1,225 @@ +//////////////////////////////////////////////////////////////////////////////// +// Name: cdwin.cpp +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// License: wxWindows license +//////////////////////////////////////////////////////////////////////////////// +#ifdef __GNUG__ +#pragma implementation "cdwin.h" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifdef __WINDOWS__ + +// --------------------------------------------------------------------------- +// System headers +// --------------------------------------------------------------------------- + +#include +#include +#include + +// --------------------------------------------------------------------------- +// MMedia headers +// --------------------------------------------------------------------------- + +#define WXMMEDIA_INTERNAL +#include "wx/mmedia/cdbase.h" +#include "wx/mmedia/cdwin.h" + +// --------------------------------------------------------------------------- +// Implementation +// --------------------------------------------------------------------------- + +wxCDAudioWin::wxCDAudioWin(void) + : wxCDAudio(), m_trksize(NULL), m_trkpos(NULL), m_ok(TRUE), m_toc(NULL) +{ + MCI_OPEN_PARMS open_struct; + MCI_SET_PARMS set_struct; + DWORD ret; + + m_internal = new CDAW_Internal; + open_struct.lpstrDeviceType = "cdaudio"; + ret = mciSendCommand(NULL, MCI_OPEN, MCI_OPEN_TYPE, + (DWORD)&open_struct); + if (ret) { + m_ok = FALSE; + return; + } + m_internal->dev_id = open_struct.wDeviceID; + + set_struct.dwTimeFormat = MCI_FORMAT_MSF; + ret = mciSendCommand(m_internal->dev_id, MCI_SET, MCI_SET_TIME_FORMAT, + (DWORD)(LPVOID)&set_struct); + + PrepareToc(); + + set_struct.dwTimeFormat = MCI_FORMAT_TMSF; + ret = mciSendCommand(m_internal->dev_id, MCI_SET, MCI_SET_TIME_FORMAT, + (DWORD)(LPVOID)&set_struct); +} + +wxCDAudioWin::~wxCDAudioWin(void) +{ + if (m_ok) { + mciSendCommand(m_internal->dev_id, MCI_CLOSE, 0, NULL); + delete m_toc; + delete[] m_trksize; + delete[] m_trkpos; + } + delete m_internal; +} + +void wxCDAudioWin::PrepareToc(void) +{ + MCI_STATUS_PARMS status_struct; + wxUint16 i, nb_m_trksize; + wxCDtime total_time, *trk; + DWORD ret, tmem; + + if (!m_ok) + return; + + status_struct.dwItem = MCI_STATUS_NUMBER_OF_TRACKS; + ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + (DWORD)&status_struct); + nb_m_trksize = status_struct.dwReturn; + + m_trksize = new wxCDtime[nb_m_trksize+1]; + m_trkpos = new wxCDtime[nb_m_trksize+1]; + + status_struct.dwItem = MCI_STATUS_LENGTH; + ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + (DWORD)&status_struct); + total_time.track = nb_m_trksize; + tmem = status_struct.dwReturn; + total_time.min = MCI_MSF_MINUTE(tmem); + total_time.sec = MCI_MSF_SECOND(tmem); + total_time.hour = total_time.min / 60; + total_time.min %= 60; + + for (i=1;i<=nb_m_trksize;i++) { + status_struct.dwItem = MCI_STATUS_POSITION; + status_struct.dwTrack = i; + ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, + MCI_STATUS_ITEM | MCI_TRACK, + (DWORD)(LPVOID)&status_struct); + tmem = status_struct.dwReturn; + + trk = &m_trkpos[i]; + trk->track = i; + trk->min = MCI_MSF_MINUTE(tmem); + trk->sec = MCI_MSF_SECOND(tmem); + trk->hour = trk->min / 60; + trk->min %= 60; + + status_struct.dwItem = MCI_STATUS_LENGTH; + status_struct.dwTrack = i; + ret = mciSendCommand(m_internal->dev_id, MCI_STATUS, + MCI_STATUS_ITEM | MCI_TRACK, + (DWORD)(LPVOID)&status_struct); + tmem = status_struct.dwReturn; + + trk = &m_trksize[i]; + trk->track = i; + trk->min = MCI_MSF_MINUTE(tmem); + trk->sec = MCI_MSF_SECOND(tmem); + trk->hour = trk->min / 60; + trk->min %= 60; + } + + m_toc = new CDtoc(total_time, m_trksize, m_trkpos); +} + +bool wxCDAudioWin::Play(const wxCDtime& beg_time, const wxCDtime& end_time) +{ + DWORD tmsf; + MCI_PLAY_PARMS play_struct; + + if (!m_ok) + return FALSE; + + tmsf = MCI_MAKE_TMSF(beg_time.track, beg_time.min, + beg_time.sec, 0); + play_struct.dwFrom = tmsf; + tmsf = MCI_MAKE_TMSF(end_time.track, end_time.min, + end_time.sec, 0); + play_struct.dwTo = tmsf; + + mciSendCommand(m_internal->dev_id, MCI_PLAY, 0, (DWORD)&play_struct); + return TRUE; +} + +bool wxCDAudioWin::Pause(void) +{ + if (!m_ok) + return FALSE; + + return (mciSendCommand(m_internal->dev_id, MCI_PAUSE, 0, 0) == 0); +} + +bool wxCDAudioWin::Resume(void) +{ + if (!m_ok) + return FALSE; + + return (mciSendCommand(m_internal->dev_id, MCI_RESUME, 0, 0) == 0); +} + +wxCDAudio::CDstatus wxCDAudioWin::GetStatus(void) +{ + MCI_STATUS_PARMS status_struct; + + if (!m_ok) + return STOPPED; + + status_struct.dwItem = MCI_STATUS_MODE; + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + (DWORD)&status_struct); + switch (status_struct.dwReturn) { + case MCI_MODE_PAUSE: + return PAUSED; + case MCI_MODE_PLAY: + return PLAYING; + } + return STOPPED; +} + +wxCDtime wxCDAudioWin::GetTime(void) +{ + MCI_STATUS_PARMS status_struct; + wxCDtime cd_time = {-1, -1, -1, -1}; + + if (!m_ok) + return cd_time; + + status_struct.dwItem = MCI_STATUS_TIME_FORMAT; + mciSendCommand(m_internal->dev_id, MCI_STATUS, MCI_STATUS_ITEM, + (DWORD)&status_struct); + cd_time.track = MCI_TMSF_TRACK(status_struct.dwReturn); + cd_time.min = MCI_TMSF_MINUTE(status_struct.dwReturn); + cd_time.sec = MCI_TMSF_SECOND(status_struct.dwReturn); + cd_time.hour = cd_time.min / 60; + cd_time.min %= 60; + return cd_time; +} + +const wxCDAudio::CDtoc& wxCDAudioWin::GetToc(void) +{ + return *m_toc; +} + +#endif + // __WINDOWS__ diff --git a/contrib/src/mmedia/g711.cpp b/contrib/src/mmedia/g711.cpp new file mode 100644 index 0000000000..99fb3cafc0 --- /dev/null +++ b/contrib/src/mmedia/g711.cpp @@ -0,0 +1,285 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +#include + +/* + * g711.c + * + * u-law, A-law and linear PCM conversions. + */ +#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define QUANT_MASK (0xf) /* Quantization field mask. */ +#define NSEGS (8) /* Number of A-law segments. */ +#define SEG_SHIFT (4) /* Left shift for segment number. */ +#define SEG_MASK (0x70) /* Segment field mask. */ + +static short seg_end[8] = {0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF}; + +/* copy from CCITT G.711 specifications */ +unsigned char _u2a[128] = { /* u- to A-law conversions */ + 1, 1, 2, 2, 3, 3, 4, 4, + 5, 5, 6, 6, 7, 7, 8, 8, + 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, + 25, 27, 29, 31, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, + 46, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, + 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, + 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128}; + +unsigned char _a2u[128] = { /* A- to u-law conversions */ + 1, 3, 5, 7, 9, 11, 13, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 32, 33, 33, 34, 34, 35, 35, + 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 48, 49, 49, + 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 64, + 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 79, + 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127}; + +static int +search( + int val, + short *table, + int size) +{ + int i; + + for (i = 0; i < size; i++) { + if (val <= *table++) + return (i); + } + return (size); +} + +/* + * linear2alaw() - Convert a 16-bit linear PCM value to 8-bit A-law + * + * linear2alaw() accepts an 16-bit integer and encodes it as A-law data. + * + * Linear Input Code Compressed Code + * ------------------------ --------------- + * 0000000wxyza 000wxyz + * 0000001wxyza 001wxyz + * 000001wxyzab 010wxyz + * 00001wxyzabc 011wxyz + * 0001wxyzabcd 100wxyz + * 001wxyzabcde 101wxyz + * 01wxyzabcdef 110wxyz + * 1wxyzabcdefg 111wxyz + * + * For further information see John C. Bellamy's Digital Telephony, 1982, + * John Wiley & Sons, pps 98-111 and 472-476. + */ +unsigned char +linear2alaw( + int pcm_val) /* 2's complement (16-bit range) */ +{ + int mask; + int seg; + unsigned char aval; + + if (pcm_val >= 0) { + mask = 0xD5; /* sign (7th) bit = 1 */ + } else { + mask = 0x55; /* sign bit = 0 */ + pcm_val = -pcm_val - 8; + } + + /* Convert the scaled magnitude to segment number. */ + seg = search(pcm_val, seg_end, 8); + + /* Combine the sign, segment, and quantization bits. */ + + if (seg >= 8) /* out of range, return maximum value. */ + return (0x7F ^ mask); + else { + aval = seg << SEG_SHIFT; + if (seg < 2) + aval |= (pcm_val >> 4) & QUANT_MASK; + else + aval |= (pcm_val >> (seg + 3)) & QUANT_MASK; + return (aval ^ mask); + } +} + +/* + * alaw2linear() - Convert an A-law value to 16-bit linear PCM + * + */ +int +alaw2linear( + unsigned char a_val) +{ + int t; + int seg; + + a_val ^= 0x55; + + t = (a_val & QUANT_MASK) << 4; + seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; + switch (seg) { + case 0: + t += 8; + break; + case 1: + t += 0x108; + break; + default: + t += 0x108; + t <<= seg - 1; + } + return ((a_val & SIGN_BIT) ? t : -t); +} + +#define BIAS (0x84) /* Bias for linear code. */ + +/* + * linear2ulaw() - Convert a linear PCM value to u-law + * + * In order to simplify the encoding process, the original linear magnitude + * is biased by adding 33 which shifts the encoding range from (0 - 8158) to + * (33 - 8191). The result can be seen in the following encoding table: + * + * Biased Linear Input Code Compressed Code + * ------------------------ --------------- + * 00000001wxyza 000wxyz + * 0000001wxyzab 001wxyz + * 000001wxyzabc 010wxyz + * 00001wxyzabcd 011wxyz + * 0001wxyzabcde 100wxyz + * 001wxyzabcdef 101wxyz + * 01wxyzabcdefg 110wxyz + * 1wxyzabcdefgh 111wxyz + * + * Each biased linear code has a leading 1 which identifies the segment + * number. The value of the segment number is equal to 7 minus the number + * of leading 0's. The quantization interval is directly available as the + * four bits wxyz. * The trailing bits (a - h) are ignored. + * + * Ordinarily the complement of the resulting code word is used for + * transmission, and so the code word is complemented before it is returned. + * + * For further information see John C. Bellamy's Digital Telephony, 1982, + * John Wiley & Sons, pps 98-111 and 472-476. + */ +unsigned char +linear2ulaw( + int pcm_val) /* 2's complement (16-bit range) */ +{ + int mask; + int seg; + unsigned char uval; + + /* Get the sign and the magnitude of the value. */ + if (pcm_val < 0) { + pcm_val = BIAS - pcm_val; + mask = 0x7F; + } else { + pcm_val += BIAS; + mask = 0xFF; + } + + /* Convert the scaled magnitude to segment number. */ + seg = search(pcm_val, seg_end, 8); + + /* + * Combine the sign, segment, quantization bits; + * and complement the code word. + */ + if (seg >= 8) /* out of range, return maximum value. */ + return (0x7F ^ mask); + else { + uval = (seg << 4) | ((pcm_val >> (seg + 3)) & 0xF); + return (uval ^ mask); + } + +} + +/* + * ulaw2linear() - Convert a u-law value to 16-bit linear PCM + * + * First, a biased linear code is derived from the code word. An unbiased + * output can then be obtained by subtracting 33 from the biased code. + * + * Note that this function expects to be passed the complement of the + * original code word. This is in keeping with ISDN conventions. + */ +int +ulaw2linear( + unsigned char u_val) +{ + int t; + + /* Complement to obtain normal u-law value. */ + u_val = ~u_val; + + /* + * Extract and bias the quantization bits. Then + * shift up by the segment number and subtract out the bias. + */ + t = ((u_val & QUANT_MASK) << 3) + BIAS; + t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; + + return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS)); +} + +/* A-law to u-law conversion */ +unsigned char +alaw2ulaw( + unsigned char aval) +{ + aval &= 0xff; + return ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) : + (0x7F ^ _a2u[aval ^ 0x55])); +} + +/* u-law to A-law conversion */ +unsigned char +ulaw2alaw( + unsigned char uval) +{ + uval &= 0xff; + return ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) : + (0x55 ^ (_u2a[0x7F ^ uval] - 1))); +} diff --git a/contrib/src/mmedia/g721.cpp b/contrib/src/mmedia/g721.cpp new file mode 100644 index 0000000000..60b8f1c5ff --- /dev/null +++ b/contrib/src/mmedia/g721.cpp @@ -0,0 +1,175 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +#include + +/* + * g721.c + * + * Description: + * + * g721_encoder(), g721_decoder() + * + * These routines comprise an implementation of the CCITT G.721 ADPCM + * coding algorithm. Essentially, this implementation is identical to + * the bit level description except for a few deviations which + * take advantage of work station attributes, such as hardware 2's + * complement arithmetic and large memory. Specifically, certain time + * consuming operations such as multiplications are replaced + * with lookup tables and software 2's complement operations are + * replaced with hardware 2's complement. + * + * The deviation from the bit level specification (lookup tables) + * preserves the bit level performance specifications. + * + * As outlined in the G.721 Recommendation, the algorithm is broken + * down into modules. Each section of code below is preceded by + * the name of the module which it is implementing. + * + */ +#include "wx/mmedia/internal/g72x.h" + +static short qtab_721[7] = {-124, 80, 178, 246, 300, 349, 400}; +/* + * Maps G.721 code word to reconstructed scale factor normalized log + * magnitude values. + */ +static short _dqlntab[16] = {-2048, 4, 135, 213, 273, 323, 373, 425, + 425, 373, 323, 273, 213, 135, 4, -2048}; + +/* Maps G.721 code word to log of scale factor multiplier. */ +static short _witab[16] = {-12, 18, 41, 64, 112, 198, 355, 1122, + 1122, 355, 198, 112, 64, 41, 18, -12}; +/* + * Maps G.721 code words to a set of values whose long and short + * term averages are computed and then compared to give an indication + * how stationary (steady state) the signal is. + */ +static short _fitab[16] = {0, 0, 0, 0x200, 0x200, 0x200, 0x600, 0xE00, + 0xE00, 0x600, 0x200, 0x200, 0x200, 0, 0, 0}; + +/* + * g721_encoder() + * + * Encodes the input vale of linear PCM, A-law or u-law data sl and returns + * the resulting code. -1 is returned for unknown input coding value. + */ +int +g721_encoder( + int sl, + int in_coding, + struct g72x_state *state_ptr) +{ + short sezi, se, sez; /* ACCUM */ + short d; /* SUBTA */ + short sr; /* ADDB */ + short y; /* MIX */ + short dqsez; /* ADDC */ + short dq, i; + + switch (in_coding) { /* linearize input sample to 14-bit PCM */ + case AUDIO_ENCODING_ALAW: + sl = alaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_ULAW: + sl = ulaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_LINEAR: + sl = ((short)sl) >> 2; /* 14-bit dynamic range */ + break; + default: + return (-1); + } + + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + se = (sezi + predictor_pole(state_ptr)) >> 1; /* estimated signal */ + + d = sl - se; /* estimation difference */ + + /* quantize the prediction difference */ + y = step_size(state_ptr); /* quantizer step size */ + i = quantize(d, y, qtab_721, 7); /* i = ADPCM code */ + + dq = reconstruct(i & 8, _dqlntab[i], y); /* quantized est diff */ + + sr = (dq < 0) ? se - (dq & 0x3FFF) : se + dq; /* reconst. signal */ + + dqsez = sr + sez - se; /* pole prediction diff. */ + + update(4, y, _witab[i] << 5, _fitab[i], dq, sr, dqsez, state_ptr); + + return (i); +} + +/* + * g721_decoder() + * + * Description: + * + * Decodes a 4-bit code of G.721 encoded data of i and + * returns the resulting linear PCM, A-law or u-law value. + * return -1 for unknown out_coding value. + */ +int +g721_decoder( + int i, + int out_coding, + struct g72x_state *state_ptr) +{ + short sezi, sei, sez, se; /* ACCUM */ + short y; /* MIX */ + short sr; /* ADDB */ + short dq; + short dqsez; + + i &= 0x0f; /* mask to get proper bits */ + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + sei = sezi + predictor_pole(state_ptr); + se = sei >> 1; /* se = estimated signal */ + + y = step_size(state_ptr); /* dynamic quantizer step size */ + + dq = reconstruct(i & 0x08, _dqlntab[i], y); /* quantized diff. */ + + sr = (dq < 0) ? (se - (dq & 0x3FFF)) : se + dq; /* reconst. signal */ + + dqsez = sr - se + sez; /* pole prediction diff. */ + + update(4, y, _witab[i] << 5, _fitab[i], dq, sr, dqsez, state_ptr); + + switch (out_coding) { + case AUDIO_ENCODING_ALAW: + return (tandem_adjust_alaw(sr, se, y, i, 8, qtab_721)); + case AUDIO_ENCODING_ULAW: + return (tandem_adjust_ulaw(sr, se, y, i, 8, qtab_721)); + case AUDIO_ENCODING_LINEAR: + return (sr << 2); /* sr was 14-bit dynamic range */ + default: + return (-1); + } +} diff --git a/contrib/src/mmedia/g723_24.cpp b/contrib/src/mmedia/g723_24.cpp new file mode 100644 index 0000000000..fe581c3de8 --- /dev/null +++ b/contrib/src/mmedia/g723_24.cpp @@ -0,0 +1,159 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +/* + * g723_24.c + * + * Description: + * + * g723_24_encoder(), g723_24_decoder() + * + * These routines comprise an implementation of the CCITT G.723 24 Kbps + * ADPCM coding algorithm. Essentially, this implementation is identical to + * the bit level description except for a few deviations which take advantage + * of workstation attributes, such as hardware 2's complement arithmetic. + * + */ +#include +#include "wx/mmedia/internal/g72x.h" + +/* + * Maps G.723_24 code word to reconstructed scale factor normalized log + * magnitude values. + */ +static short _dqlntab[8] = {-2048, 135, 273, 373, 373, 273, 135, -2048}; + +/* Maps G.723_24 code word to log of scale factor multiplier. */ +static short _witab[8] = {-128, 960, 4384, 18624, 18624, 4384, 960, -128}; + +/* + * Maps G.723_24 code words to a set of values whose long and short + * term averages are computed and then compared to give an indication + * how stationary (steady state) the signal is. + */ +static short _fitab[8] = {0, 0x200, 0x400, 0xE00, 0xE00, 0x400, 0x200, 0}; + +static short qtab_723_24[3] = {8, 218, 331}; + +/* + * g723_24_encoder() + * + * Encodes a linear PCM, A-law or u-law input sample and returns its 3-bit code. + * Returns -1 if invalid input coding value. + */ +int +g723_24_encoder( + int sl, + int in_coding, + struct g72x_state *state_ptr) +{ + short sei, sezi, se, sez; /* ACCUM */ + short d; /* SUBTA */ + short y; /* MIX */ + short sr; /* ADDB */ + short dqsez; /* ADDC */ + short dq, i; + + switch (in_coding) { /* linearize input sample to 14-bit PCM */ + case AUDIO_ENCODING_ALAW: + sl = alaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_ULAW: + sl = ulaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_LINEAR: + sl = ((short)sl) >> 2; /* sl of 14-bit dynamic range */ + break; + default: + return (-1); + } + + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + sei = sezi + predictor_pole(state_ptr); + se = sei >> 1; /* se = estimated signal */ + + d = sl - se; /* d = estimation diff. */ + + /* quantize prediction difference d */ + y = step_size(state_ptr); /* quantizer step size */ + i = quantize(d, y, qtab_723_24, 3); /* i = ADPCM code */ + dq = reconstruct(i & 4, _dqlntab[i], y); /* quantized diff. */ + + sr = (dq < 0) ? se - (dq & 0x3FFF) : se + dq; /* reconstructed signal */ + + dqsez = sr + sez - se; /* pole prediction diff. */ + + update(3, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); + + return (i); +} + +/* + * g723_24_decoder() + * + * Decodes a 3-bit CCITT G.723_24 ADPCM code and returns + * the resulting 16-bit linear PCM, A-law or u-law sample value. + * -1 is returned if the output coding is unknown. + */ +int +g723_24_decoder( + int i, + int out_coding, + struct g72x_state *state_ptr) +{ + short sezi, sei, sez, se; /* ACCUM */ + short y; /* MIX */ + short sr; /* ADDB */ + short dq; + short dqsez; + + i &= 0x07; /* mask to get proper bits */ + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + sei = sezi + predictor_pole(state_ptr); + se = sei >> 1; /* se = estimated signal */ + + y = step_size(state_ptr); /* adaptive quantizer step size */ + dq = reconstruct(i & 0x04, _dqlntab[i], y); /* unquantize pred diff */ + + sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* reconst. signal */ + + dqsez = sr - se + sez; /* pole prediction diff. */ + + update(3, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); + + switch (out_coding) { + case AUDIO_ENCODING_ALAW: + return (tandem_adjust_alaw(sr, se, y, i, 4, qtab_723_24)); + case AUDIO_ENCODING_ULAW: + return (tandem_adjust_ulaw(sr, se, y, i, 4, qtab_723_24)); + case AUDIO_ENCODING_LINEAR: + return (sr << 2); /* sr was of 14-bit dynamic range */ + default: + return (-1); + } +} diff --git a/contrib/src/mmedia/g723_40.cpp b/contrib/src/mmedia/g723_40.cpp new file mode 100644 index 0000000000..e736a5c249 --- /dev/null +++ b/contrib/src/mmedia/g723_40.cpp @@ -0,0 +1,179 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +/* + * g723_40.c + * + * Description: + * + * g723_40_encoder(), g723_40_decoder() + * + * These routines comprise an implementation of the CCITT G.723 40Kbps + * ADPCM coding algorithm. Essentially, this implementation is identical to + * the bit level description except for a few deviations which + * take advantage of workstation attributes, such as hardware 2's + * complement arithmetic. + * + * The deviation from the bit level specification (lookup tables), + * preserves the bit level performance specifications. + * + * As outlined in the G.723 Recommendation, the algorithm is broken + * down into modules. Each section of code below is preceded by + * the name of the module which it is implementing. + * + */ +#include +#include "wx/mmedia/internal/g72x.h" + +/* + * Maps G.723_40 code word to ructeconstructed scale factor normalized log + * magnitude values. + */ +static short _dqlntab[32] = {-2048, -66, 28, 104, 169, 224, 274, 318, + 358, 395, 429, 459, 488, 514, 539, 566, + 566, 539, 514, 488, 459, 429, 395, 358, + 318, 274, 224, 169, 104, 28, -66, -2048}; + +/* Maps G.723_40 code word to log of scale factor multiplier. */ +static short _witab[32] = {448, 448, 768, 1248, 1280, 1312, 1856, 3200, + 4512, 5728, 7008, 8960, 11456, 14080, 16928, 22272, + 22272, 16928, 14080, 11456, 8960, 7008, 5728, 4512, + 3200, 1856, 1312, 1280, 1248, 768, 448, 448}; + +/* + * Maps G.723_40 code words to a set of values whose long and short + * term averages are computed and then compared to give an indication + * how stationary (steady state) the signal is. + */ +static short _fitab[32] = {0, 0, 0, 0, 0, 0x200, 0x200, 0x200, + 0x200, 0x200, 0x400, 0x600, 0x800, 0xA00, 0xC00, 0xC00, + 0xC00, 0xC00, 0xA00, 0x800, 0x600, 0x400, 0x200, 0x200, + 0x200, 0x200, 0x200, 0, 0, 0, 0, 0}; + +static short qtab_723_40[15] = {-122, -16, 68, 139, 198, 250, 298, 339, + 378, 413, 445, 475, 502, 528, 553}; + +/* + * g723_40_encoder() + * + * Encodes a 16-bit linear PCM, A-law or u-law input sample and retuens + * the resulting 5-bit CCITT G.723 40Kbps code. + * Returns -1 if the input coding value is invalid. + */ +int +g723_40_encoder( + int sl, + int in_coding, + struct g72x_state *state_ptr) +{ + short sei, sezi, se, sez; /* ACCUM */ + short d; /* SUBTA */ + short y; /* MIX */ + short sr; /* ADDB */ + short dqsez; /* ADDC */ + short dq, i; + + switch (in_coding) { /* linearize input sample to 14-bit PCM */ + case AUDIO_ENCODING_ALAW: + sl = alaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_ULAW: + sl = ulaw2linear(sl) >> 2; + break; + case AUDIO_ENCODING_LINEAR: + sl = ((short) sl) >> 2; /* sl of 14-bit dynamic range */ + break; + default: + return (-1); + } + + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + sei = sezi + predictor_pole(state_ptr); + se = sei >> 1; /* se = estimated signal */ + + d = sl - se; /* d = estimation difference */ + + /* quantize prediction difference */ + y = step_size(state_ptr); /* adaptive quantizer step size */ + i = quantize(d, y, qtab_723_40, 15); /* i = ADPCM code */ + + dq = reconstruct(i & 0x10, _dqlntab[i], y); /* quantized diff */ + + sr = (dq < 0) ? se - (dq & 0x7FFF) : se + dq; /* reconstructed signal */ + + dqsez = sr + sez - se; /* dqsez = pole prediction diff. */ + + update(5, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); + + return (i); +} + +/* + * g723_40_decoder() + * + * Decodes a 5-bit CCITT G.723 40Kbps code and returns + * the resulting 16-bit linear PCM, A-law or u-law sample value. + * -1 is returned if the output coding is unknown. + */ +int +g723_40_decoder( + int i, + int out_coding, + struct g72x_state *state_ptr) +{ + short sezi, sei, sez, se; /* ACCUM */ + short y; /* MIX */ + short sr; /* ADDB */ + short dq; + short dqsez; + + i &= 0x1f; /* mask to get proper bits */ + sezi = predictor_zero(state_ptr); + sez = sezi >> 1; + sei = sezi + predictor_pole(state_ptr); + se = sei >> 1; /* se = estimated signal */ + + y = step_size(state_ptr); /* adaptive quantizer step size */ + dq = reconstruct(i & 0x10, _dqlntab[i], y); /* estimation diff. */ + + sr = (dq < 0) ? (se - (dq & 0x7FFF)) : (se + dq); /* reconst. signal */ + + dqsez = sr - se + sez; /* pole prediction diff. */ + + update(5, y, _witab[i], _fitab[i], dq, sr, dqsez, state_ptr); + + switch (out_coding) { + case AUDIO_ENCODING_ALAW: + return (tandem_adjust_alaw(sr, se, y, i, 0x10, qtab_723_40)); + case AUDIO_ENCODING_ULAW: + return (tandem_adjust_ulaw(sr, se, y, i, 0x10, qtab_723_40)); + case AUDIO_ENCODING_LINEAR: + return (sr << 2); /* sr was of 14-bit dynamic range */ + default: + return (-1); + } +} diff --git a/contrib/src/mmedia/g72x.cpp b/contrib/src/mmedia/g72x.cpp new file mode 100644 index 0000000000..ec7e47d99c --- /dev/null +++ b/contrib/src/mmedia/g72x.cpp @@ -0,0 +1,608 @@ +/* + * This source code is a product of Sun Microsystems, Inc. and is provided + * for unrestricted use. Users may copy or modify this source code without + * charge. + * + * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING + * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR + * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. + * + * Sun source code is provided with no support and without any obligation on + * the part of Sun Microsystems, Inc. to assist in its use, correction, + * modification or enhancement. + * + * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE + * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE + * OR ANY PART THEREOF. + * + * In no event will Sun Microsystems, Inc. be liable for any lost revenue + * or profits or other special, indirect and consequential damages, even if + * Sun has been advised of the possibility of such damages. + * + * Sun Microsystems, Inc. + * 2550 Garcia Avenue + * Mountain View, California 94043 + */ + +/* + * g72x.c + * + * Common routines for G.721 and G.723 conversions. + */ + +#include +#include "wx/mmedia/internal/g72x.h" + +static short power2[15] = {1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80, + 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000}; + +/* + * quan() + * + * quantizes the input val against the table of size short integers. + * It returns i if table[i - 1] <= val < table[i]. + * + * Using linear search for simple coding. + */ +static int +quan( + int val, + short *table, + int size) +{ + int i; + + for (i = 0; i < size; i++) + if (val < *table++) + break; + return (i); +} + +static char quan2_tab[65536]; +static short base2_tab[65536]; +static int init_tabs_done = 0; + +inline char quan2 (unsigned short val) +{ + return quan2_tab[val]; +} + +inline short base2 (unsigned short val) +{ + return base2_tab[val]; +} + +static void init_quan2_tab (void) +{ + long i; + + for (i = 0; i < 65536; i++) { + quan2_tab[i] = quan (i, power2, 15); + }; +} + +static void init_base2_tab (void) +{ + long i; + short exp; + + for (i = 0; i < 65536; i++) { + exp = quan2 (short (i)); + base2_tab[i] = short ((exp << 6) + ((i << 6) >> exp)); + }; +} + +static void init_tabs (void) +{ + if (init_tabs_done) return; + + init_quan2_tab(); + init_base2_tab(); + + init_tabs_done = 1; +} + +/* + * fmult() + * + * returns the integer product of the 14-bit integer "an" and + * "floating point" representation (4-bit exponent, 6-bit mantessa) "srn". + */ +static int +fmult( + int an, + int srn) +{ + short anmag, anexp, anmant; + short wanexp, wanmant; + short retval; + + anmag = (an > 0) ? an : ((-an) & 0x1FFF); + anexp = quan2(anmag) - 6; + anmant = (anmag == 0) ? 32 : + (anexp >= 0) ? anmag >> anexp : anmag << -anexp; + wanexp = anexp + ((srn >> 6) & 0xF) - 13; + + wanmant = (anmant * (srn & 077) + 0x30) >> 4; + retval = (wanexp >= 0) ? ((wanmant << wanexp) & 0x7FFF) : + (wanmant >> -wanexp); + + return (((an ^ srn) < 0) ? -retval : retval); +} + +/* + * g72x_init_state() + * + * This routine initializes and/or resets the g72x_state structure + * pointed to by 'state_ptr'. + * All the initial state values are specified in the CCITT G.721 document. + */ +void +g72x_init_state( + struct g72x_state *state_ptr) +{ + int cnta; + + init_tabs (); + + state_ptr->yl = 34816; + state_ptr->yu = 544; + state_ptr->dms = 0; + state_ptr->dml = 0; + state_ptr->ap = 0; + for (cnta = 0; cnta < 2; cnta++) { + state_ptr->a[cnta] = 0; + state_ptr->pk[cnta] = 0; + state_ptr->sr[cnta] = 32; + } + for (cnta = 0; cnta < 6; cnta++) { + state_ptr->b[cnta] = 0; + state_ptr->dq[cnta] = 32; + } + state_ptr->td = 0; +} + +/* + * predictor_zero() + * + * computes the estimated signal from 6-zero predictor. + * + */ +int +predictor_zero( + struct g72x_state *state_ptr) +{ + int i; + int sezi; + + sezi = fmult(state_ptr->b[0] >> 2, state_ptr->dq[0]); + for (i = 1; i < 6; i++) /* ACCUM */ + sezi += fmult(state_ptr->b[i] >> 2, state_ptr->dq[i]); + return (sezi); +} +/* + * predictor_pole() + * + * computes the estimated signal from 2-pole predictor. + * + */ +int +predictor_pole( + struct g72x_state *state_ptr) +{ + return (fmult(state_ptr->a[1] >> 2, state_ptr->sr[1]) + + fmult(state_ptr->a[0] >> 2, state_ptr->sr[0])); +} +/* + * step_size() + * + * computes the quantization step size of the adaptive quantizer. + * + */ +int +step_size( + struct g72x_state *state_ptr) +{ + int y; + int dif; + int al; + + if (state_ptr->ap >= 256) + return (state_ptr->yu); + else { + y = state_ptr->yl >> 6; + dif = state_ptr->yu - y; + al = state_ptr->ap >> 2; + if (dif > 0) + y += (dif * al) >> 6; + else if (dif < 0) + y += (dif * al + 0x3F) >> 6; + return (y); + } +} + +/* + * quantize() + * + * Given a raw sample, 'd', of the difference signal and a + * quantization step size scale factor, 'y', this routine returns the + * ADPCM codeword to which that sample gets quantized. The step + * size scale factor division operation is done in the log base 2 domain + * as a subtraction. + */ +int +quantize( + int d, /* Raw difference signal sample */ + int y, /* Step size multiplier */ + short *table, /* quantization table */ + int size) /* table size of short integers */ +{ + short dqm; /* Magnitude of 'd' */ + short exp; /* Integer part of base 2 log of 'd' */ + short mant; /* Fractional part of base 2 log */ + short dl; /* Log of magnitude of 'd' */ + short dln; /* Step size scale factor normalized log */ + int i; + + /* + * LOG + * + * Compute base 2 log of 'd', and store in 'dl'. + */ + dqm = abs(d); + exp = quan2(dqm >> 1); + mant = ((dqm << 7) >> exp) & 0x7F; /* Fractional portion. */ + dl = (exp << 7) + mant; + + /* + * SUBTB + * + * "Divide" by step size multiplier. + */ + dln = dl - (y >> 2); + + /* + * QUAN + * + * Obtain codword i for 'd'. + */ + i = quan(dln, table, size); + if (d < 0) /* take 1's complement of i */ + return ((size << 1) + 1 - i); + else if (i == 0) /* take 1's complement of 0 */ + return ((size << 1) + 1); /* new in 1988 */ + else + return (i); +} +/* + * reconstruct() + * + * Returns reconstructed difference signal 'dq' obtained from + * codeword 'i' and quantization step size scale factor 'y'. + * Multiplication is performed in log base 2 domain as addition. + */ +int +reconstruct( + int sign, /* 0 for non-negative value */ + int dqln, /* G.72x codeword */ + int y) /* Step size multiplier */ +{ + short dql; /* Log of 'dq' magnitude */ + short dex; /* Integer part of log */ + short dqt; + short dq; /* Reconstructed difference signal sample */ + + dql = dqln + (y >> 2); /* ADDA */ + + if (dql < 0) { + return ((sign) ? -0x8000 : 0); + } else { /* ANTILOG */ + dex = (dql >> 7) & 15; + dqt = 128 + (dql & 127); + dq = (dqt << 7) >> (14 - dex); + return ((sign) ? (dq - 0x8000) : dq); + } +} + + +/* + * update() + * + * updates the state variables for each output code + */ +void +update( + int code_size, /* distinguish 723_40 with others */ + int y, /* quantizer step size */ + int wi, /* scale factor multiplier */ + int fi, /* for long/short term energies */ + int dq, /* quantized prediction difference */ + int sr, /* reconstructed signal */ + int dqsez, /* difference from 2-pole predictor */ + struct g72x_state *state_ptr) /* coder state pointer */ +{ + int cnt; + short mag; /* Adaptive predictor, FLOAT A */ + short a2p; /* LIMC */ + short a1ul; /* UPA1 */ + short pks1; /* UPA2 */ + short fa1; + char tr; /* tone/transition detector */ + short ylint, thr2, dqthr; + short ylfrac, thr1; + short pk0; + + pk0 = (dqsez < 0) ? 1 : 0; /* needed in updating predictor poles */ + + mag = dq & 0x7FFF; /* prediction difference magnitude */ + /* TRANS */ + ylint = short (state_ptr->yl >> 15); /* exponent part of yl */ + ylfrac = (state_ptr->yl >> 10) & 0x1F; /* fractional part of yl */ + thr1 = (32 + ylfrac) << ylint; /* threshold */ + thr2 = (ylint > 9) ? 31 << 10 : thr1; /* limit thr2 to 31 << 10 */ + dqthr = (thr2 + (thr2 >> 1)) >> 1; /* dqthr = 0.75 * thr2 */ + if (state_ptr->td == 0) /* signal supposed voice */ + tr = 0; + else if (mag <= dqthr) /* supposed data, but small mag */ + tr = 0; /* treated as voice */ + else /* signal is data (modem) */ + tr = 1; + + /* + * Quantizer scale factor adaptation. + */ + + /* FUNCTW & FILTD & DELAY */ + /* update non-steady state step size multiplier */ + state_ptr->yu = y + ((wi - y) >> 5); + + /* LIMB */ + if (state_ptr->yu < 544) /* 544 <= yu <= 5120 */ + state_ptr->yu = 544; + else if (state_ptr->yu > 5120) + state_ptr->yu = 5120; + + /* FILTE & DELAY */ + /* update steady state step size multiplier */ + state_ptr->yl += state_ptr->yu + ((-state_ptr->yl) >> 6); + + /* + * Adaptive predictor coefficients. + */ + if (tr == 1) { /* reset a's and b's for modem signal */ + state_ptr->a[0] = 0; + state_ptr->a[1] = 0; + state_ptr->b[0] = 0; + state_ptr->b[1] = 0; + state_ptr->b[2] = 0; + state_ptr->b[3] = 0; + state_ptr->b[4] = 0; + state_ptr->b[5] = 0; + + a2p = 0; /* eliminate Compiler Warnings */ + } else { /* update a's and b's */ + pks1 = pk0 ^ state_ptr->pk[0]; /* UPA2 */ + + /* update predictor pole a[1] */ + a2p = state_ptr->a[1] - (state_ptr->a[1] >> 7); + if (dqsez != 0) { + fa1 = (pks1) ? state_ptr->a[0] : -state_ptr->a[0]; + if (fa1 < -8191) /* a2p = function of fa1 */ + a2p -= 0x100; + else if (fa1 > 8191) + a2p += 0xFF; + else + a2p += fa1 >> 5; + + if (pk0 ^ state_ptr->pk[1]) + /* LIMC */ + if (a2p <= -12160) + a2p = -12288; + else if (a2p >= 12416) + a2p = 12288; + else + a2p -= 0x80; + else if (a2p <= -12416) + a2p = -12288; + else if (a2p >= 12160) + a2p = 12288; + else + a2p += 0x80; + } + + /* TRIGB & DELAY */ + state_ptr->a[1] = a2p; + + /* UPA1 */ + /* update predictor pole a[0] */ + state_ptr->a[0] -= state_ptr->a[0] >> 8; + if (dqsez != 0) + if (pks1 == 0) + state_ptr->a[0] += 192; + else + state_ptr->a[0] -= 192; + + /* LIMD */ + a1ul = 15360 - a2p; + if (state_ptr->a[0] < -a1ul) + state_ptr->a[0] = -a1ul; + else if (state_ptr->a[0] > a1ul) + state_ptr->a[0] = a1ul; + + /* UPB : update predictor zeros b[6] */ + for (cnt = 0; cnt < 6; cnt++) { + if (code_size == 5) /* for 40Kbps G.723 */ + state_ptr->b[cnt] -= state_ptr->b[cnt] >> 9; + else /* for G.721 and 24Kbps G.723 */ + state_ptr->b[cnt] -= state_ptr->b[cnt] >> 8; + if (dq & 0x7FFF) { /* XOR */ + if ((dq ^ state_ptr->dq[cnt]) >= 0) + state_ptr->b[cnt] += 128; + else + state_ptr->b[cnt] -= 128; + } + } + } + + for (cnt = 5; cnt > 0; cnt--) + state_ptr->dq[cnt] = state_ptr->dq[cnt-1]; + /* FLOAT A : convert dq[0] to 4-bit exp, 6-bit mantissa f.p. */ + if (mag == 0) { + state_ptr->dq[0] = (dq >= 0) ? 0x20 : 0xFC20; + } else { + state_ptr->dq[0] = (dq >= 0) ? + base2 (mag) : base2 (mag) - 0x400; + } + + state_ptr->sr[1] = state_ptr->sr[0]; + /* FLOAT B : convert sr to 4-bit exp., 6-bit mantissa f.p. */ + if (sr == 0) { + state_ptr->sr[0] = 0x20; + } else if (sr > 0) { + state_ptr->sr[0] = base2(sr); + } else if (sr > -32768) { + mag = -sr; + state_ptr->sr[0] = base2(mag) - 0x400; + } else + state_ptr->sr[0] = short (0xFC20); + + /* DELAY A */ + state_ptr->pk[1] = state_ptr->pk[0]; + state_ptr->pk[0] = pk0; + + /* TONE */ + if (tr == 1) /* this sample has been treated as data */ + state_ptr->td = 0; /* next one will be treated as voice */ + else if (a2p < -11776) /* small sample-to-sample correlation */ + state_ptr->td = 1; /* signal may be data */ + else /* signal is voice */ + state_ptr->td = 0; + + /* + * Adaptation speed control. + */ + state_ptr->dms += (fi - state_ptr->dms) >> 5; /* FILTA */ + state_ptr->dml += (((fi << 2) - state_ptr->dml) >> 7); /* FILTB */ + + if (tr == 1) + state_ptr->ap = 256; + else if (y < 1536) /* SUBTC */ + state_ptr->ap += (0x200 - state_ptr->ap) >> 4; + else if (state_ptr->td == 1) + state_ptr->ap += (0x200 - state_ptr->ap) >> 4; + else if (abs((state_ptr->dms << 2) - state_ptr->dml) >= + (state_ptr->dml >> 3)) + state_ptr->ap += (0x200 - state_ptr->ap) >> 4; + else + state_ptr->ap += (-state_ptr->ap) >> 4; +} + +/* + * tandem_adjust(sr, se, y, i, sign) + * + * At the end of ADPCM decoding, it simulates an encoder which may be receiving + * the output of this decoder as a tandem process. If the output of the + * simulated encoder differs from the input to this decoder, the decoder output + * is adjusted by one level of A-law or u-law codes. + * + * Input: + * sr decoder output linear PCM sample, + * se predictor estimate sample, + * y quantizer step size, + * i decoder input code, + * sign sign bit of code i + * + * Return: + * adjusted A-law or u-law compressed sample. + */ +int +tandem_adjust_alaw( + int sr, /* decoder output linear PCM sample */ + int se, /* predictor estimate sample */ + int y, /* quantizer step size */ + int i, /* decoder input code */ + int sign, + short *qtab) +{ + unsigned char sp; /* A-law compressed 8-bit code */ + short dx; /* prediction error */ + char id; /* quantized prediction error */ + int sd; /* adjusted A-law decoded sample value */ + int im; /* biased magnitude of i */ + int imx; /* biased magnitude of id */ + + if (sr <= -32768) + sr = -1; + sp = linear2alaw((sr >> 1) << 3); /* short to A-law compression */ + dx = (alaw2linear(sp) >> 2) - se; /* 16-bit prediction error */ + id = quantize(dx, y, qtab, sign - 1); + + if (id == i) { /* no adjustment on sp */ + return (sp); + } else { /* sp adjustment needed */ + /* ADPCM codes : 8, 9, ... F, 0, 1, ... , 6, 7 */ + im = i ^ sign; /* 2's complement to biased unsigned */ + imx = id ^ sign; + + if (imx > im) { /* sp adjusted to next lower value */ + if (sp & 0x80) { + sd = (sp == 0xD5) ? 0x55 : + ((sp ^ 0x55) - 1) ^ 0x55; + } else { + sd = (sp == 0x2A) ? 0x2A : + ((sp ^ 0x55) + 1) ^ 0x55; + } + } else { /* sp adjusted to next higher value */ + if (sp & 0x80) + sd = (sp == 0xAA) ? 0xAA : + ((sp ^ 0x55) + 1) ^ 0x55; + else + sd = (sp == 0x55) ? 0xD5 : + ((sp ^ 0x55) - 1) ^ 0x55; + } + return (sd); + } +} + +int +tandem_adjust_ulaw( + int sr, /* decoder output linear PCM sample */ + int se, /* predictor estimate sample */ + int y, /* quantizer step size */ + int i, /* decoder input code */ + int sign, + short *qtab) +{ + unsigned char sp; /* u-law compressed 8-bit code */ + short dx; /* prediction error */ + char id; /* quantized prediction error */ + int sd; /* adjusted u-law decoded sample value */ + int im; /* biased magnitude of i */ + int imx; /* biased magnitude of id */ + + if (sr <= -32768) + sr = 0; + sp = linear2ulaw(sr << 2); /* short to u-law compression */ + dx = (ulaw2linear(sp) >> 2) - se; /* 16-bit prediction error */ + id = quantize(dx, y, qtab, sign - 1); + if (id == i) { + return (sp); + } else { + /* ADPCM codes : 8, 9, ... F, 0, 1, ... , 6, 7 */ + im = i ^ sign; /* 2's complement to biased unsigned */ + imx = id ^ sign; + if (imx > im) { /* sp adjusted to next lower value */ + if (sp & 0x80) + sd = (sp == 0xFF) ? 0x7E : sp + 1; + else + sd = (sp == 0) ? 0 : sp - 1; + + } else { /* sp adjusted to next higher value */ + if (sp & 0x80) + sd = (sp == 0x80) ? 0x80 : sp - 1; + else + sd = (sp == 0x7F) ? 0xFE : sp + 1; + } + return (sd); + } +} diff --git a/contrib/src/mmedia/sndaiff.cpp b/contrib/src/mmedia/sndaiff.cpp new file mode 100644 index 0000000000..f86a81e346 --- /dev/null +++ b/contrib/src/mmedia/sndaiff.cpp @@ -0,0 +1,207 @@ +// -------------------------------------------------------------------------- +// Name: sndaiff.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndaiff.cpp" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/stream.h" +#include "wx/datstrm.h" +#include "wx/filefn.h" + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndaiff.h" + +#define BUILD_SIGNATURE(a,b,c,d) (((wxUint32)a) | (((wxUint32)b) << 8) | (((wxUint32)c) << 16) | (((wxUint32)d) << 24)) + +#define FORM_SIGNATURE BUILD_SIGNATURE('F','O','R','M') +#define AIFF_SIGNATURE BUILD_SIGNATURE('A','I','F','F') +#define AIFC_SIGNATURE BUILD_SIGNATURE('A','I','F','C') +#define COMM_SIGNATURE BUILD_SIGNATURE('C','O','M','M') +#define SSND_SIGNATURE BUILD_SIGNATURE('S','S','N','D') + +wxSoundAiff::wxSoundAiff(wxInputStream& stream, wxSoundStream& io_sound) + : wxSoundFileStream(stream, io_sound) +{ + m_base_offset = wxInvalidOffset; +} + +wxSoundAiff::wxSoundAiff(wxOutputStream& stream, wxSoundStream& io_sound) + : wxSoundFileStream(stream, io_sound) +{ + m_base_offset = wxInvalidOffset; +} + +wxSoundAiff::~wxSoundAiff() +{ +} + +wxString wxSoundAiff::GetCodecName() const +{ + return "wxSoundAiff codec"; +} + +bool wxSoundAiff::CanRead() +{ + wxUint32 signature1, signature2, len; + + if (m_input->Read(&signature1, 4).LastRead() != 4) + return FALSE; + + if (wxUINT32_SWAP_ON_BE(signature1) != FORM_SIGNATURE) { + m_input->Ungetch(&signature1, 4); + return FALSE; + } + + m_input->Read(&len, 4); + if (m_input->LastRead() != 4) { + m_input->Ungetch(&len, m_input->LastRead()); + m_input->Ungetch(&signature1, 4); + return FALSE; + } + + if (m_input->Read(&signature2, 4).LastRead() != 4) { + m_input->Ungetch(&signature2, m_input->LastRead()); + m_input->Ungetch(&len, 4); + m_input->Ungetch(&signature1, 4); + return FALSE; + } + + m_input->Ungetch(&signature2, 4); + m_input->Ungetch(&len, 4); + m_input->Ungetch(&signature1, 4); + + if ( + wxUINT32_SWAP_ON_BE(signature2) != AIFF_SIGNATURE && + wxUINT32_SWAP_ON_BE(signature2) != AIFC_SIGNATURE) + return FALSE; + + return TRUE; +} + +#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return FALSE; } + +bool wxSoundAiff::PrepareToPlay() +{ + wxDataInputStream data(*m_input); + wxUint32 signature, len, ssnd; + bool end_headers; + + if (!m_input) { + m_snderror = wxSOUND_INVSTRM; + return FALSE; + } + m_snderror = wxSOUND_NOERROR; + + data.BigEndianOrdered(TRUE); + + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != FORM_SIGNATURE, wxSOUND_INVSTRM); + // "FORM" + + len = data.Read32(); + FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM); + // dummy len + + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + FAIL_WITH( + wxUINT32_SWAP_ON_BE(signature) != AIFF_SIGNATURE && + wxUINT32_SWAP_ON_BE(signature) != AIFC_SIGNATURE, wxSOUND_INVSTRM); + // "AIFF" / "AIFC" + + end_headers = FALSE; + while (!end_headers) { + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + + len = data.Read32(); + FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM); + + switch (wxUINT32_SWAP_ON_BE(signature)) { + case COMM_SIGNATURE: { // "COMM" + wxUint16 channels, bps; + wxUint32 num_samples; + double srate; + wxSoundFormatPcm sndformat; + + // Get sound data informations + data >> channels >> num_samples >> bps >> srate; + + // Convert them in a wxSoundFormat object + sndformat.SetSampleRate((wxUint32) srate); + sndformat.SetBPS(bps); + sndformat.SetChannels(channels); + sndformat.Signed(FALSE); + sndformat.SetOrder(wxBIG_ENDIAN); + + if (!SetSoundFormat(sndformat)) + return FALSE; + // We pass all data left + m_input->SeekI(len-18, wxFromCurrent); + break; + } + case SSND_SIGNATURE: { // "SSND" + data >> ssnd; + // m_input->SeekI(4, wxFromCurrent); // Pass an INT32 + // m_input->SeekI(len-4, wxFromCurrent); // Pass the rest + m_input->SeekI(ssnd + 4, wxFromCurrent); + m_base_offset = m_input->TellI(); + // len-8 bytes of samples + FinishPreparation(len - 8); + end_headers = TRUE; + break; + } + default: + m_input->SeekI(len, wxFromCurrent); + break; + } + } + return TRUE; +} + +bool wxSoundAiff::PrepareToRecord(wxUint32 time) +{ + // TODO + return FALSE; +} + +bool wxSoundAiff::FinishRecording() +{ + // TODO + return FALSE; +} + +bool wxSoundAiff::RepositionStream(wxUint32 position) +{ + // If the stream is not seekable "TellI() returns wxInvalidOffset" we cannot reposition stream + if (m_base_offset == wxInvalidOffset) + return FALSE; + m_input->SeekI(m_base_offset, wxFromStart); + return TRUE; +} + +wxUint32 wxSoundAiff::GetData(void *buffer, wxUint32 len) +{ + return m_input->Read(buffer, len).LastRead(); +} + +wxUint32 wxSoundAiff::PutData(const void *buffer, wxUint32 len) +{ + return m_output->Write(buffer, len).LastWrite(); +} diff --git a/contrib/src/mmedia/sndbase.cpp b/contrib/src/mmedia/sndbase.cpp new file mode 100644 index 0000000000..88e638d5d8 --- /dev/null +++ b/contrib/src/mmedia/sndbase.cpp @@ -0,0 +1,134 @@ +// -------------------------------------------------------------------------- +// Name: sndbase.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999, 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndbase.cpp" +#endif + +#include +#include "wx/mmedia/sndbase.h" + + +// --------------------------------------------------------------------------- +// wxSoundFormatBase +// --------------------------------------------------------------------------- + +wxSoundFormatBase::wxSoundFormatBase() +{ +} + +wxSoundFormatBase::~wxSoundFormatBase() +{ +} + +wxSoundFormatBase *wxSoundFormatBase::Clone() const +{ + return NULL; +} + +bool wxSoundFormatBase::operator!=(const wxSoundFormatBase& frmt2) const +{ + return (GetType() != frmt2.GetType()); +} + +// --------------------------------------------------------------------------- +// wxSoundStream +// --------------------------------------------------------------------------- + +wxSoundStream::wxSoundStream() +{ + int i; + + // Reset all variables to their neutral value. + m_sndformat = NULL; + m_handler = NULL; + m_snderror = wxSOUND_NOERROR; + m_lastcount = 0; + for (i=0;i<2;i++) + m_callback[i] = NULL; +} + +wxSoundStream::~wxSoundStream() +{ + if (m_sndformat) + delete m_sndformat; +} + +// -------------------------------------------------------------------------- +// SetSoundFormat(const wxSoundFormatBase& format) is one of the most +// important function of the wxSoundStream class. It prepares the stream to +// receive or send the data in a strict format. Normally, the sound stream +// should be ready to accept any format it is asked to manage but in certain +// cases, it really cannot: in that case it returns FALSE. To have more +// details in the functionnalities of SetSoundFormat see +// wxSoundRouterStream::SetSoundFormat() +// -------------------------------------------------------------------------- +bool wxSoundStream::SetSoundFormat(const wxSoundFormatBase& format) +{ + // delete the previous prepared format + if (m_sndformat) + delete m_sndformat; + + // create a new one by cloning the format passed in parameter + m_sndformat = format.Clone(); + return TRUE; +} + + +// -------------------------------------------------------------------------- +// Register(int evt, ...) registers the callback for a specified async event. +// Warning ! Only one callback by event is supported. It means that if you +// call twice this function the previous registered callback is absolutely +// ignored. +// -------------------------------------------------------------------------- +void wxSoundStream::SetCallback(int evt, wxSoundCallback cbk, void *cdata) +{ + int c; + + switch (evt) { + case wxSOUND_INPUT: + c = 0; + break; + case wxSOUND_OUTPUT: + c = 1; + break; + default: + return; + } + m_callback[c] = cbk; + m_cdata[c] = cdata; +} + +// -------------------------------------------------------------------------- +// OnSoundEvent(int evt) is called either when the driver is ready to receive +// a new block to play or when the driver has a new recorded buffer. You +// must be careful here and try not to spend a lot of time: this is a +// real-time call. In the case, an "event handler" was specified previously, +// it called him before everything. +// -------------------------------------------------------------------------- +void wxSoundStream::OnSoundEvent(int evt) +{ + int c; + + if (m_handler) { + m_handler->OnSoundEvent(evt); + return; + } + + switch (evt) { + case wxSOUND_INPUT: + c = 0; + break; + case wxSOUND_OUTPUT: + c = 1; + break; + default: + return; + } + if (m_callback[c]) + m_callback[c](this, evt, m_cdata[c]); +} diff --git a/contrib/src/mmedia/sndcodec.cpp b/contrib/src/mmedia/sndcodec.cpp new file mode 100644 index 0000000000..4c4ab5bdf0 --- /dev/null +++ b/contrib/src/mmedia/sndcodec.cpp @@ -0,0 +1,47 @@ +// -------------------------------------------------------------------------- +// Name: sndcodec.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndcodec.cpp" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP +#include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" + +wxSoundStreamCodec::wxSoundStreamCodec(wxSoundStream& snd_io) + : m_sndio(&snd_io) +{ +} + +wxSoundStreamCodec::~wxSoundStreamCodec() +{ +} + +bool wxSoundStreamCodec::StartProduction(int evt) +{ + return m_sndio->StartProduction(evt); +} + +bool wxSoundStreamCodec::StopProduction() +{ + return m_sndio->StopProduction(); +} + +wxUint32 wxSoundStreamCodec::GetBestSize() const +{ + return m_sndio->GetBestSize(); +} diff --git a/contrib/src/mmedia/sndcpcm.cpp b/contrib/src/mmedia/sndcpcm.cpp new file mode 100644 index 0000000000..3eddf09eb2 --- /dev/null +++ b/contrib/src/mmedia/sndcpcm.cpp @@ -0,0 +1,443 @@ +// -------------------------------------------------------------------------- +// Name: sndcpcm.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999, 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndcpcm.cpp" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/debug.h" + #include "wx/log.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndcpcm.h" + +wxSoundStreamPcm::wxSoundStreamPcm(wxSoundStream& sndio) + : wxSoundStreamCodec(sndio) +{ + m_function_in = NULL; + m_function_out = NULL; + m_prebuffer = NULL; + m_prebuffer_size = 0; + m_best_size = 0; +} + +wxSoundStreamPcm::~wxSoundStreamPcm() +{ + if (m_prebuffer) + delete[] m_prebuffer; +} + +wxUint32 wxSoundStreamPcm::GetBestSize() const +{ + return m_best_size; +} + +// ----------------------------------------------------------------------- +// "Converters" definitions/implementations +// ----------------------------------------------------------------------- + +#define DEFINE_CONV(name, input_type, output_type, convert) \ +static void Convert_##name##(const void *buf_in, void *buf_out, wxUint32 len) \ +{\ + register input_type src; \ + register const input_type *t_buf_in = (input_type *)buf_in; \ + register output_type *t_buf_out = (output_type *)buf_out; \ +\ + while (len > 0) { \ + src = *t_buf_in++; \ + *t_buf_out++ = convert; \ + len -= sizeof(input_type); \ + } \ +} + +// TODO: define converters for all other formats (32, 24) + +DEFINE_CONV(8_8_sign, wxUint8, wxUint8, (src ^ 0x80)) + +DEFINE_CONV(8_16, wxUint8, wxUint16, (((wxUint16)src) << 8)) +DEFINE_CONV(8_16_swap, wxUint8, wxUint16, (src)) +DEFINE_CONV(8_16_sign, wxUint8, wxUint16, (((wxUint16)(src ^ 0x80)) << 8)) +DEFINE_CONV(8_16_sign_swap, wxUint8, wxUint16, (src ^ 0x80)) + +DEFINE_CONV(16_8, wxUint16, wxUint8, (wxUint8)(src >> 8)) +DEFINE_CONV(16_8_sign, wxUint16, wxUint8, (wxUint8)((src >> 8) ^ 0x80)) +DEFINE_CONV(16_swap_8, wxUint16, wxUint8, (wxUint8)(src & 0xff)) +DEFINE_CONV(16_swap_8_sign, wxUint16, wxUint8, (wxUint8)((src & 0xff) ^ 0x80)) + +//DEFINE_CONV(24_8, wxUint32, wxUint8, (wxUint8)(src >> 16)) +//DEFINE_CONV(24_8_sig, wxUint32, wxUint8, (wxUint8)((src >> 16) ^ 0x80)) + +//DEFINE_CONV(32_8, wxUint32, wxUint8, (wxUint8)(src >> 24)) + +DEFINE_CONV(16_sign, wxUint16, wxUint16, (src ^ 0x8000)) +DEFINE_CONV(16_swap, wxUint16, wxUint16, (((src & 0xff) << 8) | ((src >> 8) & 0xff))) +// Problem. +DEFINE_CONV(16_swap_16_sign, wxUint16, wxUint16, ((((src & 0xff) << 8) | ((src >> 8) & 0xff)) ^ 0x80)) +// DEFINE_CONV(16_sign_16_swap, wxUint16, wxUint16, ((((src & 0xff) << 8) | ((src >> 8) & 0xff)) ^ 0x8000)) +DEFINE_CONV(16_swap_16_sign_swap, wxUint16, wxUint16, (src ^ 0x80)) + +// ----------------------------------------------------------------------- +// Main PCM stream converter table +// ----------------------------------------------------------------------- +// Definition +// XX -> YY +// XX -> YY sign +// +// XX swapped -> YY +// XX swapped -> YY sign +// +// XX swapped -> YY swapped +// XX swapped -> YY swapped sign +// +// XX stereo -> YY mono +// XX stereo -> YY mono sign +// +// XX swapped stereo -> YY swapped mono +// XX swapped stereo -> YY swapped mono sign +// +// XX swapped stereo -> YY swapped mono +// XX swapped stereo -> YY swapped mono sign + +static wxSoundStreamPcm::ConverterType s_converters[4][3][2] = { + { + { + NULL, + Convert_8_8_sign /* 8 -> 8 sign */ + }, + { + NULL, + NULL + }, + { + NULL, + NULL + } + }, + { + { + Convert_8_16, /* 8 -> 16 */ + Convert_8_16_sign /* 8 -> 16 sign */ + }, + { + Convert_8_16_swap, /* 8 -> 16 swapped */ + Convert_8_16_sign_swap /* 8 -> 16 sign swapped */ + }, + { + NULL, + NULL + } + }, + { + { + Convert_16_8, /* 16 -> 8 */ + Convert_16_8_sign /* 16 -> 8 sign */ + }, + { + Convert_16_swap_8, /* 16 swapped -> 8 */ + Convert_16_swap_8_sign /* 16 swapped -> 8 sign */ + }, + { + NULL, + NULL + }, + }, + + { + { + NULL, /* 16 -> 16 */ + Convert_16_sign /* 16 -> 16 sign */ + }, + { + Convert_16_swap, /* 16 swapped -> 16 */ + Convert_16_swap_16_sign /* 16 swapped -> 16 sign */ + }, + { + NULL, + Convert_16_swap_16_sign_swap /* 16 swapped -> 16 sign swapped */ + } + } +}; + +// This is the buffer size multiplier. It gives the needed size of the output size. +static float s_converters_multip[] = {1, 2, 0.5, 1}; + +// +// TODO: Read() and Write() aren't really safe. If you give it a buffer which +// is not aligned on 2, you may crash (See converter.def). +// + +wxSoundStream& wxSoundStreamPcm::Read(void *buffer, wxUint32 len) +{ + wxUint32 in_bufsize; + + // We must have a multiple of 2 + len &= 0x01; + + if (!m_function_in) { + m_sndio->Read(buffer, len); + m_lastcount = m_sndio->GetLastAccess(); + m_snderror = m_sndio->GetError(); + return *this; + } + + in_bufsize = GetReadSize(len); + + if (len <= m_best_size) { + m_sndio->Read(m_prebuffer, in_bufsize); + m_snderror = m_sndio->GetError(); + if (m_snderror != wxSOUND_NOERROR) { + m_lastcount = 0; + return *this; + } + + m_function_in(m_prebuffer, buffer, m_sndio->GetLastAccess()); + } else { + char *temp_buffer; + + temp_buffer = new char[in_bufsize]; + m_sndio->Read(temp_buffer, in_bufsize); + + m_snderror = m_sndio->GetError(); + if (m_snderror != wxSOUND_NOERROR) { + m_lastcount = 0; + return *this; + } + + m_function_in(temp_buffer, buffer, m_sndio->GetLastAccess()); + + delete[] temp_buffer; + } + + m_lastcount = (wxUint32)(m_sndio->GetLastAccess() * m_multiplier_in); + + return *this; +} + +wxSoundStream& wxSoundStreamPcm::Write(const void *buffer, wxUint32 len) +{ + wxUint32 out_bufsize; + + if (!m_function_out) { + m_sndio->Write(buffer, len); + m_lastcount = m_sndio->GetLastAccess(); + m_snderror = m_sndio->GetError(); + return *this; + } + + out_bufsize = GetWriteSize(len); + + if (len <= m_best_size) { + out_bufsize = GetWriteSize(len); + + m_function_out(buffer, m_prebuffer, len); + m_sndio->Write(m_prebuffer, out_bufsize); + m_snderror = m_sndio->GetError(); + if (m_snderror != wxSOUND_NOERROR) { + m_lastcount = 0; + return *this; + } + } else { + char *temp_buffer; + + temp_buffer = new char[out_bufsize]; + m_function_out(buffer, temp_buffer, len); + + m_sndio->Write(temp_buffer, out_bufsize); + m_snderror = m_sndio->GetError(); + if (m_snderror != wxSOUND_NOERROR) { + m_lastcount = 0; + return *this; + } + + delete[] temp_buffer; + } + + m_lastcount = (wxUint32)(m_sndio->GetLastAccess() / m_multiplier_out); + + return *this; +} + +bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) +{ + wxSoundFormatBase *new_format; + wxSoundFormatPcm *pcm_format, *pcm_format2; + + if (m_sndio->SetSoundFormat(format)) { + m_function_out = NULL; + m_function_in = NULL; + return TRUE; + } + if (format.GetType() != wxSOUND_PCM) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + if (m_sndformat) + delete m_sndformat; + + new_format = m_sndio->GetSoundFormat().Clone(); + pcm_format = (wxSoundFormatPcm *)&format; + pcm_format2 = (wxSoundFormatPcm *)new_format; + +#if 0 + // ---------------------------------------------------- + // Test whether we need to resample + if (pcm_format->GetSampleRate() != pcm_format2->GetSampleRate()) { + wxUint32 src_rate, dst_rate; + + src_rate = pcm_format->GetSampleRate(); + dst_rate = pcm_format2->GetSampleRate(); + m_needResampling = TRUE; + if (src_rate < dst_rate) + m_expandSamples = TRUE; + else + m_expandSamples = FALSE; + m_pitch = (src_rate << FLOATBITS) / dst_rate; + } +#endif + // ---------------------------------------------------- + // Select table to use: + // * 8 bits -> 8 bits + // * 16 bits -> 8 bits + // * 8 bits -> 16 bits + // * 16 bits -> 16 bits + + int table_no, table_no2; + int i_sign, i_swap; + + switch (pcm_format->GetBPS()) { + case 8: + table_no = 0; + break; + case 16: + table_no = 1; + break; + default: + // TODO: Add something here: error, log, ... + return FALSE; + } + switch (pcm_format2->GetBPS()) { + case 8: + table_no2 = 0; + break; + case 16: + table_no2 = 1; + break; + default: + // TODO: Add something here: error, log, ... + return FALSE; + } + + if (pcm_format2->Signed() != pcm_format->Signed()) + i_sign = 1; + else + i_sign = 0; + +#define MY_ORDER wxBYTE_ORDER +#if wxBYTE_ORDER == wxLITTLE_ENDIAN +#define OTHER_ORDER wxBIG_ENDIAN +#else +#define OTHER_ORDER wxLITTLE_ENDIAN +#endif + + // -------------------------------------------------------- + // Find the good converter ! + + if (pcm_format->GetOrder() == OTHER_ORDER) { + if (pcm_format->GetOrder() == pcm_format2->GetOrder()) + i_swap = 2; + else + i_swap = 1; + } else { + if (pcm_format->GetOrder() == pcm_format2->GetOrder()) + i_swap = 0; + else + i_swap = 1; + } + + m_function_out = s_converters[table_no*2+table_no2][i_swap][i_sign]; + m_function_in = s_converters[table_no2*2+table_no][i_swap][i_sign]; + m_multiplier_out = s_converters_multip[table_no*2+table_no2]; + m_multiplier_in = s_converters_multip[table_no2*2+table_no2]; + + if (m_prebuffer) + delete[] m_prebuffer; + + // We try to minimize the need of dynamic memory allocation by preallocating a buffer. But + // to be sure it will be efficient we minimize the best size. + if (m_multiplier_in < m_multiplier_out) { + m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out); + m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in); + } else { + m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in); + m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out); + } + + m_prebuffer = new char[m_prebuffer_size]; + + bool SetSoundFormatReturn; + + SetSoundFormatReturn = m_sndio->SetSoundFormat(*new_format); + wxASSERT( SetSoundFormatReturn ); + + m_sndformat = new_format; + return TRUE; +} + +wxUint32 wxSoundStreamPcm::GetWriteSize(wxUint32 len) const +{ + // For the moment, it is simple but next time it will become more complicated + // (Resampling) + return (wxUint32)(len * m_multiplier_out); +} + +wxUint32 wxSoundStreamPcm::GetReadSize(wxUint32 len) const +{ + return (wxUint32)(len / m_multiplier_in); +} + +// Resampling engine. NOT FINISHED and NOT INCLUDED but this is a first DRAFT. + +#if 0 + +#define FLOATBITS 16 +#define INTBITS 16 +#define FLOATMASK 0xffff +#define INTMASK 0xffff0000 + +void ResamplingShrink_##DEPTH##(const void *source, void *destination, wxUint32 len) +{ + wxUint##DEPTH## *source_data, *dest_data; + wxUint32 pos; + + source_data = (wxUint##DEPTH## *)source; + dest_data = (wxUint##DEPTH## *)destination; + + pos = m_saved_pos; + while (len > 0) { + // Increment the position in the input buffer + pos += m_pitch; + if (pos & INTMASK) { + pos &= FLOATMASK; + + *dest_data ++ = *source_data; + } + len--; + source_data++; + } + m_saved_pos = pos; +} +#endif diff --git a/contrib/src/mmedia/sndesd.cpp b/contrib/src/mmedia/sndesd.cpp new file mode 100644 index 0000000000..74a55b63c2 --- /dev/null +++ b/contrib/src/mmedia/sndesd.cpp @@ -0,0 +1,319 @@ +// -------------------------------------------------------------------------- +// Name: sndesd.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndesd.cpp" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/string.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +// -------------------------------------------------------------------------- +// MMedia headers +// -------------------------------------------------------------------------- + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndesd.h" +#include "wx/mmedia/sndpcm.h" + +// -------------------------------------------------------------------------- +// System headers +// -------------------------------------------------------------------------- + +#include +#include +#include +#include +#ifdef __WXGTK__ +#include +#endif + +// -------------------------------------------------------------------------- + +#define MY_ESD_NAME "wxWindows/wxSoundStreamESD" + +// -------------------------------------------------------------------------- +// wxSoundStreamESD: ESD sound driver + +// -------------------------------------------------------------------------- +// Constructors/Destructors +// -------------------------------------------------------------------------- + +wxSoundStreamESD::wxSoundStreamESD(const wxString& hostname) +{ + wxSoundFormatPcm pcm_default; + + // First, we make some basic test: is there ESD on this computer ? + m_esd_ok = FALSE; + + if (hostname.IsNull()) + m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050, + hostname.mb_str(), MY_ESD_NAME); + else + m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050, + NULL, MY_ESD_NAME); + if (m_fd_output == -1) { + // Answer: no. We return with an error. + m_snderror = wxSOUND_INVDEV; + return; + } + + // Close this unuseful stream. + esd_close(m_fd_output); + + m_hostname = hostname; + + // Set the default audio format + SetSoundFormat(pcm_default); + + // Initialize some variable + m_snderror = wxSOUND_NOERROR; + m_esd_stop = TRUE; + m_q_filled = TRUE; + m_esd_ok = TRUE; + m_fd_output= -1; + m_fd_input = -1; +} + +wxSoundStreamESD::~wxSoundStreamESD() +{ + if (!m_esd_stop) + StopProduction(); +} + +// -------------------------------------------------------------------------- +// Read several samples +// -------------------------------------------------------------------------- + +wxSoundStream& wxSoundStreamESD::Read(void *buffer, wxUint32 len) +{ + int ret; + + if (m_esd_stop) { + m_snderror = wxSOUND_NOTSTARTED; + return *this; + } + + m_lastcount = (wxUint32)ret = read(m_fd_input, buffer, len); + + if (ret < 0) + m_snderror = wxSOUND_IOERROR; + else + m_snderror = wxSOUND_NOERROR; + + return *this; +} + +// -------------------------------------------------------------------------- +// Write several samples +// -------------------------------------------------------------------------- +wxSoundStream& wxSoundStreamESD::Write(const void *buffer, wxUint32 len) +{ + int ret; + + if (m_esd_stop) { + m_lastcount = 0; + m_snderror = wxSOUND_NOTSTARTED; + return *this; + } + + m_lastcount = (wxUint32)ret = write(m_fd_output, buffer, len); + + if (ret < 0) + m_snderror = wxSOUND_IOERROR; + else + m_snderror = wxSOUND_NOERROR; + + m_q_filled = TRUE; + + return *this; +} + +// -------------------------------------------------------------------------- +// SetSoundFormat(): this function specifies which format we want and which +// format is available +// -------------------------------------------------------------------------- +bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format) +{ + wxSoundFormatPcm *pcm_format; + + if (format.GetType() != wxSOUND_PCM) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + if (!m_esd_ok) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + if (m_sndformat) + delete m_sndformat; + + m_sndformat = format.Clone(); + if (!m_sndformat) { + m_snderror = wxSOUND_MEMERROR; + return FALSE; + } + pcm_format = (wxSoundFormatPcm *)m_sndformat; + + // Detect the best format + DetectBest(pcm_format); + + m_snderror = wxSOUND_NOERROR; + if (*pcm_format != format) { + m_snderror = wxSOUND_NOEXACT; + return FALSE; + } + return TRUE; +} + +// -------------------------------------------------------------------------- +// _wxSound_OSS_CBack (internal): it is called when the driver (ESD) is +// ready for a next buffer. +// -------------------------------------------------------------------------- +#ifdef __WXGTK__ +static void _wxSound_OSS_CBack(gpointer data, int source, + GdkInputCondition condition) +{ + wxSoundStreamESD *esd = (wxSoundStreamESD *)data; + + switch (condition) { + case GDK_INPUT_READ: + esd->WakeUpEvt(wxSOUND_INPUT); + break; + case GDK_INPUT_WRITE: + esd->WakeUpEvt(wxSOUND_OUTPUT); + break; + default: + break; + } +} +#endif + + +// -------------------------------------------------------------------------- +// WakeUpEvt() (internal): it is called by _wxSound_OSS_CBack to bypass the +// C++ protection +// -------------------------------------------------------------------------- +void wxSoundStreamESD::WakeUpEvt(int evt) +{ + m_q_filled = FALSE; + OnSoundEvent(evt); +} + +// -------------------------------------------------------------------------- +// StartProduction(): see wxSoundStream +// -------------------------------------------------------------------------- +bool wxSoundStreamESD::StartProduction(int evt) +{ + wxSoundFormatPcm *pcm; + int flag = 0; + + if (!m_esd_ok) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + if (!m_esd_stop) + StopProduction(); + + pcm = (wxSoundFormatPcm *)m_sndformat; + + flag |= (pcm->GetBPS() == 16) ? ESD_BITS16 : ESD_BITS8; + flag |= (pcm->GetChannels() == 2) ? ESD_STEREO : ESD_MONO; + + if ((evt & wxSOUND_OUTPUT) != 0) { + flag |= ESD_PLAY | ESD_STREAM; + m_fd_output = esd_play_stream(flag, pcm->GetSampleRate(), NULL, + MY_ESD_NAME); + } + + if ((evt & wxSOUND_INPUT) != 0) { + flag |= ESD_RECORD | ESD_STREAM; + m_fd_input = esd_record_stream(flag, pcm->GetSampleRate(), NULL, + MY_ESD_NAME); + } + +#ifdef __WXGTK__ + if ((evt & wxSOUND_OUTPUT) != 0) { + m_tag_output = gdk_input_add(m_fd_output, GDK_INPUT_WRITE, + _wxSound_OSS_CBack, (gpointer)this); + } + if ((evt & wxSOUND_INPUT) != 0) { + m_tag_input = gdk_input_add(m_fd_input, GDK_INPUT_READ, + _wxSound_OSS_CBack, (gpointer)this); + } +#endif + + m_esd_stop = FALSE; + m_q_filled = FALSE; + + return TRUE; +} + +// -------------------------------------------------------------------------- +// StopProduction(): see wxSoundStream +// -------------------------------------------------------------------------- +bool wxSoundStreamESD::StopProduction() +{ + if (m_esd_stop) + return FALSE; + + if (m_fd_input != -1) { + esd_close(m_fd_input); +#ifdef __WXGTK__ + gdk_input_remove(m_tag_input); +#endif + } + if (m_fd_output != -1) { + esd_close(m_fd_output); +#ifdef __WXGTK__ + gdk_input_remove(m_tag_output); +#endif + } + + m_fd_input = -1; + m_fd_output= -1; + m_esd_stop = TRUE; + m_q_filled = TRUE; + return TRUE; +} + +// +// Detect the closest format (The best). +// +void wxSoundStreamESD::DetectBest(wxSoundFormatPcm *pcm) +{ + wxSoundFormatPcm best_pcm; + + // We change neither the number of channels nor the sample rate + // because ESD is clever. + + best_pcm.SetSampleRate(pcm->GetSampleRate()); + best_pcm.SetChannels(pcm->GetChannels()); + + // It supports 16 bits + if (pcm->GetBPS() >= 16) + best_pcm.SetBPS(16); + else + best_pcm.SetBPS(8); + + best_pcm.SetOrder(wxLITTLE_ENDIAN); + best_pcm.Signed(TRUE); + + // Finally recopy the new format + *pcm = best_pcm; +} diff --git a/contrib/src/mmedia/sndfile.cpp b/contrib/src/mmedia/sndfile.cpp new file mode 100644 index 0000000000..ffe842706e --- /dev/null +++ b/contrib/src/mmedia/sndfile.cpp @@ -0,0 +1,421 @@ +// -------------------------------------------------------------------------- +// Name: sndfile.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999, 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#include + +#ifndef WX_PRECOMP +#include +#include +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndcpcm.h" +#include "wx/mmedia/sndulaw.h" +#include "wx/mmedia/sndg72x.h" + +// -------------------------------------------------------------------------- +// Sound codec router +// A very important class: it ensures that everybody is satisfied. +// It is supposed to create as many codec as it is necessary to transform +// a signal in a specific format in an another. +// -------------------------------------------------------------------------- +wxSoundRouterStream::wxSoundRouterStream(wxSoundStream& sndio) + : wxSoundStreamCodec(sndio) +{ + m_router = NULL; +} + +wxSoundRouterStream::~wxSoundRouterStream() +{ + if (m_router) + delete m_router; +} + +// -------------------------------------------------------------------------- +// Read(void *buffer, wxUint32 len): It reads data synchronously. See sndbase.h +// for possible errors and behaviours ... +// -------------------------------------------------------------------------- +wxSoundStream& wxSoundRouterStream::Read(void *buffer, wxUint32 len) +{ + if (m_router) { + m_router->Read(buffer, len); + m_snderror = m_router->GetError(); + m_lastcount = m_router->GetLastAccess(); + } else { + m_sndio->Read(buffer, len); + m_snderror = m_sndio->GetError(); + m_lastcount = m_sndio->GetLastAccess(); + } + return *this; +} + +// -------------------------------------------------------------------------- +// Write(const void *buffer, wxUint32 len): It writes data synchronously +// -------------------------------------------------------------------------- +wxSoundStream& wxSoundRouterStream::Write(const void *buffer, wxUint32 len) +{ + if (m_router) { + m_router->Write(buffer, len); + m_snderror = m_router->GetError(); + m_lastcount = m_router->GetLastAccess(); + } else { + m_sndio->Write(buffer, len); + m_snderror = m_sndio->GetError(); + m_lastcount = m_sndio->GetLastAccess(); + } + return *this; +} + +// -------------------------------------------------------------------------- +// SetSoundFormat(const wxSoundFormatBase& format) first tries to setup the +// sound driver using the specified format. If this fails, it uses personnal +// codec converters: for the moment there is a PCM converter (PCM to PCM: +// with optional resampling, ...), an ULAW converter (ULAW to PCM), a G72X +// converter (G72X to PCM). If nothing works, it returns FALSE. +// -------------------------------------------------------------------------- +bool wxSoundRouterStream::SetSoundFormat(const wxSoundFormatBase& format) +{ + if (m_router) + delete m_router; + + // First, we try to setup the sound device + if (m_sndio->SetSoundFormat(format)) { + // We are lucky, it is working. + wxSoundStream::SetSoundFormat(m_sndio->GetSoundFormat()); + return TRUE; + } + + switch(format.GetType()) { + case wxSOUND_NOFORMAT: + return FALSE; + case wxSOUND_PCM: + m_router = new wxSoundStreamPcm(*m_sndio); + m_router->SetSoundFormat(format); + break; + case wxSOUND_ULAW: + m_router = new wxSoundStreamUlaw(*m_sndio); + m_router->SetSoundFormat(format); + break; + case wxSOUND_G72X: + m_router = new wxSoundStreamG72X(*m_sndio); + m_router->SetSoundFormat(format); + break; + default: + return FALSE; + + } + wxSoundStream::SetSoundFormat(m_router->GetSoundFormat()); + return TRUE; +} + +// -------------------------------------------------------------------------- +// GetBestSize() returns the specific best buffer size a sound driver +// can manage. It means that it will be easier for it to manage the buffer +// and so it will be faster and in some case more accurate for real-time event. +// -------------------------------------------------------------------------- +wxUint32 wxSoundRouterStream::GetBestSize() const +{ + if (m_router) + return m_router->GetBestSize(); + else + return m_sndio->GetBestSize(); +} + +// -------------------------------------------------------------------------- +// StartProduction(int evt). See sndbase.h +// -------------------------------------------------------------------------- +bool wxSoundRouterStream::StartProduction(int evt) +{ + if (!m_router) { + if (m_sndio->StartProduction(evt)) + return TRUE; + + m_snderror = m_sndio->GetError(); + m_lastcount = m_sndio->GetLastAccess(); + return FALSE; + } + + if (m_router->StartProduction(evt)) + return TRUE; + + m_snderror = m_router->GetError(); + m_lastcount = m_router->GetLastAccess(); + return FALSE; +} + +// -------------------------------------------------------------------------- +// StopProduction(). See sndbase.h +// -------------------------------------------------------------------------- +bool wxSoundRouterStream::StopProduction() +{ + if (!m_router) { + if (m_sndio->StopProduction()) + return TRUE; + + m_snderror = m_sndio->GetError(); + m_lastcount = m_sndio->GetLastAccess(); + return FALSE; + } + + if (m_router->StopProduction()) + return TRUE; + + m_snderror = m_router->GetError(); + m_lastcount = m_router->GetLastAccess(); + return FALSE; +} + +// -------------------------------------------------------------------------- +// wxSoundFileStream: generic reader +// -------------------------------------------------------------------------- + +wxSoundFileStream::wxSoundFileStream(wxInputStream& stream, + wxSoundStream& io_sound) + : m_codec(io_sound), m_sndio(&io_sound), + m_input(&stream), m_output(NULL), m_state(wxSOUND_FILE_STOPPED) +{ + m_length = 0; + m_bytes_left = 0; + m_prepared = FALSE; +} + +wxSoundFileStream::wxSoundFileStream(wxOutputStream& stream, + wxSoundStream& io_sound) + : m_codec(io_sound), m_sndio(&io_sound), + m_input(NULL), m_output(&stream), m_state(wxSOUND_FILE_STOPPED) +{ + m_length = 0; + m_bytes_left = 0; + m_prepared = FALSE; +} + +wxSoundFileStream::~wxSoundFileStream() +{ + if (m_state != wxSOUND_FILE_STOPPED) + Stop(); +} + +bool wxSoundFileStream::Play() +{ + if (m_state != wxSOUND_FILE_STOPPED) + return FALSE; + + if (!m_prepared) + if (!PrepareToPlay()) + return FALSE; + + m_state = wxSOUND_FILE_PLAYING; + + if (!StartProduction(wxSOUND_OUTPUT)) + return FALSE; + + return TRUE; +} + +bool wxSoundFileStream::Record(wxUint32 time) +{ + if (m_state != wxSOUND_FILE_STOPPED) + return FALSE; + + if (!PrepareToRecord(time)) + return FALSE; + + FinishPreparation(m_sndformat->GetBytesFromTime(time)); + + m_state = wxSOUND_FILE_RECORDING; + if (!StartProduction(wxSOUND_INPUT)) + return FALSE; + + return TRUE; +} + +bool wxSoundFileStream::Stop() +{ + if (m_state == wxSOUND_FILE_STOPPED) + return FALSE; + + if (!StopProduction()) + return FALSE; + + m_prepared = FALSE; + + if (m_state == wxSOUND_FILE_RECORDING) + if (!FinishRecording()) { + m_state = wxSOUND_FILE_STOPPED; + return FALSE; + } + + if (m_input) + m_input->SeekI(0, wxFromStart); + + if (m_output) + m_output->SeekO(0, wxFromStart); + + m_state = wxSOUND_FILE_STOPPED; + return TRUE; +} + +bool wxSoundFileStream::Pause() +{ + if (m_state == wxSOUND_FILE_PAUSED || m_state == wxSOUND_FILE_STOPPED) + return FALSE; + + if (!StopProduction()) + return FALSE; + + m_oldstate = m_state; + m_state = wxSOUND_FILE_PAUSED; + return TRUE; +} + +bool wxSoundFileStream::Resume() +{ + if (m_state == wxSOUND_FILE_PLAYING || m_state == wxSOUND_FILE_RECORDING || + m_state == wxSOUND_FILE_STOPPED) + return FALSE; + + if (!StartProduction( (m_oldstate == wxSOUND_FILE_PLAYING) ? + wxSOUND_OUTPUT : wxSOUND_INPUT)) + return FALSE; + + m_state = m_oldstate; + + return TRUE; +} + +wxSoundStream& wxSoundFileStream::Read(void *buffer, wxUint32 len) +{ + if (!m_prepared || m_state != wxSOUND_FILE_PLAYING) { + m_snderror = wxSOUND_NOTSTARTED; + m_lastcount = 0; + return *this; + } + m_lastcount = GetData(buffer, len); + return *this; +} + +wxSoundStream& wxSoundFileStream::Write(const void *buffer, wxUint32 len) +{ + if (!m_prepared || m_state != wxSOUND_FILE_RECORDING) { + m_snderror = wxSOUND_NOTSTARTED; + m_lastcount = 0; + return *this; + } + m_lastcount = PutData(buffer, len); + return *this; +} + +bool wxSoundFileStream::StartProduction(int evt) +{ + m_sndio->SetEventHandler(this); + + if (!m_codec.StartProduction(evt)) + return FALSE; + + return TRUE; +} + +bool wxSoundFileStream::StopProduction() +{ + return m_codec.StopProduction(); +} + +void wxSoundFileStream::FinishPreparation(wxUint32 len) +{ + m_bytes_left = m_length = len; + m_prepared = TRUE; +} + +wxString wxSoundFileStream::GetCodecName() const +{ + return wxString(wxT("wxSoundFileStream base codec")); +} + +wxUint32 wxSoundFileStream::GetLength() +{ + if (m_input && !m_prepared && GetError() == wxSOUND_NOERROR) + return (PrepareToPlay()) ? m_length : 0; + + return m_length; +} + +wxUint32 wxSoundFileStream::GetPosition() +{ + if (!m_prepared && m_input != NULL && GetError() == wxSOUND_NOERROR) + PrepareToPlay(); + + return m_length-m_bytes_left; +} + +wxUint32 wxSoundFileStream::SetPosition(wxUint32 new_position) +{ + if (!m_prepared && m_input != NULL && GetError() == wxSOUND_NOERROR) + PrepareToPlay(); + + if (!m_prepared) + return 0; + + if (!RepositionStream(new_position)) + return m_length-m_bytes_left; + + if (new_position >= m_length) { + m_bytes_left = 0; + return m_length; + } + + m_bytes_left = m_length-new_position; + return new_position; +} + +void wxSoundFileStream::OnSoundEvent(int evt) +{ + wxUint32 len = m_codec.GetBestSize(); + char *buffer; + + buffer = new char[len]; + wxSoundStream::OnSoundEvent(evt); + + while (!m_sndio->QueueFilled()) { + switch(evt) { + case wxSOUND_INPUT: + if (len > m_bytes_left) + len = m_bytes_left; + + len = m_codec.Read(buffer, len).GetLastAccess(); + PutData(buffer, len); + m_bytes_left -= len; + if (m_bytes_left == 0) { + Stop(); + delete[] buffer; + return; + } + break; + case wxSOUND_OUTPUT: + if (len > m_bytes_left) + len = m_bytes_left; + + len = GetData(buffer, len); + m_bytes_left -= len; + if (m_bytes_left == 0) { + Stop(); + delete[] buffer; + return; + } + m_codec.Write(buffer, len); + break; + } + } + delete[] buffer; +} + +bool wxSoundFileStream::SetSoundFormat(const wxSoundFormatBase& format) +{ + wxSoundStream::SetSoundFormat(format); + return m_codec.SetSoundFormat(format); +} diff --git a/contrib/src/mmedia/sndg72x.cpp b/contrib/src/mmedia/sndg72x.cpp new file mode 100644 index 0000000000..91245524b9 --- /dev/null +++ b/contrib/src/mmedia/sndg72x.cpp @@ -0,0 +1,309 @@ +// -------------------------------------------------------------------------- +// Name: sndg72x.cpp +// Purpose: +// Date: 08/26/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndg72x.cpp" +#endif + +#include + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndg72x.h" +#include "wx/mmedia/internal/g72x.h" + +// -------------------------------------------------------------------------- +// wxSoundFormatG72X +// -------------------------------------------------------------------------- + +wxSoundFormatG72X::wxSoundFormatG72X() + : m_srate(22050) +{ +} + +wxSoundFormatG72X::~wxSoundFormatG72X() +{ +} + +void wxSoundFormatG72X::SetSampleRate(wxUint32 srate) +{ + m_srate = srate; +} + +wxUint32 wxSoundFormatG72X::GetSampleRate() const +{ + return m_srate; +} + +void wxSoundFormatG72X::SetG72XType(wxSoundG72XType type) +{ + m_g72x_type = type; +} + +wxSoundFormatBase *wxSoundFormatG72X::Clone() const +{ + wxSoundFormatG72X *g72x = new wxSoundFormatG72X(); + + g72x->m_srate = m_srate; + g72x->m_g72x_type = m_g72x_type; + return g72x; +} + +wxUint32 wxSoundFormatG72X::GetTimeFromBytes(wxUint32 bytes) const +{ + int n_bits; + + switch (m_g72x_type) { + case wxSOUND_G721: + n_bits = 4; + break; + case wxSOUND_G723_24: + n_bits = 3; + break; + case wxSOUND_G723_40: + n_bits = 5; + break; + default: + n_bits = 0; + break; + } + return (wxUint32)((bytes / m_srate) * n_bits) / 8; +} + +wxUint32 wxSoundFormatG72X::GetBytesFromTime(wxUint32 time) const +{ + int n_bits; + + switch (m_g72x_type) { + case wxSOUND_G721: + n_bits = 4; + break; + case wxSOUND_G723_24: + n_bits = 3; + break; + case wxSOUND_G723_40: + n_bits = 5; + break; + default: + n_bits = 0; + } + return (wxUint32)((time * m_srate * n_bits) / 8); +} + +bool wxSoundFormatG72X::operator !=(const wxSoundFormatBase& frmt2) const +{ + wxSoundFormatG72X *g72x = (wxSoundFormatG72X *)&frmt2; + + if (frmt2.GetType() != wxSOUND_G72X) + return TRUE; + + return (g72x->m_srate != m_srate || g72x->m_g72x_type != m_g72x_type); +} + +// -------------------------------------------------------------------------- +// wxSoundStreamG72X +// -------------------------------------------------------------------------- + +wxSoundStreamG72X::wxSoundStreamG72X(wxSoundStream& sndio) + : wxSoundStreamCodec(sndio) +{ + // PCM converter + m_router = new wxSoundRouterStream(sndio); + m_state = new g72state; + g72x_init_state(m_state); +} + +wxSoundStreamG72X::~wxSoundStreamG72X() +{ + delete m_router; +} + +wxSoundStream& wxSoundStreamG72X::Read(void *buffer, wxUint32 len) +{ + wxUint16 *old_linear; + register wxUint16 *linear_buffer; + register wxUint32 real_len; + register wxUint32 countdown = len; + + real_len = (len * 8 / m_n_bits); + + old_linear = linear_buffer = new wxUint16[real_len]; + + m_router->Read(linear_buffer, real_len); + + real_len = (wxUint32)(m_router->GetLastAccess() * ((float)m_n_bits / 8)); + if (!real_len) + return *m_router; + + m_io_buffer = (wxUint8 *)buffer; + m_current_b_pos = 0; + + while (countdown != 0) { + PutBits(m_coder(*linear_buffer++, AUDIO_ENCODING_LINEAR, m_state)); + countdown--; + } + m_lastcount = real_len; + m_snderror = m_router->GetError(); + + delete[] old_linear; + + return *this; +} + +wxSoundStream& wxSoundStreamG72X::Write(const void *buffer, wxUint32 len) +{ + wxUint16 *old_linear; + register wxUint16 *linear_buffer; + register wxUint32 countdown = len; + register wxUint32 real_len; + + // Compute the real length (PCM format) to sendt to the sound card + real_len = (len * m_n_bits / 8); + + // Allocate a temporary buffer + old_linear = linear_buffer = new wxUint16[real_len]; + + // Bad, we override the const + m_io_buffer = (wxUint8 *)buffer; + m_current_b_pos = 0; + + // Decode the datas + while (countdown != 0) { + *linear_buffer++ = m_decoder(GetBits(), AUDIO_ENCODING_LINEAR, m_state); + countdown--; + } + m_lastcount = len; + + // Send them to the sound card + m_router->Write(old_linear, real_len); + + // Destroy the temporary buffer + delete[] old_linear; + + return *m_router; +} + +bool wxSoundStreamG72X::SetSoundFormat(const wxSoundFormatBase& format) +{ + if (format.GetType() != wxSOUND_G72X) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + wxSoundFormatPcm pcm; + wxSoundFormatG72X *g72x; + + wxSoundStreamCodec::SetSoundFormat(format); + + g72x = (wxSoundFormatG72X *)m_sndformat; + + // Set PCM as the output format of the codec + pcm.SetSampleRate(g72x->GetSampleRate()); + pcm.SetBPS(16); + pcm.SetChannels(1); // Only mono supported + pcm.Signed(TRUE); + pcm.SetOrder(wxBYTE_ORDER); + + // Look for the correct codec to use and set its bit width + switch (g72x->GetG72XType()) { + case wxSOUND_G721: + m_n_bits = 4; + m_coder = g721_encoder; + m_decoder = g721_decoder; + break; + case wxSOUND_G723_24: + m_n_bits = 3; + m_coder = g723_24_encoder; + m_decoder = g723_24_decoder; + break; + case wxSOUND_G723_40: + m_n_bits = 5; + m_coder = g723_40_encoder; + m_decoder = g723_40_decoder; + break; + } + + // Let the router finish the work + m_router->SetSoundFormat(pcm); + + return TRUE; +} + +#define BYTE_SIZE 8 + +wxUint8 wxSoundStreamG72X::GetBits() +{ + register wxUint8 bits; + + // We have two bytes to compute + if (m_current_b_pos < m_n_bits) { + register wxUint8 b_left; + + // TRANSLATE the mask + m_current_mask >>= m_current_b_pos; + + // GET the last bits: 0001..1 + bits = (m_current_byte & m_current_mask) << (m_n_bits - m_current_b_pos); + + // GEN: 1. n times .1000 + b_left = BYTE_SIZE-m_n_bits; + m_current_mask = ((1 << m_n_bits) - 1) << b_left; + + // GET the next byte + m_current_byte = *m_io_buffer++; + + register wxUint8 tmp_mask; + + // COMPUTE a new temporary mask to get the last bits + b_left = m_n_bits - b_left; + tmp_mask = (1 << b_left) - 1; + // TRANSLATE the old mask to get ready for the next time + m_current_mask >>= b_left; + + // COMPUTE the new bit position + b_left = BYTE_SIZE - b_left; + m_current_b_pos = b_left; + tmp_mask <<= b_left; + + // GET the last bits + bits |= (m_current_byte & tmp_mask) >> b_left; + } else { + m_current_mask >>= m_n_bits; + m_current_b_pos -= m_n_bits; + bits = (m_current_byte & m_current_mask) >> m_current_b_pos; + } + return bits; +} + +void wxSoundStreamG72X::PutBits(wxUint8 bits) +{ + if (m_current_b_pos < m_n_bits) { + register wxUint8 tmp_mask; + register wxUint8 diff; + + diff = m_n_bits - m_current_b_pos; + // Pack bits and put the byte in the buffer + m_current_byte |= bits >> diff; + *m_io_buffer++ = m_current_byte; + + // Gen a mask + tmp_mask = ~((1 << diff) - 1); + + m_current_b_pos = BYTE_SIZE - (m_n_bits - m_current_b_pos); + + m_current_byte = (bits & (tmp_mask)) << m_current_b_pos; + } else { + m_current_b_pos -= m_n_bits; + bits <<= m_current_b_pos; + m_current_byte |= bits; + } +} diff --git a/contrib/src/mmedia/sndmsad.cpp b/contrib/src/mmedia/sndmsad.cpp new file mode 100644 index 0000000000..8e9c73ff81 --- /dev/null +++ b/contrib/src/mmedia/sndmsad.cpp @@ -0,0 +1,168 @@ +// -------------------------------------------------------------------------- +// Name: sndulaw.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndulaw.cpp" +#endif + +#include +#include "sndbase.h" +#include "sndfile.h" +#include "sndpcm.h" +#include "sndmsad.h" + +// -------------------------------------------------------------------------- +// wxSoundFormatMSAdpcm +// -------------------------------------------------------------------------- + +wxSoundFormatMSAdpcm::wxSoundFormatMSAdpcm() + : m_srate(22050) +{ + m_coefs = new wxMSAdpcmCoefs(); +} + +wxSoundFormatMSAdpcm::~wxSoundFormatMSAdpcm() +{ + delete m_coefs; +} + +void wxSoundFormatMSAdpcm::SetSampleRate(wxUint32 srate) +{ + m_srate = srate; +} + +wxUint32 wxSoundFormatMSAdpcm::GetSampleRate() const +{ + return m_srate; +} + +wxSoundFormatBase *wxSoundFormatMSAdpcm::Clone() const +{ + wxSoundFormatMSAdpcm *adpcm = new wxSoundFormatMSAdpcm(); + + adpcm->m_srate = m_srate; + adpcm->m_coefs = new wxMSAdpcmCoefs(); + *(adpcm->m_coefs) = *m_coefs; + return adpcm; +} + +wxUint32 wxSoundFormatMSAdpcm::GetTimeFromBytes(wxUint32 bytes) const +{ + return 0; +} + +wxUint32 wxSoundFormatMSAdpcm::GetBytesFromTime(wxUint32 time) const +{ + return 0; +} + +bool wxSoundFormatMSAdpcm::operator !=(const wxSoundFormatBase& frmt2) const +{ + wxSoundFormatUlaw *adpcm = (wxSoundFormatMSAdpcm *)&frmt2; + + if (frmt2.GetType() != wxSOUND_MSADPCM) + return TRUE; + + return (adpcm->m_srate != m_srate) && 0; +} + +// -------------------------------------------------------------------------- +// wxSoundStreamMSAdpcm +// -------------------------------------------------------------------------- +wxSoundStreamMSAdpcm::wxSoundStreamMSAdpcm(wxSoundStream& sndio) + : wxSoundStreamCodec(sndio) +{ + // PCM converter + m_router = new wxSoundRouterStream(sndio); + m_got_header = FALSE; +} + +wxSoundStreamMSAdpcm::~wxSoundStreamMSAdpcm() +{ + delete m_router; +} + +wxSoundStream& wxSoundStreamMSAdpcm::Read(void *buffer, wxUint32 len) +{ + m_snderror = wxSOUND_NOCODEC; + m_lastcount = 0; + return *this; +} + +static wxInt16 gl_ADPCMcoeff_delta[] = { + 230, 230, 230, 230, 307, 409, 512, 614, 768, 614, 512, 409, 307, 230, 230, 230 +}; + +static wxInt16 gl_ADPCMcoeff_1[] = { + 256, 512, 0, 192, 240, 460, 392 +}; + +static wxInt16 gl_ADPCMcoeff_2[] = { + 0, -256, 0, 64, 0, -208, -232 +}; + +wxSoundStream& wxSoundStreamMSAdpcm::Write(const void *buffer, wxUint32 len) +{ + wxInt16 delta; + wxUint8 ADPCMdata; + wxUint16 *PCMdata; + wxInt16 coeff1, coeff2; + +#define GET_DATA_16 (*ADPCMdata++ | ((wxUint32)(*ADPCMdata++) << 8); +#define GET_DATA_8 (*ADPCMdata++) + + if (!m_got_header) { + i_predict = GET_DATA_8; + delta = GET_DATA_16; + samp1 = GET_DATA_16; + PCMdata = GET_DATA_16; + len -= 3*2 + 1; + m_got_header = TRUE; + + coeff1 = gl_ADPCMcoeff_1[i_predict]; + coeff2 = gl_ADPCMcoeff_2[i_predict]; + } + + while (len > 0) { + nyb1 = GET_DATA_8; + nyb0 = (nyb1 & 0xf0) >> 4; + nyb1 &= 0x0f; + + + return *this; +} + +wxUint32 wxSoundStreamMSAdpcm::GetBestSize() const +{ + return m_sndio->GetBestSize() / 2; +} + +bool wxSoundStreamMSAdpcm::SetSoundFormat(const wxSoundFormatBase& format) +{ + if (format.GetType() != wxSOUND_ULAW) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + wxSoundFormatPcm pcm; + wxSoundFormatUlaw *ulaw; + + wxSoundStreamCodec::SetSoundFormat(format); + + ulaw = (wxSoundFormatMSAdpcm *)m_sndformat; + + pcm.SetSampleRate(adpcm->GetSampleRate()); + pcm.SetBPS(16); + pcm.SetChannels(adpcm->GetChannels()); + pcm.Signed(TRUE); + pcm.SetOrder(wxBYTE_ORDER); + + m_router->SetSoundFormat(pcm); + + return TRUE; +} + diff --git a/contrib/src/mmedia/sndoss.cpp b/contrib/src/mmedia/sndoss.cpp new file mode 100644 index 0000000000..48b35e8017 --- /dev/null +++ b/contrib/src/mmedia/sndoss.cpp @@ -0,0 +1,387 @@ +// -------------------------------------------------------------------------- +// Name: sndoss.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999, 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndoss.cpp" +#endif + +// -------------------------------------------------------------------------- +// System dependent headers +// -------------------------------------------------------------------------- + +#include +#include +#include +#include +#include +#include +#ifdef __WXGTK__ +#include +#endif + +// -------------------------------------------------------------------------- +// wxWindows headers +// -------------------------------------------------------------------------- +#include "wx/defs.h" +#include "wx/string.h" +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndoss.h" +#include "wx/mmedia/sndpcm.h" + +wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name) +{ + wxSoundFormatPcm pcm_default; + + // Open the OSS device + m_fd = open(dev_name.mb_str(), O_WRONLY); + if (m_fd == -1) { + // OSS not found + m_oss_ok = FALSE; + m_snderror = wxSOUND_INVDEV; + return; + } + + // Remember the device name + m_devname = dev_name; + + // Initialize the default format + wxSoundStreamOSS::SetSoundFormat(pcm_default); + + // Get the default best size for OSS + ioctl(m_fd, SNDCTL_DSP_GETBLKSIZE, &m_bufsize); + + m_snderror = wxSOUND_NOERROR; + + // Close OSS + close(m_fd); + + m_oss_ok = TRUE; + m_oss_stop = TRUE; + m_q_filled = TRUE; +} + +wxSoundStreamOSS::~wxSoundStreamOSS() +{ + if (m_fd > 0) + close(m_fd); +} + +wxUint32 wxSoundStreamOSS::GetBestSize() const +{ + return m_bufsize; +} + +wxSoundStream& wxSoundStreamOSS::Read(void *buffer, wxUint32 len) +{ + int ret; + + if (m_oss_stop) { + m_snderror = wxSOUND_NOTSTARTED; + m_lastcount = 0; + return *this; + } + + m_lastcount = (wxUint32)ret = read(m_fd, buffer, len); + m_q_filled = TRUE; + + if (ret < 0) + m_snderror = wxSOUND_IOERROR; + else + m_snderror = wxSOUND_NOERROR; + + return *this; +} + +wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len) +{ + int ret; + + if (m_oss_stop) { + m_snderror = wxSOUND_NOTSTARTED; + m_lastcount= 0; + return *this; + } + + ret = write(m_fd, buffer, len); + m_q_filled = TRUE; + + if (ret < 0) { + m_lastcount = 0; + m_snderror = wxSOUND_IOERROR; + } else { + m_snderror = wxSOUND_NOERROR; + m_lastcount = (wxUint32)ret; + } + + return *this; +} + +bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format) +{ + int tmp; + wxSoundFormatPcm *pcm_format; + + if (format.GetType() != wxSOUND_PCM) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + if (!m_oss_ok) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + if (m_sndformat) + delete m_sndformat; + + m_sndformat = format.Clone(); + if (!m_sndformat) { + m_snderror = wxSOUND_MEMERROR; + return FALSE; + } + pcm_format = (wxSoundFormatPcm *)m_sndformat; + + // We temporary open the OSS device + if (m_oss_stop) { + m_fd = open(m_devname.mb_str(), O_WRONLY); + if (m_fd == -1) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + } + + // Set the sample rate field. + tmp = pcm_format->GetSampleRate(); + ioctl(m_fd, SNDCTL_DSP_SPEED, &tmp); + + pcm_format->SetSampleRate(tmp); + + // Detect the best format + DetectBest(pcm_format); + // Try to apply it + SetupFormat(pcm_format); + + tmp = pcm_format->GetChannels(); + ioctl(m_fd, SNDCTL_DSP_CHANNELS, &tmp); + pcm_format->SetChannels(tmp); + + // Close the OSS device + if (m_oss_stop) + close(m_fd); + + m_snderror = wxSOUND_NOERROR; + if (*pcm_format != format) { + m_snderror = wxSOUND_NOEXACT; + return FALSE; + } + + return TRUE; +} + +bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format) +{ + int tmp; + + switch(pcm_format->GetBPS()) { + case 8: + if (pcm_format->Signed()) + tmp = AFMT_S8; + else + tmp = AFMT_U8; + break; + case 16: + switch (pcm_format->GetOrder()) { + case wxBIG_ENDIAN: + if (pcm_format->Signed()) + tmp = AFMT_S16_BE; + else + tmp = AFMT_U16_BE; + break; + case wxLITTLE_ENDIAN: + if (pcm_format->Signed()) + tmp = AFMT_S16_LE; + else + tmp = AFMT_U16_LE; + break; + } + break; + } + + ioctl(m_fd, SNDCTL_DSP_SETFMT, &tmp); + + // Demangling. + switch (tmp) { + case AFMT_U8: + pcm_format->SetBPS(8); + pcm_format->Signed(FALSE); + break; + case AFMT_S8: + pcm_format->SetBPS(8); + pcm_format->Signed(TRUE); + break; + case AFMT_U16_LE: + pcm_format->SetBPS(16); + pcm_format->Signed(FALSE); + pcm_format->SetOrder(wxLITTLE_ENDIAN); + break; + case AFMT_U16_BE: + pcm_format->SetBPS(16); + pcm_format->Signed(FALSE); + pcm_format->SetOrder(wxBIG_ENDIAN); + break; + case AFMT_S16_LE: + pcm_format->SetBPS(16); + pcm_format->Signed(TRUE); + pcm_format->SetOrder(wxLITTLE_ENDIAN); + break; + case AFMT_S16_BE: + pcm_format->SetBPS(16); + pcm_format->Signed(TRUE); + pcm_format->SetOrder(wxBIG_ENDIAN); + break; + } + return TRUE; +} + +#ifdef __WXGTK__ +static void _wxSound_OSS_CBack(gpointer data, int source, + GdkInputCondition condition) +{ + wxSoundStreamOSS *oss = (wxSoundStreamOSS *)data; + + switch (condition) { + case GDK_INPUT_READ: + oss->WakeUpEvt(wxSOUND_INPUT); + break; + case GDK_INPUT_WRITE: + oss->WakeUpEvt(wxSOUND_OUTPUT); + break; + default: + break; + } +} +#endif + +void wxSoundStreamOSS::WakeUpEvt(int evt) +{ + m_q_filled = FALSE; + OnSoundEvent(evt); +} + +bool wxSoundStreamOSS::StartProduction(int evt) +{ + wxSoundFormatBase *old_frmt; + + if (!m_oss_stop) + StopProduction(); + + old_frmt = m_sndformat->Clone(); + if (!old_frmt) { + m_snderror = wxSOUND_MEMERROR; + return FALSE; + } + + if (evt == wxSOUND_OUTPUT) + m_fd = open(m_devname.mb_str(), O_WRONLY); + else if (evt == wxSOUND_INPUT) + m_fd = open(m_devname.mb_str(), O_RDONLY); + + if (m_fd == -1) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + SetSoundFormat(*old_frmt); + delete old_frmt; + + int trig; + + if (evt == wxSOUND_OUTPUT) { +#ifdef __WXGTK__ + m_tag = gdk_input_add(m_fd, GDK_INPUT_WRITE, _wxSound_OSS_CBack, (gpointer)this); +#endif + trig = PCM_ENABLE_OUTPUT; + } else { +#ifdef __WXGTK__ + m_tag = gdk_input_add(m_fd, GDK_INPUT_READ, _wxSound_OSS_CBack, (gpointer)this); +#endif + trig = PCM_ENABLE_INPUT; + } + + ioctl(m_fd, SNDCTL_DSP_SETTRIGGER, &trig); + + m_oss_stop = FALSE; + m_q_filled = FALSE; + + return TRUE; +} + +bool wxSoundStreamOSS::StopProduction() +{ + if (m_oss_stop) + return FALSE; + +#ifdef __WXGTK__ + gdk_input_remove(m_tag); +#endif + + close(m_fd); + m_oss_stop = TRUE; + m_q_filled = TRUE; + return TRUE; +} + +bool wxSoundStreamOSS::QueueFilled() const +{ + return m_q_filled; +} + +// +// Detect the closest format (The best). +// +void wxSoundStreamOSS::DetectBest(wxSoundFormatPcm *pcm) +{ +#define MASK_16BITS (AFMT_S16_LE | AFMT_S16_BE | AFMT_U16_LE | AFMT_U16_BE) + + int fmt_mask; + wxSoundFormatPcm best_pcm; + + // We change neither the number of channels nor the sample rate + + best_pcm.SetSampleRate(pcm->GetSampleRate()); + best_pcm.SetChannels(pcm->GetChannels()); + + // Get the supported format by the sound card + ioctl(m_fd, SNDCTL_DSP_GETFMTS, &fmt_mask); + + // It supports 16 bits + if (pcm->GetBPS() == 16 && ((fmt_mask & MASK_16BITS) != 0)) + best_pcm.SetBPS(16); + + // It supports big endianness + if (pcm->GetOrder() == wxBIG_ENDIAN && + ((fmt_mask & (AFMT_S16_BE | AFMT_U16_BE)) != 0)) + best_pcm.SetOrder(wxBIG_ENDIAN); + + // It supports little endianness + if (pcm->GetOrder() == wxLITTLE_ENDIAN && + ((fmt_mask & (AFMT_S16_LE | AFMT_U16_LE)) != 0)) + best_pcm.SetOrder(wxLITTLE_ENDIAN); + + // It supports signed samples + if (pcm->Signed() && + ((fmt_mask & (AFMT_S16_LE | AFMT_S16_BE | AFMT_S8)) != 0)) + best_pcm.Signed(TRUE); + + // It supports unsigned samples + if (!pcm->Signed() && + ((fmt_mask & (AFMT_U16_LE | AFMT_U16_BE | AFMT_U8)) != 0)) + best_pcm.Signed(FALSE); + + // Finally recopy the new format + *pcm = best_pcm; +} diff --git a/contrib/src/mmedia/sndpcm.cpp b/contrib/src/mmedia/sndpcm.cpp new file mode 100644 index 0000000000..0c1bc67a3c --- /dev/null +++ b/contrib/src/mmedia/sndpcm.cpp @@ -0,0 +1,98 @@ +// -------------------------------------------------------------------------- +// Name: sndpcm.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndpcm.cpp" +#endif + +#include + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndpcm.h" + +wxSoundFormatPcm::wxSoundFormatPcm(wxUint32 srate, wxUint8 bps, + wxUint16 nchannels, bool sign, + int order) + : m_srate(srate), m_bps(bps), m_nchan(nchannels), m_order(order), + m_signed(sign) +{ +} + +wxSoundFormatPcm::~wxSoundFormatPcm() +{ +} + +void wxSoundFormatPcm::SetSampleRate(wxUint32 srate) +{ + m_srate = srate; +} + +void wxSoundFormatPcm::SetBPS(wxUint8 bps) +{ + m_bps = bps; +} + +void wxSoundFormatPcm::SetChannels(wxUint16 nchannels) +{ + m_nchan = nchannels; +} + +void wxSoundFormatPcm::SetOrder(int order) +{ + m_order = order; +} + +void wxSoundFormatPcm::Signed(bool sign) +{ + m_signed = sign; +} + +wxSoundFormatBase *wxSoundFormatPcm::Clone() const +{ + wxSoundFormatPcm *new_pcm; + + new_pcm = new wxSoundFormatPcm(); + new_pcm->m_srate = m_srate; + new_pcm->m_bps = m_bps; + new_pcm->m_nchan = m_nchan; + new_pcm->m_order = m_order; + new_pcm->m_signed= m_signed; + + return new_pcm; +} + +wxUint32 wxSoundFormatPcm::GetTimeFromBytes(wxUint32 bytes) const +{ + return (bytes / (m_srate * (m_bps / 8) * m_nchan)); +} + +wxUint32 wxSoundFormatPcm::GetBytesFromTime(wxUint32 time) const +{ + return (time * (m_srate * (m_bps / 8) * m_nchan)); +} + +bool wxSoundFormatPcm::operator!=(const wxSoundFormatBase& format) const +{ + wxSoundFormatPcm *format2 = (wxSoundFormatPcm *)&format; + + if (format.GetType() != wxSOUND_PCM) + return TRUE; + + return ( (m_srate != format2->m_srate) || + (m_bps != format2->m_bps) || + (m_nchan != format2->m_nchan) || + (m_order != format2->m_order) || + (m_signed != format2->m_signed) ); +} diff --git a/contrib/src/mmedia/sndulaw.cpp b/contrib/src/mmedia/sndulaw.cpp new file mode 100644 index 0000000000..3ad9e5174a --- /dev/null +++ b/contrib/src/mmedia/sndulaw.cpp @@ -0,0 +1,185 @@ +// -------------------------------------------------------------------------- +// Name: sndulaw.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndulaw.cpp" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndulaw.h" +#include "wx/mmedia/internal/g72x.h" + +// -------------------------------------------------------------------------- +// wxSoundFormatUlaw +// -------------------------------------------------------------------------- + +wxSoundFormatUlaw::wxSoundFormatUlaw() + : m_srate(22050), m_channels(1) +{ +} + +wxSoundFormatUlaw::~wxSoundFormatUlaw() +{ +} + +void wxSoundFormatUlaw::SetSampleRate(wxUint32 srate) +{ + m_srate = srate; +} + +wxUint32 wxSoundFormatUlaw::GetSampleRate() const +{ + return m_srate; +} + +wxUint8 wxSoundFormatUlaw::GetChannels() const +{ + return m_channels; +} + +void wxSoundFormatUlaw::SetChannels(wxUint8 nchannels) +{ + m_channels = nchannels; +} + +wxSoundFormatBase *wxSoundFormatUlaw::Clone() const +{ + wxSoundFormatUlaw *ulaw = new wxSoundFormatUlaw(); + + ulaw->m_srate = m_srate; + ulaw->m_channels = m_channels; + return ulaw; +} + +wxUint32 wxSoundFormatUlaw::GetTimeFromBytes(wxUint32 bytes) const +{ + return (bytes / m_srate); +} + +wxUint32 wxSoundFormatUlaw::GetBytesFromTime(wxUint32 time) const +{ + return time * m_srate; +} + +bool wxSoundFormatUlaw::operator !=(const wxSoundFormatBase& frmt2) const +{ + wxSoundFormatUlaw *ulaw = (wxSoundFormatUlaw *)&frmt2; + + if (frmt2.GetType() != wxSOUND_ULAW) + return TRUE; + + return (ulaw->m_srate != m_srate); +} + +// -------------------------------------------------------------------------- +// wxSoundStreamUlaw +// -------------------------------------------------------------------------- +wxSoundStreamUlaw::wxSoundStreamUlaw(wxSoundStream& sndio) + : wxSoundStreamCodec(sndio) +{ + // PCM converter + m_router = new wxSoundRouterStream(sndio); +} + +wxSoundStreamUlaw::~wxSoundStreamUlaw() +{ + delete m_router; +} + +wxSoundStream& wxSoundStreamUlaw::Read(void *buffer, wxUint32 len) +{ + wxUint16 *old_linear; + register wxUint16 *linear_buffer; + register const wxUint8 *ulaw_buffer; + register wxUint32 countdown; + + old_linear = linear_buffer = new wxUint16[len*2]; + ulaw_buffer = (const wxUint8 *)buffer; + + m_router->Read(linear_buffer, len * 2); + + m_lastcount = countdown = m_router->GetLastAccess() / 2; + m_snderror = m_router->GetError(); + if (m_snderror != wxSOUND_NOERROR) + return *this; + + while (countdown > 0) { + *linear_buffer++ = ulaw2linear(*ulaw_buffer++); + countdown--; + } + + delete[] old_linear; + + return *m_router; +} + +wxSoundStream& wxSoundStreamUlaw::Write(const void *buffer, wxUint32 len) +{ + wxUint16 *old_linear; + register wxUint16 *linear_buffer; + register const wxUint8 *ulaw_buffer; + register wxUint32 countdown = len; + + old_linear = linear_buffer = new wxUint16[len*2]; + ulaw_buffer = (const wxUint8 *)buffer; + + while (countdown > 0) { + *linear_buffer++ = ulaw2linear(*ulaw_buffer++); + countdown--; + } + + m_router->Write(old_linear, len * 2); + + delete[] old_linear; + + return *m_router; +} + +wxUint32 wxSoundStreamUlaw::GetBestSize() const +{ + return m_sndio->GetBestSize() / 2; +} + +bool wxSoundStreamUlaw::SetSoundFormat(const wxSoundFormatBase& format) +{ + if (format.GetType() != wxSOUND_ULAW) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + // As the codec only support 16 bits, Mono we must use a wxSoundRouter to filter the data and + // to translate them to a format supported by the sound card. + + wxSoundFormatPcm pcm; + wxSoundFormatUlaw *ulaw; + + wxSoundStreamCodec::SetSoundFormat(format); + + ulaw = (wxSoundFormatUlaw *)m_sndformat; + + pcm.SetSampleRate(ulaw->GetSampleRate()); + pcm.SetBPS(16); + pcm.SetChannels(ulaw->GetChannels()); + pcm.Signed(TRUE); + pcm.SetOrder(wxBYTE_ORDER); + + m_router->SetSoundFormat(pcm); + + return TRUE; +} diff --git a/contrib/src/mmedia/sndwav.cpp b/contrib/src/mmedia/sndwav.cpp new file mode 100644 index 0000000000..7d6d891878 --- /dev/null +++ b/contrib/src/mmedia/sndwav.cpp @@ -0,0 +1,363 @@ +// -------------------------------------------------------------------------- +// Name: sndwav.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndwav.cpp" +#endif + +#include + +#ifndef WX_PRECOMP + #include "wx/defs.h" +#endif + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/stream.h" +#include "wx/datstrm.h" +#include "wx/filefn.h" +#include "wx/mstream.h" + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndcodec.h" +#include "wx/mmedia/sndfile.h" +#include "wx/mmedia/sndpcm.h" +#include "wx/mmedia/sndg72x.h" +#include "wx/mmedia/sndwav.h" + +#define BUILD_SIGNATURE(a,b,c,d) (((wxUint32)a) | (((wxUint32)b) << 8) | (((wxUint32)c) << 16) | (((wxUint32)d) << 24)) + +#define RIFF_SIGNATURE BUILD_SIGNATURE('R','I','F','F') +#define WAVE_SIGNATURE BUILD_SIGNATURE('W','A','V','E') +#define FMT_SIGNATURE BUILD_SIGNATURE('f','m','t',' ') +#define DATA_SIGNATURE BUILD_SIGNATURE('d','a','t','a') + +#define HEADER_SIZE 4+4 + 4+4+16 + 4+4 +// 4+4 => NAME + LEN +// 16 => fmt size + +wxSoundWave::wxSoundWave(wxInputStream& stream, wxSoundStream& io_sound) + : wxSoundFileStream(stream, io_sound) +{ + m_base_offset = wxInvalidOffset; +} + +wxSoundWave::wxSoundWave(wxOutputStream& stream, wxSoundStream& io_sound) + : wxSoundFileStream(stream, io_sound) +{ + m_base_offset = wxInvalidOffset; +} + +wxSoundWave::~wxSoundWave() +{ +} + +wxString wxSoundWave::GetCodecName() const +{ + return wxString(wxT("wxSoundWave codec")); +} + +#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return FALSE; } + +bool wxSoundWave::CanRead() +{ + wxUint32 len, signature1, signature2; + m_snderror = wxSOUND_NOERROR; + + // Test the main signatures: + // "RIFF" + FAIL_WITH(m_input->Read(&signature1, 4).LastRead() != 4, wxSOUND_INVSTRM); + + if (wxUINT32_SWAP_ON_BE(signature1) != RIFF_SIGNATURE) { + m_input->Ungetch(&signature1, 4); + return FALSE; + } + + // Pass the global length + m_input->Read(&len, 4); + FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM); + + // Get the second signature + FAIL_WITH(m_input->Read(&signature2, 4).LastRead() != 4, wxSOUND_INVSTRM); + // Ungetch all + m_input->Ungetch(&signature2, 4); + m_input->Ungetch(&len, 4); + m_input->Ungetch(&signature1, 4); + + // Test the second signature + if (wxUINT32_SWAP_ON_BE(signature2) != WAVE_SIGNATURE) + return FALSE; + + return TRUE; +} + +bool wxSoundWave::HandleOutputPCM(wxDataInputStream& data, wxUint16 channels, + wxUint32 sample_fq, wxUint32 byte_p_sec, + wxUint16 byte_p_spl, wxUint16 bits_p_spl) +{ + wxSoundFormatPcm sndformat; + + sndformat.SetSampleRate(sample_fq); + sndformat.SetBPS(bits_p_spl); + sndformat.SetChannels(channels); + sndformat.Signed(TRUE); + sndformat.SetOrder(wxLITTLE_ENDIAN); + + if (!SetSoundFormat(sndformat)) + return FALSE; + + return TRUE; +} + +bool wxSoundWave::HandleOutputG721(wxDataInputStream& data, wxUint16 channels, + wxUint32 sample_fq, wxUint32 byte_p_sec, + wxUint16 byte_p_spl, wxUint16 bits_p_spl) +{ + wxSoundFormatG72X sndformat; + + sndformat.SetSampleRate(sample_fq); + sndformat.SetG72XType(wxSOUND_G721); + + if (!SetSoundFormat(sndformat)) + return FALSE; + + return TRUE; +} + +bool wxSoundWave::PrepareToPlay() +{ + wxUint32 signature, len; + bool end_headers; + + if (!m_input) { + m_snderror = wxSOUND_INVSTRM; + return FALSE; + } + + wxDataInputStream data(*m_input); + data.BigEndianOrdered(FALSE); + + // Get the first signature + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != RIFF_SIGNATURE, wxSOUND_INVSTRM); + // "RIFF" + + len = data.Read32(); + FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM); + // dummy len + + // Get the second signature + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != WAVE_SIGNATURE, wxSOUND_INVSTRM); + // "WAVE" + + end_headers = FALSE; + // Chunk loop + while (!end_headers) { + FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM); + + len = data.Read32(); + FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM); + + switch (wxUINT32_SWAP_ON_BE(signature)) { + case FMT_SIGNATURE: { // "fmt " + wxUint16 format, channels, byte_p_spl, bits_p_spl; + wxUint32 sample_fq, byte_p_sec; + + // Get the common parameters + data >> format >> channels >> sample_fq + >> byte_p_sec >> byte_p_spl >> bits_p_spl; + + switch (format) { + case 0x01: // PCM + if (!HandleOutputPCM(data, channels, sample_fq, + byte_p_sec, byte_p_spl, bits_p_spl)) + return FALSE; + break; + case 0x40: // G721 + if (!HandleOutputG721(data, channels, sample_fq, + byte_p_sec, byte_p_spl, bits_p_spl)) + return FALSE; + break; + default: + m_snderror = wxSOUND_NOCODEC; + return FALSE; + } + break; + } + case DATA_SIGNATURE: // "data" + m_base_offset = m_input->TellI(); + end_headers = TRUE; + FinishPreparation(len); + break; + default: + // We pass the chunk + m_input->SeekI(len, wxFromCurrent); + break; + } + } + return TRUE; +} + +wxSoundFormatBase *wxSoundWave::HandleInputPCM(wxDataOutputStream& data) +{ + wxUint16 format, channels, byte_p_spl, bits_p_spl; + wxUint32 sample_fq, byte_p_sec; + wxSoundFormatPcm *pcm; + + pcm = (wxSoundFormatPcm *)(m_sndformat->Clone()); + + // Write block length + data.Write32(16); + + sample_fq = pcm->GetSampleRate(); + bits_p_spl = pcm->GetBPS(); + channels = pcm->GetChannels(); + byte_p_spl = pcm->GetBPS() / 8; + byte_p_sec = pcm->GetBytesFromTime(1); + format = 0x01; + + pcm->Signed(TRUE); + pcm->SetOrder(wxLITTLE_ENDIAN); + + data << format << channels << sample_fq + << byte_p_sec << byte_p_spl << bits_p_spl; + + return pcm; +} + +wxSoundFormatBase *wxSoundWave::HandleInputG72X(wxDataOutputStream& data) +{ + wxUint16 format, channels, byte_p_spl, bits_p_spl; + wxUint32 sample_fq, byte_p_sec; + wxSoundFormatG72X *g72x; + + // Write block length + data.Write32(16); + + g72x = (wxSoundFormatG72X *)(m_sndformat->Clone()); + if (g72x->GetG72XType() != wxSOUND_G721) { + delete g72x; + return NULL; + } + + sample_fq = g72x->GetSampleRate(); + bits_p_spl = 4; + channels = 1; + byte_p_spl = 0; + byte_p_sec = g72x->GetBytesFromTime(1); + format = 0x40; + data << format << channels << sample_fq + << byte_p_sec << byte_p_spl << bits_p_spl; + + return g72x; +} + +bool wxSoundWave::PrepareToRecord(wxUint32 time) +{ +#define WRITE_SIGNATURE(s,sig) \ +signature = sig; \ +signature = wxUINT32_SWAP_ON_BE(signature); \ +FAIL_WITH(s->Write(&signature, 4).LastWrite() != 4, wxSOUND_INVSTRM); + + wxUint32 signature; + wxMemoryOutputStream fmt_data; + + if (!m_output) { + m_snderror = wxSOUND_INVSTRM; + return FALSE; + } + + wxDataOutputStream data(*m_output); + wxDataOutputStream fmt_d_data(fmt_data); + + data.BigEndianOrdered(FALSE); + fmt_d_data.BigEndianOrdered(FALSE); + + WRITE_SIGNATURE(m_output, RIFF_SIGNATURE); + + FAIL_WITH(m_output->LastWrite() != 4, wxSOUND_INVSTRM); + + WRITE_SIGNATURE((&fmt_data), WAVE_SIGNATURE); + + { + wxSoundFormatBase *frmt; + + WRITE_SIGNATURE((&fmt_data), FMT_SIGNATURE); + + switch (m_sndformat->GetType()) { + case wxSOUND_PCM: + frmt = HandleInputPCM(fmt_d_data); + break; + case wxSOUND_G72X: + frmt = HandleInputG72X(fmt_d_data); + break; + default: + m_snderror = wxSOUND_NOCODEC; + return FALSE; + } + + FAIL_WITH(!frmt, wxSOUND_NOCODEC); + + if (!SetSoundFormat(*frmt)) { + delete frmt; + return FALSE; + } + + delete frmt; + } + + data << (fmt_data.GetSize() + m_sndformat->GetBytesFromTime(time)); + + // We, finally, copy the header block to the output stream + { + char *out_buf; + out_buf = new char[fmt_data.GetSize()]; + + fmt_data.CopyTo(out_buf, fmt_data.GetSize()); + m_output->Write(out_buf, fmt_data.GetSize()); + + delete[] out_buf; + } + + WRITE_SIGNATURE(m_output, DATA_SIGNATURE); + data.Write32(m_sndformat->GetBytesFromTime(time)); + return TRUE; +} + +bool wxSoundWave::FinishRecording() +{ + if (m_output->SeekO(0, wxFromStart) == wxInvalidOffset) + // We can't but there is no error. + return TRUE; + + if (m_bytes_left == 0) + return TRUE; + + // TODO: Update headers when we stop before the specified time (if possible) + return TRUE; +} + +bool wxSoundWave::RepositionStream(wxUint32 position) +{ + if (m_base_offset == wxInvalidOffset) + return FALSE; + m_input->SeekI(m_base_offset, wxFromStart); + return TRUE; +} + +wxUint32 wxSoundWave::GetData(void *buffer, wxUint32 len) +{ + return m_input->Read(buffer, len).LastRead(); +} + +wxUint32 wxSoundWave::PutData(const void *buffer, wxUint32 len) +{ + return m_output->Write(buffer, len).LastWrite(); +} diff --git a/contrib/src/mmedia/sndwin.cpp b/contrib/src/mmedia/sndwin.cpp new file mode 100644 index 0000000000..c2776d9438 --- /dev/null +++ b/contrib/src/mmedia/sndwin.cpp @@ -0,0 +1,776 @@ +// -------------------------------------------------------------------------- +// Name: sndwin.cpp +// Purpose: +// Date: 08/11/1999 +// Author: Guilhem Lavaux (C) 1999, 2000 +// CVSID: $Id$ +// -------------------------------------------------------------------------- +#ifdef __GNUG__ +#pragma implementation "sndwin.cpp" +#endif + +#include "wx/wxprec.h" + +#ifdef __WINDOWS__ + +#ifndef WX_PRECOMP + #include "wx/defs.h" + #include "wx/app.h" + #include "wx/module.h" + #include "wx/msw/private.h" + #include "wx/string.h" +#endif + +// ------------------------------------------------------------------------- +// MMedia headers +// ------------------------------------------------------------------------- + +#include "wx/mmedia/sndbase.h" +#include "wx/mmedia/sndwin.h" +#include "wx/mmedia/sndpcm.h" + +// ------------------------------------------------------------------------- +// System headers +// ------------------------------------------------------------------------- + +#include +#include + +// ------------------------------------------------------------------------- +// External definitions, forward, ... +// ------------------------------------------------------------------------- + +typedef struct _wxSoundInternal wxSoundInternal; +typedef struct _wxSoundInfoHeader wxSoundInfoHeader; + +extern const wxChar *wxCanvasClassName; + +wxList *wxSoundHandleList = NULL; + +static inline wxSoundStreamWin *wxFindSoundFromHandle(WXHWND hWnd) +{ + wxNode *node = wxSoundHandleList->Find((long)hWnd); + if (!node) + return NULL; + return (wxSoundStreamWin *)node->Data(); +} + +struct _wxSoundInternal { + HWND m_sndWin; + HWAVEIN m_devin; + HWAVEOUT m_devout; + bool m_output_enabled, m_input_enabled; +}; + +struct _wxSoundInfoHeader { + HGLOBAL m_h_header, m_h_data; + char *m_data; + WAVEHDR *m_header; + int m_mode; + bool m_playing, m_recording; + wxUint32 m_position, m_size; + + wxSoundStreamWin *m_driver; +}; + +#define WXSOUND_MAX_QUEUE 10 + +wxSoundStreamWin::wxSoundStreamWin() +{ + wxSoundFormatPcm pcm; + + m_production_started = FALSE; + m_internal = new wxSoundInternal; + if (!m_internal) { + m_snderror = wxSOUND_MEMERROR; + m_internal = NULL; + return; + } + m_snderror = wxSOUND_NOERROR; + + // Setup defaults + CreateSndWindow(); + SetSoundFormat(pcm); + + m_internal->m_input_enabled = FALSE; + m_internal->m_output_enabled = FALSE; + + m_waiting_for = FALSE; + + if (!OpenDevice(wxSOUND_OUTPUT)) + return; + + CloseDevice(); +} + +wxSoundStreamWin::~wxSoundStreamWin() +{ + if (m_internal) { + if (m_production_started) + StopProduction(); + DestroySndWindow(); + + delete m_internal; + } +} + +// ----------------------------------------------------------------------- +// _wxSoundHandlerWndProc: Window callback to handle buffer completion +// ----------------------------------------------------------------------- +LRESULT APIENTRY _EXPORT _wxSoundHandlerWndProc(HWND hWnd, UINT message, + WPARAM wParam, LPARAM lParam) +{ + wxSoundStreamWin *sndwin; + + sndwin = wxFindSoundFromHandle((WXHWND)hWnd); + if (!sndwin) + return (LRESULT)0; + + switch (message) { + case MM_WOM_DONE: + sndwin->NotifyDoneBuffer(wParam, wxSOUND_OUTPUT); + break; + case MM_WIM_DATA: + sndwin->NotifyDoneBuffer(wParam, wxSOUND_INPUT); + break; + default: + break; + } + return (LRESULT)0; +} + +// ----------------------------------------------------------------------- +// CreateSndWindow() creates an hidden window which will receive the sound +// events +// ----------------------------------------------------------------------- + +void wxSoundStreamWin::CreateSndWindow() +{ + FARPROC proc = MakeProcInstance((FARPROC)_wxSoundHandlerWndProc, + wxGetInstance()); + int error; + + m_internal->m_sndWin = ::CreateWindow(wxCanvasClassName, NULL, 0, + 0, 0, 0, 0, NULL, (HMENU) NULL, + wxGetInstance(), NULL); + + error = GetLastError(); + + ::SetWindowLong(m_internal->m_sndWin, GWL_WNDPROC, (LONG)proc); + + // Add this window to the sound handle list so we'll be able to redecode + // the "magic" number. + wxSoundHandleList->Append((long)m_internal->m_sndWin, (wxObject *)this); +} + +// ----------------------------------------------------------------------- +// DestroySndWindow() destroys the hidden window +// ----------------------------------------------------------------------- + +void wxSoundStreamWin::DestroySndWindow() +{ + if (m_internal->m_sndWin) { + ::DestroyWindow(m_internal->m_sndWin); + wxSoundHandleList->DeleteObject((wxObject *)this); + } +} + +// ------------------------------------------------------------------------- +// OpenDevice(int mode) initializes the windows driver for a "mode" +// operation. mode is a bit mask: if the bit "wxSOUND_OUTPUT" is set, +// the driver is opened for output operation, and if the bit "wxSOUND_INPUT" +// is set, then the driver is opened for input operation. The two modes +// aren't exclusive. +// The initialization parameters (sample rate, ...) are taken from the +// m_sndformat object. +// At the end, OpenDevice() calls AllocHeaders() to initialize the Sound IO +// queue. +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::OpenDevice(int mode) +{ + wxSoundFormatPcm *pcm; + WAVEFORMATEX wformat; + + if (!m_sndformat) { + m_snderror = wxSOUND_INVFRMT; + return FALSE; + } + + pcm = (wxSoundFormatPcm *)m_sndformat; + + wformat.wFormatTag = WAVE_FORMAT_PCM; + wformat.nChannels = pcm->GetChannels(); + wformat.nBlockAlign = wformat.nChannels * pcm->GetBPS() / 8; + wformat.nSamplesPerSec = pcm->GetSampleRate(); + wformat.nAvgBytesPerSec = wformat.nSamplesPerSec * wformat.nBlockAlign; + wformat.wBitsPerSample = pcm->GetBPS(); + wformat.cbSize = 0; + + // ----------------------------------- + // Open the driver for Output operation + // ----------------------------------- + if (mode & wxSOUND_OUTPUT) { + MMRESULT result; + + result = waveOutOpen(&m_internal->m_devout, + WAVE_MAPPER, &wformat, + (DWORD)m_internal->m_sndWin, 0, + CALLBACK_WINDOW); + + if (result != MMSYSERR_NOERROR) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + m_output_frag_out = WXSOUND_MAX_QUEUE-1; + m_current_frag_out = 0; + + m_internal->m_output_enabled = TRUE; + } + // ----------------------------------- + // Open the driver for Input operation + // ----------------------------------- + if (mode & wxSOUND_INPUT) { + MMRESULT result; + + result = waveInOpen(&m_internal->m_devin, + WAVE_MAPPER, &wformat, + (DWORD)m_internal->m_sndWin, 0, + CALLBACK_WINDOW); + + if (result != MMSYSERR_NOERROR) { + m_snderror = wxSOUND_INVDEV; + return FALSE; + } + + m_current_frag_in = WXSOUND_MAX_QUEUE-1; + m_input_frag_in = 0; + + m_internal->m_input_enabled = TRUE; + } + + if (mode & wxSOUND_OUTPUT) { + if (!AllocHeaders(wxSOUND_OUTPUT)) { + CloseDevice(); + return FALSE; + } + } + if (mode & wxSOUND_INPUT) { + if (!AllocHeaders(wxSOUND_INPUT)) { + CloseDevice(); + return FALSE; + } + } + + return TRUE; +} + +// ------------------------------------------------------------------------- +// CloseDevice() closes the driver handles and frees memory allocated for +// IO queues. +// ------------------------------------------------------------------------- +void wxSoundStreamWin::CloseDevice() +{ + if (m_internal->m_output_enabled) { + FreeHeaders(wxSOUND_OUTPUT); + m_internal->m_output_enabled = FALSE; + waveOutClose(m_internal->m_devout); + } + + if (m_internal->m_input_enabled) { + FreeHeaders(wxSOUND_INPUT); + m_internal->m_input_enabled = FALSE; + waveInClose(m_internal->m_devin); + } +} + +// ------------------------------------------------------------------------- +// AllocHeader(int mode) +// +// mode has the same mean as in OpenDevice() except that here the two flags +// must be exclusive. +// AllocHeader() initializes an element of an operation (this can be input +// or output). It means it allocates the sound header's memory block +// and "prepares" it (It is needed by Windows). At the same time, it sets +// private datas so we can the header's owner (See callback). +// +// It returns the new allocated block or NULL. +// ------------------------------------------------------------------------- +wxSoundInfoHeader *wxSoundStreamWin::AllocHeader(int mode) +{ + wxSoundInfoHeader *info; + WAVEHDR *header; + + // Some memory allocation + info = new wxSoundInfoHeader; + info->m_h_data = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, GetBestSize()); + info->m_h_header = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, sizeof(WAVEHDR)); + if (!info->m_h_data || !info->m_h_header) { + delete info; + m_snderror = wxSOUND_MEMERR; + return NULL; + } + + // Get the two pointers from the system + info->m_data = (char *)GlobalLock(info->m_h_data); + info->m_header = (WAVEHDR *)GlobalLock(info->m_h_header); + // Set the header's mode + info->m_mode = mode; + // Set the parent of the header + info->m_driver = this; + // Clean it up + ClearHeader(info); + + header = info->m_header; + // Initialize Windows variables + header->lpData = info->m_data; + header->dwBufferLength = GetBestSize(); + header->dwUser = (DWORD)info; + header->dwFlags = WHDR_DONE; + + // "Prepare" the header + if (mode == wxSOUND_INPUT) { + MMRESULT result; + + result = waveInPrepareHeader(m_internal->m_devin, header, + sizeof(WAVEHDR)); + + if (result != MMSYSERR_NOERROR) { + // If something goes wrong, free everything. + GlobalUnlock(info->m_data); + GlobalUnlock(info->m_header); + GlobalFree(info->m_h_data); + GlobalFree(info->m_h_header); + delete info; + + m_snderror = wxSOUND_IOERROR; + return NULL; + } + } else if (mode == wxSOUND_OUTPUT) { + MMRESULT result; + + result = waveOutPrepareHeader(m_internal->m_devout, header, + sizeof(WAVEHDR)); + + if (result != MMSYSERR_NOERROR) { + // If something goes wrong, free everything. + GlobalUnlock(info->m_data); + GlobalUnlock(info->m_header); + GlobalFree(info->m_h_data); + GlobalFree(info->m_h_header); + delete info; + + m_snderror = wxSOUND_IOERROR; + return NULL; + } + } + return info; +} + +// ------------------------------------------------------------------------- +// AllocHeaders(int mode) +// +// "mode" has the same mean as for OpenDevice() except that the two flags must +// be exclusive. +// AllocHeaders() allocates WXSOUND_MAX_QUEUE (= 128) blocks for an operation +// queue. It uses AllocHeader() for each element. +// +// Once it has allocated all blocks, it returns TRUE and if an error occured +// it returns FALSE. +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::AllocHeaders(int mode) +{ + int i; + wxSoundInfoHeader **headers; + + if (mode == wxSOUND_OUTPUT) + headers = m_headers_play = new wxSoundInfoHeader *[WXSOUND_MAX_QUEUE]; + else + headers = m_headers_rec = new wxSoundInfoHeader *[WXSOUND_MAX_QUEUE]; + + memset(headers, 0, WXSOUND_MAX_QUEUE*sizeof(wxSoundInfoHeader *)); + + for (i=0;im_devout, header->m_header, sizeof(WAVEHDR)); + else + waveInUnprepareHeader(m_internal->m_devin, header->m_header, sizeof(WAVEHDR)); + + GlobalUnlock(header->m_data); + GlobalUnlock(header->m_header); + GlobalFree(header->m_h_header); + GlobalFree(header->m_h_data); + delete header; +} + +// ------------------------------------------------------------------------- +// FreeHeaders(int mode) +// +// "mode" has the same mean as for OpenDevice() except that the two flags must +// be exclusive. +// FreeHeaders() frees all an operation queue once it has checked that +// all buffers have been terminated. +// ------------------------------------------------------------------------- +void wxSoundStreamWin::FreeHeaders(int mode) +{ + int i; + wxSoundInfoHeader ***headers; + + if (mode == wxSOUND_OUTPUT) + headers = &m_headers_play; + else + headers = &m_headers_rec; + + for (i=0;im_playing) { + + // We begun filling it: we must send it to the Windows queue + if (info->m_position != 0) { + memset(info->m_data + info->m_position, 0, info->m_size); + AddToQueue(info); + } + } + + if (m_waiting_for) { + // PROBLEM // + return; + } + m_waiting_for = TRUE; + // Else, we wait for its termination + while (info->m_playing || info->m_recording) + wxYield(); + m_waiting_for = FALSE; +} + +// ------------------------------------------------------------------------- +// AddToQueue(wxSoundInfoHeader *info) +// +// For "info", see WaitFor() +// AddToQueue() sends the IO queue element to the Windows queue. +// +// Warning: in the current implementation, it partially assume we send the +// element in the right order. This is true in that implementation but if +// you use it elsewhere, be careful: it may shuffle all your sound datas. +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::AddToQueue(wxSoundInfoHeader *info) +{ + MMRESULT result; + + if (info->m_mode == wxSOUND_INPUT) { + // Increment the input fragment pointer + result = waveInAddBuffer(m_internal->m_devin, + info->m_header, sizeof(WAVEHDR)); + if (result == MMSYSERR_NOERROR) + info->m_recording = TRUE; + else + return FALSE; + } else if (info->m_mode == wxSOUND_OUTPUT) { + result = waveOutWrite(m_internal->m_devout, + info->m_header, sizeof(WAVEHDR)); + if (result == MMSYSERR_NOERROR) + info->m_playing = TRUE; + else + return FALSE; + } + return TRUE; +} + +// ------------------------------------------------------------------------- +// ClearHeader(wxSoundInfoHeader *info) +// +// ClearHeader() reinitializes the parameters of "info" to their default +// value. +// ------------------------------------------------------------------------- +void wxSoundStreamWin::ClearHeader(wxSoundInfoHeader *info) +{ + info->m_playing = FALSE; + info->m_recording = FALSE; + info->m_position = 0; + info->m_size = GetBestSize(); +} + +// ------------------------------------------------------------------------- +// wxSoundInfoHeader *NextFragmentOutput() +// +// NextFragmentOutput() looks for a free output block. It will always +// return you a non-NULL pointer but it may waits for an empty buffer a long +// time. +// ------------------------------------------------------------------------- +wxSoundInfoHeader *wxSoundStreamWin::NextFragmentOutput() +{ + if (m_headers_play[m_current_frag_out]->m_playing) { + m_current_frag_out = (m_current_frag_out + 1) % WXSOUND_MAX_QUEUE; + + if (m_headers_play[m_current_frag_out]->m_playing) + WaitFor(m_headers_play[m_current_frag_out]); + } + if (m_current_frag_out == m_output_frag_out) + m_queue_filled = TRUE; + return m_headers_play[m_current_frag_out]; +} + +// ------------------------------------------------------------------------- +// The behaviour of Write is documented in the global documentation. +// ------------------------------------------------------------------------- +wxSoundStream& wxSoundStreamWin::Write(const void *buffer, wxUint32 len) +{ + m_lastcount = 0; + if (!m_internal->m_output_enabled) { + m_snderror = wxSOUND_NOTSTARTED; + return *this; + } + + + while (len > 0) { + wxSoundInfoHeader *header; + wxUint32 to_copy; + + // Get a new output fragment + header = NextFragmentOutput(); + + to_copy = (len > header->m_size) ? header->m_size : len; + memcpy(header->m_data + header->m_position, buffer, to_copy); + + header->m_position += to_copy; + header->m_size -= to_copy; + buffer = (((const char *)buffer) + to_copy); + len -= to_copy; + m_lastcount += to_copy; + + // If the fragment is full, we send it to the Windows queue. + if (header->m_size == 0) + if (!AddToQueue(header)) { + m_snderror = wxSOUND_IOERROR; + return *this; + } + } + return *this; +} + +// ------------------------------------------------------------------------- +// NextFragmentInput is not functional. +// ------------------------------------------------------------------------- +wxSoundInfoHeader *wxSoundStreamWin::NextFragmentInput() +{ + wxSoundInfoHeader *header; + + // Queue pointer: reader + m_current_frag_in = (m_current_frag_in + 1) % WXSOUND_MAX_QUEUE; + + header = m_headers_rec[m_current_frag_in]; + // If the current buffer is in recording mode, we must wait for its + // completion. + if (header->m_recording) + WaitFor(header); + + // We reached the writer position: the queue is full. + if (m_current_frag_in == m_input_frag_in) + m_queue_filled = TRUE; + + return header; +} + +// ------------------------------------------------------------------------- +// The behaviour of Read is documented in the global documentation. +// ------------------------------------------------------------------------- +wxSoundStream& wxSoundStreamWin::Read(void *buffer, wxUint32 len) +{ + wxSoundInfoHeader *header; + wxUint32 to_copy; + + m_lastcount = 0; + if (!m_internal->m_input_enabled) + return *this; + + while (len > 0) { + header = NextFragmentInput(); + + to_copy = (len > header->m_size) ? header->m_size : len; + memcpy(buffer, header->m_data + header->m_position, to_copy); + + header->m_position += to_copy; + header->m_size -= to_copy; + buffer = (((char *)buffer) + to_copy); + len -= to_copy; + m_lastcount += to_copy; + + if (header->m_size == 0) { + ClearHeader(header); + if (!AddToQueue(header)) { + m_snderror = wxSOUND_IOERROR; + return *this; + } + } + } + return *this; +} + +// ------------------------------------------------------------------------- +// NotifyDoneBuffer(wxUint32 dev_handle) +// +// NotifyDoneBuffer() is called by wxSoundHandlerProc each time a sound +// fragment finished. It reinitializes the parameters of the fragment and +// sends an event to the clients. +// ------------------------------------------------------------------------- +void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 dev_handle, int flag) +{ + wxSoundInfoHeader *info; + + if (flag == wxSOUND_OUTPUT) { + if (!m_internal->m_output_enabled) + return; + + // Queue pointer: reader + m_output_frag_out = (m_output_frag_out + 1) % WXSOUND_MAX_QUEUE; + info = m_headers_play[m_output_frag_out]; + // Clear header to tell the system the buffer is free now + ClearHeader(info); + m_queue_filled = FALSE; + if (!m_waiting_for) + // Try to requeue a new buffer. + OnSoundEvent(wxSOUND_OUTPUT); + } else { + if (!m_internal->m_input_enabled) + return; + + // Recording completed + m_headers_rec[m_input_frag_in]->m_recording = FALSE; + // Queue pointer: writer + m_input_frag_in = (m_input_frag_in + 1) % WXSOUND_MAX_QUEUE; + if (!m_waiting_for) + OnSoundEvent(wxSOUND_INPUT); + m_queue_filled = FALSE; + } +} + +// ------------------------------------------------------------------------- +// SetSoundFormat() +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::SetSoundFormat(wxSoundFormatBase& base) +{ + // TODO: detect best format + return wxSoundStream::SetSoundFormat(base); +} + +// ------------------------------------------------------------------------- +// StartProduction() +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::StartProduction(int evt) +{ + if (!m_internal) + return FALSE; + + if ((m_internal->m_output_enabled && (evt & wxSOUND_OUTPUT)) || + (m_internal->m_input_enabled && (evt & wxSOUND_INPUT))) + CloseDevice(); + + if (!OpenDevice(evt)) + return FALSE; + + m_production_started = TRUE; + m_queue_filled = FALSE; + // Send a dummy event to start. + if (evt & wxSOUND_OUTPUT) + OnSoundEvent(wxSOUND_OUTPUT); + + if (evt & wxSOUND_INPUT) { + int i; + for (i=0;im_devin); + } + + return TRUE; +} + +// ------------------------------------------------------------------------- +// StopProduction() +// ------------------------------------------------------------------------ +bool wxSoundStreamWin::StopProduction() +{ + if (!m_production_started) { + m_snderror = wxSOUND_NOTSTARTED; + return FALSE; + } + + m_snderror = wxSOUND_NOERROR; + m_production_started = FALSE; + CloseDevice(); + return TRUE; +} + +// ------------------------------------------------------------------------- +// QueueFilled() +// ------------------------------------------------------------------------- +bool wxSoundStreamWin::QueueFilled() const +{ + return (!m_production_started || m_queue_filled); +} + + +// -------------------------------------------------------------------------- +// wxSoundWinModule +// -------------------------------------------------------------------------- + +class WXDLLEXPORT wxSoundWinModule : public wxModule { + DECLARE_DYNAMIC_CLASS(wxSoundWinModule) + public: + bool OnInit(); + void OnExit(); +}; + +IMPLEMENT_DYNAMIC_CLASS(wxSoundWinModule, wxModule) + +bool wxSoundWinModule::OnInit() { + wxSoundHandleList = new wxList(wxKEY_INTEGER); + return TRUE; +} + +void wxSoundWinModule::OnExit() { + delete wxSoundHandleList; +} + +#endif + // __WINDOWS__ diff --git a/contrib/src/mmedia/vidbase.cpp b/contrib/src/mmedia/vidbase.cpp new file mode 100644 index 0000000000..1cd5a0632c --- /dev/null +++ b/contrib/src/mmedia/vidbase.cpp @@ -0,0 +1,74 @@ +//////////////////////////////////////////////////////////////////////////////// +// Name: vidbdrv.cpp +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, Guilhem Lavaux +// License: wxWindows license +//////////////////////////////////////////////////////////////////////////////// +#ifdef __GNUG__ +#pragma implementation "vidbase.h" +#endif + +#include + +#ifndef WX_PRECOMP +#include +#include +#endif + +#include "wx/mmedia/vidbase.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject) + +/// +wxVideoBaseDriver::wxVideoBaseDriver() +{ + m_video_output = NULL; +} + +wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str) +{ + m_video_output = NULL; +} + +wxVideoBaseDriver::wxVideoBaseDriver(const wxString& filename) +{ + m_video_output = NULL; +} + +wxVideoBaseDriver::~wxVideoBaseDriver() +{ +} + +bool wxVideoBaseDriver::AttachOutput(wxWindow& output) +{ + m_video_output = &output; + return TRUE; +} + +void wxVideoBaseDriver::DetachOutput() +{ + m_video_output = NULL; +} + +// Use an external frame for video output + +wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv) +{ + wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100)); + wxWindow *vid_out = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(300, 300)); + + frame->Layout(); + frame->Show(TRUE); + + vid_drv->AttachOutput(*vid_out); + vid_drv->Play(); + + return frame; +} diff --git a/contrib/src/mmedia/vidwin.cpp b/contrib/src/mmedia/vidwin.cpp new file mode 100644 index 0000000000..2f0c28f1a9 --- /dev/null +++ b/contrib/src/mmedia/vidwin.cpp @@ -0,0 +1,251 @@ +// ----------------------------------------------------------------------------- +// Name: vidwin.h +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: February 1998 +// Updated: +// Copyright: (C) 1998, 1999, 2000 Guilhem Lavaux +// License: wxWindows license +// ----------------------------------------------------------------------------- + +#ifdef __GNUG__ +#pragma implementation "vidwin.h" +#endif + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +#ifdef __WINDOWS__ + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/stream.h" +#include "wx/wfstream.h" + +#define WXMMEDIA_INTERNAL +#include +#include +#include +#include "wx/mmedia/vidwin.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +IMPLEMENT_DYNAMIC_CLASS(wxVideoWindows, wxVideoBaseDriver) + +wxVideoWindows::wxVideoWindows() +{ +} + +wxVideoWindows::wxVideoWindows(wxInputStream& str) + : wxVideoBaseDriver(str) +{ + m_internal = new wxVIDWinternal; + m_remove_file = TRUE; + m_filename = wxGetTempFileName("wxvid"); + m_paused = FALSE; + m_stopped = TRUE; + m_frameRate = 1.0; + + wxFileOutputStream temp_file(m_filename); + temp_file << str; + + OpenFile(); +} + +wxVideoWindows::wxVideoWindows(const wxString& filename) + : wxVideoBaseDriver(filename) +{ + m_internal = new wxVIDWinternal; + m_remove_file = FALSE; + m_filename = filename; + m_paused = FALSE; + m_stopped = TRUE; + m_frameRate = 1.0; + OpenFile(); +} + +wxVideoWindows::~wxVideoWindows(void) +{ + mciSendCommand(m_internal->m_dev_id, MCI_CLOSE, 0, 0); + + if (m_internal) + delete m_internal; +} + +void wxVideoWindows::OpenFile() +{ + MCI_DGV_OPEN_PARMS openStruct; + MCI_DGV_SET_PARMS setStruct; + MCI_STATUS_PARMS statusStruct; + DWORD ret; + + openStruct.lpstrDeviceType = "avivideo"; + openStruct.lpstrElementName = (LPSTR)(m_filename.mb_str()); + openStruct.hWndParent = 0; + + ret = mciSendCommand(0, MCI_OPEN, + MCI_OPEN_ELEMENT|MCI_DGV_OPEN_PARENT|MCI_OPEN_TYPE|MCI_DGV_OPEN_32BIT, + (DWORD)(LPVOID)&openStruct); + m_internal->m_dev_id = openStruct.wDeviceID; + + + setStruct.dwCallback = 0; + setStruct.dwTimeFormat = MCI_FORMAT_FRAMES; + + ret = mciSendCommand(m_internal->m_dev_id, MCI_SET, MCI_SET_TIME_FORMAT, + (DWORD)(LPVOID)&setStruct); + + + statusStruct.dwCallback = 0; + statusStruct.dwItem = MCI_DGV_STATUS_FRAME_RATE; + ret = mciSendCommand(m_internal->m_dev_id, MCI_STATUS, + MCI_STATUS_ITEM, + (DWORD)(LPVOID)&statusStruct); + + m_frameRate = ((double)statusStruct.dwReturn) / 1000; + + statusStruct.dwItem = MCI_DGV_STATUS_BITSPERSAMPLE; + ret = mciSendCommand(m_internal->m_dev_id, MCI_STATUS, MCI_STATUS_ITEM, + (DWORD)(LPVOID)&statusStruct); + m_bps = statusStruct.dwReturn; + +} + +bool wxVideoWindows::Pause() +{ + if (m_paused || m_stopped) + return TRUE; + m_paused = TRUE; + return (mciSendCommand(m_internal->m_dev_id, MCI_PAUSE, MCI_WAIT, 0) == 0); +} + +bool wxVideoWindows::Resume() +{ + if (!m_paused || m_stopped) + return TRUE; + m_paused = FALSE; + return (mciSendCommand(m_internal->m_dev_id, MCI_RESUME, 0, 0) == 0); +} + +bool wxVideoWindows::IsPaused() const +{ + return m_paused; +} + +bool wxVideoWindows::IsStopped() const +{ + return m_stopped; +} + +bool wxVideoWindows::GetSize(wxSize& size) const +{ + size.SetWidth(200); + size.SetHeight(200); + return TRUE; +} + +bool wxVideoWindows::SetSize(wxSize size) +{ + return TRUE; +} + +bool wxVideoWindows::IsCapable(wxVideoType v_type) +{ + return (v_type == wxVIDEO_MSAVI); +} + +bool wxVideoWindows::AttachOutput(wxWindow& output) +{ + MCI_DGV_WINDOW_PARMS win_struct; + + if (!wxVideoBaseDriver::AttachOutput(output)) + return FALSE; + + win_struct.hWnd = (HWND)output.GetHWND(); + mciSendCommand(m_internal->m_dev_id, MCI_WINDOW, + MCI_DGV_WINDOW_HWND, (DWORD)(LPVOID)&win_struct); + return TRUE; +} + +void wxVideoWindows::DetachOutput() +{ + MCI_DGV_WINDOW_PARMS win_struct; + + wxVideoBaseDriver::DetachOutput(); + + win_struct.hWnd = 0; + mciSendCommand(m_internal->m_dev_id, MCI_WINDOW, + MCI_DGV_WINDOW_HWND, (DWORD)(LPVOID)&win_struct); +} + +bool wxVideoWindows::Play() +{ + if (!m_stopped) + return FALSE; + m_stopped = FALSE; + return (mciSendCommand(m_internal->m_dev_id, MCI_PLAY, 0, NULL) == 0); +} + +bool wxVideoWindows::Stop() +{ + MCI_SEEK_PARMS seekStruct; + + if (m_stopped) + return FALSE; + m_stopped = TRUE; + if (::mciSendCommand(m_internal->m_dev_id, MCI_STOP, MCI_WAIT, NULL) != 0) + return FALSE; + + seekStruct.dwCallback = 0; + seekStruct.dwTo = 0; + return (::mciSendCommand(m_internal->m_dev_id, MCI_SEEK, MCI_SEEK_TO_START|MCI_WAIT, (DWORD)(LPVOID)&seekStruct) == 0); +} + +// TODO TODO +// I hate windows :-(. The doc says MCI_STATUS should return all info I want but when I call it +// it returns to me with an UNSUPPORTED_FUNCTION error. I will have to do all by myself. Grrrr ! + +wxString wxVideoWindows::GetMovieCodec() const +{ + return wxT("No info"); +} + +wxString wxVideoWindows::GetAudioCodec() const +{ + return wxT("No info"); +} + +wxUint32 wxVideoWindows::GetSampleRate() const +{ + return 22500; +} + +wxUint8 wxVideoWindows::GetChannels() const +{ + return 1; +} + +wxUint8 wxVideoWindows::GetBPS() const +{ + return m_bps; +} + +double wxVideoWindows::GetFrameRate() const +{ + return m_frameRate; +} + +wxUint32 wxVideoWindows::GetNbFrames() const +{ + return 0; +} + +#endif + // __WINDOWS__ diff --git a/contrib/src/mmedia/vidxanm.cpp b/contrib/src/mmedia/vidxanm.cpp new file mode 100644 index 0000000000..4700a23803 --- /dev/null +++ b/contrib/src/mmedia/vidxanm.cpp @@ -0,0 +1,511 @@ +// ------------------------------------------------------------------------- +// Name: vidxanm.cpp +// Purpose: wxMMedia +// Author: Guilhem Lavaux +// Created: 1997 +// Updated: 1998 +// Copyright: (C) 1997, 1998, 1999 Guilhem Lavaux +// License: wxWindows license +// ------------------------------------------------------------------------- + +#ifdef __GNUG__ +#pragma implementation "vidxanm.h" +#endif + +#include + +#ifndef WX_PRECOMP +#include +#endif + +// Pizza ! +#include + +#include +#include +#ifdef __WXGTK__ +#include +#include +#include +#include +#endif + +#include +#include +#include +#include + +#define WXMMEDIA_INTERNAL +#include "wx/mmedia/vidbase.h" +#include "wx/mmedia/vidxanm.h" + +IMPLEMENT_DYNAMIC_CLASS(wxVideoXANIM, wxVideoBaseDriver) + +// ------------------------------------------------------------------------- +// End process detector + +class wxVideoXANIMProcess: public wxProcess { +public: + wxVideoXANIMProcess(wxVideoXANIM *xanim); + + void OnTerminate(int pid, int status); + +protected: + wxVideoXANIM *m_vid_xanim; +}; + +class wxVideoXANIMOutput: public wxProcess { +public: + wxVideoXANIMOutput(); + + void OnTerminate(int pid, int status); + + bool IsTerminated() const; +protected: + bool m_terminated; +}; + +// ------------------------------------------------------------------------- +// XAnim video driver (process handling implementation) + +wxVideoXANIMProcess::wxVideoXANIMProcess(wxVideoXANIM *xanim) +{ + m_vid_xanim = xanim; +} + +void wxVideoXANIMProcess::OnTerminate(int WXUNUSED(pid), int WXUNUSED(status)) +{ + m_vid_xanim->m_xanim_started = FALSE; + m_vid_xanim->OnFinished(); +} + +wxVideoXANIMOutput::wxVideoXANIMOutput() + : wxProcess(NULL, -1) +{ + m_terminated = FALSE; + Redirect(); +} + +bool wxVideoXANIMOutput::IsTerminated() const +{ + return m_terminated; +} + +void wxVideoXANIMOutput::OnTerminate(int pid, int status) +{ + m_terminated = TRUE; +} + +// ------------------------------------------------------------------------- +// XAnim video driver (implementation) + +wxVideoXANIM::wxVideoXANIM() + : wxVideoBaseDriver() +{ + m_internal = new wxXANIMinternal; + m_xanim_detector = new wxVideoXANIMProcess(this); + m_xanim_started = FALSE; + m_paused = FALSE; + m_filename = ""; + m_remove_file = FALSE; +} + +wxVideoXANIM::wxVideoXANIM(wxInputStream& str) + : wxVideoBaseDriver(str) +{ + m_internal = new wxXANIMinternal; + m_xanim_detector = new wxVideoXANIMProcess(this); + m_xanim_started = FALSE; + m_paused = FALSE; + m_size[0] = 0; + m_size[1] = 0; + + m_filename = wxGetTempFileName("vidxa"); + m_remove_file = TRUE; + wxFileOutputStream fout(m_filename); + + fout << str; + + CollectInfo(); +} + +wxVideoXANIM::wxVideoXANIM(const wxString& filename) +{ + m_internal = new wxXANIMinternal; + m_xanim_detector = new wxVideoXANIMProcess(this); + m_xanim_started = FALSE; + m_paused = FALSE; + + m_filename = filename; + m_remove_file = FALSE; + m_size[0] = 0; + m_size[1] = 0; + + CollectInfo(); +} + +wxVideoXANIM::~wxVideoXANIM() +{ + if (m_xanim_started) + Stop(); + delete m_internal; + delete m_xanim_detector; + + if (m_remove_file) + wxRemoveFile(m_filename); +} + +// ------------------------------------------------------------------------- +// Movie controller + +bool wxVideoXANIM::Play() +{ + if (!m_paused && m_xanim_started) + return TRUE; + if (!m_video_output) { + wxVideoCreateFrame(this); + return TRUE; + } + + // The movie starts with xanim + if (RestartXANIM()) { + m_paused = FALSE; + return TRUE; + } + return FALSE; +} + +bool wxVideoXANIM::Pause() +{ + if (!m_paused && SendCommand(" ")) { + m_paused = TRUE; + return TRUE; + } + return FALSE; +} + +bool wxVideoXANIM::Resume() +{ + if (m_paused && SendCommand(" ")) { + m_paused = FALSE; + return TRUE; + } + return FALSE; +} + +bool wxVideoXANIM::Stop() +{ + if (!m_xanim_started) + return FALSE; + + SendCommand("q"); + + // We are waiting for the termination of the subprocess. + while (m_xanim_started) { + wxYield(); + } + + m_paused = FALSE; + + return TRUE; +} + +// ------------------------------------------------------------------------- +// Movie size controller + +bool wxVideoXANIM::SetSize(wxSize size) +{ + if (!m_video_output) + return FALSE; + + m_video_output->SetSize(size.GetWidth(), size.GetHeight()); + return FALSE; +} + +bool wxVideoXANIM::GetSize(wxSize& size) const +{ + if (m_size[0] == 0) + return FALSE; + size.Set(m_size[0], m_size[1]); + return TRUE; +} + +// ------------------------------------------------------------------------- +// Capabilities of XAnim + +bool wxVideoXANIM::IsCapable(wxVideoType v_type) const +{ + if (v_type == wxVIDEO_MSAVI || v_type == wxVIDEO_MPEG || + v_type == wxVIDEO_QT || v_type == wxVIDEO_GIF || v_type == wxVIDEO_JMOV || + v_type == wxVIDEO_FLI || v_type == wxVIDEO_IFF || v_type == wxVIDEO_SGI) + return TRUE; + else + return FALSE; +} + +// ------------------------------------------------------------------------- +// Movie state + +wxString wxVideoXANIM::GetMovieCodec() const +{ + if (m_size[0] == 0) + return wxT(""); + return m_movieCodec; +} + +wxString wxVideoXANIM::GetAudioCodec() const +{ + if (m_size[0] == 0) + return wxT(""); + return m_audioCodec; +} + +wxUint32 wxVideoXANIM::GetSampleRate() const +{ + if (m_size[0] == 0) + return 0; + return m_sampleRate; +} + +wxUint8 wxVideoXANIM::GetChannels() const +{ + if (m_size[0] == 0) + return 0; + return m_channels; +} + +wxUint8 wxVideoXANIM::GetBPS() const +{ + if (m_size[0] == 0) + return 0; + return m_bps; +} + +double wxVideoXANIM::GetFrameRate() const +{ + if (m_size[0] == 0) + return 0.0; + return m_frameRate; +} + +wxUint32 wxVideoXANIM::GetNbFrames() const +{ + if (m_size[0] == 0) + return 0; + return m_frames; +} + + +bool wxVideoXANIM::IsPaused() const +{ + return m_paused; +} + +bool wxVideoXANIM::IsStopped() const +{ + return !m_xanim_started; +} + +// ------------------------------------------------------------------------- +// Output management + +bool wxVideoXANIM::AttachOutput(wxWindow& out) +{ + if (!wxVideoBaseDriver::AttachOutput(out)) + return FALSE; + + return TRUE; +} + +void wxVideoXANIM::DetachOutput() +{ + SendCommand("q"); + m_xanim_started = FALSE; + m_paused = FALSE; + + wxVideoBaseDriver::DetachOutput(); +} + +// ------------------------------------------------------------------------- +// Lowlevel XAnim controller + +bool wxVideoXANIM::SendCommand(const char *command, char **ret, + wxUint32 *size) +{ + if (!m_xanim_started) + if (!RestartXANIM()) + return FALSE; + + // Send a command to XAnim through X11 Property + XChangeProperty(m_internal->xanim_dpy, m_internal->xanim_window, + m_internal->xanim_atom, + XA_STRING, 8, PropModeReplace, (unsigned char *)command, + strlen(command)); + XFlush(m_internal->xanim_dpy); + if (ret) { + int prop_format; + Atom prop_type; + unsigned long extra; + + XGetWindowProperty(m_internal->xanim_dpy, m_internal->xanim_window, + m_internal->xanim_ret, 0, 16, True, AnyPropertyType, + &prop_type, &prop_format, (unsigned long *)size, + &extra, (unsigned char **)ret); + } + return TRUE; +} + +bool wxVideoXANIM::CollectInfo() +{ + wxVideoXANIMOutput *xanimProcess; + wxString xanim_command; + wxStringTokenizer tokenizer; + + xanimProcess = new wxVideoXANIMOutput; + xanim_command = wxT("xanim +v +Zv -Ae "); + xanim_command += m_filename; + if (!wxExecute(xanim_command, FALSE, xanimProcess)) + return FALSE; + + wxInputStream *infoStream = xanimProcess->GetInputStream(); + wxString totalOutput; + + while (infoStream->LastError() == wxSTREAM_NOERROR) { + char line[100]; + + infoStream->Read(line, sizeof(line)-1); + if (infoStream->LastRead() == 0) + break; + + line[infoStream->LastRead()] = 0; + + totalOutput += line; + } + + // This is good for everything ... :-) + int position = totalOutput.Find(wxT("Video Codec:")); + + totalOutput.Remove(0, position+13); + + position = totalOutput.Find(wxT("depth=")); + m_movieCodec = totalOutput(0, position); + + totalOutput.Remove(0, position); + tokenizer.SetString(totalOutput, "\n\r"); + + // the rest of the line + wxString token = tokenizer.GetNextToken(); + unsigned long my_long; + +#define GETINT(i) \ +totalOutput.ToULong(&my_long); \ +i = my_long; + + // 'Audio Codec:' + totalOutput = tokenizer.GetString(); + totalOutput.Remove(0, totalOutput.Find(wxT(":"))+2); + + position = totalOutput.Find(wxT("Rate")); + m_audioCodec = totalOutput(0, position-1); + + // 'Rate=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + GETINT(m_sampleRate); + // 'Chans=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + GETINT(m_channels); + // 'Bps=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + GETINT(m_bps); + // 'Frame Stats:' + tokenizer.Reinit(totalOutput); + tokenizer.GetNextToken(); + totalOutput = tokenizer.GetString(); + totalOutput.Remove(0, totalOutput.Find(wxT(":"))+2); + // 'Size=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + GETINT(m_size[0]); + // 'x' + totalOutput.Remove(0,1); + GETINT(m_size[1]); + // 'Frames=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + GETINT(m_frames); + // 'avfps=' + totalOutput.Remove(0, totalOutput.Find(wxT("="))+1); + totalOutput.ToDouble(&m_frameRate); + + // We wait for the conclusion + while (!xanimProcess->IsTerminated()) + wxYield(); + + delete xanimProcess; + + return TRUE; +} + +bool wxVideoXANIM::RestartXANIM() +{ + wxString xanim_command; + int ret; + Atom prop_type; + int prop_format; + unsigned long nitems; + unsigned long extra; + char prop[4]; + bool xanim_chg_size; + + if (!m_video_output || m_xanim_started) + return FALSE; + + // Check if we can change the size of the window dynamicly + xanim_chg_size = TRUE; + // Get current display +#ifdef __WXGTK__ + m_internal->xanim_dpy = gdk_display; + GtkPizza *pizza = GTK_PIZZA( m_video_output->m_wxwindow ); + GdkWindow *window = pizza->bin_window; + + m_internal->xanim_window = + ((GdkWindowPrivate *)window)->xwindow; +#endif + // Get the XANIM atom + m_internal->xanim_atom = XInternAtom(m_internal->xanim_dpy, + "XANIM_PROPERTY", False); + + // Build the command + xanim_command.Printf(wxT("xanim -Zr +Ze +Sr +f +W%d +f +q " + "+Av70 %s %s"), m_internal->xanim_window, + (xanim_chg_size) ? _T("") : _T(""), + WXSTRINGCAST m_filename); + + // Execute it + if (!wxExecute(xanim_command, FALSE, m_xanim_detector)) + return FALSE; + + // Wait for XAnim to be ready + nitems = 0; + m_xanim_started = TRUE; + while (nitems == 0 && m_xanim_started) { + ret = XGetWindowProperty(m_internal->xanim_dpy, m_internal->xanim_window, + m_internal->xanim_atom, + 0, 4, False, AnyPropertyType, &prop_type, + &prop_format, &nitems, &extra, + (unsigned char **)&prop); + wxYield(); + } + + wxSize vibrato_size; + + vibrato_size = m_video_output->GetSize(); + + vibrato_size.SetWidth(vibrato_size.GetWidth()+1); + m_video_output->SetSize(vibrato_size); + vibrato_size.SetWidth(vibrato_size.GetWidth()-1); + m_video_output->SetSize(vibrato_size); + // Very useful ! Actually it sends a SETSIZE event to XAnim + + m_paused = FALSE; + + return TRUE; +} diff --git a/contrib/src/ogl/Makefile.in b/contrib/src/ogl/Makefile.in index 1edfe19d0f..d335435b44 100644 --- a/contrib/src/ogl/Makefile.in +++ b/contrib/src/ogl/Makefile.in @@ -1,6 +1,7 @@ # -top_builddir = ../.. +top_srcdir = @top_srcdir@/.. +top_builddir = ../../.. VPATH= $(top_srcdir)/ogl @@ -9,5 +10,9 @@ LIBTARGET=$(top_builddir)/lib/libogl OBJECTS=basic.o bmpshape.o composit.o divided.o lines.o misc.o \ basic2.o canvas.o constrnt.o drawn.o mfutils.o ogldiag.o +# the comment at the end of the next line is needed because otherwise autoconf +# would remove this line completely - it contains a built-in hack to remove +# any VPATH assignment not containing ':' +VPATH = :$(top_srcdir)/contrib/src/ogl # ':' for autoconf include $(top_builddir)/src/makelib.env diff --git a/docs/latex/wx/process.tex b/docs/latex/wx/process.tex index 974a85a734..8a15c8f363 100644 --- a/docs/latex/wx/process.tex +++ b/docs/latex/wx/process.tex @@ -26,17 +26,12 @@ processed (and call \helpref{Detach()}{wxprocessdetach} for others). \membersection{wxProcess::wxProcess}\label{wxprocessconstr} -\func{}{wxProcess}{\param{wxEvtHandler *}{ parent = NULL}, \param{bool}{ needPipe = FALSE}, \param{int}{ id = -1}} +\func{}{wxProcess}{\param{wxEvtHandler *}{ parent = NULL}, \param{int}{ id = -1}} Constructs a process object. {\it id} is only used in the case you want to use wxWindows events. It identifies this object, or another window that will receive the event. -If you set {\it needPipe} to TRUE, wxExecute will try to open a couple of pipes -to catch the subprocess stdio. The caught input stream is returned by -GetOutputStream() as a non-seekable stream. The caught output stream is returned -by GetInputStream() as a non-seekable stream. - If the {\it parent} parameter is different from NULL, it will receive a wxEVT\_END\_PROCESS notification event (you should insert EVT\_END\_PROCESS macro in the event table of the parent to handle it) with the given {\it id}. @@ -72,14 +67,16 @@ notification. \constfunc{wxInputStream* }{GetInputStream}{\void} It returns a input stream correspoding to the output stream of the subprocess. -If it is NULL, you have not set needPipe to TRUE. +If it is NULL, you have not turned on the redirection. +See \helpref{wxProcess::Redirect}{wxprocessredirect}. \membersection{wxProcess::GetInputStream}\label{wxprocessgetinputstream} \constfunc{wxInputStream* }{GetInputStream}{\void} It returns a output stream corresponding to the input stream of the subprocess. -If it is NULL, you have not set needPipe to TRUE. +If it is NULL, you have not turned on the redirection. +See \helpref{wxProcess::Redirect}{wxprocessredirect}. \membersection{wxProcess::OnTerminate}\label{wxprocessonterminate} @@ -92,3 +89,11 @@ It raises a wxWindows event when it isn't overriden. \docparam{status}{The exit code of the process.} +\membersection{wxProcess::Redirect}\label{wxprocessredirect} + +\func{void}{Redirect}{\void} + +It turns on the redirection, wxExecute will try to open a couple of pipes +to catch the subprocess stdio. The caught input stream is returned by +GetOutputStream() as a non-seekable stream. The caught output stream is returned +by GetInputStream() as a non-seekable stream. diff --git a/samples/configure b/samples/configure index 1bbc253857..1a376c1a05 100755 --- a/samples/configure +++ b/samples/configure @@ -2,7 +2,7 @@ # From configure.in Id: configure.in # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.14 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -334,7 +334,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.14" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -526,6 +526,14 @@ fi SAMPLES_SUBDIRS=$wx_cv_path_samplesubdirs +PATH_IFS=$wx_cv_path_ifs +PROGRAM_EXT=$wx_cv_program_ext +WX_TARGET_LIBRARY=$wx_cv_target_library + + + + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -628,7 +636,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.14" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -737,6 +745,9 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@SAMPLES_SUBDIRS@%$SAMPLES_SUBDIRS%g +s%@PATH_IFS@%$PATH_IFS%g +s%@PROGRAM_EXT@%$PROGRAM_EXT%g +s%@WX_TARGET_LIBRARY@%$WX_TARGET_LIBRARY%g CEOF EOF diff --git a/samples/configure.in b/samples/configure.in index 4787082f56..d40449739c 100644 --- a/samples/configure.in +++ b/samples/configure.in @@ -6,6 +6,14 @@ AC_INIT(Makefile.in) SAMPLES_SUBDIRS=$wx_cv_path_samplesubdirs AC_SUBST(SAMPLES_SUBDIRS) +PATH_IFS=$wx_cv_path_ifs +PROGRAM_EXT=$wx_cv_program_ext +WX_TARGET_LIBRARY=$wx_cv_target_library + +AC_SUBST(PATH_IFS) +AC_SUBST(PROGRAM_EXT) +AC_SUBST(WX_TARGET_LIBRARY) + AC_OUTPUT([ Makefile caret/Makefile diff --git a/utils/configure b/utils/configure index 3626b629fb..a03a36e569 100755 --- a/utils/configure +++ b/utils/configure @@ -2,7 +2,7 @@ # From configure.in Id: configure.in # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.14 +# Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation @@ -334,7 +334,7 @@ EOF verbose=yes ;; -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.14" + echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) @@ -628,7 +628,7 @@ do echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.14" + echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; @@ -640,9 +640,6 @@ ac_given_srcdir=$srcdir trap 'rm -fr `echo " Makefile - wxMMedia2/Makefile - wxMMedia2/lib/Makefile - wxMMedia2/sample/Makefile makegen/Makefile HelpGen/Makefile HelpGen/src/Makefile @@ -726,9 +723,6 @@ EOF cat >> $CONFIG_STATUS <m_h_header); delete info; - m_snderror = wxSOUND_IOERR; + m_snderror = wxSOUND_IOERROR; return NULL; } } else if (mode == wxSOUND_OUTPUT) { @@ -335,7 +338,7 @@ wxSoundInfoHeader *wxSoundStreamWin::AllocHeader(int mode) GlobalFree(info->m_h_header); delete info; - m_snderror = wxSOUND_IOERR; + m_snderror = wxSOUND_IOERROR; return NULL; } } @@ -437,25 +440,25 @@ void wxSoundStreamWin::FreeHeaders(int mode) // ------------------------------------------------------------------------- void wxSoundStreamWin::WaitFor(wxSoundInfoHeader *info) { - // If the buffer is finished, we return immediately - if (!info->m_playing) { - - // We begun filling it: we must send it to the Windows queue - if (info->m_position != 0) { - memset(info->m_data + info->m_position, 0, info->m_size); - AddToQueue(info); + // If the buffer is finished, we return immediately + if (!info->m_playing) { + + // We begun filling it: we must send it to the Windows queue + if (info->m_position != 0) { + memset(info->m_data + info->m_position, 0, info->m_size); + AddToQueue(info); + } } - } - - if (m_waiting_for) { - // PROBLEM // - return; - } - m_waiting_for = TRUE; - // Else, we wait for its termination - while (info->m_playing || info->m_recording) - wxYield(); - m_waiting_for = FALSE; + + if (m_waiting_for) { + // PROBLEM // + return; + } + m_waiting_for = TRUE; + // Else, we wait for its termination + while (info->m_playing || info->m_recording) + wxYield(); + m_waiting_for = FALSE; } // ------------------------------------------------------------------------- @@ -470,25 +473,25 @@ void wxSoundStreamWin::WaitFor(wxSoundInfoHeader *info) // ------------------------------------------------------------------------- bool wxSoundStreamWin::AddToQueue(wxSoundInfoHeader *info) { - MMRESULT result; - - if (info->m_mode == wxSOUND_INPUT) { - // Increment the input fragment pointer - result = waveInAddBuffer(m_internal->m_devin, - info->m_header, sizeof(WAVEHDR)); - if (result == MMSYSERR_NOERROR) - info->m_recording = TRUE; - else - return FALSE; - } else if (info->m_mode == wxSOUND_OUTPUT) { - result = waveOutWrite(m_internal->m_devout, - info->m_header, sizeof(WAVEHDR)); - if (result == MMSYSERR_NOERROR) + MMRESULT result; + + if (info->m_mode == wxSOUND_INPUT) { + // Increment the input fragment pointer + result = waveInAddBuffer(m_internal->m_devin, + info->m_header, sizeof(WAVEHDR)); + if (result == MMSYSERR_NOERROR) + info->m_recording = TRUE; + else + return FALSE; + } else if (info->m_mode == wxSOUND_OUTPUT) { + result = waveOutWrite(m_internal->m_devout, + info->m_header, sizeof(WAVEHDR)); + if (result == MMSYSERR_NOERROR) info->m_playing = TRUE; - else - return FALSE; - } - return TRUE; + else + return FALSE; + } + return TRUE; } // ------------------------------------------------------------------------- @@ -530,34 +533,37 @@ wxSoundInfoHeader *wxSoundStreamWin::NextFragmentOutput() // ------------------------------------------------------------------------- wxSoundStream& wxSoundStreamWin::Write(const void *buffer, wxUint32 len) { - m_lastcount = 0; - if (!m_internal->m_output_enabled) - return *this; - - while (len > 0) { - wxSoundInfoHeader *header; - wxUint32 to_copy; - - // Get a new output fragment - header = NextFragmentOutput(); - - to_copy = (len > header->m_size) ? header->m_size : len; - memcpy(header->m_data + header->m_position, buffer, to_copy); - - header->m_position += to_copy; - header->m_size -= to_copy; - buffer = (((const char *)buffer) + to_copy); - len -= to_copy; - m_lastcount += to_copy; - - // If the fragment is full, we send it to the Windows queue. - if (header->m_size == 0) - if (!AddToQueue(header)) { - m_snderror = wxSOUND_IOERR; + m_lastcount = 0; + if (!m_internal->m_output_enabled) { + m_snderror = wxSOUND_NOTSTARTED; return *this; - } - } - return *this; + } + + + while (len > 0) { + wxSoundInfoHeader *header; + wxUint32 to_copy; + + // Get a new output fragment + header = NextFragmentOutput(); + + to_copy = (len > header->m_size) ? header->m_size : len; + memcpy(header->m_data + header->m_position, buffer, to_copy); + + header->m_position += to_copy; + header->m_size -= to_copy; + buffer = (((const char *)buffer) + to_copy); + len -= to_copy; + m_lastcount += to_copy; + + // If the fragment is full, we send it to the Windows queue. + if (header->m_size == 0) + if (!AddToQueue(header)) { + m_snderror = wxSOUND_IOERROR; + return *this; + } + } + return *this; } // ------------------------------------------------------------------------- @@ -565,18 +571,22 @@ wxSoundStream& wxSoundStreamWin::Write(const void *buffer, wxUint32 len) // ------------------------------------------------------------------------- wxSoundInfoHeader *wxSoundStreamWin::NextFragmentInput() { - wxSoundInfoHeader *header; - - m_current_frag_in = (m_current_frag_in + 1) % WXSOUND_MAX_QUEUE; - - header = m_headers_rec[m_current_frag_in]; - if (header->m_recording) - WaitFor(header); - - if (m_current_frag_in == m_input_frag_in) - m_queue_filled = TRUE; + wxSoundInfoHeader *header; - return header; + // Queue pointer: reader + m_current_frag_in = (m_current_frag_in + 1) % WXSOUND_MAX_QUEUE; + + header = m_headers_rec[m_current_frag_in]; + // If the current buffer is in recording mode, we must wait for its + // completion. + if (header->m_recording) + WaitFor(header); + + // We reached the writer position: the queue is full. + if (m_current_frag_in == m_input_frag_in) + m_queue_filled = TRUE; + + return header; } // ------------------------------------------------------------------------- @@ -584,34 +594,34 @@ wxSoundInfoHeader *wxSoundStreamWin::NextFragmentInput() // ------------------------------------------------------------------------- wxSoundStream& wxSoundStreamWin::Read(void *buffer, wxUint32 len) { - wxSoundInfoHeader *header; - wxUint32 to_copy; - - m_lastcount = 0; - if (!m_internal->m_input_enabled) - return *this; - - while (len > 0) { - header = NextFragmentInput(); - - to_copy = (len > header->m_size) ? header->m_size : len; - memcpy(buffer, header->m_data + header->m_position, to_copy); - - header->m_position += to_copy; - header->m_size -= to_copy; - buffer = (((char *)buffer) + to_copy); - len -= to_copy; - m_lastcount += to_copy; - - if (header->m_size == 0) { - ClearHeader(header); - if (!AddToQueue(header)) { - m_snderror = wxSOUND_IOERR; + wxSoundInfoHeader *header; + wxUint32 to_copy; + + m_lastcount = 0; + if (!m_internal->m_input_enabled) return *this; - } + + while (len > 0) { + header = NextFragmentInput(); + + to_copy = (len > header->m_size) ? header->m_size : len; + memcpy(buffer, header->m_data + header->m_position, to_copy); + + header->m_position += to_copy; + header->m_size -= to_copy; + buffer = (((char *)buffer) + to_copy); + len -= to_copy; + m_lastcount += to_copy; + + if (header->m_size == 0) { + ClearHeader(header); + if (!AddToQueue(header)) { + m_snderror = wxSOUND_IOERROR; + return *this; + } + } } - } - return *this; + return *this; } // ------------------------------------------------------------------------- @@ -623,31 +633,37 @@ wxSoundStream& wxSoundStreamWin::Read(void *buffer, wxUint32 len) // ------------------------------------------------------------------------- void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 dev_handle, int flag) { - wxSoundInfoHeader *info; - - if (flag == wxSOUND_OUTPUT) { - if (!m_internal->m_output_enabled) - return; - - m_output_frag_out = (m_output_frag_out + 1) % WXSOUND_MAX_QUEUE; - info = m_headers_play[m_output_frag_out]; - ClearHeader(info); - m_queue_filled = FALSE; - if (!m_waiting_for) - OnSoundEvent(wxSOUND_OUTPUT); - } else { - if (!m_internal->m_input_enabled) - return; - - m_headers_rec[m_input_frag_in]->m_recording = FALSE; - m_input_frag_in = (m_input_frag_in + 1) % WXSOUND_MAX_QUEUE; - if (!m_waiting_for) - OnSoundEvent(wxSOUND_INPUT); - m_queue_filled = FALSE; - } + wxSoundInfoHeader *info; + + if (flag == wxSOUND_OUTPUT) { + if (!m_internal->m_output_enabled) + return; + + // Queue pointer: reader + m_output_frag_out = (m_output_frag_out + 1) % WXSOUND_MAX_QUEUE; + info = m_headers_play[m_output_frag_out]; + // Clear header to tell the system the buffer is free now + ClearHeader(info); + m_queue_filled = FALSE; + if (!m_waiting_for) + // Try to requeue a new buffer. + OnSoundEvent(wxSOUND_OUTPUT); + } else { + if (!m_internal->m_input_enabled) + return; + + // Recording completed + m_headers_rec[m_input_frag_in]->m_recording = FALSE; + // Queue pointer: writer + m_input_frag_in = (m_input_frag_in + 1) % WXSOUND_MAX_QUEUE; + if (!m_waiting_for) + OnSoundEvent(wxSOUND_INPUT); + m_queue_filled = FALSE; + } } // ------------------------------------------------------------------------- +// SetSoundFormat() // ------------------------------------------------------------------------- bool wxSoundStreamWin::SetSoundFormat(wxSoundFormatBase& base) { @@ -656,6 +672,7 @@ bool wxSoundStreamWin::SetSoundFormat(wxSoundFormatBase& base) } // ------------------------------------------------------------------------- +// StartProduction() // ------------------------------------------------------------------------- bool wxSoundStreamWin::StartProduction(int evt) { @@ -687,18 +704,23 @@ bool wxSoundStreamWin::StartProduction(int evt) } // ------------------------------------------------------------------------- -// ------------------------------------------------------------------------- +// StopProduction() +// ------------------------------------------------------------------------ bool wxSoundStreamWin::StopProduction() { - if (!m_production_started) - return FALSE; - - m_production_started = FALSE; - CloseDevice(); - return TRUE; + if (!m_production_started) { + m_snderror = wxSOUND_NOTSTARTED; + return FALSE; + } + + m_snderror = wxSOUND_NOERROR; + m_production_started = FALSE; + CloseDevice(); + return TRUE; } // ------------------------------------------------------------------------- +// QueueFilled() // ------------------------------------------------------------------------- bool wxSoundStreamWin::QueueFilled() const { -- 2.45.2