Update of /cvsroot/alpp/openalpp/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26590/tests Modified Files: CMakeLists.txt Makefile.am Makefile.in moving.cpp simple.cpp testfstream.cpp testmic.cpp Log Message: Changed from initial capital letter for methods. i.e. SetPosition() is now setPosition() to be more C++ compliant. Removed dependency of CommonC++ for threading. CHanged to OpenThreads which is GPL licensed. Removed tests for streaming over the net... (Due to Commonc++ removal) Index: CMakeLists.txt =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/CMakeLists.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CMakeLists.txt 16 Jul 2003 19:20:02 -0000 1.2 --- CMakeLists.txt 2 Mar 2004 07:50:27 -0000 1.3 *************** *** 35,42 **** ADD_EXECUTABLE(testmic testmic.cpp) TARGET_LINK_LIBRARIES(testmic openalpp ${EXTRALIBS}) ! ADD_EXECUTABLE(testsend testsend.cpp) ! TARGET_LINK_LIBRARIES(testsend openalpp ${EXTRALIBS}) ! ADD_EXECUTABLE(teststream teststream.cpp) ! TARGET_LINK_LIBRARIES(teststream openalpp ${EXTRALIBS}) ENDIF(CCGNU_FOUND) ADD_EXECUTABLE(testfstream testfstream.cpp) --- 35,42 ---- ADD_EXECUTABLE(testmic testmic.cpp) TARGET_LINK_LIBRARIES(testmic openalpp ${EXTRALIBS}) ! # ADD_EXECUTABLE(testsend testsend.cpp) ! # TARGET_LINK_LIBRARIES(testsend openalpp ${EXTRALIBS}) ! # ADD_EXECUTABLE(teststream teststream.cpp) ! # TARGET_LINK_LIBRARIES(teststream openalpp ${EXTRALIBS}) ENDIF(CCGNU_FOUND) ADD_EXECUTABLE(testfstream testfstream.cpp) Index: Makefile.am =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile.am 21 Feb 2003 14:48:24 -0000 1.5 --- Makefile.am 2 Mar 2004 07:50:27 -0000 1.6 *************** *** 4,7 **** --- 4,8 ---- if WITH_CCGNU ccgnulibs = @CCGNULIBS@ + endif if WITH_PORTAUDIO portaudiolibs = -lportaudio *************** *** 12,22 **** ! LDADD = ../src/libopenalpp.la $(ccgnulibs) -lopenal $(portaudiolibs) $(ogglibs) ! bin_PROGRAMS = teststream testsend testfstream testmic simple moving ! teststream_SOURCES = teststream.cpp ! testsend_SOURCES = testsend.cpp testmic_SOURCES = testmic.cpp --- 13,23 ---- ! LDADD = ../src/libopenalpp.la $(ccgnulibs) -lopenal $(portaudiolibs) $(ogglibs) -lOpenThreads ! bin_PROGRAMS = testfstream testmic simple moving #testsend teststream ! #teststream_SOURCES = teststream.cpp ! #testsend_SOURCES = testsend.cpp testmic_SOURCES = testmic.cpp *************** *** 28,30 **** testfstream_SOURCES = testfstream.cpp - endif --- 29,30 ---- Index: Makefile.in =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/Makefile.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.in 16 Apr 2003 11:15:07 -0000 1.9 --- Makefile.in 2 Mar 2004 07:50:27 -0000 1.10 *************** *** 1,5 **** ! # Makefile.in generated automatically by automake 1.4-p6 from Makefile.am ! # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, --- 1,7 ---- ! # Makefile.in generated by automake 1.7.2 from Makefile.am. ! # @configure_input@ ! # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 [...985 lines suppressed...] ! ps: ps-am ! ps-am: ! uninstall-am: uninstall-binPROGRAMS uninstall-info-am + .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool ctags distclean distclean-compile \ + distclean-depend distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. Index: moving.cpp =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/moving.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** moving.cpp 11 Dec 2003 09:32:49 -0000 1.10 --- moving.cpp 2 Mar 2004 07:50:27 -0000 1.11 *************** *** 6,10 **** * OpenAL (http://www.openal.org), * PortAudio (http://www.portaudio.com/), and - * CommonC++ (http://cplusplus.sourceforge.net/) * * This library is free software; you can redistribute it and/or --- 6,9 ---- *************** *** 26,32 **** * Plays a file bee.wav and moves it left right. */ - #include <cc++/thread.h> #include <openalpp/alpp.h> #include <iostream> using namespace openalpp; --- 25,31 ---- * Plays a file bee.wav and moves it left right. */ #include <openalpp/alpp.h> #include <iostream> + #include <unistd.h> using namespace openalpp; *************** *** 39,46 **** int main() { try { - Source *asd = new Source("bee.wav"); Source beesound("bee.wav"); ! beesound.SetGain(1); ! beesound.SetLooping(); float limits[2] = {5,-15}; --- 38,44 ---- int main() { try { Source beesound("bee.wav"); ! beesound.setGain(1); ! beesound.setLooping(); float limits[2] = {5,-15}; *************** *** 48,61 **** float time=0,angle=0; ! beesound.SetPosition(limits[0],0.0,0.0); ! beesound.Play(); ! const int no_laps=5; ! std::cerr << "Moving sound 5 laps..." << std::endl; ! // Do a cheat time loop. while(angle<(M_PI*2.0*no_laps)) { ! ost::Thread::sleep(delay); // Wait for delay milliseconds time +=delay/1000; // Calculate the time in the loop --- 46,59 ---- float time=0,angle=0; ! beesound.setPosition(limits[0],0.0,0.0); ! beesound.play(); ! const int no_laps=5; ! std::cerr << "Moving sound 5 laps..." << std::endl; ! // Do a cheat time loop. while(angle<(M_PI*2.0*no_laps)) { ! usleep(delay*1000); // Wait for delay milliseconds time +=delay/1000; // Calculate the time in the loop *************** *** 63,68 **** // Calculate a new position ! beesound.SetPosition(limits[0]*cos(angle),0.0,limits[1]*sin(angle)); ! } } catch(Error e) { std::cerr << e << "\n"; --- 61,66 ---- // Calculate a new position ! beesound.setPosition(limits[0]*cos(angle),0.0,limits[1]*sin(angle)); ! } } catch(Error e) { std::cerr << e << "\n"; Index: simple.cpp =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/simple.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** simple.cpp 12 Dec 2003 06:55:04 -0000 1.10 --- simple.cpp 2 Mar 2004 07:50:27 -0000 1.11 *************** *** 6,10 **** * OpenAL (http://www.openal.org), * PortAudio (http://www.portaudio.com/), and - * CommonC++ (http://cplusplus.sourceforge.net/) * * This library is free software; you can redistribute it and/or --- 6,9 ---- *************** *** 25,47 **** * Plays a file bee.wav in the background. */ - #include <cc++/thread.h> #include <openalpp/alpp.h> #include <iostream> using namespace openalpp; ! int main() { try { ! Source bgsound("bee.wav"); // Create source and load sound ! bgsound.SetGain(0.6f); // Lower gain (volume) ! bgsound.SetLooping(); ! bgsound.SetAmbient(); // Make sound ambient (i.e. not attenuated) ! bgsound.Play(); // Start playing std::cerr << "playing bee.wav for 3 seconds: " << std::endl; ! ost::Thread::sleep(3000); // Sleep for a while ! bgsound.Stop(); } catch(Error e) { --- 24,56 ---- * Plays a file bee.wav in the background. */ #include <openalpp/alpp.h> #include <iostream> + #include <unistd.h> using namespace openalpp; ! int main(int argc,char **argv) { ! ! std::string file; ! file = "bee.wav"; ! ! if (argc > 1) ! file = argv[1]; ! ! std::cout << "Playing " << file << "\n"; ! try { ! Source bgsound(file); // Create source and load sound ! bgsound.setGain(0.6f); // Lower gain (volume) ! bgsound.setLooping(); ! bgsound.setAmbient(); // Make sound ambient (i.e. not attenuated) ! bgsound.play(); // Start playing std::cerr << "playing bee.wav for 3 seconds: " << std::endl; ! usleep(3000*1000); // Sleep for a while ! std::cerr << "Done " << std::endl; ! bgsound.stop(); } catch(Error e) { Index: testfstream.cpp =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/testfstream.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testfstream.cpp 23 May 2003 14:51:43 -0000 1.5 --- testfstream.cpp 2 Mar 2004 07:50:27 -0000 1.6 *************** *** 6,10 **** * OpenAL (http://www.openal.org), * PortAudio (http://www.portaudio.com/), and - * CommonC++ (http://cplusplus.sourceforge.net/) * * This library is free software; you can redistribute it and/or --- 6,9 ---- *************** *** 42,54 **** try { FileStream stream(argv[1]); ! stream.SetLooping(); // Remove this to play file once only. Source source(stream); ! source.SetAmbient(); ! source.Play(); std::cerr << "Press return to continue\n"; std::cin.get(); ! source.Stop(); } catch(openalpp::Error e) { std::cerr << e << "\n"; --- 41,53 ---- try { FileStream stream(argv[1]); ! stream.setLooping(); // Remove this to play file once only. Source source(stream); ! source.setAmbient(); ! source.play(); std::cerr << "Press return to continue\n"; std::cin.get(); ! source.stop(); } catch(openalpp::Error e) { std::cerr << e << "\n"; Index: testmic.cpp =================================================================== RCS file: /cvsroot/alpp/openalpp/tests/testmic.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testmic.cpp 11 Dec 2003 09:32:49 -0000 1.11 --- testmic.cpp 2 Mar 2004 07:50:27 -0000 1.12 *************** *** 6,10 **** * OpenAL (http://www.openal.org), * PortAudio (http://www.portaudio.com/), and - * CommonC++ (http://cplusplus.sourceforge.net/) * * This library is free software; you can redistribute it and/or --- 6,9 ---- *************** *** 24,28 **** * Example where sound is streamed from a microphone. */ - #include <cc++/thread.h> #include "openalpp/alpp.h" #include <iostream> --- 23,26 ---- *************** *** 43,50 **** Source source(mic); ! source.SetGain(2); //source.SetLooping(); ! source.Play(); ! ost::Thread::sleep(3000); float limits[2] = {0.5,-0.5}; --- 41,48 ---- Source source(mic); ! source.setGain(2); //source.SetLooping(); ! source.play(); ! usleep(3000*1000); float limits[2] = {0.5,-0.5}; *************** *** 52,57 **** //float time=0,angle=0; ! source.SetPosition(limits[0],0.0,0.0); ! source.Play(); //const int no_laps=5; --- 50,55 ---- //float time=0,angle=0; ! source.setPosition(limits[0],0.0,0.0); ! source.play(); //const int no_laps=5; *************** *** 62,66 **** #if 0 while(angle<(M_PI*no_laps)) { ! ccxx_sleep(delay); // Wait for delay milliseconds time +=delay/1000; // Calculate the time in the loop --- 60,64 ---- #if 0 while(angle<(M_PI*no_laps)) { ! usleep(delay*1000); // Wait for delay milliseconds time +=delay/1000; // Calculate the time in the loop *************** *** 69,81 **** // Calculate a new position std::cerr << cos(angle) << ", " << sin(angle) << std::endl; ! source.SetPosition(limits[0]*cos(0),0.0,limits[1]*sin(0)); } #else std::cerr << "Moved to the left" << std::endl; ! source.SetPosition(-0.5,0.0,0); ! ost::Thread::sleep(3000); std::cerr << "Moved to the right" << std::endl; ! source.SetPosition(+0.5,0.0,0); ! ost::Thread::sleep(3000); #endif } catch(Error e) { --- 67,79 ---- // Calculate a new position std::cerr << cos(angle) << ", " << sin(angle) << std::endl; ! source.setPosition(limits[0]*cos(0),0.0,limits[1]*sin(0)); } #else std::cerr << "Moved to the left" << std::endl; ! source.setPosition(-0.5,0.0,0); ! usleep(3000*1000); std::cerr << "Moved to the right" << std::endl; ! source.setPosition(+0.5,0.0,0); ! usleep(3000*1000); #endif } catch(Error e) { |