[Plib-cvs] plib/examples/src/sl playsound.cxx,NONE,1.1 Makefile.am,1.7,1.8 README,1.1,1.2
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2004-12-29 07:19:52
|
Update of /cvsroot/plib/plib/examples/src/sl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/examples/src/sl Modified Files: Makefile.am README Added Files: playsound.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. --- NEW FILE: playsound.cxx --- /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information visit http://plib.sourceforge.net $Id: playsound.cxx,v 1.1 2004/12/29 07:19:39 sjbaker Exp $ */ #include <plib/sl.h> #include <plib/sm.h> #include <math.h> /* Construct a sound scheduler and a mixer. */ slScheduler sched ( 8000 ) ; smMixer mixer ( "/dev/mixer" ) ; #ifndef M_PI #define EX_PI 3.1415926535 #else #define EX_PI M_PI #endif int main ( int argc, char **argv ) { mixer . setMasterVolume ( 100 ) ; sched . setSafetyMargin ( 0.128f ) ; /* Set up the samples and a loop */ slSample *s1 = new slSample ( argv[1], & sched ) ; s1 -> adjustVolume ( 10.0f ) ; sched . loopSample ( s1 ) ; int tim = 0 ; /* My periodic event timer. */ while ( SL_TRUE ) { tim++ ; /* Time passes */ #ifdef WIN32 Sleep ( 1000 / 30 ) ; /* 30Hz */ #elif defined(sgi) sginap( 3 ); /* ARG */ #else usleep ( 1000000 / 30 ) ; /* 30Hz */ #endif /* This would normally be called just before the graphics buffer swap - but it could be anywhere where it's guaranteed to get called fairly often. */ sched . update () ; } return 0 ; } Index: Makefile.am =================================================================== RCS file: /cvsroot/plib/plib/examples/src/sl/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 2 Sep 2002 10:42:49 -0000 1.7 +++ Makefile.am 29 Dec 2004 07:19:39 -0000 1.8 @@ -1,12 +1,14 @@ if BUILD_SL -noinst_PROGRAMS = example mod_demo +noinst_PROGRAMS = example mod_demo playsound example_SOURCES = example.cxx mod_demo_SOURCES = mod_demo.cxx +playsound_SOURCES = playsound.cxx -example_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm -mod_demo_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +example_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +mod_demo_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm +playsound_LDADD = -lplibsm -lplibsl -lplibul $(SND_LIBS) -lm endif Index: README =================================================================== RCS file: /cvsroot/plib/plib/examples/src/sl/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 16 Sep 2000 03:15:19 -0000 1.1 +++ README 29 Dec 2004 07:19:39 -0000 1.2 @@ -4,5 +4,15 @@ for demonstration purposes only. Please don't use it in your applications. + +example -- Plays a variety of sounds read from samples on disk plus + it generates a sound in-situ in memory. A good general + sound sample replay example. + +playsound -- Plays any sound sample file that you enter on it's + command line. Much simpler than 'example'. + +mod_demo -- Plays a '.mod' music file. + -- Steve Baker. |