diff --git a/INSTALL b/INSTALL index c290a1a..84082f9 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ By Perry R. Cook and Gary P. Scavone, 1995-2007. The Synthesis ToolKit in C++ can be used in a variety of ways, depending on your particular needs. Some people just choose the classes they need for a particular project and copy those to their project directory. Others like to compile and link to a library of object files. STK was not designed with one particular style of use in mind. -To configure and compile (on Unix systems): +To configure and compile (on Unix systems and MinGW): 1. Unpack the STK distribution (tar -xzf stk-4.x.x.tar.gz). 2. From within the directory containing this file, run configure: @@ -22,6 +22,8 @@ Several options can be passed to configure, including: --with-oss = choose native OSS API support (linux only) --with-jack = choose native JACK server API support (linux and macintosh OS-X) --with-core = choose OS-X Core Audio API (macintosh OS-X only) + --with-asio = choose ASIO API support (windows only) + --with-ds = choose DirectSound API support (windows only) It is now possible to specify more than one audio API where supported. Note however that the ALSA library is required in order to compile the RtMidi class, even if the "--with-oss" option is provided (only the OSS audio API will be used, not the OSS MIDI API). Typing "./configure --help" will display all the available options. In addition, it is possible to specify the RAWWAVES and INCLUDE paths to configure as (ex. to set to /home/gary/rawwaves and /home/gary/include): @@ -39,4 +41,4 @@ In addition, a linux RPM is available from the Planet CCRMA WWW site (http://ccr For Windows Users: -An STK distribution is available which contains precompiled executables. In addition, Visual C++ project files are included for each of the example STK projects. +MinGW support is provided in the configure script. In addition, Visual C++ project files are included for each of the example STK projects. diff --git a/README b/README index 8e23fb8..b050547 100644 --- a/README +++ b/README @@ -70,8 +70,9 @@ SYSTEM REQUIREMENTS: See the individual README's (eg. README-linux) in the /doc directory for platform specific information and system requirements. In general, you will use the configure script to create Makefiles on unix -platforms or the VC++ workspace files to compile the example programs. -To use the Tcl/Tk GUIs, you will need Tcl/Tk version 8.0 or higher. +platforms (and MinGW) or the VC++ workspace files to compile the +example programs. To use the Tcl/Tk GUIs, you will need Tcl/Tk +version 8.0 or higher. WHAT'S NEW (AND NOT SO NEW): @@ -142,6 +143,11 @@ where certain things are likely to be protected by patents. LICENSE: +STK WWW site: http://ccrma.stanford.edu/software/stk/ + +The Synthesis ToolKit in C++ (STK) +Copyright (c) 1995-2007 Perry R. Cook and Gary P. Scavone + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including diff --git a/STK_TODO.txt b/STK_TODO.txt deleted file mode 100644 index 9bcc5e0..0000000 --- a/STK_TODO.txt +++ /dev/null @@ -1,25 +0,0 @@ -Ongoing STK "to do" list: - -- OSC server/client classes - -- move various error checks, especially in tick() functions, into __DEBUG__ blocks - -- more information reported in __DEBUG__ blocks - -- add funcionality for sample rate in MAT-file support - -- develop a good solution for multi-channel support in Instrumnt class (and others) - -- add WAVEFORMATEXTENSIBLE support to WvIn/WvOut? - -- port Blotar and Ublotar classes from PeRColate - -- consider further sample rate change updates in classes? - -- more documentation - - -To see differences: -------------------- - -diff -B -C2 -P -u original_src_dir new_src_dir > difffile.txt diff --git a/bin/treesed b/bin/treesed deleted file mode 100755 index 06ff4dd..0000000 --- a/bin/treesed +++ /dev/null @@ -1,189 +0,0 @@ -#!/usr/bin/perl - -# treesed -# Written January 1996 by Rick Jansen (rick@sara.nl) -# URL: http://www.sara.nl/rick - -# usage: treesed pattern1 pattern2 -tree -# treesed pattern1 pattern2 -files file1 file2 ... - -# example: treesed href HREF -files *.html - -# Treesed searches for pattern1 and replaces pattern1 by pattern2 -# if pattern2 supplied. If only pattern1 given treesed just searches. -# Treesed will search in all files and subdirectories of the current -# directory - - - -#-------------------------------------------------------- -# Parameters - -$DoEdit=0; -$search_pattern = $ARGV[0]; -$search_pattern =~ s/(\W)/\\$1/g; # escape regexp chars -shift; - -while ($#ARGV >= 0) { - - if ($ARGV[0] eq '-files') { - @temp_ls = @ARGV[1 .. $#ARGV]; - # Get list of files, skip dirs - foreach $file (@ARGV[1 .. $#ARGV]) { - if (-f $file) { - push(@ls, $file); - } - } - last; - } - elsif ($ARGV[0] eq '-tree') { - &Get_LS; - last; - } - - if (! -f $ARGV[0]) { - if (defined($replacement_pattern)) { - print "usage: treesed pattern1 -tree/-files \n"; - exit(1); - } - - $replacement_pattern = $ARGV[0]; - #$replacement_pattern =~ s/(\W)/\\$1/g; # escape regexp chars - $DoEdit=1; - shift; - } - -} - -# No files? -if ($#ls < 0) { - print "xx No input files\n"; - exit(1); -} - -print "search_pattern: $search_pattern\n"; -print "replacement_pattern: $replacement_pattern\n"; -if ($DoEdit) { - print "\n** EDIT MODE!\n\n"; } -else { - print "\n** Search mode\n\n"; -} - -#foreach $file (@ls) { -# print "$file \n"; -#} - - -#-------------------------------------------------------- -# Search list of files for pattern - -$linepos=0; - -$| = 1; # Force flush after every write -foreach $file (@ls) { - #print "$file\n"; - print '.'; - $linepos++; - if ($linepos > 50) { - $linepos=0; - print "\n"; - } - - if (!open(FILE, $file)) { - print "\nCould not open $file\n"; - next; - } - - $Found = 0; - $Count = 0; - $lineno = 0; - @lines = (); - while () { - $lineno++; - if (/$search_pattern/i) { - #print; - $Count++; - $Found = 1; - push(@lines, $lineno); - } - } - close(FILE); - if ($Found) { - print "\n$file: $Count lines on: @lines\n"; - } - - if ($Found && $DoEdit) { &Edit($file); } - -} -$| = 0; -print "\n"; - - -exit(0); - - -#-------------------------------------------------------- -# Edit file - -sub Edit { - -# Replace $ARGV[0] with $ARGV[1] in $file - -local($file) = @_; -local($bakfile) = $file.'.'.$$; - -# First create backup -open(FILE, $file) || die "Could not open $file for read\n"; -open(BAKFILE, ">$bakfile") || die "Could not open $bakfile for backup\n"; -while () { - print BAKFILE; -} -close(BAKFILE); -close(FILE); - -# Now replace $ARGV[0] by $ARGV[1] in the backupfile, -# result into $file -open(BAKFILE, $bakfile) || die "Could not open $bakfile for read\n"; -open(FILE,">$file") || die "Could not open $file for write\n"; -$Count=0; -while () { - if (/$search_pattern/i) { $Count++; } - s/$search_pattern/$replacement_pattern/gi; - print FILE; -} -close(BAKFILE); -close(FILE); - -print -"\nReplaced $search_pattern by $replacement_pattern on $Count lines in $file\n"; - -} #sub Edit - -#-------------------------------------------------------- - -sub Get_LS { - -# Get a list of full path names into array @ls - -local(@localls)=`ls -R1`; -local($item,$Dir); - -#print "localls: @localls\n"; -$Dir=''; -foreach $item (@localls) { - #print "$item\n"; - if ($item =~ /:$/) { - $Dir=$item; - chop($Dir); - $Dir =~ s/:$/\//; - } - else { - chop($item); - $item = $Dir.$item; - if ($item !~ /^\s*$/) { push(@ls, $item); } - } -} -@localls=(); - -} # sub Get_LS - diff --git a/configure.ac b/configure.ac index 5c35b0f..468b3ec 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,9 @@ AC_INIT(STK, 4.3, gary@music.mcgill.ca, stk) AC_CONFIG_SRCDIR(src/Stk.cpp) AC_CONFIG_FILES(src/Makefile projects/demo/Makefile projects/effects/Makefile projects/ragamatic/Makefile projects/examples/Makefile projects/examples/libMakefile) +# Fill GXX with something before test. +AC_SUBST( GXX, ["no"] ) + # Checks for programs. AC_PROG_CC AC_PROG_CXX(g++ CC c++ cxx) @@ -39,9 +42,10 @@ AC_MSG_RESULT($realtime) # Check for math library AC_CHECK_LIB(m, cos, , AC_MSG_ERROR(math library is needed!)) +# Checks for functions if test $realtime = yes; then - AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!)) - AC_CHECK_FUNCS(gettimeofday select socket) + AC_CHECK_FUNCS(select socket) + AC_CHECK_FUNC(gettimeofday, [cflags=$cflags" -DHAVE_GETTIMEOFDAY"], ) fi # Check for debug @@ -94,6 +98,8 @@ if test $realtime = yes; then AC_MSG_RESULT(using ALSA) audio_apis="-D__LINUX_ALSA__ $audio_apis" fi + + AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!)) ;; *-apple*) @@ -123,6 +129,35 @@ if test $realtime = yes; then [AC_MSG_ERROR(CoreAudio header files not found!)] ) AC_SUBST( frameworks, ["-framework CoreAudio -framework CoreFoundation -framework CoreMidi"] ) fi + + AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(realtime support requires the pthread library!)) + ;; + + *-mingw32*) + AC_SUBST( sound_api, [_NO_API_] ) + AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [AC_SUBST( sound_api, [-D__WINDOWS_ASIO__] ) AC_MSG_RESULT(using ASIO)], ) + if [test $sound_api = -D__WINDOWS_ASIO__;] then + audio_apis="-D__WINDOWS_ASIO__" + AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) + fi + + # Look for DirectSound flag + AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [AC_SUBST( sound_api, [-D__WINDOWS_DS__] ) AC_MSG_RESULT(using DirectSound)], ) + if test $sound_api = -D__WINDOWS_DS__; then + audio_apis="-D__WINDOWS_DS__ $audio_apis" + LIBS="-ldsound $LIBS" + fi + + # If no audio api flags specified, use DirectSound + if [test $sound_api = _NO_API_;] then + AC_SUBST( sound_api, [-D__WINDOWS_DS__] ) + AC_MSG_RESULT(using DirectSound) + audio_apis="-D__WINDOWS_DS__" + LIBS="-ldsound $LIBS" + fi + + audio_apis="-D__WINDOWS_MM__ $audio_apis" + LIBS="-lole32 -lwinmm -lWsock32 $LIBS" ;; *) diff --git a/doc/README-Win.txt b/doc/README-Win.txt index 4f1e03e..bbfa781 100644 --- a/doc/README-Win.txt +++ b/doc/README-Win.txt @@ -7,11 +7,11 @@ Please read the file README for more general STK information. DirectX and WindowsNT Issues: ----------------------------- -STK is currently distributed with Visual C++ .NET project and workspace files. It no longer compiles with Visual C++ 6.0. I gave up attempting to fix all the problems created by such a bad compiler. This version of STK has been tested using Visual C++ .NET. +STK is currently distributed with Visual C++ .NET project and workspace files. It no longer compiles with Visual C++ 6.0. I gave up attempting to fix all the problems created by such a bad compiler. This version of STK has been tested using Visual C++ .NET. As well, the configure script now supprots MinGW. IMPORTANT VC++ NOTE: When compiling "release" versions of STK programs, link to the release multithreaded library. When compiling "debug" versions, link to the debug multithreaded library. Compiler errors will result otherwise. Also, the Microsoft folk are up to their old habits of trying to change standards. The .NET compiler will complain about cerr for some reason. -Both the DirectSound and Steinberg ASIO audio APIs are supported for realtime audio input/output. The Visual C++ project files included with this distribution are configured to use the DirectSound API. In order to use the ASIO API, it is necessary to change the preprocessor definition from __WINDOWS_DS__ to __WINDOWS_ASIO__, as well as include all the files in the /src/asio/ directory (i.e. asio.h, asio.cpp, ...). If you have a good quality soundcard and a native ASIO driver (not emulated), you are likely to get much better input/output response using that. +Both the DirectSound and Steinberg ASIO audio APIs are supported for realtime audio input/output. The Visual C++ project files included with this distribution are configured to use the DirectSound API. In order to use the ASIO API, it is necessary to change the preprocessor definition from __WINDOWS_DS__ to __WINDOWS_ASIO__, as well as include all the files in the /src/include/ directory (i.e. asio.h, asio.cpp, ...). If you have a good quality soundcard and a native ASIO driver (not emulated), you are likely to get much better input/output response using that. When using the DirectSound API for audio input, latency is typically pretty horrendous (should we be surprised?). Also, there is a slight chance you don't have DirectSoundCapture support on your computer. If not, you should download the DirectX 6.0 (or higher) runtime libraries from Microsoft's WWW site (http://www.microsoft.com/directx/download.asp) in order to run the pre-compiled STK executables for Windoze. The last time I checked, there was no DirectSoundCapture support for WindowsNT ... you'll have to switch to Windows 2000 or XP or use an ASIO driver. I stopped supporting the WinMM audio output code with release 3.2. diff --git a/doc/ReleaseNotes.txt b/doc/ReleaseNotes.txt index c946a58..55ceef0 100644 --- a/doc/ReleaseNotes.txt +++ b/doc/ReleaseNotes.txt @@ -2,6 +2,14 @@ The Synthesis ToolKit in C++ (STK) By Perry R. Cook and Gary P. Scavone, 1995-2007. +v4.3.1: (7 December 2007) +- further headerless file support in FileRead +- bug fix in RtWvOut.cpp +- added configure support for MinGW +- updates to RtAudio and RtMidi for MinGW +- changes to channel assignment in demo.cpp + + v4.3.0: (13 August 2007) - an official MIT-like license - new functionality to automatically update class data when the STK sample rate changes (partly implemented) diff --git a/doc/doxygen/Doxyfile b/doc/doxygen/Doxyfile index 9d51253..7916708 100644 --- a/doc/doxygen/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = STK -PROJECT_NUMBER = 4.3 +PROJECT_NUMBER = 4.3.1 OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff --git a/doc/doxygen/download.txt b/doc/doxygen/download.txt index 0986d23..f50289a 100644 --- a/doc/doxygen/download.txt +++ b/doc/doxygen/download.txt @@ -1,16 +1,26 @@ /*! \page download Download, Release Notes, and Bug Fixes -\section down Download Version 4.3.0 (13 August 2007): +\section down Download Version 4.3.1 (7 December 2007): \section notes Release Notes: +\subsection v4dot3dot0 Version 4.3.1 + +
    +
  • Further headerless file support in FileRead.
  • +
  • Bug fix in RtWvOut.cpp.
  • +
  • Added configure support for MinGW.
  • +
  • Updates to RtAudio and RtMidi for MinGW.
  • +
  • Changes to channel assignment in demo.cpp.
  • +
+ + \subsection v4dot3dot0 Version 4.3.0
    diff --git a/doc/doxygen/faq.txt b/doc/doxygen/faq.txt index fbd3f93..cbb1686 100644 --- a/doc/doxygen/faq.txt +++ b/doc/doxygen/faq.txt @@ -11,6 +11,23 @@ Yes, we finally made something official for release 4.3.0. It is listed in the Stk class and a few other places in the distribution, but I'll repeat it here for clarity: +\verbatim +The Synthesis ToolKit in C++ (STK) is a set of open source audio +signal processing and algorithmic synthesis classes written in the +C++ programming language. STK was designed to facilitate rapid +development of music synthesis and audio processing software, with +an emphasis on cross-platform functionality, realtime control, +ease of use, and educational example code. STK currently runs +with realtime support (audio and MIDI) on Linux, Macintosh OS X, +and Windows computer platforms. Generic, non-realtime support has +been tested under NeXTStep, Sun, and other platforms and should +work with any standard C++ compiler. + +STK WWW site: http://ccrma.stanford.edu/software/stk/ + +The Synthesis ToolKit in C++ (STK) +Copyright (c) 1995-2007 Perry R. Cook and Gary P. Scavone + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -34,6 +51,7 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +\endverbatim \section filerate Why is my file sample rate wrong? diff --git a/doc/treesed.html b/doc/treesed.html deleted file mode 100644 index 6fb9187..0000000 --- a/doc/treesed.html +++ /dev/null @@ -1,175 +0,0 @@ - - -Treesed Usage - - - -
    - -

    How to Use Treesed

    - -Go to the directory where you want to search or make changes. - -

    -There are two choices you can make when using treesed: -

      -
    1. Do I just want to search for a text, or do I want to search for a -text and replace it with something else? -
      -If you are just searching you are using Treesed in "search mode", otherwise it is in -"replace mode." -
    2. Do I want to search/replace only in files in my current directory, -or should files in all subdirectories (and all directories below that) -also be done? -
    -Some examples will make this clear. - -

    Searching

    -Say you are faced with the situation that the author of a slew of web-pages, Nathan Brazil, has left and has been succeeded by Mavra Chang. First, let us see which files are affected by this (what you type in is shown in bold): -
    -
    [localhost] treesed "Nathan Brazil" -files *.html
    -search_pattern: Nathan\ Brazil
    -replacement_pattern: 
    -
    -** Search mode
    -
    -.
    -midnight.html: 1 lines on: 2
    -..
    -well.html: 1 lines on: 3
    -
    -
    -We notice the following: -
      -
    • The search text "Nathan Brazil" is enclosed in -double-quotes ("). -
    • You specify which files to search with -files followed by a -list of file names--in this case *.html. -
    • Treesed reports the search pattern ("pattern" is just a fancy word -for "text") you specified (you can ignore -that \). -
    • Treesed reports an empty replacement_pattern. This is -correct, because you haven't entered one. -
    • It therefore deduces that is is in search mode. -
    • It finds two files containing "Nathan Brazil", and reports on which -lines of these files it found it; it does not show the lines themselves. -
    -Because you used -files, Treesed will search in the files you -specify in the current directory. You can also search files in -the current directory and all directories below it. However, in -that case you can not specify which file names to use, all files will be -searched: -
    -
    [localhost] treesed "Nathan Brazil" -tree
    -search_pattern: Nathan\ Brazil
    -replacement_pattern: 
    -
    -** Search mode
    -
    -.
    -midnight.html: 1 lines on: 2
    -...
    -well.html: 1 lines on: 3
    -.
    -new/echoes.html: 1 lines on: 2
    -
    -
    -We notice the following: -
      -
    • Instead of -files we now see -tree. -
    • We do not see a specification of file names. -
    • Treesed finds an occurence of "Nathan Brazil" in the file -echoes.html in the subdirectory new; it did not -find this file in the previous example (as it shouldn't). -
    - -

    Replacing

    -To replace a text you simply add the replacement text right after the -search text: -
    -
    [localhost] treesed "Nathan Brazil" "Mavra Change" -files *.html
    -search_pattern: Nathan\ Brazil
    -replacement_pattern: Mavra Chang
    -
    -** EDIT MODE!
    -
    -.
    -midnight.html: 1 lines on: 2
    -
    -Replaced Nathan\ Brazil by Mavra Chang on 1 lines in midnight.html
    -..
    -well.html: 1 lines on: 3
    -
    -Replaced Nathan\ Brazil by Mavra Chang on 1 lines in well.html
    -
    -
    -We notice the following: -
      -
    • Right after the search text "Nathan Brazil" you specify the -replacement text "Mavra Chang". -
    • As a result, Treesed now reports a non-empty -replacement_pattern. -
    • Hence it concludes it is in "edit mode", which means replacment mode. -
    • Treesed dutifully reports on which lines in which files it did the -replacement. -
    -To replace a text in all files in the current directory and the ones -below it, we do the following: -
    -
    [localhost] treesed "Nathan Brazil" "Mavra Chang" -tree
    -search_pattern: Nathan\ Brazil
    -replacement_pattern: Mavra Chang
    -
    -** EDIT MODE!
    -
    -.
    -midnight.html: 1 lines on: 2
    -
    -Replaced Nathan\ Brazil by Mavra Chang on 1 lines in midnight.html
    -
    -....
    -well.html: 1 lines on: 3
    -
    -Replaced Nathan\ Brazil by Mavra Chang on 1 lines in well.html
    -.
    -new/echoes.html: 1 lines on: 2
    -
    -Replaced Nathan\ Brazil by Mavra Chang on 1 lines in new/echoes.html
    -
    -
    -and we get the expected results, including the replace in -new/echoes.html. - -

    Old Versions

    -Treesed leaves behind quite a mess of old versions of the files it -changed (only in change-mode, of course). These old files have the same -name as the original file, with .ddddd appended to it. For -example, if treesed makes a change to midnight.html it will -leave the original version as something like -midnight.html.26299. You'll have to remove these files lest -your disk area clutters up. Here is a command that does that, but -beware! This command removes all files in the current directory and -all below it, that end in a period followed by one or more -digits: -
    -
    find . -name "*.[0-9]*" -exec rm {} \;
    -
    -
    - -It is interesting to note that if you use treesed again without cleaning -up, you may get files like midnight.html.26299.27654. These -will also be cleaned up by the above slightly dangerous command. - - -

    About Treesed

    -treesed is public domain software developed -and designed by Rick Jansen from Sara, Amsterdam, Netherlands, January -1996. - -

    - -

    About This Document

    -This usage document was created by the Division of Information Technology Services at The -University of Western Ontario. - - \ No newline at end of file diff --git a/include/FileRead.h b/include/FileRead.h index 3d29195..7bd04d4 100644 --- a/include/FileRead.h +++ b/include/FileRead.h @@ -43,9 +43,12 @@ public: //! Overloaded constructor that opens a file during instantiation. /*! An StkError will be thrown if the file is not found or its - format is unknown or unsupported. + format is unknown or unsupported. The optional arguments allow a + headerless file type to be supported. If \c typeRaw is false (the + default), the subsequent parameters are ignored. */ - FileRead( std::string fileName, bool typeRaw = false ); + FileRead( std::string fileName, bool typeRaw = false, unsigned int nChannels = 1, + StkFormat format = STK_SINT16, StkFloat rate = 22050.0 ); //! Class destructor. ~FileRead(); @@ -53,11 +56,12 @@ public: //! Open the specified file and determine its formatting. /*! An StkError will be thrown if the file is not found or its - format is unknown or unsupported. An optional parameter is - provided to specify whether the input file is of type STK RAW - (default = false). + format is unknown or unsupported. The optional arguments allow a + headerless file type to be supported. If \c typeRaw is false (the + default), the subsequent parameters are ignored. */ - void open( std::string fileName, bool typeRaw = false ); + void open( std::string fileName, bool typeRaw = false, unsigned int nChannels = 1, + StkFormat format = STK_SINT16, StkFloat rate = 22050.0 ); //! If a file is open, close it. void close( void ); @@ -97,7 +101,8 @@ public: protected: // Get STK RAW file information. - bool getRawInfo( const char *fileName ); + bool getRawInfo( const char *fileName, unsigned int nChannels, + StkFormat format, StkFloat rate ); // Get WAV file header information. bool getWavInfo( const char *fileName ); diff --git a/include/RtAudio.h b/include/RtAudio.h index 1c54e97..5acc9a5 100644 --- a/include/RtAudio.h +++ b/include/RtAudio.h @@ -42,7 +42,7 @@ \file RtAudio.h */ -// RtAudio: Version 4.0 +// RtAudio: Version 4.0.3 #ifndef __RTAUDIO_H #define __RTAUDIO_H @@ -679,20 +679,20 @@ protected: // // **************************************************************** // -inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }; -inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); }; -inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); }; -inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); }; -inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); }; -inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); }; -inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); }; -inline void RtAudio :: stopStream( void ) { return rtapi_->stopStream(); }; -inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); }; -inline bool RtAudio :: isStreamOpen( void ) throw() { return rtapi_->isStreamOpen(); }; -inline bool RtAudio :: isStreamRunning( void ) throw() { return rtapi_->isStreamRunning(); }; -inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); }; -inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); }; -inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); }; +inline RtAudio::Api RtAudio :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); } +inline unsigned int RtAudio :: getDeviceCount( void ) throw() { return rtapi_->getDeviceCount(); } +inline RtAudio::DeviceInfo RtAudio :: getDeviceInfo( unsigned int device ) { return rtapi_->getDeviceInfo( device ); } +inline unsigned int RtAudio :: getDefaultInputDevice( void ) throw() { return rtapi_->getDefaultInputDevice(); } +inline unsigned int RtAudio :: getDefaultOutputDevice( void ) throw() { return rtapi_->getDefaultOutputDevice(); } +inline void RtAudio :: closeStream( void ) throw() { return rtapi_->closeStream(); } +inline void RtAudio :: startStream( void ) { return rtapi_->startStream(); } +inline void RtAudio :: stopStream( void ) { return rtapi_->stopStream(); } +inline void RtAudio :: abortStream( void ) { return rtapi_->abortStream(); } +inline bool RtAudio :: isStreamOpen( void ) throw() { return rtapi_->isStreamOpen(); } +inline bool RtAudio :: isStreamRunning( void ) throw() { return rtapi_->isStreamRunning(); } +inline long RtAudio :: getStreamLatency( void ) { return rtapi_->getStreamLatency(); } +inline double RtAudio :: getStreamTime( void ) { return rtapi_->getStreamTime(); } +inline void RtAudio :: showWarnings( bool value ) throw() { rtapi_->showWarnings( value ); } // RtApi Subclass prototypes. @@ -794,6 +794,8 @@ public: private: + std::vector devices_; + void saveDeviceInfo( void ); bool coInitialized_; bool probeDeviceOpen( unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, @@ -911,7 +913,7 @@ class RtApiDummy: public RtApi { public: - RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( WARNING ); }; + RtApiDummy() { errorText_ = "RtApiDummy: This class provides no functionality."; error( RtError::WARNING ); }; RtAudio::Api getCurrentApi( void ) { return RtAudio::RTAUDIO_DUMMY; }; unsigned int getDeviceCount( void ) { return 0; }; RtAudio::DeviceInfo getDeviceInfo( unsigned int device ) { RtAudio::DeviceInfo info; return info; }; diff --git a/include/RtMidi.h b/include/RtMidi.h index b6113f6..e443e2a 100644 --- a/include/RtMidi.h +++ b/include/RtMidi.h @@ -8,7 +8,7 @@ RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ RtMidi: realtime MIDI i/o C++ classes - Copyright (c) 2003-2005 Gary P. Scavone + Copyright (c) 2003-2007 Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -35,7 +35,7 @@ */ /**********************************************************************/ -// RtMidi: Version 1.0.5, in development +// RtMidi: Version 1.0.7 #ifndef RTMIDI_H #define RTMIDI_H @@ -121,7 +121,7 @@ class RtMidiIn : public RtMidi */ void openPort( unsigned int portNumber = 0 ); - //! Create a virtual input port to allow software connections (OS X and ALSA only). + //! Create a virtual input port, with optional name, to allow software connections (OS X and ALSA only). /*! This function creates a virtual MIDI input port to which other software applications can connect. This type of functionality @@ -261,7 +261,7 @@ class RtMidiOut : public RtMidi //! Close an open MIDI connection (if one exists). void closePort(); - //! Create a virtual output port to allow software connections (OS X and ALSA only). + //! Create a virtual output port, with optional name, to allow software connections (OS X and ALSA only). /*! This function creates a virtual MIDI output port to which other software applications can connect. This type of functionality diff --git a/include/Stk.h b/include/Stk.h index cd78200..0f0fadd 100644 --- a/include/Stk.h +++ b/include/Stk.h @@ -8,7 +8,21 @@ this class provides error handling and byte-swapping functions. - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. + The Synthesis ToolKit in C++ (STK) is a set of open source audio + signal processing and algorithmic synthesis classes written in the + C++ programming language. STK was designed to facilitate rapid + development of music synthesis and audio processing software, with + an emphasis on cross-platform functionality, realtime control, + ease of use, and educational example code. STK currently runs + with realtime support (audio and MIDI) on Linux, Macintosh OS X, + and Windows computer platforms. Generic, non-realtime support has + been tested under NeXTStep, Sun, and other platforms and should + work with any standard C++ compiler. + + STK WWW site: http://ccrma.stanford.edu/software/stk/ + + The Synthesis ToolKit in C++ (STK) + Copyright (c) 1995-2007 Perry R. Cook and Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files diff --git a/projects/demo/Makefile.in b/projects/demo/Makefile.in index 0caef5f..31af87a 100644 --- a/projects/demo/Makefile.in +++ b/projects/demo/Makefile.in @@ -1,3 +1,4 @@ +### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in ### STK demo Makefile - for various flavors of unix PROGRAMS = demo @@ -33,14 +34,14 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ -I$(INCLUDE) +CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include LIBRARY = @LIBS@ LIBRARY += @frameworks@ REALTIME = @realtime@ ifeq ($(REALTIME),yes) PROGRAMS += demo - OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o + OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o @objects@ DEFS += @audio_apis@ endif @@ -53,25 +54,28 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : $(SRC_PATH)/%.cpp $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ +%.o : ../../src/include/%.cpp + $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ + all : $(PROGRAMS) demo: demo.cpp $(OBJECTS) $(CC) $(CFLAGS) $(DEFS) -o demo demo.cpp $(OBJECT_PATH)/*.o $(LIBRARY) libdemo: demo.cpp - $(CC) $(CFLAGS) $(DEFS) -o demo utilities.cpp demo.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o demo utilities.cpp demo.cpp -L../../src -lstk $(LIBRARY) Md2Skini: Md2Skini.cpp Stk.o RtMidi.o $(CC) $(CFLAGS) $(DEFS) -o Md2Skini Md2Skini.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/RtMidi.o $(LIBRARY) libMd2Skini: Md2Skini.cpp - $(CC) $(CFLAGS) $(DEFS) -o Md2Skini Md2Skini.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o Md2Skini Md2Skini.cpp -L../../src -lstk $(LIBRARY) $(OBJECTS) : Stk.h clean : -rm $(OBJECT_PATH)/*.o - -rm $(PROGRAMS) + -rm $(PROGRAMS) *.exe strip : strip $(PROGRAMS) diff --git a/projects/demo/Md2Skini.dsp b/projects/demo/Md2Skini.dsp old mode 100644 new mode 100755 diff --git a/projects/demo/Md2Skini.vcproj b/projects/demo/Md2Skini.vcproj deleted file mode 100755 index 6028ef6..0000000 --- a/projects/demo/Md2Skini.vcproj +++ /dev/null @@ -1,240 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/demo/demo.cpp b/projects/demo/demo.cpp index 3d82072..b048dee 100644 --- a/projects/demo/demo.cpp +++ b/projects/demo/demo.cpp @@ -20,9 +20,9 @@ #include "utilities.h" #include -#include #include #include +#include using std::min; bool done; @@ -66,6 +66,10 @@ void processMessage( TickData* data ) register StkFloat value1 = data->message.floatValues[0]; register StkFloat value2 = data->message.floatValues[1]; + // If only one instrument, allow messages from all channels to control it. + int channel = 1; + if ( data->nVoices > 1 ) channel = data->message.channel; + switch( data->message.type ) { case __SK_Exit_: @@ -75,13 +79,13 @@ void processMessage( TickData* data ) case __SK_NoteOn_: if ( value2 == 0.0 ) // velocity is zero ... really a NoteOff - data->voicer->noteOff( value1, 64.0, data->message.channel ); + data->voicer->noteOff( value1, 64.0, channel ); else // a NoteOn - data->voicer->noteOn( value1, value2, data->message.channel ); + data->voicer->noteOn( value1, value2, channel ); break; case __SK_NoteOff_: - data->voicer->noteOff( value1, value2, data->message.channel ); + data->voicer->noteOff( value1, value2, channel ); break; case __SK_ControlChange_: @@ -90,31 +94,34 @@ void processMessage( TickData* data ) else if (value1 == 7.0) data->volume = value2 * ONE_OVER_128; else if (value1 == 49.0) - data->voicer->setFrequency( value2, data->message.channel ); + data->voicer->setFrequency( value2, channel ); else if (value1 == 50.0) - data->voicer->controlChange( 128, value2, data->message.channel ); + data->voicer->controlChange( 128, value2, channel ); else if (value1 == 51.0) data->frequency = data->message.intValues[1]; else if (value1 == 52.0) { data->frequency += ( data->message.intValues[1] << 7 ); // Convert to a fractional MIDI note value StkFloat note = 12.0 * log( data->frequency / 220.0 ) / log( 2.0 ) + 57.0; - data->voicer->setFrequency( note, data->message.channel ); + data->voicer->setFrequency( note, channel ); } else - data->voicer->controlChange( (int) value1, value2, data->message.channel ); + data->voicer->controlChange( (int) value1, value2, channel ); break; case __SK_AfterTouch_: - data->voicer->controlChange( 128, value1, data->message.channel ); + data->voicer->controlChange( 128, value1, channel ); break; case __SK_PitchChange_: - data->voicer->setFrequency( value1, data->message.channel ); + data->voicer->setFrequency( value1, channel ); break; case __SK_PitchBend_: - data->voicer->pitchBend( value1, data->message.channel ); + short temp; + temp = data->message.intValues[1] << 7; + temp += data->message.intValues[0]; + data->voicer->pitchBend( (StkFloat) temp, channel ); break; case __SK_Volume_: @@ -134,7 +141,7 @@ void processMessage( TickData* data ) data->currentVoice = voiceByNumber( (int)value1, &data->instrument[i] ); if ( data->currentVoice < 0 ) data->currentVoice = voiceByNumber( 0, &data->instrument[i] ); - data->voicer->addInstrument( data->instrument[i], data->message.channel ); + data->voicer->addInstrument( data->instrument[i], channel ); data->settling = false; } @@ -155,7 +162,7 @@ void processMessage( TickData* data ) // control updates. If doing realtime audio output, it will be called // automatically when the system needs a new buffer of audio samples. int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, - double streamTime, RtAudioStreamStatus status, void *dataPointer ) + double streamTime, RtAudioStreamStatus status, void *dataPointer ) { TickData *data = (TickData *) dataPointer; register StkFloat sample, *samples = (StkFloat *) outputBuffer; diff --git a/projects/demo/demo.dsp b/projects/demo/demo.dsp old mode 100644 new mode 100755 index 9f835cb..ac77b40 --- a/projects/demo/demo.dsp +++ b/projects/demo/demo.dsp @@ -307,10 +307,6 @@ SOURCE=..\..\src\RtAudio.cpp # End Source File # Begin Source File -SOURCE=..\..\src\RtDuplex.cpp -# End Source File -# Begin Source File - SOURCE=..\..\src\RtMidi.cpp # End Source File # Begin Source File @@ -651,10 +647,6 @@ SOURCE=..\..\include\RtAudio.h # End Source File # Begin Source File -SOURCE=..\..\include\RtDuplex.h -# End Source File -# Begin Source File - SOURCE=..\..\include\RtMidi.h # End Source File # Begin Source File diff --git a/projects/demo/demo.dsw b/projects/demo/demo.dsw old mode 100644 new mode 100755 diff --git a/projects/demo/demo.vcproj b/projects/demo/demo.vcproj deleted file mode 100755 index eb0cf20..0000000 --- a/projects/demo/demo.vcproj +++ /dev/null @@ -1,2103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/demo/scores/README b/projects/demo/scores/README index f4b38ff..87c4381 100644 --- a/projects/demo/scores/README +++ b/projects/demo/scores/README @@ -5,15 +5,14 @@ Rhodey doogie.ski Mandolin duelingb.ski Bowed fiddle.ski PercFlut misacrio.ski -AgogoBel morazbel.ski +ModalBar morazbel.ski Brass pictures.ski -Wurley nriderson.ski +Wurley riderson.ski Flute simplgft.ski Clarinet simplgft.ski -Marimba spain.ski -Vibraphn spain.ski -HeavyMtl streetsf.ski -Moog1 thecars.ski +ModalBar spain.ski +HevyMetl streetsf.ski +Moog thecars.ski TubeBell tubebell.ski FMVoices lacrymos.ski, vocaliz.ski diff --git a/projects/demo/scores/organs.ski b/projects/demo/scores/organs.ski index c4a5be2..de0e797 100644 --- a/projects/demo/scores/organs.ski +++ b/projects/demo/scores/organs.ski @@ -1,221 +1,221 @@ /* Howdy!! ToolKit96cpp SKINI File, Perry Cook */ -NoteOn 0.000327 2 68 64 -NoteOn 0.011439 2 72 60 -NoteOn 0.100661 2 69 58 -NoteOff 0.022910 2 68 0 -NoteOff 0.087179 2 69 0 -NoteOff 0.002768 2 72 0 -NoteOn 0.146276 2 74 60 -NoteOn 0.007877 2 70 73 -NoteOff 0.065823 2 74 0 -NoteOff 0.034091 2 70 0 -NoteOn 0.071562 2 65 42 -NoteOff 0.095505 2 65 0 -NoteOn 0.117222 2 72 36 -NoteOn 0.003568 2 75 57 -NoteOff 0.867934 2 72 0 -NoteOff 0.016747 2 75 0 -NoteOn 0.001292 2 70 66 -NoteOn 0.016806 2 74 41 -NoteOff 0.903721 2 70 0 -NoteOn 0.002269 2 71 60 -NoteOff 0.002452 2 74 0 -NoteOff 0.024367 2 71 0 -NoteOn 0.573769 2 71 71 -NoteOn 0.071125 2 72 47 -NoteOff 0.017603 2 71 0 -NoteOn 0.099531 2 77 63 -NoteOff 0.005133 2 72 0 -NoteOn 0.002825 2 75 57 -NoteOff 0.051047 2 77 0 -NoteOn 0.062443 2 72 42 -NoteOff 0.003421 2 75 0 -NoteOn 0.004190 2 73 22 -NoteOff 0.032476 2 73 0 -NoteOff 0.003357 2 72 0 -NoteOn 0.003412 2 71 51 -NoteOff 0.082169 2 71 0 -NoteOn 0.030527 2 70 64 -NoteOff 0.068936 2 70 0 -NoteOn 0.002836 2 68 63 -NoteOff 0.069395 2 68 0 -NoteOn 0.024967 2 65 52 -NoteOff 0.083696 2 65 0 -NoteOn 0.027784 2 63 69 -NoteOff 0.102489 2 63 0 -NoteOn 0.048174 2 60 61 -NoteOff 0.094914 2 60 0 -NoteOn 0.076034 2 58 62 -NoteOff 0.080772 2 58 0 -NoteOn 0.107826 2 56 73 -NoteOff 0.114325 2 56 0 -NoteOn 0.159665 2 53 71 -NoteOff 0.094385 2 53 0 -NoteOn 0.218823 2 56 82 -NoteOff 0.396073 2 56 0 -NoteOn 0.016601 2 53 79 -NoteOff 0.590675 2 53 0 -NoteOn 0.013945 2 41 61 -NoteOn 0.003797 2 53 48 -NoteOn 0.749734 2 57 69 -NoteOn 0.006420 2 63 69 -NoteOff 0.004025 2 53 0 -NoteOn 0.001033 2 59 71 -NoteOff 0.183718 2 59 0 -ControlChange 0.981560 2 1 1 -ControlChange 0.014051 2 1 2 -ControlChange 0.018312 2 1 3 -ControlChange 0.013991 2 1 4 -ControlChange 0.014672 2 1 5 -ControlChange 0.008917 2 1 6 -ControlChange 0.009676 2 1 7 -ControlChange 0.009401 2 1 8 -ControlChange 0.014007 2 1 9 -ControlChange 0.009716 2 1 10 -ControlChange 0.009322 2 1 11 -ControlChange 0.009533 2 1 12 -ControlChange 0.009596 2 1 13 -ControlChange 0.009475 2 1 14 -ControlChange 0.014006 2 1 15 -ControlChange 0.009540 2 1 16 -ControlChange 0.010279 2 1 17 -ControlChange 0.013663 2 1 18 -ControlChange 0.009675 2 1 19 -ControlChange 0.009790 2 1 20 -ControlChange 0.014027 2 1 21 -ControlChange 0.013973 2 1 22 -ControlChange 0.009544 2 1 23 -ControlChange 0.014007 2 1 24 -ControlChange 0.010353 2 1 25 -ControlChange 0.010221 2 1 26 -ControlChange 0.017407 2 1 27 -ControlChange 0.010088 2 1 28 -ControlChange 0.009214 2 1 29 -ControlChange 0.009312 2 1 31 -ControlChange 0.014216 2 1 32 -ControlChange 0.004844 2 1 33 -ControlChange 0.009540 2 1 34 -ControlChange 0.005039 2 1 35 -ControlChange 0.009520 2 1 36 -ControlChange 0.010018 2 1 37 -ControlChange 0.004663 2 1 38 -ControlChange 0.009539 2 1 39 -ControlChange 0.009540 2 1 41 -ControlChange 0.005017 2 1 42 -ControlChange 0.009504 2 1 43 -ControlChange 0.005097 2 1 44 -ControlChange 0.009941 2 1 45 -ControlChange 0.004610 2 1 46 -ControlChange 0.005284 2 1 47 -ControlChange 0.004821 2 1 48 -ControlChange 0.005134 2 1 49 -ControlChange 0.009580 2 1 51 -ControlChange 0.009561 2 1 52 -ControlChange 0.019091 2 1 54 -ControlChange 0.001107 2 1 55 -ControlChange 0.003756 2 1 56 -ControlChange 0.009684 2 1 57 -ControlChange 0.004888 2 1 58 -ControlChange 0.014042 2 1 59 -ControlChange 0.009508 2 1 60 -ControlChange 0.009528 2 1 61 -ControlChange 0.014029 2 1 62 -ControlChange 0.009753 2 1 63 -ControlChange 0.018303 2 1 64 -ControlChange 0.014210 2 1 65 -ControlChange 0.027270 2 1 66 -ControlChange 0.027450 2 1 67 -ControlChange 0.072463 2 1 68 -ControlChange 0.040774 2 1 69 -ControlChange 0.022966 2 1 70 -ControlChange 0.018511 2 1 71 -ControlChange 0.023463 2 1 72 -ControlChange 0.013521 2 1 73 -ControlChange 0.014483 2 1 74 -ControlChange 0.013854 2 1 75 -ControlChange 0.009555 2 1 76 -ControlChange 0.018674 2 1 77 -ControlChange 0.009540 2 1 78 -ControlChange 0.009616 2 1 79 -ControlChange 0.013994 2 1 80 -ControlChange 0.014260 2 1 81 -ControlChange 0.018448 2 1 82 -ControlChange 0.032114 2 1 83 -ControlChange 0.058711 2 1 84 -ControlChange 0.049895 2 1 85 -ControlChange 0.032104 2 1 86 -ControlChange 0.036434 2 1 87 -ControlChange 0.022873 2 1 88 -ControlChange 0.068096 2 1 89 -ControlChange 0.112544 2 1 90 -ControlChange 0.018361 2 1 91 -ControlChange 0.018528 2 1 92 -ControlChange 0.018461 2 1 93 -ControlChange 0.014041 2 1 94 -ControlChange 0.037010 2 1 95 -ControlChange 0.008956 2 1 96 -ControlChange 0.099445 2 1 95 -ControlChange 0.013834 2 1 94 -ControlChange 0.009499 2 1 93 -ControlChange 0.010104 2 1 92 -ControlChange 0.005027 2 1 91 -ControlChange 0.010180 2 1 90 -ControlChange 0.008871 2 1 89 -ControlChange 0.009510 2 1 88 -ControlChange 0.005047 2 1 87 -ControlChange 0.014061 2 1 86 -ControlChange 0.009903 2 1 85 -ControlChange 0.009119 2 1 84 -ControlChange 0.009573 2 1 83 -ControlChange 0.009491 2 1 82 -ControlChange 0.005078 2 1 81 -ControlChange 0.005002 2 1 80 -ControlChange 0.009607 2 1 78 -ControlChange 0.005082 2 1 77 -ControlChange 0.009826 2 1 76 -ControlChange 0.004771 2 1 75 -ControlChange 0.005025 2 1 74 -ControlChange 0.005486 2 1 72 -ControlChange 0.004613 2 1 71 -ControlChange 0.005046 2 1 70 -ControlChange 0.005514 2 1 69 -ControlChange 0.004571 2 1 67 -ControlChange 0.005025 2 1 66 -ControlChange 0.005039 2 1 65 -ControlChange 0.005033 2 1 63 -ControlChange 0.005073 2 1 62 -ControlChange 0.005017 2 1 60 -ControlChange 0.005073 2 1 59 -ControlChange 0.005033 2 1 57 -ControlChange 0.005061 2 1 56 -ControlChange 0.005057 2 1 54 -ControlChange 0.005024 2 1 52 -ControlChange 0.005068 2 1 51 -ControlChange 0.004988 2 1 49 -ControlChange 0.005074 2 1 47 -ControlChange 0.005035 2 1 45 -ControlChange 0.005221 2 1 44 -ControlChange 0.005234 2 1 42 -ControlChange 0.005196 2 1 40 -ControlChange 0.005115 2 1 38 -ControlChange 0.005286 2 1 36 -ControlChange 0.005148 2 1 34 -ControlChange 0.005234 2 1 32 -ControlChange 0.005301 2 1 30 -ControlChange 0.005069 2 1 28 -ControlChange 0.005155 2 1 26 -ControlChange 0.008498 2 1 24 -ControlChange 0.002918 2 1 21 -ControlChange 0.004145 2 1 20 -ControlChange 0.005652 2 1 17 -ControlChange 0.004790 2 1 15 -ControlChange 0.005180 2 1 13 -ControlChange 0.005223 2 1 10 -ControlChange 0.005177 2 1 8 -ControlChange 0.005270 2 1 6 -ControlChange 0.005135 2 1 4 -ControlChange 0.005196 2 1 2 -ControlChange 0.005197 2 1 0 -NoteOff 0.354573 2 63 0 -NoteOff 0.014193 2 57 0 -NoteOff 0.008219 2 41 0 +NoteOn 0.000327 1 68 64 +NoteOn 0.011439 1 72 60 +NoteOn 0.100661 1 69 58 +NoteOff 0.022910 1 68 0 +NoteOff 0.087179 1 69 0 +NoteOff 0.002768 1 72 0 +NoteOn 0.146276 1 74 60 +NoteOn 0.007877 1 70 73 +NoteOff 0.065823 1 74 0 +NoteOff 0.034091 1 70 0 +NoteOn 0.071562 1 65 42 +NoteOff 0.095505 1 65 0 +NoteOn 0.117222 1 72 36 +NoteOn 0.003568 1 75 57 +NoteOff 0.867934 1 72 0 +NoteOff 0.016747 1 75 0 +NoteOn 0.001292 1 70 66 +NoteOn 0.016806 1 74 41 +NoteOff 0.903721 1 70 0 +NoteOn 0.002269 1 71 60 +NoteOff 0.002452 1 74 0 +NoteOff 0.024367 1 71 0 +NoteOn 0.573769 1 71 71 +NoteOn 0.071125 1 72 47 +NoteOff 0.017603 1 71 0 +NoteOn 0.099531 1 77 63 +NoteOff 0.005133 1 72 0 +NoteOn 0.002825 1 75 57 +NoteOff 0.051047 1 77 0 +NoteOn 0.062443 1 72 42 +NoteOff 0.003421 1 75 0 +NoteOn 0.004190 1 73 22 +NoteOff 0.032476 1 73 0 +NoteOff 0.003357 1 72 0 +NoteOn 0.003412 1 71 51 +NoteOff 0.082169 1 71 0 +NoteOn 0.030527 1 70 64 +NoteOff 0.068936 1 70 0 +NoteOn 0.002836 1 68 63 +NoteOff 0.069395 1 68 0 +NoteOn 0.024967 1 65 52 +NoteOff 0.083696 1 65 0 +NoteOn 0.027784 1 63 69 +NoteOff 0.102489 1 63 0 +NoteOn 0.048174 1 60 61 +NoteOff 0.094914 1 60 0 +NoteOn 0.076034 1 58 62 +NoteOff 0.080772 1 58 0 +NoteOn 0.107826 1 56 73 +NoteOff 0.114325 1 56 0 +NoteOn 0.159665 1 53 71 +NoteOff 0.094385 1 53 0 +NoteOn 0.218823 1 56 82 +NoteOff 0.396073 1 56 0 +NoteOn 0.016601 1 53 79 +NoteOff 0.590675 1 53 0 +NoteOn 0.013945 1 41 61 +NoteOn 0.003797 1 53 48 +NoteOn 0.749734 1 57 69 +NoteOn 0.006420 1 63 69 +NoteOff 0.004025 1 53 0 +NoteOn 0.001033 1 59 71 +NoteOff 0.183718 1 59 0 +ControlChange 0.981560 1 1 1 +ControlChange 0.014051 1 1 2 +ControlChange 0.018312 1 1 3 +ControlChange 0.013991 1 1 4 +ControlChange 0.014672 1 1 5 +ControlChange 0.008917 1 1 6 +ControlChange 0.009676 1 1 7 +ControlChange 0.009401 1 1 8 +ControlChange 0.014007 1 1 9 +ControlChange 0.009716 1 1 10 +ControlChange 0.009322 1 1 11 +ControlChange 0.009533 1 1 12 +ControlChange 0.009596 1 1 13 +ControlChange 0.009475 1 1 14 +ControlChange 0.014006 1 1 15 +ControlChange 0.009540 1 1 16 +ControlChange 0.010279 1 1 17 +ControlChange 0.013663 1 1 18 +ControlChange 0.009675 1 1 19 +ControlChange 0.009790 1 1 20 +ControlChange 0.014027 1 1 21 +ControlChange 0.013973 1 1 22 +ControlChange 0.009544 1 1 23 +ControlChange 0.014007 1 1 24 +ControlChange 0.010353 1 1 25 +ControlChange 0.010221 1 1 26 +ControlChange 0.017407 1 1 27 +ControlChange 0.010088 1 1 28 +ControlChange 0.009214 1 1 29 +ControlChange 0.009312 1 1 31 +ControlChange 0.014216 1 1 32 +ControlChange 0.004844 1 1 33 +ControlChange 0.009540 1 1 34 +ControlChange 0.005039 1 1 35 +ControlChange 0.009520 1 1 36 +ControlChange 0.010018 1 1 37 +ControlChange 0.004663 1 1 38 +ControlChange 0.009539 1 1 39 +ControlChange 0.009540 1 1 41 +ControlChange 0.005017 1 1 42 +ControlChange 0.009504 1 1 43 +ControlChange 0.005097 1 1 44 +ControlChange 0.009941 1 1 45 +ControlChange 0.004610 1 1 46 +ControlChange 0.005284 1 1 47 +ControlChange 0.004821 1 1 48 +ControlChange 0.005134 1 1 49 +ControlChange 0.009580 1 1 51 +ControlChange 0.009561 1 1 52 +ControlChange 0.019091 1 1 54 +ControlChange 0.001107 1 1 55 +ControlChange 0.003756 1 1 56 +ControlChange 0.009684 1 1 57 +ControlChange 0.004888 1 1 58 +ControlChange 0.014042 1 1 59 +ControlChange 0.009508 1 1 60 +ControlChange 0.009528 1 1 61 +ControlChange 0.014029 1 1 62 +ControlChange 0.009753 1 1 63 +ControlChange 0.018303 1 1 64 +ControlChange 0.014210 1 1 65 +ControlChange 0.027270 1 1 66 +ControlChange 0.027450 1 1 67 +ControlChange 0.072463 1 1 68 +ControlChange 0.040774 1 1 69 +ControlChange 0.022966 1 1 70 +ControlChange 0.018511 1 1 71 +ControlChange 0.023463 1 1 72 +ControlChange 0.013521 1 1 73 +ControlChange 0.014483 1 1 74 +ControlChange 0.013854 1 1 75 +ControlChange 0.009555 1 1 76 +ControlChange 0.018674 1 1 77 +ControlChange 0.009540 1 1 78 +ControlChange 0.009616 1 1 79 +ControlChange 0.013994 1 1 80 +ControlChange 0.014260 1 1 81 +ControlChange 0.018448 1 1 82 +ControlChange 0.032114 1 1 83 +ControlChange 0.058711 1 1 84 +ControlChange 0.049895 1 1 85 +ControlChange 0.032104 1 1 86 +ControlChange 0.036434 1 1 87 +ControlChange 0.022873 1 1 88 +ControlChange 0.068096 1 1 89 +ControlChange 0.112544 1 1 90 +ControlChange 0.018361 1 1 91 +ControlChange 0.018528 1 1 92 +ControlChange 0.018461 1 1 93 +ControlChange 0.014041 1 1 94 +ControlChange 0.037010 1 1 95 +ControlChange 0.008956 1 1 96 +ControlChange 0.099445 1 1 95 +ControlChange 0.013834 1 1 94 +ControlChange 0.009499 1 1 93 +ControlChange 0.010104 1 1 92 +ControlChange 0.005027 1 1 91 +ControlChange 0.010180 1 1 90 +ControlChange 0.008871 1 1 89 +ControlChange 0.009510 1 1 88 +ControlChange 0.005047 1 1 87 +ControlChange 0.014061 1 1 86 +ControlChange 0.009903 1 1 85 +ControlChange 0.009119 1 1 84 +ControlChange 0.009573 1 1 83 +ControlChange 0.009491 1 1 82 +ControlChange 0.005078 1 1 81 +ControlChange 0.005002 1 1 80 +ControlChange 0.009607 1 1 78 +ControlChange 0.005082 1 1 77 +ControlChange 0.009826 1 1 76 +ControlChange 0.004771 1 1 75 +ControlChange 0.005025 1 1 74 +ControlChange 0.005486 1 1 72 +ControlChange 0.004613 1 1 71 +ControlChange 0.005046 1 1 70 +ControlChange 0.005514 1 1 69 +ControlChange 0.004571 1 1 67 +ControlChange 0.005025 1 1 66 +ControlChange 0.005039 1 1 65 +ControlChange 0.005033 1 1 63 +ControlChange 0.005073 1 1 62 +ControlChange 0.005017 1 1 60 +ControlChange 0.005073 1 1 59 +ControlChange 0.005033 1 1 57 +ControlChange 0.005061 1 1 56 +ControlChange 0.005057 1 1 54 +ControlChange 0.005024 1 1 52 +ControlChange 0.005068 1 1 51 +ControlChange 0.004988 1 1 49 +ControlChange 0.005074 1 1 47 +ControlChange 0.005035 1 1 45 +ControlChange 0.005221 1 1 44 +ControlChange 0.005234 1 1 42 +ControlChange 0.005196 1 1 40 +ControlChange 0.005115 1 1 38 +ControlChange 0.005286 1 1 36 +ControlChange 0.005148 1 1 34 +ControlChange 0.005234 1 1 32 +ControlChange 0.005301 1 1 30 +ControlChange 0.005069 1 1 28 +ControlChange 0.005155 1 1 26 +ControlChange 0.008498 1 1 24 +ControlChange 0.002918 1 1 21 +ControlChange 0.004145 1 1 20 +ControlChange 0.005652 1 1 17 +ControlChange 0.004790 1 1 15 +ControlChange 0.005180 1 1 13 +ControlChange 0.005223 1 1 10 +ControlChange 0.005177 1 1 8 +ControlChange 0.005270 1 1 6 +ControlChange 0.005135 1 1 4 +ControlChange 0.005196 1 1 2 +ControlChange 0.005197 1 1 0 +NoteOff 0.354573 1 63 0 +NoteOff 0.014193 1 57 0 +NoteOff 0.008219 1 41 0 diff --git a/projects/effects/Makefile.in b/projects/effects/Makefile.in index 51ce25d..39d60f5 100644 --- a/projects/effects/Makefile.in +++ b/projects/effects/Makefile.in @@ -1,3 +1,4 @@ +### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in ### STK effects Makefile - for various flavors of unix PROGRAMS = @@ -22,14 +23,14 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ -I$(INCLUDE) +CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include LIBRARY = @LIBS@ LIBRARY += @frameworks@ REALTIME = @realtime@ ifeq ($(REALTIME),yes) PROGRAMS += effects - OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o + OBJECTS += RtMidi.o RtAudio.o Thread.o Mutex.o Socket.o TcpServer.o @objects@ DEFS += @audio_apis@ endif @@ -42,19 +43,22 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : $(SRC_PATH)/%.cpp $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ +%.o : ../../src/include/%.cpp + $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ + all : $(PROGRAMS) effects: effects.cpp $(OBJECTS) $(CC) $(CFLAGS) $(DEFS) -o effects effects.cpp $(OBJECT_PATH)/*.o $(LIBRARY) libeffects: effects.cpp - $(CC) $(CFLAGS) $(DEFS) -o effects effects.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o effects effects.cpp -L../../src -lstk $(LIBRARY) $(OBJECTS) : Stk.h clean : -rm $(OBJECT_PATH)/*.o - -rm $(PROGRAMS) + -rm $(PROGRAMS) *.exe strip : strip $(PROGRAMS) diff --git a/projects/effects/effects.cpp b/projects/effects/effects.cpp index 8f33313..985dcf3 100644 --- a/projects/effects/effects.cpp +++ b/projects/effects/effects.cpp @@ -15,9 +15,7 @@ #include #include #include -#if !defined(__OS_WINDOWS__) // Windoze bogosity for VC++ 6.0 - using std::min; -#endif +using std::min; void usage(void) { // Error function in case of incorrect command-line argument specifications diff --git a/projects/effects/effects.vcproj b/projects/effects/effects.vcproj deleted file mode 100755 index 8c7d246..0000000 --- a/projects/effects/effects.vcproj +++ /dev/null @@ -1,732 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/Makefile.in b/projects/examples/Makefile.in index 64fd041..17b360c 100644 --- a/projects/examples/Makefile.in +++ b/projects/examples/Makefile.in @@ -1,3 +1,4 @@ +### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in ### STK examples Makefile - for various flavors of unix PROGRAMS = sine sineosc foursine @@ -16,13 +17,13 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ -I$(INCLUDE) +CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include LIBRARY = @LIBS@ LIBRARY += @frameworks@ REALTIME = @realtime@ ifeq ($(REALTIME),yes) - PROGRAMS += play record probe duplex inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains + PROGRAMS += play record audioprobe midiprobe duplex inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains DEFS += @audio_apis@ endif @@ -35,19 +36,25 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : $(SRC_PATH)/%.cpp $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ +%.o : ../../src/include/%.cpp + $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ + all : $(PROGRAMS) $(OBJECTS) : Stk.h clean : -rm $(OBJECT_PATH)/*.o - -rm $(PROGRAMS) + -rm $(PROGRAMS) *.exe strip : strip $(PROGRAMS) -probe: RtAudio.o - $(CC) $(CFLAGS) $(DEFS) -o probe probe.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY) +audioprobe: RtAudio.o @objects@ + $(CC) $(CFLAGS) $(DEFS) -o audioprobe audioprobe.cpp $(OBJECT_PATH)/*.o $(LIBRARY) + +midiprobe: RtMidi.o + $(CC) $(CFLAGS) $(DEFS) -o midiprobe midiprobe.cpp $(OBJECT_PATH)/RtMidi.o $(LIBRARY) play: play.cpp Stk.o FileRead.o WvIn.o FileWvIn.o RtAudio.o $(CC) $(CFLAGS) $(DEFS) -o play play.cpp $(OBJECT_PATH)/Stk.o $(OBJECT_PATH)/WvIn.o $(OBJECT_PATH)/FileRead.o $(OBJECT_PATH)/FileWvIn.o $(OBJECT_PATH)/RtAudio.o $(LIBRARY) diff --git a/projects/examples/probe.cpp b/projects/examples/audioprobe.cpp similarity index 99% rename from projects/examples/probe.cpp rename to projects/examples/audioprobe.cpp index e756346..f7246fb 100644 --- a/projects/examples/probe.cpp +++ b/projects/examples/audioprobe.cpp @@ -1,6 +1,6 @@ /******************************************/ /* - probe.cpp + audioprobe.cpp by Gary P. Scavone, 2001 Probe audio system and prints device info. diff --git a/projects/examples/audioprobe.dsp b/projects/examples/audioprobe.dsp new file mode 100755 index 0000000..bdb557c --- /dev/null +++ b/projects/examples/audioprobe.dsp @@ -0,0 +1,162 @@ +# Microsoft Developer Studio Project File - Name="audioprobe" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=audioprobe - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "audioprobe.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "audioprobe.mak" CFG="audioprobe - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "audioprobe - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "audioprobe - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "audioprobe - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "audioprobe___Win32_Release" +# PROP BASE Intermediate_Dir "audioprobe___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "audioprobe - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "audioprobe___Win32_Debug" +# PROP BASE Intermediate_Dir "audioprobe___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "audioprobe - Win32 Release" +# Name "audioprobe - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\src\include\asio.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiodrivers.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiolist.cpp +# End Source File +# Begin Source File + +SOURCE=.\audioprobe.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\iasiothiscallresolver.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\RtAudio.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\src\include\asio.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiodrivers.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiodrvr.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiolist.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\asiosys.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\ginclude.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\iasiodrv.h +# End Source File +# Begin Source File + +SOURCE=..\..\src\include\iasiothiscallresolver.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\RtAudio.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\RtError.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/projects/examples/bethree.dsp b/projects/examples/bethree.dsp index f80a047..c5f4401 100755 --- a/projects/examples/bethree.dsp +++ b/projects/examples/bethree.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/bethree.vcproj b/projects/examples/bethree.vcproj deleted file mode 100755 index a0db11e..0000000 --- a/projects/examples/bethree.vcproj +++ /dev/null @@ -1,562 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/controlbee.cpp b/projects/examples/controlbee.cpp index cbfd067..8902172 100644 --- a/projects/examples/controlbee.cpp +++ b/projects/examples/controlbee.cpp @@ -6,9 +6,7 @@ #include "SKINI.msg" #include #include -#if !defined(__OS_WINDOWS__) // Windoze bogosity for VC++ 6.0 - using std::min; -#endif +using std::min; void usage(void) { // Error function in case of incorrect command-line diff --git a/projects/examples/controlbee.dsp b/projects/examples/controlbee.dsp index d42fa2e..557262b 100755 --- a/projects/examples/controlbee.dsp +++ b/projects/examples/controlbee.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -67,7 +67,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/controlbee.vcproj b/projects/examples/controlbee.vcproj deleted file mode 100755 index 6c94122..0000000 --- a/projects/examples/controlbee.vcproj +++ /dev/null @@ -1,708 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/crtsine.dsp b/projects/examples/crtsine.dsp index 8daa8fb..004e7c7 100755 --- a/projects/examples/crtsine.dsp +++ b/projects/examples/crtsine.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/crtsine.vcproj b/projects/examples/crtsine.vcproj deleted file mode 100755 index b7dc8a8..0000000 --- a/projects/examples/crtsine.vcproj +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/duplex.cpp b/projects/examples/duplex.cpp index 5e63cd7..77cf961 100644 --- a/projects/examples/duplex.cpp +++ b/projects/examples/duplex.cpp @@ -101,7 +101,7 @@ int main(int argc, char *argv[]) } catch ( RtError& e ) { std::cout << '\n' << e.getMessage() << '\n' << std::endl; - exit( 0 ); + exit( 1 ); } bufferBytes = bufferFrames * channels * sizeof( MY_TYPE ); diff --git a/projects/examples/duplex.dsp b/projects/examples/duplex.dsp index cb2aa46..a15b558 100755 --- a/projects/examples/duplex.dsp +++ b/projects/examples/duplex.dsp @@ -39,17 +39,18 @@ RSC=rc.exe # PROP Use_Debug_Libraries 0 # PROP Output_Dir "" # PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "duplex - Win32 Debug" @@ -64,16 +65,16 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__WINDOWS_ASIO__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF @@ -86,15 +87,15 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File -SOURCE=..\..\src\asio\asio.cpp +SOURCE=..\..\src\include\asio.cpp # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiodrivers.cpp +SOURCE=..\..\src\include\asiodrivers.cpp # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiolist.cpp +SOURCE=..\..\src\include\asiolist.cpp # End Source File # Begin Source File @@ -102,7 +103,7 @@ SOURCE=.\duplex.cpp # End Source File # Begin Source File -SOURCE=..\..\src\asio\iasiothiscallresolver.cpp +SOURCE=..\..\src\include\iasiothiscallresolver.cpp # End Source File # Begin Source File @@ -114,35 +115,35 @@ SOURCE=..\..\src\RtAudio.cpp # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File -SOURCE=..\..\src\asio\asio.h +SOURCE=..\..\src\include\asio.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiodrivers.h +SOURCE=..\..\src\include\asiodrivers.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiodrvr.h +SOURCE=..\..\src\include\asiodrvr.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiolist.h +SOURCE=..\..\src\include\asiolist.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\asiosys.h +SOURCE=..\..\src\include\asiosys.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\ginclude.h +SOURCE=..\..\src\include\ginclude.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\iasiodrv.h +SOURCE=..\..\src\include\iasiodrv.h # End Source File # Begin Source File -SOURCE=..\..\src\asio\iasiothiscallresolver.h +SOURCE=..\..\src\include\iasiothiscallresolver.h # End Source File # Begin Source File diff --git a/projects/examples/duplex.vcproj b/projects/examples/duplex.vcproj deleted file mode 100755 index 70e4fd0..0000000 --- a/projects/examples/duplex.vcproj +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/examples.dsw b/projects/examples/examples.dsw old mode 100644 new mode 100755 index 1187690..d81dccf --- a/projects/examples/examples.dsw +++ b/projects/examples/examples.dsw @@ -3,6 +3,18 @@ Microsoft Developer Studio Workspace File, Format Version 6.00 ############################################################################### +Project: "audioprobe"=".\audioprobe.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "bethree"=".\bethree.dsp" - Package Owner=<4> Package=<5> @@ -99,6 +111,18 @@ Package=<4> ############################################################################### +Project: "midiprobe"=".\midiprobe.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Project: "play"=".\play.dsp" - Package Owner=<4> Package=<5> @@ -123,18 +147,6 @@ Package=<4> ############################################################################### -Project: "probe"=".\probe.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - Project: "record"=".\record.dsp" - Package Owner=<4> Package=<5> diff --git a/projects/examples/foursine.cpp b/projects/examples/foursine.cpp index 8480b1f..7e64c88 100644 --- a/projects/examples/foursine.cpp +++ b/projects/examples/foursine.cpp @@ -21,7 +21,7 @@ int main() output.openFile( "foursine.aif", 4, FileWrite::FILE_AIF, Stk::STK_SINT16 ); } catch (StkError &) { - exit(0); + exit( 1 ); } // Write two seconds of four sines to the output file diff --git a/projects/examples/foursine.dsp b/projects/examples/foursine.dsp index 75ef26a..220fd1b 100755 --- a/projects/examples/foursine.dsp +++ b/projects/examples/foursine.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -64,7 +64,7 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/foursine.vcproj b/projects/examples/foursine.vcproj deleted file mode 100755 index 66b5efd..0000000 --- a/projects/examples/foursine.vcproj +++ /dev/null @@ -1,390 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/grains.cpp b/projects/examples/grains.cpp index 2ab6c2b..71f2f45 100644 --- a/projects/examples/grains.cpp +++ b/projects/examples/grains.cpp @@ -20,19 +20,19 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, return 0; } -void usage(void) { +void usage( void ) { // Error function in case of incorrect command-line // argument specifications. - printf("\nuseage: grains file N dur ramp offset delay stretch ramdomness\n"); - printf(" where file = a soundfile to granulate,\n"); - printf(" N = the number of grain voices to use,\n"); - printf(" dur = the grain duration (ms),\n"); - printf(" ramp = the envelope percent (0-100),\n"); - printf(" offset = hop time between grains (ms),\n"); - printf(" delay = pause time between grains (ms),\n"); - printf(" stretch = stetch factor (1-1000),\n"); - printf(" and randomness = factor between 0 - 1.0 to control grain parameter randomness.\n\n"); - exit(0); + std::cout << "\nuseage: grains file N dur ramp offset delay stretch ramdomness\n"; + std::cout << " where file = a soundfile to granulate,\n"; + std::cout << " N = the number of grain voices to use,\n"; + std::cout << " dur = the grain duration (ms),\n"; + std::cout << " ramp = the envelope percent (0-100),\n"; + std::cout << " offset = hop time between grains (ms),\n"; + std::cout << " delay = pause time between grains (ms),\n"; + std::cout << " stretch = stetch factor (1-1000),\n"; + std::cout << " and randomness = factor between 0 - 1.0 to control grain parameter randomness.\n\n"; + exit( 0 ); } int main( int argc, char *argv[] ) @@ -60,7 +60,7 @@ int main( int argc, char *argv[] ) grani.openFile( argv[1] ); } catch ( StkError& ) { - exit(0); + exit( 1 ); } grani.setVoices( N ); diff --git a/projects/examples/grains.dsp b/projects/examples/grains.dsp index 7409b54..cc98daf 100755 --- a/projects/examples/grains.dsp +++ b/projects/examples/grains.dsp @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "grains - Win32 Debug" @@ -65,15 +65,15 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF diff --git a/projects/examples/grains.vcproj b/projects/examples/grains.vcproj deleted file mode 100755 index 78fed15..0000000 --- a/projects/examples/grains.vcproj +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/inetIn.cpp b/projects/examples/inetIn.cpp index 7e4ff46..5a4cf76 100644 --- a/projects/examples/inetIn.cpp +++ b/projects/examples/inetIn.cpp @@ -34,20 +34,20 @@ void usage(void) { // Error function in case of incorrect command-line // argument specifications. - printf("\nuseage: inetIn N fs \n"); - printf(" where N = number of channels,\n"); - printf(" and fs = the data sample rate.\n\n"); - exit(0); + std::cout << "\nuseage: inetIn N fs \n"; + std::cout << " where N = number of channels,\n"; + std::cout << " and fs = the data sample rate.\n\n"; + exit( 0 ); } int main(int argc, char *argv[]) { // Minimal command-line checking. - if (argc != 3) usage(); + if ( argc != 3 ) usage(); Stk::showWarnings( true ); - Stk::setSampleRate( atof(argv[2]) ); - int channels = (int) atoi(argv[1]); + Stk::setSampleRate( atof( argv[2] ) ); + int channels = (int) atoi( argv[1] ); StkFrames frame( 1, channels ); // Create instances and pointers. @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) //input.listen( 2006, channels, Stk::STK_SINT16, Socket::PROTO_UDP ); input.listen( 2006, channels, Stk::STK_SINT16, Socket::PROTO_TCP ); } - catch (StkError &) { + catch ( StkError & ) { goto cleanup; } @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) try { output = new RtWvOut( channels ); } - catch (StkError &) { + catch ( StkError & ) { goto cleanup; } diff --git a/projects/examples/inetIn.dsp b/projects/examples/inetIn.dsp index f43b9cb..5e4f4e6 100755 --- a/projects/examples/inetIn.dsp +++ b/projects/examples/inetIn.dsp @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib wsock32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "inetIn - Win32 Debug" @@ -65,15 +65,15 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib dsound.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF diff --git a/projects/examples/inetIn.vcproj b/projects/examples/inetIn.vcproj deleted file mode 100755 index 579f521..0000000 --- a/projects/examples/inetIn.vcproj +++ /dev/null @@ -1,415 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/inetOut.cpp b/projects/examples/inetOut.cpp index 5175423..211fd1c 100644 --- a/projects/examples/inetOut.cpp +++ b/projects/examples/inetOut.cpp @@ -19,24 +19,23 @@ #include "FileWvIn.h" #include "InetWvOut.h" -#include void usage(void) { // Error function in case of incorrect command-line // argument specifications. - printf("\nuseage: inetOut file host \n"); - printf(" where file = the file to load,\n"); - printf(" host = the hostname where the receiving\n"); - printf(" application is running.\n"); - printf(" and rate = an optional playback rate for the file.\n"); - printf(" (default = 1.0, can be negative)\n\n"); - exit(0); + std::cout << "\nuseage: inetOut file host \n"; + std::cout << " where file = the file to load,\n"; + std::cout << " host = the hostname where the receiving\n"; + std::cout << " application is running.\n"; + std::cout << " and rate = an optional playback rate for the file.\n"; + std::cout << " (default = 1.0, can be negative)\n\n"; + exit( 0 ); } -int main(int argc, char *argv[]) +int main( int argc, char *argv[] ) { // Minimal command-line checking. - if (argc < 3 || argc > 4) usage(); + if ( argc < 3 || argc > 4 ) usage(); FileWvIn input; InetWvOut output; @@ -45,8 +44,8 @@ int main(int argc, char *argv[]) try { input.openFile( (char *)argv[1] ); } - catch (StkError &) { - exit(0); + catch ( StkError & ) { + exit( 1 ); } // Set the global STK sample rate to the file rate. @@ -54,7 +53,7 @@ int main(int argc, char *argv[]) // Set input read rate. double rate = 1.0; - if ( argc == 4 ) rate = atof(argv[3]); + if ( argc == 4 ) rate = atof( argv[3] ); input.setRate( rate ); // Find out how many channels we have. @@ -66,8 +65,8 @@ int main(int argc, char *argv[]) //output.connect( 2006, Socket::PROTO_UDP, (char *)argv[2], channels, Stk::STK_SINT16 ); output.connect( 2006, Socket::PROTO_TCP, (char *)argv[2], channels, Stk::STK_SINT16 ); } - catch (StkError &) { - exit(0); + catch ( StkError & ) { + exit( 1 ); } // Here's the runtime loop diff --git a/projects/examples/inetOut.dsp b/projects/examples/inetOut.dsp index 85995be..6ecf774 100755 --- a/projects/examples/inetOut.dsp +++ b/projects/examples/inetOut.dsp @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "inetOut - Win32 Debug" @@ -65,15 +65,15 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_DS__" /D "__LITTLE_ENDIAN__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF diff --git a/projects/examples/inetOut.vcproj b/projects/examples/inetOut.vcproj deleted file mode 100755 index 0182d61..0000000 --- a/projects/examples/inetOut.vcproj +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/libMakefile.in b/projects/examples/libMakefile.in index 15bd48c..d6e995d 100644 --- a/projects/examples/libMakefile.in +++ b/projects/examples/libMakefile.in @@ -13,13 +13,13 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ -I$(INCLUDE) +CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include LIBRARY = @LIBS@ LIBRARY += @frameworks@ REALTIME = @realtime@ ifeq ($(REALTIME),yes) - PROGRAMS += play record io inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains + PROGRAMS += audioprobe midiprobe duplex play record inetIn inetOut rtsine crtsine bethree controlbee threebees playsmf grains DEFS += @audio_apis@ endif @@ -34,56 +34,59 @@ all : $(PROGRAMS) $(OBJECTS) : Stk.h clean : - -rm $(PROGRAMS) + -rm $(PROGRAMS) *.exe strip : strip $(PROGRAMS) -play: play.cpp - $(CC) $(CFLAGS) $(DEFS) -o play play.cpp -L../../src $(LIBRARY) -lstk +audioprobe: audioprobe.cpp + $(CC) $(CFLAGS) $(DEFS) -o audioprobe audioprobe.cpp -L../../src -lstk $(LIBRARY) -probe: probe.cpp - $(CC) $(CFLAGS) $(DEFS) -o probe probe.cpp -L../../src $(LIBRARY) -lstk +midiprobe: midiprobe.cpp + $(CC) $(CFLAGS) $(DEFS) -o midiprobe midiprobe.cpp -L../../src -lstk $(LIBRARY) + +play: play.cpp + $(CC) $(CFLAGS) $(DEFS) -o play play.cpp -L../../src -lstk $(LIBRARY) record: record.cpp - $(CC) $(CFLAGS) $(DEFS) -o record record.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o record record.cpp -L../../src -lstk $(LIBRARY) sine: sine.cpp - $(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o sine sine.cpp -L../../src -lstk $(LIBRARY) duplex: duplex.cpp - $(CC) $(CFLAGS) $(DEFS) -o duplex duplex.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o duplex duplex.cpp -L../../src -lstk $(LIBRARY) inetIn: inetIn.cpp - $(CC) $(CFLAGS) $(DEFS) -o inetIn inetIn.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o inetIn inetIn.cpp -L../../src -lstk $(LIBRARY) inetOut: inetOut.cpp - $(CC) $(CFLAGS) $(DEFS) -o inetOut inetOut.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o inetOut inetOut.cpp -L../../src -lstk $(LIBRARY) sineosc: sineosc.cpp - $(CC) $(CFLAGS) $(DEFS) -o sineosc sineosc.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o sineosc sineosc.cpp -L../../src -lstk $(LIBRARY) rtsine: rtsine.cpp - $(CC) $(CFLAGS) $(DEFS) -o rtsine rtsine.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o rtsine rtsine.cpp -L../../src -lstk $(LIBRARY) crtsine: crtsine.cpp - $(CC) $(CFLAGS) $(DEFS) -o crtsine crtsine.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o crtsine crtsine.cpp -L../../src -lstk $(LIBRARY) bethree: bethree.cpp - $(CC) $(CFLAGS) $(DEFS) -o bethree bethree.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o bethree bethree.cpp -L../../src -lstk $(LIBRARY) controlbee: controlbee.cpp - $(CC) $(CFLAGS) $(DEFS) -o controlbee controlbee.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o controlbee controlbee.cpp -L../../src -lstk $(LIBRARY) foursine: foursine.cpp - $(CC) $(CFLAGS) $(DEFS) -o foursine foursine.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o foursine foursine.cpp -L../../src -lstk $(LIBRARY) threebees: threebees.cpp - $(CC) $(CFLAGS) $(DEFS) -o threebees threebees.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o threebees threebees.cpp -L../../src -lstk $(LIBRARY) playsmf: playsmf.cpp - $(CC) $(CFLAGS) $(DEFS) -o playsmf playsmf.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o playsmf playsmf.cpp -L../../src -lstk $(LIBRARY) grains: grains.cpp - $(CC) $(CFLAGS) $(DEFS) -o grains grains.cpp -L../../src $(LIBRARY) -lstk + $(CC) $(CFLAGS) $(DEFS) -o grains grains.cpp -L../../src -lstk $(LIBRARY) diff --git a/projects/examples/midiprobe.cpp b/projects/examples/midiprobe.cpp new file mode 100644 index 0000000..7b4dc8c --- /dev/null +++ b/projects/examples/midiprobe.cpp @@ -0,0 +1,70 @@ +// midiprobe.cpp +// +// Simple program to check MIDI inputs and outputs. +// +// by Gary Scavone, 2003-2004. + +#include +#include "RtMidi.h" + +int main() +{ + RtMidiIn *midiin = 0; + RtMidiOut *midiout = 0; + + // RtMidiIn constructor + try { + midiin = new RtMidiIn(); + } + catch ( RtError &error ) { + error.printMessage(); + exit( EXIT_FAILURE ); + } + + // Check inputs. + unsigned int nPorts = midiin->getPortCount(); + std::cout << "\nThere are " << nPorts << " MIDI input sources available.\n"; + std::string portName; + unsigned int i; + for ( i=0; igetPortName(i); + } + catch ( RtError &error ) { + error.printMessage(); + goto cleanup; + } + std::cout << " Input Port #" << i+1 << ": " << portName << '\n'; + } + + // RtMidiOut constructor + try { + midiout = new RtMidiOut(); + } + catch ( RtError &error ) { + error.printMessage(); + exit( EXIT_FAILURE ); + } + + // Check outputs. + nPorts = midiout->getPortCount(); + std::cout << "\nThere are " << nPorts << " MIDI output ports available.\n"; + for ( i=0; igetPortName(i); + } + catch ( RtError &error ) { + error.printMessage(); + goto cleanup; + } + std::cout << " Output Port #" << i+1 << ": " << portName << '\n'; + } + std::cout << '\n'; + + // Clean up + cleanup: + delete midiin; + delete midiout; + + return 0; +} diff --git a/projects/examples/midiprobe.dsp b/projects/examples/midiprobe.dsp new file mode 100755 index 0000000..0c03b2b --- /dev/null +++ b/projects/examples/midiprobe.dsp @@ -0,0 +1,114 @@ +# Microsoft Developer Studio Project File - Name="midiprobe" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=midiprobe - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "midiprobe.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "midiprobe.mak" CFG="midiprobe - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "midiprobe - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "midiprobe - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "midiprobe - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "midiprobe___Win32_Release" +# PROP BASE Intermediate_Dir "midiprobe___Win32_Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_MM__" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "midiprobe - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "midiprobe___Win32_Debug" +# PROP BASE Intermediate_Dir "midiprobe___Win32_Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "midiprobe - Win32 Release" +# Name "midiprobe - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\midiprobe.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\RtMidi.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=..\..\include\RtError.h +# End Source File +# Begin Source File + +SOURCE=..\..\include\RtMidi.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/projects/examples/play.cpp b/projects/examples/play.cpp index a2c41fe..c0cd29b 100644 --- a/projects/examples/play.cpp +++ b/projects/examples/play.cpp @@ -32,7 +32,7 @@ void usage(void) { std::cout << " where sr = sample rate,\n"; std::cout << " and rate = an optional playback rate.\n"; std::cout << " (default = 1.0, can be negative)\n\n"; - exit(0); + exit( 0 ); } // This tick() function handles sample computation only. It will be @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) if ( argc < 3 || argc > 4 ) usage(); // Set the global sample rate before creating class instances. - Stk::setSampleRate( (StkFloat) atof(argv[2]) ); + Stk::setSampleRate( (StkFloat) atof( argv[2] ) ); // Initialize our WvIn and RtAudio pointers. RtAudio dac; @@ -72,14 +72,14 @@ int main(int argc, char *argv[]) try { input.openFile( argv[1] ); } - catch (StkError &) { - exit(0); + catch ( StkError & ) { + exit( 1 ); } // Set input read rate based on the default STK sample rate. double rate = 1.0; rate = input.getFileRate() / Stk::sampleRate(); - if ( argc == 4 ) rate *= atof(argv[3]); + if ( argc == 4 ) rate *= atof( argv[3] ); input.setRate( rate ); input.ignoreSampleRateChange(); diff --git a/projects/examples/play.dsp b/projects/examples/play.dsp old mode 100644 new mode 100755 index 2d2c8f5..8bd0a7f --- a/projects/examples/play.dsp +++ b/projects/examples/play.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/play.vcproj b/projects/examples/play.vcproj deleted file mode 100755 index aaf7009..0000000 --- a/projects/examples/play.vcproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/playsmf.cpp b/projects/examples/playsmf.cpp index ec91312..3abb7f1 100644 --- a/projects/examples/playsmf.cpp +++ b/projects/examples/playsmf.cpp @@ -20,7 +20,7 @@ void usage(void) { std::cout << " track = the track to play (0 = 1st track),\n"; std::cout << " and an optional port integer identifier can be specified\n"; std::cout << " (default = 0) or a value of -1 to use a virtual MIDI output port.\n\n"; - exit(0); + exit( 0 ); } int main( int argc, char *argv[] ) @@ -67,7 +67,7 @@ int main( int argc, char *argv[] ) // Install an interrupt handler function. Type "ctrl-c" to quit the // program. - (void) signal(SIGINT, finish); + (void) signal( SIGINT, finish ); try { MidiFileIn midiFile( argv[1] ); diff --git a/projects/examples/playsmf.dsp b/projects/examples/playsmf.dsp old mode 100644 new mode 100755 index 2758488..1992cc9 --- a/projects/examples/playsmf.dsp +++ b/projects/examples/playsmf.dsp @@ -42,14 +42,14 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /machine:I386 !ELSEIF "$(CFG)" == "playsmf - Win32 Debug" @@ -65,15 +65,15 @@ LINK32=link.exe # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_DS__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept !ENDIF diff --git a/projects/examples/playsmf.vcproj b/projects/examples/playsmf.vcproj deleted file mode 100755 index 6fb9139..0000000 --- a/projects/examples/playsmf.vcproj +++ /dev/null @@ -1,243 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/probe.vcproj b/projects/examples/probe.vcproj deleted file mode 100755 index 96fcb4d..0000000 --- a/projects/examples/probe.vcproj +++ /dev/null @@ -1,290 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/record.cpp b/projects/examples/record.cpp index c539495..d7b49cc 100644 --- a/projects/examples/record.cpp +++ b/projects/examples/record.cpp @@ -25,27 +25,27 @@ #include "RtWvIn.h" #include "FileWvOut.h" -void usage(void) { +void usage( void ) { // Error function in case of incorrect command-line // argument specifications. - printf("\nuseage: record N file time fs \n"); - printf(" where N = number of channels,\n"); - printf(" file = the .wav file to create,\n"); - printf(" time = the amount of time to record (in seconds),\n"); - printf(" and fs = the sample rate.\n\n"); - exit(0); + std::cout << "\nuseage: record N file time fs \n"; + std::cout << " where N = number of channels,\n"; + std::cout << " file = the .wav file to create,\n"; + std::cout << " time = the amount of time to record (in seconds),\n"; + std::cout << " and fs = the sample rate.\n\n"; + exit( 0 ); } -int main(int argc, char *argv[]) +int main( int argc, char *argv[] ) { // minimal command-line checking if ( argc != 5 ) usage(); Stk::showWarnings( true ); - unsigned int channels = (unsigned int) atoi(argv[1]); - double sampleRate = atof(argv[4]); - double time = atof(argv[3]); + unsigned int channels = (unsigned int) atoi( argv[1] ); + double sampleRate = atof( argv[4] ); + double time = atof( argv[3] ); long samples, i; StkFrames frame( 1, channels ); @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) input = new RtWvIn( channels ); } catch ( StkError & ) { - exit(0); + exit( 1 ); } // Open the soundfile for output. diff --git a/projects/examples/record.dsp b/projects/examples/record.dsp old mode 100644 new mode 100755 index 40fb1ac..fe537e7 --- a/projects/examples/record.dsp +++ b/projects/examples/record.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/record.vcproj b/projects/examples/record.vcproj deleted file mode 100755 index 99d27e6..0000000 --- a/projects/examples/record.vcproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/rtsine.cpp b/projects/examples/rtsine.cpp index 4d7ec9b..96a9773 100644 --- a/projects/examples/rtsine.cpp +++ b/projects/examples/rtsine.cpp @@ -17,7 +17,7 @@ int main() dac = new RtWvOut( 1 ); } catch ( StkError & ) { - exit(0); + exit( 1 ); } sine.setFrequency( 441.0 ); diff --git a/projects/examples/rtsine.dsp b/projects/examples/rtsine.dsp index acaf1dd..cab3ae3 100755 --- a/projects/examples/rtsine.dsp +++ b/projects/examples/rtsine.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/rtsine.vcproj b/projects/examples/rtsine.vcproj deleted file mode 100755 index 6bf23e1..0000000 --- a/projects/examples/rtsine.vcproj +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/sine.cpp b/projects/examples/sine.cpp index a01be15..84fb59d 100644 --- a/projects/examples/sine.cpp +++ b/projects/examples/sine.cpp @@ -14,21 +14,19 @@ #include "SineWave.h" #include "FileWvOut.h" -#include void usage(void) { // Error function in case of incorrect command-line // argument specifications. - printf("\nuseage: sine N file time fs\n"); - printf(" where N = number of channels (sines),\n"); - printf(" file = the .wav file to create,\n"); - printf(" time = the amount of time to record (in seconds),\n"); - printf(" and fs = the sample rate (in Hz).\n\n"); - exit(0); + std::cout << "\nuseage: sine N file time fs\n"; + std::cout << " where N = number of channels (sines),\n"; + std::cout << " file = the .wav file to create,\n"; + std::cout << " time = the amount of time to record (in seconds),\n"; + std::cout << " and fs = the sample rate (in Hz).\n\n"; + exit( 0 ); } -int -main(int argc, char *argv[]) +int main( int argc, char *argv[] ) { float base_freq = 220.0; int i; @@ -36,9 +34,9 @@ main(int argc, char *argv[]) // Minimal command-line checking. if ( argc != 5 ) usage(); - int channels = (int) atoi(argv[1]); - double time = atof(argv[3]); - double srate = atof(argv[4]); + int channels = (int) atoi( argv[1] ); + double time = atof( argv[3] ); + double srate = atof( argv[4] ); // Create our object instances. FileWvOut output; diff --git a/projects/examples/sine.dsp b/projects/examples/sine.dsp old mode 100644 new mode 100755 index e25264c..694d86b --- a/projects/examples/sine.dsp +++ b/projects/examples/sine.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/sine.vcproj b/projects/examples/sine.vcproj deleted file mode 100755 index b726d6d..0000000 --- a/projects/examples/sine.vcproj +++ /dev/null @@ -1,384 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/sineosc.cpp b/projects/examples/sineosc.cpp index 28ce975..868ea91 100644 --- a/projects/examples/sineosc.cpp +++ b/projects/examples/sineosc.cpp @@ -19,7 +19,7 @@ int main() output.openFile( "hellosine.wav", 1, FileWrite::FILE_WAV, Stk::STK_SINT16 ); } catch ( StkError & ) { - exit(0); + exit( 1 ); } input.setFrequency( 440.0 ); @@ -32,9 +32,8 @@ int main() output.tick( input.tick() ); } catch ( StkError & ) { - exit(0); + exit( 1 ); } - } return 0; diff --git a/projects/examples/sineosc.dsp b/projects/examples/sineosc.dsp index c2c3f29..d775bf9 100755 --- a/projects/examples/sineosc.dsp +++ b/projects/examples/sineosc.dsp @@ -41,7 +41,7 @@ RSC=rc.exe # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -65,7 +65,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "_AFXDLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "_AFXDLL" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /D "__WINDOWS_DS__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL" BSC32=bscmake.exe diff --git a/projects/examples/sineosc.vcproj b/projects/examples/sineosc.vcproj deleted file mode 100755 index ad01cc5..0000000 --- a/projects/examples/sineosc.vcproj +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/examples/threebees.cpp b/projects/examples/threebees.cpp index e4caa0a..6e0156d 100644 --- a/projects/examples/threebees.cpp +++ b/projects/examples/threebees.cpp @@ -7,9 +7,7 @@ #include "SKINI.msg" #include -#if !defined(__OS_WINDOWS__) // Windoze bogosity for VC++ 6.0 - using std::min; -#endif +using std::min; // The TickData structure holds all the class instances and data that // are shared by the various processing functions. diff --git a/projects/examples/threebees.dsp b/projects/examples/threebees.dsp index 773e0e2..f8c9a24 100755 --- a/projects/examples/threebees.dsp +++ b/projects/examples/threebees.dsp @@ -42,7 +42,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /I "../../src/include" /D "NDEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe @@ -66,7 +66,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /I "../../src/include" /D "_DEBUG" /D "__WINDOWS_DS__" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "__LITTLE_ENDIAN__" /D "__WINDOWS_MM__" /YX /FD /GZ /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe diff --git a/projects/examples/threebees.vcproj b/projects/examples/threebees.vcproj deleted file mode 100755 index f9afbee..0000000 --- a/projects/examples/threebees.vcproj +++ /dev/null @@ -1,731 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/projects/ragamatic/Makefile.in b/projects/ragamatic/Makefile.in index 220c9c9..cc65a20 100644 --- a/projects/ragamatic/Makefile.in +++ b/projects/ragamatic/Makefile.in @@ -1,3 +1,4 @@ +### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in ### STK ragamatic Makefile - for various flavors of unix PROGRAMS = @@ -23,14 +24,14 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ -I$(INCLUDE) +CFLAGS += @warn@ -I$(INCLUDE) -I../../src/include LIBRARY = @LIBS@ LIBRARY += @frameworks@ REALTIME = @realtime@ ifeq ($(REALTIME),yes) PROGRAMS = ragamat - OBJECTS += RtMidi.o RtAudio.o RtWvOut.o Thread.o Mutex.o Socket.o TcpServer.o + OBJECTS += RtMidi.o RtAudio.o RtWvOut.o Thread.o Mutex.o Socket.o TcpServer.o @objects@ DEFS += @audio_apis@ endif @@ -43,6 +44,9 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : $(SRC_PATH)/%.cpp $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ +%.o : ../../src/include/%.cpp + $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ + all : $(PROGRAMS) ragamat: ragamat.cpp $(OBJECTS) @@ -55,7 +59,7 @@ $(OBJECTS) : Stk.h clean : -rm $(OBJECT_PATH)/*.o - -rm $(PROGRAMS) + -rm $(PROGRAMS) *.exe strip : strip $(PROGRAMS) diff --git a/projects/ragamatic/ragamat.cpp b/projects/ragamatic/ragamat.cpp index 5b5c482..fbab62b 100644 --- a/projects/ragamatic/ragamat.cpp +++ b/projects/ragamatic/ragamat.cpp @@ -13,9 +13,7 @@ #include #include #include -#if !defined(__OS_WINDOWS__) // Windoze bogosity for VC++ 6.0 - using std::min; -#endif +using std::min; StkFloat float_random(StkFloat max) // Return random float between 0.0 and max { @@ -149,7 +147,7 @@ void processMessage( TickData* data ) data->counter = (int) (data->t60 * Stk::sampleRate()); data->drones[1].noteOn( droneFreqs[1], 0.1 ); data->settling = true; - std::cout << "What Need Have I for This?\n"; + std::cout << "What Need Have I for This?" << std::endl; } // The tick() function handles sample computation and scheduling of @@ -192,17 +190,17 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, data->counter = (int) (data->t60 * Stk::sampleRate()); if ( data->endPhase == 0 ) { data->drones[2].noteOn( droneFreqs[2], 0.1 ); - std::cout << "What Need Have I for This?\n"; + std::cout << "What Need Have I for This?" << std::endl; } else if ( data->endPhase == 1 ) { data->drones[0].noteOn( droneFreqs[0], 0.1 ); - std::cout << "RagaMatic finished ... \n"; + std::cout << "RagaMatic finished ... " << std::endl; } else if ( data->endPhase == 2 ) { - std::cout << "All is Bliss ...\n"; + std::cout << "All is Bliss ... " << std::endl; } else if ( data->endPhase == 3 ) { - std::cout << "All is Bliss ...\n"; + std::cout << "All is Bliss ..." << std::endl; } data->endPhase++; } diff --git a/projects/ragamatic/ragamat.vcproj b/projects/ragamatic/ragamat.vcproj deleted file mode 100755 index af0c994..0000000 --- a/projects/ragamatic/ragamat.vcproj +++ /dev/null @@ -1,842 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/save/Blotar.cpp b/save/Blotar.cpp deleted file mode 100644 index 50d58d3..0000000 --- a/save/Blotar.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/***************************************************/ -/*! \class Blotar - \brief STK Blotar class. - - This class is a port of Dan Trueman's MSP/PeRColate "blotar" - instrument, which itself was a modified version of the STK - waveguide flute model. - - This port was made by Simon de Leon in the Music Technology area - at McGill University in 2006. - - This is a digital waveguide model, making its use possibly subject - to patents held by Stanford University, Yamaha, and others. There - exist at least two patents, assigned to Stanford, bearing the - names of Karplus and/or Strong. - - Control Change Numbers: - - Jet Delay = 2 - - Noise Gain = 4 - - Vibrato Frequency = 11 - - Vibrato Gain = 1 - - Breath Pressure = 128 - - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. -*/ -/***************************************************/ - -#include "Blotar.h" -#include "SKINI.msg" - -Blotar :: Blotar() -{ - this->initialize( 100.0 ); -} - -Blotar :: Blotar( StkFloat lowestFrequency ) -{ - this->initialize( lowestFrequency ); -} - -Blotar :: ~Blotar() -{ - for ( int i=0; i<12; i++ ) - delete soundfile_[i]; -} - -void Blotar :: initialize( StkFloat lowestFrequency ) -{ - length_ = (unsigned long) (Stk::sampleRate() / lowestFrequency + 1); - boreDelay_.setMaximumDelay( length_ ); - boreDelay_.setDelay( 100.0 ); - - jetDelay_.setMaximumDelay( 2 * length_ ); - jetDelay_.setDelay( 49.0 ); - - combDelay_.setMaximumDelay( length_ ); - combDelay_.setDelay( length_ / 2 ); - - vibrato_.setFrequency( 5.0 ); - dcBlock_.setBlockZero(); - - this->clear(); - - // Initialize control variables - pluckAmplitude_ = 0.8; - pluckPosition_ = 0.4; - lastFrequency_ = 220.0; - //endReflection_ = 0.5; - //jetReflection_ = 0.5; - endReflection_ = 0.99; - jetReflection_ = 0.06; - noiseGain_ = 0.15; // Breath pressure random component. - vibratoGain_ = 0.05; // Breath periodic vibrato component. - jetRatio_ = 0.32; - filterRatio_ = 1.0; - - // Impulse responses - soundfile_[0] = new FileWvIn( (Stk::rawwavePath() + "mand1.raw").c_str(), true ); - soundfile_[1] = new FileWvIn( (Stk::rawwavePath() + "mand2.raw").c_str(), true ); - soundfile_[2] = new FileWvIn( (Stk::rawwavePath() + "mand3.raw").c_str(), true ); - soundfile_[3] = new FileWvIn( (Stk::rawwavePath() + "mand4.raw").c_str(), true ); - soundfile_[4] = new FileWvIn( (Stk::rawwavePath() + "mand5.raw").c_str(), true ); - soundfile_[5] = new FileWvIn( (Stk::rawwavePath() + "mand6.raw").c_str(), true ); - soundfile_[6] = new FileWvIn( (Stk::rawwavePath() + "mand7.raw").c_str(), true ); - soundfile_[7] = new FileWvIn( (Stk::rawwavePath() + "mand8.raw").c_str(), true ); - soundfile_[8] = new FileWvIn( (Stk::rawwavePath() + "mand9.raw").c_str(), true ); - soundfile_[9] = new FileWvIn( (Stk::rawwavePath() + "mand10.raw").c_str(), true ); - soundfile_[10] = new FileWvIn( (Stk::rawwavePath() + "mand11.raw").c_str(), true ); - soundfile_[11] = new FileWvIn( (Stk::rawwavePath() + "mand12.raw").c_str(), true ); - - mic_ = 0; - waveDone_ = soundfile_[mic_]->isFinished(); - - this->setFrequency( lastFrequency_ ); - - fluteFilter_.setPole( 0.7 - ((StkFloat) 0.1 * 22050.0 / Stk::sampleRate() ) ); - fluteFilter_.setGain( -1.0 ); -} - -void Blotar :: clear() -{ - boreDelay_.clear(); - jetDelay_.clear(); - combDelay_.clear(); - dcBlock_.clear(); - fluteFilter_.clear(); -} - -void Blotar :: noteOn( StkFloat frequency, StkFloat amplitude ) -{ - if ( frequency != lastFrequency_ ) - this->setFrequency( frequency ); - - this->pluck( amplitude ); - - #if defined(_STK_DEBUG_) - errorString_ << "Blotar::NoteOn: frequency = " << frequency << ", amplitude = " << amplitude << "."; - handleError( StkError::DEBUG_WARNING ); - #endif -} - -void Blotar :: noteOff( StkFloat amplitude ) -{ -} - -void Blotar :: setFrequency( StkFloat frequency ) -{ - lastFrequency_ = frequency; - if ( frequency <= 0.0 ) { - errorString_ << "Blotar::setFrequency: parameter is less than or equal to zero!"; - handleError( StkError::WARNING ); - lastFrequency_ = 220.0; - } - - // We're overblowing here. - lastFrequency_ *= 0.66666; - - // delay = length - approximate filter delay. - StkFloat delay = Stk::sampleRate() / lastFrequency_ - (StkFloat) 2.0; - if ( delay <= 0.0 ) delay = 0.3; - else if ( delay > length_ ) delay = length_; - - boreDelay_.setDelay( delay ); - jetDelay_.setDelay( delay * jetRatio_ ); -} - -void Blotar :: pluck( StkFloat amplitude ) -{ - // This function gets interesting, because pluck may be longer than - // string length, so we just reset the soundfile and add in the - // pluck in the tick method. - soundfile_[mic_]->reset(); - waveDone_ = false; - pluckAmplitude_ = amplitude; - if ( amplitude < 0.0 ) { - errorString_ << "Blotar::pluck: amplitude parameter less than zero ... setting to 0.0!"; - handleError( StkError::WARNING ); - pluckAmplitude_ = 0.0; - } - else if ( amplitude > 1.0 ) { - errorString_ << "Blotar::pluck: amplitude parameter greater than one ... setting to 1.0!"; - handleError( StkError::WARNING ); - pluckAmplitude_ = 1.0; - } - - // Set the pick position, which puts zeroes at position * length. - combDelay_.setDelay( 0.5 * pluckPosition_ * length_ ); -} - -void Blotar :: setPluckPosition( StkFloat position ) -{ - pluckPosition_ = position; -} - -void Blotar :: setBodySize( StkFloat size ) -{ - for ( int i=0; i<12; i++ ) - soundfile_[i]->setRate( size ); -} - -void Blotar :: setBreathPressure( StkFloat bp ) -{ - maxPressure_ = bp; -} - -void Blotar :: setJetDelay( StkFloat aRatio ) -{ - // Delay = length - approximate filter delay. - StkFloat temp = Stk::sampleRate() / lastFrequency_ - (StkFloat) 2.0; - jetRatio_ = aRatio; - jetDelay_.setDelay(temp * aRatio); // Scaled by ratio. -} - -/* -void Blotar :: setJetDelay( StkFloat frequency ) -{ - StkFloat temp; - if ( frequency < WATCHIT ) - frequency = WATCHIT; - StkFloat temp = (Stk::sampleRate() / frequency) - 2; - - // Control jet length directly, not as function of bore length - jetDelay_.setDelay( temp ); - - jd_ = frequency; -} -*/ - -void Blotar :: setNoiseGain( StkFloat noiseGain ) -{ - noiseGain_ = noiseGain; -} - -void Blotar :: setVibratoGain( StkFloat gain ) -{ - vibratoGain_ = gain; -} -void Blotar :: setJetReflection( StkFloat jetReflection ) -{ - jetReflection_ = jetReflection; -} - -void Blotar :: setEndReflection( StkFloat endReflection ) -{ - endReflection_ = endReflection; -} - -void Blotar :: setFilterRatio( StkFloat filterRatio ) -{ - filterRatio_ = filterRatio; -} - -StkFloat Blotar :: computeSample() -{ - StkFloat temp = 0.0; - if ( !waveDone_ ) { - // Scale the pluck excitation with comb - // filtering for the duration of the file. - temp = soundfile_[mic_]->tick() * pluckAmplitude_; - temp = temp - combDelay_.tick( temp ); - waveDone_ = soundfile_[mic_]->isFinished(); - } - - // Interpolate between one-pole filter of flute and one-zero filter of string - StkFloat flute = fluteFilter_.tick( boreDelay_.lastOut() + temp ); - StkFloat string = lowpass_.tick( boreDelay_.lastOut() + temp ); - temp = filterRatio_ * flute + ( 1 - filterRatio_ ) * string; - temp = dcBlock_.tick( temp ); - - // Random turbulence and vibrato - StkFloat breathPressure = maxPressure_ * ( noiseGain_ * noise_.tick() + vibratoGain_ * vibrato_.tick() ); - - StkFloat pressureDiff = breathPressure - ( jetReflection_ * temp ); - pressureDiff = jetDelay_.tick( pressureDiff ); - - // Implement the "classic" mode of MSP blotar~ as if "mode" was default - //pressureDiff = jetTable_.tick( pressureDiff + ( endReflection_ * temp ) ); - pressureDiff = jetTable_.tick( pressureDiff ) + ( endReflection_ * temp ); - lastOutput_ = boreDelay_.tick( pressureDiff ); - - return lastOutput_; -} - -void Blotar :: controlChange( int number, StkFloat value ) -{ - StkFloat norm = value * ONE_OVER_128; - if ( norm < 0 ) { - norm = 0.0; - errorString_ << "Blotar::controlChange: control value less than zero ... setting to zero!"; - handleError( StkError::WARNING ); - } - else if ( norm > 1.0 ) { - norm = 1.0; - errorString_ << "Blotar::controlChange: control value greater than 128.0 ... setting to 128.0!"; - handleError( StkError::WARNING ); - } - - if (number == __SK_JetDelay_) // 2 - //if (number == __SK_BodySize_) // 2 - //this->setBodySize( norm * 2.0 ); - this->setJetDelay( (StkFloat) (0.08 + (0.48 * norm)) ); - //else if (number == __SK_NoiseLevel_) // 4 - else if (number == __SK_PickPosition_) // 4 - this->setPluckPosition( norm ); - //this->setNoiseGain( norm * 0.4 ); - else if (number == __SK_ModFrequency_) // 11 - vibrato_.setFrequency( norm * 12.0); - else if (number == __SK_ModWheel_) // 1 - this->setVibratoGain( norm * 0.4 ); - else if (number == __SK_AfterTouch_Cont_) // 128 - this->setBreathPressure( norm ); - else { - errorString_ << "Blotar::controlChange: undefined control number (" << number << ")!"; - handleError( StkError::WARNING ); - } - -#if defined(_STK_DEBUG_) - errorString_ << "Blotar::controlChange: number = " << number << ", value = " << value << "."; - handleError( StkError::DEBUG_WARNING ); -#endif -} diff --git a/save/Blotar.h b/save/Blotar.h deleted file mode 100644 index 38e3617..0000000 --- a/save/Blotar.h +++ /dev/null @@ -1,138 +0,0 @@ -/***************************************************/ -/*! \class Blotar - \brief STK Blotar class. - - This class is a port of Dan Trueman's MSP/PeRColate "blotar" - instrument, which itself was a modified version of the STK - waveguide flute model. - - This port was made by Simon de Leon in the Music Technology area - at McGill University in 2006. - - This is a digital waveguide model, making its use possibly subject - to patents held by Stanford University, Yamaha, and others. There - exist at least two patents, assigned to Stanford, bearing the - names of Karplus and/or Strong. - - Control Change Numbers: - - Jet Delay = 2 - - Noise Gain = 4 - - Vibrato Frequency = 11 - - Vibrato Gain = 1 - - Breath Pressure = 128 - - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. -*/ -/***************************************************/ - -#ifndef STK_BLOTAR_H -#define STK_BLOTAR_H - -#define WATCHIT 0.00001 - -#include "Instrmnt.h" -#include "DelayL.h" -#include "DelayA.h" -#include "OneZero.h" -#include "OnePole.h" -#include "PoleZero.h" -#include "Noise.h" -#include "WaveLoop.h" -#include "JetTable.h" -#include "SineWave.h" -#include - -class Blotar : public Instrmnt -{ - public: - - //! Default class consructor, default lowest frequency is 100 Hz - Blotar(); - - //! Overloaded class constructor, taking the lowest desired playing frequency. - Blotar( StkFloat lowestFrequency ); - - //! Class destructor. - ~Blotar(); - - //! Reset and clear all internal state. - void clear(); - - //! Start a note with the given frequency and amplitude. - virtual void noteOn(StkFloat frequency, StkFloat amplitude); - - //! Stop a note with the given amplitude (speed of decay). - virtual void noteOff(StkFloat amplitude); - - //! Set boreDelay_ line length parameters for a particular frequency - virtual void setFrequency(StkFloat frequency); - - //! Set combDelay_ line length parameters to filter impulse response for particular position - void setPluckPosition(StkFloat position); - - //! Set mandolin impulse response playback rate - void setBodySize(StkFloat size); - - //! Set breath pressure - void setBreathPressure(StkFloat bp); - - //! Set jetDelay_ line length parameter - void setJetDelay(StkFloat frequency); - - //! Set gain of random breath pressure component - void setNoiseGain(StkFloat noiseGain); - - //! Set read rate from sinusoidal table, which is used to scale random breath pressure component - void setVibatoFrequency( StkFloat frequency ); - - //! Set amplitude of sinusoidal table used to scale random breath pressure component - void setVibratoGain( StkFloat gain ); - - //! Set the reflection coefficient for the jet delay (-1.0 - 1.0) - void setJetReflection(StkFloat jetReflection); - - //! Set the reflection coefficient for the air column delay (-1.0 - 1.0) - void setEndReflection(StkFloat endReflection); - - //! Interpolates between one-pole filter of the flute and lowpass filter of plucked string - void setFilterRatio(StkFloat filterRatio); - - //! Perform the control change specified by \e number and \e value (0.0 - 128.0). - void controlChange(int number, StkFloat value); - - protected: - - void initialize( StkFloat lowestFrequency ); - StkFloat computeSample( void ); - void pluck( StkFloat amplitude ); - - DelayL boreDelay_; - DelayL jetDelay_; - DelayL combDelay_; - PoleZero dcBlock_; - OnePole fluteFilter_; - OneZero lowpass_; - Noise noise_; - JetTable jetTable_; - SineWave vibrato_; - FileWvIn *soundfile_[12]; - - // Performance variables - StkFloat pluckAmplitude_; - StkFloat pluckPosition_; - StkFloat maxPressure_; // breath pressure - StkFloat noiseGain_; - StkFloat vibratoGain_; - StkFloat jetReflection_; - StkFloat endReflection_; - StkFloat filterRatio_; // one-zero vs. one-pole filter ratio - StkFloat jetRatio_; // one-zero vs. one-pole filter ratio - - int mic_; // directional position (NBody) - bool waveDone_; - - long length_; - StkFloat lastFrequency_; -}; - -#endif diff --git a/save/Ublotar.cpp b/save/Ublotar.cpp deleted file mode 100644 index 8f27a60..0000000 --- a/save/Ublotar.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/***************************************************/ -/*! \class Ublotar - \brief STK Ublotar model class. - - WaveGuide Flute ala Karjalainen, - Smith, Waryznyk, etc. - with polynomial Jet ala Cook - by Perry Cook, 1995-96 - - ported to MSP by Dan Trueman, 2000 - and modified to become the nearly - righteous Ublotar. Extension of the Blotar to - include 6 strings and pre/post distortion outputs, - more plucking options; closer to the Sullivan electric - guitar model, while retaining some of the flute - potentials of the blotar~ - - Ublotar modifications ported to STK by - Simon de Leon, 2006. - - This is a digital waveguide model, making its - use possibly subject to patents held by - Stanford University, Yamaha, and others. - There exist at least two patents, assigned to - Stanford, bearing the names of Karplus and/or - Strong. - - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. -*/ -/***************************************************/ - -#include "Ublotar.h" - -Ublotar :: Ublotar (StkFloat lowestFrequency) -{ - // initialize variables - int i; - unsigned long length_ = (unsigned long) Stk::sampleRate()/((unsigned long) lowestFrequency + 1); - for (i=0; isetFrequency( frequency ); - - // pluckPos never < 0 in ublotar~, so always do Karplus with the DC block - int i, j; - int borelength; - StkFloat temp = 0; - for ( j=0; j 0 ) { - borelength = (int) boreDelay_[j].getDelay() - 1; - - // load with noise and DC block - for ( i=0; i< borelength; i++) { - temp = makenoise_.tick() * pluckAmp_[j]; // input to DC block - // DC block - pluckblock_.output = temp - pluckblock_.input + (0.99 * pluckblock_.output); - pluckblock_.input = temp; - pluckblock_.lastOutput = pluckblock_.output; - temp = pluckblock_.lastOutput; // output from DC block, should go into bore j at location i - - // ublotar~ adds noise manually into input pointer, just tick in the noise for bore length here - boreDelay_[j].tick( temp ); - - // ublotar~ does in-place LPF of delay line here, effect is negligible - } - - // prevent this string from filling up with noise again after filling it with noise - pluckAmp_[j] = 0; - } - } - -} - -void Ublotar :: noteOff (StkFloat amplitude) -{ - -} - -void Ublotar :: setFrequency (StkFloat *frequency) -{ - StkFloat temp; - int i; - // Set string/bore frequency for each one - for ( i=0; i= NUM_STRINGS) - stringtopluck_ = NUM_STRINGS - 1; - else if (stringtopluck < 0) - stringtopluck_ = 0; - else - stringtopluck_ = stringtopluck; -} - -StkFloat Ublotar :: vib() -{ - long temp; - StkFloat temp_time, alpha, output; - - vibTime_ += vibRate_; - while (vibTime_ >= (StkFloat) vibLength_) - vibTime_ -= (StkFloat) vibLength_; - - while (vibTime_ < 0.) - vibTime_ += (StkFloat) vibLength_; - - temp_time = vibTime_; - - temp = (long) temp_time; - alpha = temp_time - (StkFloat) temp; - output = vibTable_[temp]; - output = output + (alpha * (vibTable_[temp+1] - output)); - return output; - -} - -StkFloat Ublotar :: computeSample () -{ - StkFloat temp = 0; - int i; - StkFloat randPressure = ng_ * makenoise_.tick(); - randPressure += va_ * vib(); - randPressure *= bp_; - - StkFloat string_bore_output = 0; - StkFloat tempsave, sample; - for ( i=0; i limit_ || temp < -limit_) temp = 0; - last_output_ = temp; // return statement of blostring_tick - string_bore_output += last_output_; - } - - StkFloat pressureDiff = bp_ + randPressure - string_bore_output * 1/NUM_STRINGS; - - // feedback delay line - temp = jetDelay_.tick( pressureDiff ); - - // distortion - last_output_ = flutejet_.tick( predistortion_gain_ * temp ); - StkFloat distortion_output = last_output_; - - return predistortion_outgain_ * string_bore_output + postdistortion_outgain_ * distortion_output; -} - -void Ublotar :: setJetReflection( StkFloat jetReflection ) // feedgain in ublotar~ -{ - jr_ = jetReflection; -} - -void Ublotar :: setEndReflection( StkFloat endReflection ) // setsustain in ublotar~ -{ - // default mode for all presets set same er for all strings - er_ = endReflection; -} - -void Ublotar :: setFilterRatio( StkFloat filterRatio ) // lowpasscross in ublotar~ -{ - // default mode for all presets set same filterRatio for all strings - filterRatio_ = filterRatio; -} - -void Ublotar :: setDistortGain( StkFloat distortGain ) // distortgain in ublotar~ -{ - predistortion_gain_ = distortGain; -} - -void Ublotar :: setLimit( StkFloat limit ) // setlimit in ublotar~ -{ - // set to 10 for most presets, sometimes much larger - limit_ = limit; -} - -void Ublotar :: setNoiseGain( StkFloat noiseGain ) // noisegain in ublotar~ -{ - ng_ = noiseGain; -} - -void Ublotar :: setVib( StkFloat vibFreq, StkFloat vibAmount ) // vib in ublotar~ -{ - va_ = vibAmount; - vibRate_ = vibLength_ / Stk::sampleRate() * vibFreq; -} diff --git a/save/Ublotar.h b/save/Ublotar.h deleted file mode 100644 index 6126e99..0000000 --- a/save/Ublotar.h +++ /dev/null @@ -1,158 +0,0 @@ -/***************************************************/ -/*! \class Ublotar - \brief STK Ublotar model class. - - WaveGuide Flute ala Karjalainen, - Smith, Waryznyk, etc. - with polynomial Jet ala Cook - by Perry Cook, 1995-96 - - ported to MSP by Dan Trueman, 2000 - and modified to become the nearly - righteous Ublotar. Extension of the Blotar to - include 6 strings and pre/post distortion outputs, - more plucking options; closer to the Sullivan electric - guitar model, while retaining some of the flute - potentials of the blotar~ - - Ublotar modifications ported to STK by - Simon de Leon, 2006. - - This is a digital waveguide model, making its - use possibly subject to patents held by - Stanford University, Yamaha, and others. - There exist at least two patents, assigned to - Stanford, bearing the names of Karplus and/or - Strong. - - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. -*/ -/***************************************************/ - -#ifndef STK_PLUCKED_H -#define STK_PLUCKED_H - -#define WATCHIT 0.00001 -#define NUM_STRINGS 6 -#define MAX_INPUTS 10 -#define VIBLENGTH 1024 - -#include "Instrmnt.h" -#include "DelayL.h" -#include "DelayA.h" -#include "OneZero.h" -#include "OnePole.h" -#include "Noise.h" -#include "WaveLoop.h" -#include "JetTable.h" -#include -#include -#include "Flute.h" -#include "Blotar.h" -#include "TwoPole.h" - -class Ublotar : public Instrmnt -{ - public: - - //! Default class destructor. - ~Ublotar (); - - //! Class constructor, taking the lowest desired playing frequency. - Ublotar (StkFloat lowestFrequency); - - //! Start a note with the given frequency and amplitude - virtual void noteOn (StkFloat frequency, StkFloat amplitude); - - //! Stop a note with the given amplitude (speed of decay). - virtual void noteOff (StkFloat amplitude); - - //! Set boreDelay_ line length parameter of stringtopluck_ for a particular frequency - virtual void setFrequency (StkFloat frequency); - - //! Set boreDelay_ line length parameters of all strings for certain frequencies - void setFrequency (StkFloat *frequency); - - //! Set pre-distortion gain - void setPredistortionGain (StkFloat predistortionGain); - - //! Set post-distortion gain - void setPostdistortionGain (StkFloat postdistortionGain); - - //! Set breath pressure - void setBreathPressure (StkFloat bp); - - //! Set jetDelay_ line length parameter - void setJetDelay (StkFloat frequency); - - //! Set the reflection coefficient for the jet delay (-1.0 - 1.0) - void setJetReflection( StkFloat jetReflection ); // feedgain in ublotar~ - - //! Set the reflection coefficient for the air column delay (-1.0 - 1.0) - void setEndReflection( StkFloat endReflection ); // setsustain in ublotar~ - - //! Interpolates between one-pole filter of the flute and lowpass filter of plucked string - void setFilterRatio( StkFloat filterRatio ); // lowpasscross in ublotar~ - - //! Set distortion gain - void setDistortGain( StkFloat distortGain ); // distortgain in ublotar~ - - //! Set hard limiter value to prevent infinitely growing amplitudes - void setLimit( StkFloat limit ); // setlimit in ublotar~ - - //! Set gain of random breath pressure component - void setNoiseGain( StkFloat noiseGain ); // noisegain in ublotar~ - - //! Set vibrato parameters, which are used to scale random breath pressure component - void setVib( StkFloat vibFreq, StkFloat vibAmount ); // vib in ublotar~ - - //! Set string that frequency and amplitude parameters in subsequent call to noteOn will alter - void setStringToPluck (int stringtopluck); - - protected: - StkFloat computeSample ( void ); - StkFloat vib ( void ); - - - // Global string parameters - StkFloat in_[MAX_INPUTS]; - StkFloat jd_; - StkFloat jr_; - StkFloat predistortion_gain_; - StkFloat predistortion_outgain_; - StkFloat postdistortion_outgain_; - StkFloat limit_; - StkFloat *vibTable_; - DelayL jetDelay_; - StkFloat bp_; - StkFloat va_; - StkFloat ng_; - - // String-Bore variables - StkFloat fr_[NUM_STRINGS]; - StkFloat er_; - StkFloat pluckAmp_[NUM_STRINGS]; - StkFloat pluckPos_[NUM_STRINGS]; - int squish_[NUM_STRINGS]; // number of times to LPF the blostring - StkFloat filterRatio_; - StkFloat resetDelay_[NUM_STRINGS]; - OnePole flute_filter_[NUM_STRINGS]; - OneZero lowpass_[NUM_STRINGS]; - StkFloat vibTime_, vibRate_; - DelayL boreDelay_[NUM_STRINGS]; - StkFloat last_output_; - StkFloat lastFreq_[NUM_STRINGS], lastLength_[NUM_STRINGS]; - - // Auxiliary variables - StkFloat length_; - int vibLength_; - StkFloat position_; - int stringtopluck_; - struct { - StkFloat output, input, lastOutput; - } killdc_[NUM_STRINGS], pluckblock_; - Noise makenoise_; - JetTable flutejet_; -}; - -#endif diff --git a/src/FileRead.cpp b/src/FileRead.cpp index ea1ff89..2373ad6 100644 --- a/src/FileRead.cpp +++ b/src/FileRead.cpp @@ -39,10 +39,11 @@ FileRead :: FileRead() { } -FileRead :: FileRead( std::string fileName, bool typeRaw ) +FileRead :: FileRead( std::string fileName, bool typeRaw, unsigned int nChannels, + StkFormat format, StkFloat rate ) : fd_(0) { - open( fileName, typeRaw ); + open( fileName, typeRaw, nChannels, format, rate ); } FileRead :: ~FileRead() @@ -64,7 +65,8 @@ bool FileRead :: isOpen( void ) else return false; } -void FileRead :: open( std::string fileName, bool typeRaw ) +void FileRead :: open( std::string fileName, bool typeRaw, unsigned int nChannels, + StkFormat format, StkFloat rate ) { // If another file is open, close it. close(); @@ -79,7 +81,7 @@ void FileRead :: open( std::string fileName, bool typeRaw ) // Attempt to determine file type from header (unless RAW). bool result = false; if ( typeRaw ) - result = getRawInfo( fileName.c_str() ); + result = getRawInfo( fileName.c_str(), nChannels, format, rate ); else { char header[12]; if ( fread( &header, 4, 3, fd_ ) != 3 ) goto error; @@ -121,7 +123,7 @@ void FileRead :: open( std::string fileName, bool typeRaw ) handleError( StkError::FILE_ERROR ); } -bool FileRead :: getRawInfo( const char *fileName ) +bool FileRead :: getRawInfo( const char *fileName, unsigned int nChannels, StkFormat format, StkFloat rate ) { // Use the system call "stat" to determine the file length. struct stat filestat; @@ -130,14 +132,22 @@ bool FileRead :: getRawInfo( const char *fileName ) return false; } - // STK rawwave files have no header and are assumed to contain a - // monophonic stream of 16-bit signed integers in big-endian byte - // order at a sample rate of 22050 Hz. - channels_ = 1; - fileSize_ = (long) filestat.st_size / 2; // length in 2-byte samples + // Rawwave files have no header and by default, are assumed to + // contain a monophonic stream of 16-bit signed integers in + // big-endian byte order at a sample rate of 22050 Hz. However, + // different parameters can be specified if desired. dataOffset_ = 0; - fileRate_ = 22050.0; - dataType_ = STK_SINT16; + channels_ = nChannels; + dataType_ = format; + fileRate_ = rate; + int sampleBytes = 0; + if ( format == STK_SINT8 ) sampleBytes = 1; + else if ( format == STK_SINT16 ) sampleBytes = 2; + else if ( format == STK_SINT32 || format == STK_FLOAT32 ) sampleBytes = 4; + else if ( format == STK_FLOAT64 ) sampleBytes = 8; + + fileSize_ = (long) filestat.st_size / sampleBytes / channels_; // length in frames + byteswap_ = false; #ifdef __LITTLE_ENDIAN__ byteswap_ = true; diff --git a/src/Makefile.in b/src/Makefile.in index df84d32..c320781 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1,3 +1,4 @@ +### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in ### libstk Makefile - for various flavors of unix LIBRARY = libstk.a @@ -38,11 +39,11 @@ CC = @CXX@ DEFS = @byte_order@ DEFS += @debug@ CFLAGS = @cflags@ -CFLAGS += @warn@ $(INCLUDE) +CFLAGS += @warn@ $(INCLUDE) -Iinclude REALTIME = @realtime@ ifeq ($(REALTIME),yes) - OBJECTS += RtMidi.o RtAudio.o RtWvOut.o RtWvIn.o InetWvOut.o InetWvIn.o Thread.o Mutex.o Socket.o TcpClient.o TcpServer.o UdpSocket.o + OBJECTS += RtMidi.o RtAudio.o RtWvOut.o RtWvIn.o InetWvOut.o InetWvIn.o Thread.o Mutex.o Socket.o TcpClient.o TcpServer.o UdpSocket.o @objects@ DEFS += @audio_apis@ endif @@ -55,6 +56,9 @@ DEFS += -DRAWWAVE_PATH=\"$(RAWWAVES)\" %.o : %.cpp $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ +%.o : ../src/include/%.cpp + $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@ + all : $(LIBRARY) $(LIBRARY) : $(OBJECTS) diff --git a/src/RtAudio.cpp b/src/RtAudio.cpp index 97c2f3f..cdefda4 100644 --- a/src/RtAudio.cpp +++ b/src/RtAudio.cpp @@ -38,7 +38,7 @@ */ /************************************************************************/ -// RtAudio: Version 4.0 +// RtAudio: Version 4.0.3 #include "RtAudio.h" #include @@ -539,7 +539,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) error( RtError::WARNING ); return info; } - info.name.append( (const char *)name, strlen(name) + 1 ); + info.name.append( (const char *)name, strlen(name) ); info.name.append( ": " ); dataSize = 256; @@ -552,7 +552,7 @@ RtAudio::DeviceInfo RtApiCore :: getDeviceInfo( unsigned int device ) error( RtError::WARNING ); return info; } - info.name.append( (const char *)name, strlen(name) + 1 ); + info.name.append( (const char *)name, strlen(name) ); // Get the output stream "configuration". AudioBufferList *bufferList = nil; @@ -2291,10 +2291,10 @@ bool RtApiJack :: callbackEvent( unsigned long nframes ) // on information found in // http://www.cs.wustl.edu/~schmidt/win32-cv-1.html. -#include "asio/asiosys.h" -#include "asio/asio.h" -#include "asio/iasiothiscallresolver.h" -#include "asio/asiodrivers.h" +#include "asiosys.h" +#include "asio.h" +#include "iasiothiscallresolver.h" +#include "asiodrivers.h" #include AsioDrivers drivers; @@ -2366,11 +2366,14 @@ RtAudio::DeviceInfo RtApiAsio :: getDeviceInfo( unsigned int device ) error( RtError::INVALID_USE ); } - // Don't probe if a stream is already open. + // If a stream is already open, we cannot probe other devices. Thus, use the saved results. if ( stream_.state != STREAM_CLOSED ) { - errorText_ = "RtApiAsio::getDeviceInfo: unable to probe driver while a stream is open."; - error( RtError::WARNING ); - return info; + if ( device >= devices_.size() ) { + errorText_ = "RtApiAsio::getDeviceInfo: device ID was not present before stream was opened."; + error( RtError::WARNING ); + return info; + } + return devices_[ device ]; } char driverName[32]; @@ -2463,6 +2466,16 @@ void bufferSwitch( long index, ASIOBool processNow ) object->callbackEvent( index ); } +void RtApiAsio :: saveDeviceInfo( void ) +{ + devices_.clear(); + + unsigned int nDevices = getDeviceCount(); + devices_.resize( nDevices ); + for ( unsigned int i=0; isaveDeviceInfo(); + // Only load the driver once for duplex stream. if ( mode != INPUT || stream_.mode != OUTPUT ) { if ( !drivers.loadDriver( driverName ) ) { @@ -2528,15 +2547,27 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne return FAILURE; } - // Set the sample rate. - result = ASIOSetSampleRate( (ASIOSampleRate) sampleRate ); + // Get the current sample rate + ASIOSampleRate currentRate; + result = ASIOGetSampleRate( ¤tRate ); if ( result != ASE_OK ) { drivers.removeCurrentDriver(); - errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error setting sample rate (" << sampleRate << ")."; + errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error getting sample rate."; errorText_ = errorStream_.str(); return FAILURE; } + // Set the sample rate only if necessary + if ( currentRate != sampleRate ) { + result = ASIOSetSampleRate( (ASIOSampleRate) sampleRate ); + if ( result != ASE_OK ) { + drivers.removeCurrentDriver(); + errorStream_ << "RtApiAsio::probeDeviceOpen: driver (" << driverName << ") error setting sample rate (" << sampleRate << ")."; + errorText_ = errorStream_.str(); + return FAILURE; + } + } + // Determine the driver data type. ASIOChannelInfo channelInfo; channelInfo.channel = 0; @@ -2696,7 +2727,8 @@ bool RtApiAsio :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne stream_.doConvertBuffer[mode] = true; // Allocate necessary internal buffers - unsigned long bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); + unsigned long bufferBytes; + bufferBytes = stream_.nUserChannels[mode] * *bufferSize * formatBytes( stream_.userFormat ); stream_.userBuffer[mode] = (char *) calloc( bufferBytes, 1 ); if ( stream_.userBuffer[mode] == NULL ) { errorText_ = "RtApiAsio::probeDeviceOpen: error allocating user buffer memory."; @@ -2958,8 +2990,8 @@ bool RtApiAsio :: callbackEvent( long bufferIndex ) handle->internalDrain = true; } - unsigned int bufferBytes, i, j; - unsigned int nChannels = stream_.nDeviceChannels[0] + stream_.nDeviceChannels[1]; + unsigned int nChannels, bufferBytes, i, j; + nChannels = stream_.nDeviceChannels[0] + stream_.nDeviceChannels[1]; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { bufferBytes = stream_.bufferSize * formatBytes( stream_.deviceFormat[0] ); @@ -3187,6 +3219,14 @@ static const char* getAsioErrorString( ASIOError result ) #include #include +#if defined(__MINGW32__) +// missing from latest mingw winapi +#define WAVE_FORMAT_96M08 0x00010000 /* 96 kHz, Mono, 8-bit */ +#define WAVE_FORMAT_96S08 0x00020000 /* 96 kHz, Stereo, 8-bit */ +#define WAVE_FORMAT_96M16 0x00040000 /* 96 kHz, Mono, 16-bit */ +#define WAVE_FORMAT_96S16 0x00080000 /* 96 kHz, Stereo, 16-bit */ +#endif + #define MINIMUM_DEVICE_BUFFER_SIZE 32768 #ifdef _MSC_VER // if Microsoft Visual C++ @@ -3223,7 +3263,7 @@ struct DsHandle { HANDLE condition; DsHandle() - :drainCounter(0), internalDrain(false) { id[0] = 0, id[1] = 0; xrun[0] = false; xrun[1] = false; bufferPointer[0] = 0; bufferPointer[1] = 0; } + :drainCounter(0), internalDrain(false) { id[0] = 0; id[1] = 0; buffer[0] = 0; buffer[1] = 0; xrun[0] = false; xrun[1] = false; bufferPointer[0] = 0; bufferPointer[1] = 0; } }; /* @@ -3247,7 +3287,7 @@ RtApiDs::RtDsStatistics RtApiDs::getDsStatistics() // Declarations for utility functions, callbacks, and structures // specific to the DirectSound implementation. -static bool CALLBACK deviceCountCallback( LPGUID lpguid, +static BOOL CALLBACK deviceQueryCallback( LPGUID lpguid, LPCTSTR description, LPCTSTR module, LPVOID lpContext ); @@ -3288,7 +3328,7 @@ unsigned int RtApiDs :: getDefaultInputDevice( void ) { // Count output devices. EnumInfo info; - HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &info ); + HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &info ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDefaultOutputDevice: error (" << getErrorString( result ) << ") counting output devices!"; errorText_ = errorStream_.str(); @@ -3299,7 +3339,7 @@ unsigned int RtApiDs :: getDefaultInputDevice( void ) // Now enumerate input devices until we find the id = NULL. info.isInput = true; info.getDefault = true; - result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &info ); + result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &info ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDefaultInputDevice: error (" << getErrorString( result ) << ") enumerating input devices!"; errorText_ = errorStream_.str(); @@ -3316,7 +3356,7 @@ unsigned int RtApiDs :: getDefaultOutputDevice( void ) // Enumerate output devices until we find the id = NULL. EnumInfo info; info.getDefault = true; - HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &info ); + HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &info ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDefaultOutputDevice: error (" << getErrorString( result ) << ") enumerating output devices!"; errorText_ = errorStream_.str(); @@ -3332,7 +3372,7 @@ unsigned int RtApiDs :: getDeviceCount( void ) { // Count DirectSound devices. EnumInfo info; - HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &info ); + HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &info ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating output devices!"; errorText_ = errorStream_.str(); @@ -3341,7 +3381,7 @@ unsigned int RtApiDs :: getDeviceCount( void ) // Count DirectSoundCapture devices. info.isInput = true; - result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &info ); + result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &info ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceCount: error (" << getErrorString( result ) << ") enumerating input devices!"; errorText_ = errorStream_.str(); @@ -3366,7 +3406,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) EnumInfo dsinfo; dsinfo.findIndex = true; dsinfo.index = device; - HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &dsinfo ); + HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &dsinfo ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") enumerating output devices!"; errorText_ = errorStream_.str(); @@ -3424,7 +3464,7 @@ RtAudio::DeviceInfo RtApiDs :: getDeviceInfo( unsigned int device ) probeInput: dsinfo.isInput = true; - result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &dsinfo ); + result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &dsinfo ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::getDeviceInfo: error (" << getErrorString( result ) << ") enumerating input devices!"; errorText_ = errorStream_.str(); @@ -3534,7 +3574,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned EnumInfo dsinfo; dsinfo.findIndex = true; dsinfo.index = device; - HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &dsinfo ); + HRESULT result = DirectSoundEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &dsinfo ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") enumerating output devices!"; errorText_ = errorStream_.str(); @@ -3550,7 +3590,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned } else { // mode == INPUT dsinfo.isInput = true; - HRESULT result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceCountCallback, &dsinfo ); + HRESULT result = DirectSoundCaptureEnumerate( (LPDSENUMCALLBACK) deviceQueryCallback, &dsinfo ); if ( FAILED( result ) ) { errorStream_ << "RtApiDs::probeDeviceOpen: error (" << getErrorString( result ) << ") enumerating input devices!"; errorText_ = errorStream_.str(); @@ -3858,6 +3898,7 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned } // Set various stream parameters + DsHandle *handle = 0; stream_.nDeviceChannels[mode] = channels + firstChannel; stream_.nUserChannels[mode] = channels; stream_.bufferSize = *bufferSize; @@ -3907,7 +3948,6 @@ bool RtApiDs :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigned } // Allocate our DsHandle structures for the stream. - DsHandle *handle; if ( stream_.apiHandle == 0 ) { try { handle = new DsHandle; @@ -4078,7 +4118,7 @@ void RtApiDs :: startStream() duplexPrerollBytes = (int) ( 0.5 * stream_.sampleRate * formatBytes( stream_.deviceFormat[1] ) * stream_.nDeviceChannels[1] ); } - HRESULT result; + HRESULT result = 0; if ( stream_.mode == OUTPUT || stream_.mode == DUPLEX ) { //statistics.outputFrameSize = formatBytes( stream_.deviceFormat[0] ) * stream_.nDeviceChannels[0]; @@ -4124,7 +4164,7 @@ void RtApiDs :: stopStream() MUTEX_LOCK( &stream_.mutex ); - HRESULT result; + HRESULT result = 0; LPVOID audioPtr; DWORD dataLen; DsHandle *handle = (DsHandle *) stream_.apiHandle; @@ -4665,7 +4705,7 @@ std::string convertTChar( LPCTSTR name ) return s; } -static bool CALLBACK deviceCountCallback( LPGUID lpguid, +static BOOL CALLBACK deviceQueryCallback( LPGUID lpguid, LPCTSTR description, LPCTSTR module, LPVOID lpContext ) @@ -4678,7 +4718,7 @@ static bool CALLBACK deviceCountCallback( LPGUID lpguid, LPDIRECTSOUNDCAPTURE object; hr = DirectSoundCaptureCreate( lpguid, &object, NULL ); - if ( hr != DS_OK ) return true; + if ( hr != DS_OK ) return TRUE; caps.dwSize = sizeof(caps); hr = object->GetCaps( &caps ); @@ -4692,7 +4732,7 @@ static bool CALLBACK deviceCountCallback( LPGUID lpguid, DSCAPS caps; LPDIRECTSOUND object; hr = DirectSoundCreate( lpguid, &object, NULL ); - if ( hr != DS_OK ) return true; + if ( hr != DS_OK ) return TRUE; caps.dwSize = sizeof(caps); hr = object->GetCaps( &caps ); @@ -4703,20 +4743,20 @@ static bool CALLBACK deviceCountCallback( LPGUID lpguid, object->Release(); } - if ( info->getDefault && lpguid == NULL ) return false; + if ( info->getDefault && lpguid == NULL ) return FALSE; if ( info->findIndex && info->counter > info->index ) { info->id = lpguid; info->name = convertTChar( description ); - return false; + return FALSE; } - return true; + return TRUE; } static char* getErrorString( int code ) { - switch (code) { + switch ( code ) { case DSERR_ALLOCATED: return "Already allocated"; @@ -5906,7 +5946,9 @@ extern "C" void *alsaCallbackHandler( void *ptr ) #ifdef SCHED_RR // Set a higher scheduler priority (P.J. Leonard) struct sched_param param; - param.sched_priority = 39; // Is this the best number? + int min = sched_get_priority_min( SCHED_RR ); + int max = sched_get_priority_max( SCHED_RR ); + param.sched_priority = min + ( max - min ) / 2; // Is this the best number? sched_setscheduler( 0, SCHED_RR, ¶m ); #endif @@ -5928,7 +5970,7 @@ extern "C" void *alsaCallbackHandler( void *ptr ) #include #include #include -#include "oss/soundcard.h" +#include "soundcard.h" #include #include diff --git a/src/RtMidi.cpp b/src/RtMidi.cpp index cbf7eb6..837e9c6 100644 --- a/src/RtMidi.cpp +++ b/src/RtMidi.cpp @@ -8,7 +8,7 @@ RtMidi WWW site: http://music.mcgill.ca/~gary/rtmidi/ RtMidi: realtime MIDI i/o C++ classes - Copyright (c) 2003-2005 Gary P. Scavone + Copyright (c) 2003-2007 Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files @@ -35,7 +35,7 @@ */ /**********************************************************************/ -// RtMidi: Version 1.0.5, in development +// RtMidi: Version 1.0.7 #include "RtMidi.h" #include @@ -768,12 +768,9 @@ extern "C" void *alsaMidiHandler( void *ptr ) else message.bytes.insert( message.bytes.end(), buffer, &buffer[nBytes] ); - if ( ev->type == SND_SEQ_EVENT_SYSEX && message.bytes.back() == 0xF7 ) - continueSysex = false; - else { - continueSysex = true; + continueSysex = ( ev->type == SND_SEQ_EVENT_SYSEX && message.bytes.back() != 0xF7 ); + if ( continueSysex ) break; - } // Calculate the time stamp: message.timeStamp = 0.0; @@ -1926,7 +1923,7 @@ std::string RtMidiIn :: getPortName( unsigned int portNumber ) } MIDIINCAPS deviceCaps; - MMRESULT result = midiInGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIINCAPS)); + midiInGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIINCAPS)); // For some reason, we need to copy character by character with // UNICODE (thanks to Eduardo Coutinho!). @@ -1960,7 +1957,7 @@ std::string RtMidiOut :: getPortName( unsigned int portNumber ) } MIDIOUTCAPS deviceCaps; - MMRESULT result = midiOutGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIOUTCAPS)); + midiOutGetDevCaps( portNumber, &deviceCaps, sizeof(MIDIOUTCAPS)); // For some reason, we need to copy character by character with // UNICODE (thanks to Eduardo Coutinho!). diff --git a/src/RtWvOut.cpp b/src/RtWvOut.cpp index 1eb69df..40161b6 100644 --- a/src/RtWvOut.cpp +++ b/src/RtWvOut.cpp @@ -104,7 +104,7 @@ RtWvOut :: RtWvOut( unsigned int nChannels, StkFloat sampleRate, int device, int } data_.resize( size * nBuffers, nChannels ); - unsigned int offset = (unsigned int ) (data_.size() / 2.0); + unsigned int offset = (unsigned int ) (data_.frames() / 2.0); writeIndex_ = offset; // start writing half-way into buffer framesFilled_ = offset; } diff --git a/src/Stk.cpp b/src/Stk.cpp index 46c120d..2f9ad59 100644 --- a/src/Stk.cpp +++ b/src/Stk.cpp @@ -8,7 +8,21 @@ provides error handling and byte-swapping functions. - by Perry R. Cook and Gary P. Scavone, 1995 - 2007. + The Synthesis ToolKit in C++ (STK) is a set of open source audio + signal processing and algorithmic synthesis classes written in the + C++ programming language. STK was designed to facilitate rapid + development of music synthesis and audio processing software, with + an emphasis on cross-platform functionality, realtime control, + ease of use, and educational example code. STK currently runs + with realtime support (audio and MIDI) on Linux, Macintosh OS X, + and Windows computer platforms. Generic, non-realtime support has + been tested under NeXTStep, Sun, and other platforms and should + work with any standard C++ compiler. + + STK WWW site: http://ccrma.stanford.edu/software/stk/ + + The Synthesis ToolKit in C++ (STK) + Copyright (c) 1995-2007 Perry R. Cook and Gary P. Scavone Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files diff --git a/src/asio/asio.cpp b/src/include/asio.cpp similarity index 100% rename from src/asio/asio.cpp rename to src/include/asio.cpp diff --git a/src/asio/asio.h b/src/include/asio.h similarity index 100% rename from src/asio/asio.h rename to src/include/asio.h diff --git a/src/asio/asiodrivers.cpp b/src/include/asiodrivers.cpp similarity index 100% rename from src/asio/asiodrivers.cpp rename to src/include/asiodrivers.cpp diff --git a/src/asio/asiodrivers.h b/src/include/asiodrivers.h similarity index 100% rename from src/asio/asiodrivers.h rename to src/include/asiodrivers.h diff --git a/src/asio/asiodrvr.h b/src/include/asiodrvr.h similarity index 100% rename from src/asio/asiodrvr.h rename to src/include/asiodrvr.h diff --git a/src/asio/asiolist.cpp b/src/include/asiolist.cpp similarity index 100% rename from src/asio/asiolist.cpp rename to src/include/asiolist.cpp diff --git a/src/asio/asiolist.h b/src/include/asiolist.h similarity index 100% rename from src/asio/asiolist.h rename to src/include/asiolist.h diff --git a/src/asio/asiosys.h b/src/include/asiosys.h similarity index 100% rename from src/asio/asiosys.h rename to src/include/asiosys.h diff --git a/src/include/dsound.h b/src/include/dsound.h new file mode 100644 index 0000000..cb19cca --- /dev/null +++ b/src/include/dsound.h @@ -0,0 +1,2369 @@ +/*==========================================================================; + * + * Copyright (c) Microsoft Corporation. All rights reserved. + * + * File: dsound.h + * Content: DirectSound include file + * + **************************************************************************/ + +#define COM_NO_WINDOWS_H +#include +#include + +#ifndef DIRECTSOUND_VERSION +#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */ +#endif + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#ifndef __DSOUND_INCLUDED__ +#define __DSOUND_INCLUDED__ + +/* Type definitions shared with Direct3D */ + +#ifndef DX_SHARED_DEFINES + +typedef float D3DVALUE, *LPD3DVALUE; + +#ifndef D3DCOLOR_DEFINED +typedef DWORD D3DCOLOR; +#define D3DCOLOR_DEFINED +#endif + +#ifndef LPD3DCOLOR_DEFINED +typedef DWORD *LPD3DCOLOR; +#define LPD3DCOLOR_DEFINED +#endif + +#ifndef D3DVECTOR_DEFINED +typedef struct _D3DVECTOR { + float x; + float y; + float z; +} D3DVECTOR; +#define D3DVECTOR_DEFINED +#endif + +#ifndef LPD3DVECTOR_DEFINED +typedef D3DVECTOR *LPD3DVECTOR; +#define LPD3DVECTOR_DEFINED +#endif + +#define DX_SHARED_DEFINES +#endif // DX_SHARED_DEFINES + +#define _FACDS 0x878 /* DirectSound's facility code */ +#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code) + +// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000} +DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0); + +// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B} +DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b); + +// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16} +DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1} +DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1); + +// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D} +DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d); + + +// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + +// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03} +DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03); + + +// +// Forward declarations for interfaces. +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +// + +#ifdef __cplusplus +struct IDirectSound; +struct IDirectSoundBuffer; +struct IDirectSound3DListener; +struct IDirectSound3DBuffer; +struct IDirectSoundCapture; +struct IDirectSoundCaptureBuffer; +struct IDirectSoundNotify; +#endif // __cplusplus + + +// +// DirectSound 8.0 interfaces. +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#ifdef __cplusplus +struct IDirectSound8; +struct IDirectSoundBuffer8; +struct IDirectSoundCaptureBuffer8; +struct IDirectSoundFXGargle; +struct IDirectSoundFXChorus; +struct IDirectSoundFXFlanger; +struct IDirectSoundFXEcho; +struct IDirectSoundFXDistortion; +struct IDirectSoundFXCompressor; +struct IDirectSoundFXParamEq; +struct IDirectSoundFXWavesReverb; +struct IDirectSoundFXI3DL2Reverb; +struct IDirectSoundCaptureFXAec; +struct IDirectSoundCaptureFXNoiseSuppress; +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the +// only DirectSound 7.0 interfaces with changed functionality in version 8.0. +// The other level 8 interfaces as equivalent to their level 7 counterparts: + +#define IDirectSoundCapture8 IDirectSoundCapture +#define IDirectSound3DListener8 IDirectSound3DListener +#define IDirectSound3DBuffer8 IDirectSound3DBuffer +#define IDirectSoundNotify8 IDirectSoundNotify +#define IDirectSoundFXGargle8 IDirectSoundFXGargle +#define IDirectSoundFXChorus8 IDirectSoundFXChorus +#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger +#define IDirectSoundFXEcho8 IDirectSoundFXEcho +#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion +#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor +#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq +#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb +#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb +#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec +#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress +#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSound *LPDIRECTSOUND; +typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER; +typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER; +typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER; +typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE; +typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER; +typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY; + + +#if DIRECTSOUND_VERSION >= 0x0800 + +typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE; +typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS; +typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER; +typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO; +typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION; +typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR; +typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ; +typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB; +typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB; +typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC; +typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS; +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +typedef struct IDirectSound8 *LPDIRECTSOUND8; +typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8; +typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8; +typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8; +typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8; +typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8; +typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8; +typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8; +typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8; +typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8; +typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8; +typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8; +typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8; +typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8; +typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8; +typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8; +typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8; +typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8; +typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8; + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IID definitions for the unchanged DirectSound 8.0 interfaces +// + +#if DIRECTSOUND_VERSION >= 0x0800 + +#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture +#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener +#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer +#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify +#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle +#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus +#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger +#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho +#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion +#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor +#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq +#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb +#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb +#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec +#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress +#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Compatibility typedefs +// + +#ifndef _LPCWAVEFORMATEX_DEFINED +#define _LPCWAVEFORMATEX_DEFINED +typedef const WAVEFORMATEX *LPCWAVEFORMATEX; +#endif // _LPCWAVEFORMATEX_DEFINED + +#ifndef __LPCGUID_DEFINED__ +#define __LPCGUID_DEFINED__ +typedef const GUID *LPCGUID; +#endif // __LPCGUID_DEFINED__ + +typedef LPDIRECTSOUND *LPLPDIRECTSOUND; +typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER; +typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER; +typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER; +typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE; +typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER; +typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY; + +#if DIRECTSOUND_VERSION >= 0x0800 +typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8; +typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8; +typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8; +typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8; +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Structures +// + +typedef struct _DSCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwMinSecondarySampleRate; + DWORD dwMaxSecondarySampleRate; + DWORD dwPrimaryBuffers; + DWORD dwMaxHwMixingAllBuffers; + DWORD dwMaxHwMixingStaticBuffers; + DWORD dwMaxHwMixingStreamingBuffers; + DWORD dwFreeHwMixingAllBuffers; + DWORD dwFreeHwMixingStaticBuffers; + DWORD dwFreeHwMixingStreamingBuffers; + DWORD dwMaxHw3DAllBuffers; + DWORD dwMaxHw3DStaticBuffers; + DWORD dwMaxHw3DStreamingBuffers; + DWORD dwFreeHw3DAllBuffers; + DWORD dwFreeHw3DStaticBuffers; + DWORD dwFreeHw3DStreamingBuffers; + DWORD dwTotalHwMemBytes; + DWORD dwFreeHwMemBytes; + DWORD dwMaxContigFreeHwMemBytes; + DWORD dwUnlockTransferRateHwBuffers; + DWORD dwPlayCpuOverheadSwBuffers; + DWORD dwReserved1; + DWORD dwReserved2; +} DSCAPS, *LPDSCAPS; + +typedef const DSCAPS *LPCDSCAPS; + +typedef struct _DSBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwUnlockTransferRate; + DWORD dwPlayCpuOverhead; +} DSBCAPS, *LPDSBCAPS; + +typedef const DSBCAPS *LPCDSBCAPS; + +#if DIRECTSOUND_VERSION >= 0x0800 + + typedef struct _DSEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSFXClass; + DWORD_PTR dwReserved1; + DWORD_PTR dwReserved2; + } DSEFFECTDESC, *LPDSEFFECTDESC; + typedef const DSEFFECTDESC *LPCDSEFFECTDESC; + + #define DSFX_LOCHARDWARE 0x00000001 + #define DSFX_LOCSOFTWARE 0x00000002 + + enum + { + DSFXR_PRESENT, // 0 + DSFXR_LOCHARDWARE, // 1 + DSFXR_LOCSOFTWARE, // 2 + DSFXR_UNALLOCATED, // 3 + DSFXR_FAILED, // 4 + DSFXR_UNKNOWN, // 5 + DSFXR_SENDLOOP // 6 + }; + + typedef struct _DSCEFFECTDESC + { + DWORD dwSize; + DWORD dwFlags; + GUID guidDSCFXClass; + GUID guidDSCFXInstance; + DWORD dwReserved1; + DWORD dwReserved2; + } DSCEFFECTDESC, *LPDSCEFFECTDESC; + typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC; + + #define DSCFX_LOCHARDWARE 0x00000001 + #define DSCFX_LOCSOFTWARE 0x00000002 + + #define DSCFXR_LOCHARDWARE 0x00000010 + #define DSCFXR_LOCSOFTWARE 0x00000020 + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +typedef struct _DSBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0700 + GUID guid3DAlgorithm; +#endif +} DSBUFFERDESC, *LPDSBUFFERDESC; + +typedef const DSBUFFERDESC *LPCDSBUFFERDESC; + +// Older version of this structure: + +typedef struct _DSBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSBUFFERDESC1, *LPDSBUFFERDESC1; + +typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1; + +typedef struct _DS3DBUFFER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + DWORD dwInsideConeAngle; + DWORD dwOutsideConeAngle; + D3DVECTOR vConeOrientation; + LONG lConeOutsideVolume; + D3DVALUE flMinDistance; + D3DVALUE flMaxDistance; + DWORD dwMode; +} DS3DBUFFER, *LPDS3DBUFFER; + +typedef const DS3DBUFFER *LPCDS3DBUFFER; + +typedef struct _DS3DLISTENER +{ + DWORD dwSize; + D3DVECTOR vPosition; + D3DVECTOR vVelocity; + D3DVECTOR vOrientFront; + D3DVECTOR vOrientTop; + D3DVALUE flDistanceFactor; + D3DVALUE flRolloffFactor; + D3DVALUE flDopplerFactor; +} DS3DLISTENER, *LPDS3DLISTENER; + +typedef const DS3DLISTENER *LPCDS3DLISTENER; + +typedef struct _DSCCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwFormats; + DWORD dwChannels; +} DSCCAPS, *LPDSCCAPS; + +typedef const DSCCAPS *LPCDSCCAPS; + +typedef struct _DSCBUFFERDESC1 +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +} DSCBUFFERDESC1, *LPDSCBUFFERDESC1; + +typedef struct _DSCBUFFERDESC +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; + LPWAVEFORMATEX lpwfxFormat; +#if DIRECTSOUND_VERSION >= 0x0800 + DWORD dwFXCount; + LPDSCEFFECTDESC lpDSCFXDesc; +#endif +} DSCBUFFERDESC, *LPDSCBUFFERDESC; + +typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC; + +typedef struct _DSCBCAPS +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwBufferBytes; + DWORD dwReserved; +} DSCBCAPS, *LPDSCBCAPS; + +typedef const DSCBCAPS *LPCDSCBCAPS; + +typedef struct _DSBPOSITIONNOTIFY +{ + DWORD dwOffset; + HANDLE hEventNotify; +} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY; + +typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY; + +// +// DirectSound API +// + +typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID); +typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID); + +extern HRESULT WINAPI DirectSoundCreate(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext); +extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext); + +extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext); +extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext); + +#if DIRECTSOUND_VERSION >= 0x0800 +extern HRESULT WINAPI DirectSoundCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUND8 *ppDS8, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter); +extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice, + LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd, + DWORD dwLevel, LPDIRECTSOUNDFULLDUPLEX* ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8, + LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter); +#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate + +extern HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest); +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#ifdef UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKW +#define DirectSoundEnumerate DirectSoundEnumerateW +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW +#else // UNICODE +#define LPDSENUMCALLBACK LPDSENUMCALLBACKA +#define DirectSoundEnumerate DirectSoundEnumerateA +#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA +#endif // UNICODE + +// +// IUnknown +// + +#if !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p) +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->lpVtbl->Release(p) +#endif // IUnknown_Release +#else // !defined(__cplusplus) || defined(CINTERFACE) +#ifndef IUnknown_QueryInterface +#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#endif // IUnknown_QueryInterface +#ifndef IUnknown_AddRef +#define IUnknown_AddRef(p) (p)->AddRef() +#endif // IUnknown_AddRef +#ifndef IUnknown_Release +#define IUnknown_Release(p) (p)->Release() +#endif // IUnknown_Release +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#ifndef __IReferenceClock_INTERFACE_DEFINED__ +#define __IReferenceClock_INTERFACE_DEFINED__ + +typedef LONGLONG REFERENCE_TIME; +typedef REFERENCE_TIME *LPREFERENCE_TIME; + +DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); + +#undef INTERFACE +#define INTERFACE IReferenceClock + +DECLARE_INTERFACE_(IReferenceClock, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IReferenceClock methods + STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE; + STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime, + HANDLE hEvent, LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime, + HANDLE hSemaphore, LPDWORD pdwAdviseCookie) PURE; + STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE; +}; + +#endif // __IReferenceClock_INTERFACE_DEFINED__ + +#ifndef IReferenceClock_QueryInterface + +#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IReferenceClock_AddRef(p) IUnknown_AddRef(p) +#define IReferenceClock_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IReferenceClock_GetTime(p,a) (p)->GetTime(a) +#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d) +#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d) +#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // IReferenceClock_QueryInterface + +// +// IDirectSound +// + +DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound + +DECLARE_INTERFACE_(IDirectSound, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) +#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p) +#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b) +#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c) +#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b) +#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) +#define IDirectSound_Compact(p) (p)->Compact() +#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a) +#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b) +#define IDirectSound_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound8 +// + +DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66); + +#undef INTERFACE +#define INTERFACE IDirectSound8 + +DECLARE_INTERFACE_(IDirectSound8, IDirectSound) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound methods + STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ LPDSCAPS pDSCaps) PURE; + STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE; + STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE; + STDMETHOD(Compact) (THIS) PURE; + STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD pdwSpeakerConfig) PURE; + STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE; + STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE; + + // IDirectSound8 methods + STDMETHOD(VerifyCertification) (THIS_ LPDWORD pdwCertified) PURE; +}; + +#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b) +#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p) +#define IDirectSound8_Release(p) IDirectSound_Release(p) +#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c) +#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a) +#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b) +#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b) +#define IDirectSound8_Compact(p) IDirectSound_Compact(p) +#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a) +#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a) +#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer +// + +DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer + +DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, + LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; +}; + +#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a) +#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a) +#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a) +#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a) +#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c) +#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a) +#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a) +#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a) +#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a) +#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a) +#define IDirectSoundBuffer_Stop(p) (p)->Stop() +#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#define IDirectSoundBuffer_Restore(p) (p)->Restore() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e); + +#undef INTERFACE +#define INTERFACE IDirectSoundBuffer8 + +DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundBuffer methods + STDMETHOD(GetCaps) (THIS_ LPDSBCAPS pDSBufferCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetVolume) (THIS_ LPLONG plVolume) PURE; + STDMETHOD(GetPan) (THIS_ LPLONG plPan) PURE; + STDMETHOD(GetFrequency) (THIS_ LPDWORD pdwFrequency) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, + LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE; + STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE; + STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE; + STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE; + STDMETHOD(SetPan) (THIS_ LONG lPan) PURE; + STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + STDMETHOD(Restore) (THIS) PURE; + + // IDirectSoundBuffer8 methods + STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE; + STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE; + STDMETHOD(GetObjectInPath) (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE; +}; + +// Special GUID meaning "select all objects" for use in GetObjectInPath() +DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5); + +#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a) +#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c) +#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a) +#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a) +#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a) +#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a) +#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b) +#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c) +#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a) +#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a) +#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a) +#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a) +#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a) +#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p) +#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d) +#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c) +#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c) +#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSound3DListener +// + +DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DListener + +DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DListener methods + STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER pListener) PURE; + STDMETHOD(GetDistanceFactor) (THIS_ D3DVALUE* pflDistanceFactor) PURE; + STDMETHOD(GetDopplerFactor) (THIS_ D3DVALUE* pflDopplerFactor) PURE; + STDMETHOD(GetOrientation) (THIS_ D3DVECTOR* pvOrientFront, D3DVECTOR* pvOrientTop) PURE; + STDMETHOD(GetPosition) (THIS_ D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetRolloffFactor) (THIS_ D3DVALUE* pflRolloffFactor) PURE; + STDMETHOD(GetVelocity) (THIS_ D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER pcListener, DWORD dwApply) PURE; + STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE; + STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE; + STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront, + D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(CommitDeferredSettings) (THIS) PURE; +}; + +#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DListener_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a) +#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a) +#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b) +#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a) +#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b) +#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b) +#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g) +#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b) +#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings() +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSound3DBuffer +// + +DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60); + +#undef INTERFACE +#define INTERFACE IDirectSound3DBuffer + +DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSound3DBuffer methods + STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER pDs3dBuffer) PURE; + STDMETHOD(GetConeAngles) (THIS_ LPDWORD pdwInsideConeAngle, LPDWORD pdwOutsideConeAngle) PURE; + STDMETHOD(GetConeOrientation) (THIS_ D3DVECTOR* pvOrientation) PURE; + STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG plConeOutsideVolume) PURE; + STDMETHOD(GetMaxDistance) (THIS_ D3DVALUE* pflMaxDistance) PURE; + STDMETHOD(GetMinDistance) (THIS_ D3DVALUE* pflMinDistance) PURE; + STDMETHOD(GetMode) (THIS_ LPDWORD pdwMode) PURE; + STDMETHOD(GetPosition) (THIS_ D3DVECTOR* pvPosition) PURE; + STDMETHOD(GetVelocity) (THIS_ D3DVECTOR* pvVelocity) PURE; + STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE; + STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE; + STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE; + STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE; + STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE; + STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE; + STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; + STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE; +}; + +#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b) +#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a) +#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a) +#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a) +#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a) +#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a) +#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a) +#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a) +#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b) +#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c) +#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d) +#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b) +#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d) +#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b) +#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b) +#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b) +#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCapture +// + +DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCapture + +DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCapture methods + STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC pcDSCBufferDesc, LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, LPUNKNOWN pUnkOuter) PURE; + STDMETHOD(GetCaps) (THIS_ LPDSCCAPS pDSCCaps) PURE; + STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE; +}; + +#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCapture_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c) +#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureBuffer +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, + LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; +}; + +#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p) +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b) +#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c) +#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a) +#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b) +#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a) +#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop() +#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundCaptureBuffer8 +// + +DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6); + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureBuffer8 + +DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureBuffer methods + STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE; + STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE; + STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE; + STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE; + STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE; + STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1, + LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE; + STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE; + STDMETHOD(Stop) (THIS) PURE; + STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE; + + // IDirectSoundCaptureBuffer8 methods + STDMETHOD(GetObjectInPath) (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE; + STDMETHOD(GetFXStatus) (DWORD dwFXCount, LPDWORD pdwFXStatus) PURE; +}; + +#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p) + +#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a) +#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) +#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) +#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a) +#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b) +#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) +#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a) +#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p)) +#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d) +#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundNotify +// + +DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16); + +#undef INTERFACE +#define INTERFACE IDirectSoundNotify + +DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundNotify methods + STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE; +}; + +#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundNotify_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IKsPropertySet +// + +#ifndef _IKsPropertySet_ +#define _IKsPropertySet_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IKsPropertySet; +#endif // __cplusplus + +typedef struct IKsPropertySet *LPKSPROPERTYSET; + +#define KSPROPERTY_SUPPORT_GET 0x00000001 +#define KSPROPERTY_SUPPORT_SET 0x00000002 + +DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); + +#undef INTERFACE +#define INTERFACE IKsPropertySet + +DECLARE_INTERFACE_(IKsPropertySet, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IKsPropertySet methods + STDMETHOD(Get) (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength, + LPVOID pPropertyData, ULONG ulDataLength, PULONG pulBytesReturned) PURE; + STDMETHOD(Set) (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength, + LPVOID pPropertyData, ULONG ulDataLength) PURE; + STDMETHOD(QuerySupport) (THIS_ REFGUID rguidPropSet, ULONG ulId, PULONG pulTypeSupport) PURE; +}; + +#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p) +#define IKsPropertySet_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g) +#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f) +#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IKsPropertySet_ + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// IDirectSoundFXGargle +// + +DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3); + +typedef struct _DSFXGargle +{ + DWORD dwRateHz; // Rate of modulation in hz + DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx +} DSFXGargle, *LPDSFXGargle; + +#define DSFXGARGLE_WAVE_TRIANGLE 0 +#define DSFXGARGLE_WAVE_SQUARE 1 + +typedef const DSFXGargle *LPCDSFXGargle; + +#define DSFXGARGLE_RATEHZ_MIN 1 +#define DSFXGARGLE_RATEHZ_MAX 1000 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXGargle + +DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXGargle methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXGargle pcDsFxGargle) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXGargle pDsFxGargle) PURE; +}; + +#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXChorus +// + +DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47); + +typedef struct _DSFXChorus +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx + FLOAT fDelay; + LONG lPhase; +} DSFXChorus, *LPDSFXChorus; + +typedef const DSFXChorus *LPCDSFXChorus; + +#define DSFXCHORUS_WAVE_TRIANGLE 0 +#define DSFXCHORUS_WAVE_SIN 1 + +#define DSFXCHORUS_WETDRYMIX_MIN 0.0f +#define DSFXCHORUS_WETDRYMIX_MAX 100.0f +#define DSFXCHORUS_DEPTH_MIN 0.0f +#define DSFXCHORUS_DEPTH_MAX 100.0f +#define DSFXCHORUS_FEEDBACK_MIN -99.0f +#define DSFXCHORUS_FEEDBACK_MAX 99.0f +#define DSFXCHORUS_FREQUENCY_MIN 0.0f +#define DSFXCHORUS_FREQUENCY_MAX 10.0f +#define DSFXCHORUS_DELAY_MIN 0.0f +#define DSFXCHORUS_DELAY_MAX 20.0f +#define DSFXCHORUS_PHASE_MIN 0 +#define DSFXCHORUS_PHASE_MAX 4 + +#define DSFXCHORUS_PHASE_NEG_180 0 +#define DSFXCHORUS_PHASE_NEG_90 1 +#define DSFXCHORUS_PHASE_ZERO 2 +#define DSFXCHORUS_PHASE_90 3 +#define DSFXCHORUS_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXChorus + +DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXChorus methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXChorus pcDsFxChorus) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXChorus pDsFxChorus) PURE; +}; + +#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXFlanger +// + +DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83); + +typedef struct _DSFXFlanger +{ + FLOAT fWetDryMix; + FLOAT fDepth; + FLOAT fFeedback; + FLOAT fFrequency; + LONG lWaveform; + FLOAT fDelay; + LONG lPhase; +} DSFXFlanger, *LPDSFXFlanger; + +typedef const DSFXFlanger *LPCDSFXFlanger; + +#define DSFXFLANGER_WAVE_TRIANGLE 0 +#define DSFXFLANGER_WAVE_SIN 1 + +#define DSFXFLANGER_WETDRYMIX_MIN 0.0f +#define DSFXFLANGER_WETDRYMIX_MAX 100.0f +#define DSFXFLANGER_FREQUENCY_MIN 0.0f +#define DSFXFLANGER_FREQUENCY_MAX 10.0f +#define DSFXFLANGER_DEPTH_MIN 0.0f +#define DSFXFLANGER_DEPTH_MAX 100.0f +#define DSFXFLANGER_PHASE_MIN 0 +#define DSFXFLANGER_PHASE_MAX 4 +#define DSFXFLANGER_FEEDBACK_MIN -99.0f +#define DSFXFLANGER_FEEDBACK_MAX 99.0f +#define DSFXFLANGER_DELAY_MIN 0.0f +#define DSFXFLANGER_DELAY_MAX 4.0f + +#define DSFXFLANGER_PHASE_NEG_180 0 +#define DSFXFLANGER_PHASE_NEG_90 1 +#define DSFXFLANGER_PHASE_ZERO 2 +#define DSFXFLANGER_PHASE_90 3 +#define DSFXFLANGER_PHASE_180 4 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXFlanger + +DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXFlanger methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXFlanger pcDsFxFlanger) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXFlanger pDsFxFlanger) PURE; +}; + +#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXEcho +// + +DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42); + +typedef struct _DSFXEcho +{ + FLOAT fWetDryMix; + FLOAT fFeedback; + FLOAT fLeftDelay; + FLOAT fRightDelay; + LONG lPanDelay; +} DSFXEcho, *LPDSFXEcho; + +typedef const DSFXEcho *LPCDSFXEcho; + +#define DSFXECHO_WETDRYMIX_MIN 0.0f +#define DSFXECHO_WETDRYMIX_MAX 100.0f +#define DSFXECHO_FEEDBACK_MIN 0.0f +#define DSFXECHO_FEEDBACK_MAX 100.0f +#define DSFXECHO_LEFTDELAY_MIN 1.0f +#define DSFXECHO_LEFTDELAY_MAX 2000.0f +#define DSFXECHO_RIGHTDELAY_MIN 1.0f +#define DSFXECHO_RIGHTDELAY_MAX 2000.0f +#define DSFXECHO_PANDELAY_MIN 0 +#define DSFXECHO_PANDELAY_MAX 1 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXEcho + +DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXEcho methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXEcho pcDsFxEcho) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXEcho pDsFxEcho) PURE; +}; + +#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXDistortion +// + +DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b); + +typedef struct _DSFXDistortion +{ + FLOAT fGain; + FLOAT fEdge; + FLOAT fPostEQCenterFrequency; + FLOAT fPostEQBandwidth; + FLOAT fPreLowpassCutoff; +} DSFXDistortion, *LPDSFXDistortion; + +typedef const DSFXDistortion *LPCDSFXDistortion; + +#define DSFXDISTORTION_GAIN_MIN -60.0f +#define DSFXDISTORTION_GAIN_MAX 0.0f +#define DSFXDISTORTION_EDGE_MIN 0.0f +#define DSFXDISTORTION_EDGE_MAX 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f +#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f +#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f +#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXDistortion + +DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXDistortion methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXDistortion pcDsFxDistortion) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXDistortion pDsFxDistortion) PURE; +}; + +#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXCompressor +// + +DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0); + +typedef struct _DSFXCompressor +{ + FLOAT fGain; + FLOAT fAttack; + FLOAT fRelease; + FLOAT fThreshold; + FLOAT fRatio; + FLOAT fPredelay; +} DSFXCompressor, *LPDSFXCompressor; + +typedef const DSFXCompressor *LPCDSFXCompressor; + +#define DSFXCOMPRESSOR_GAIN_MIN -60.0f +#define DSFXCOMPRESSOR_GAIN_MAX 60.0f +#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f +#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f +#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f +#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f +#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f +#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f +#define DSFXCOMPRESSOR_RATIO_MIN 1.0f +#define DSFXCOMPRESSOR_RATIO_MAX 100.0f +#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f +#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXCompressor + +DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXCompressor methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXCompressor pcDsFxCompressor) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXCompressor pDsFxCompressor) PURE; +}; + +#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXParamEq +// + +DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda); + +typedef struct _DSFXParamEq +{ + FLOAT fCenter; + FLOAT fBandwidth; + FLOAT fGain; +} DSFXParamEq, *LPDSFXParamEq; + +typedef const DSFXParamEq *LPCDSFXParamEq; + +#define DSFXPARAMEQ_CENTER_MIN 80.0f +#define DSFXPARAMEQ_CENTER_MAX 16000.0f +#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f +#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f +#define DSFXPARAMEQ_GAIN_MIN -15.0f +#define DSFXPARAMEQ_GAIN_MAX 15.0f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXParamEq + +DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXParamEq methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXParamEq pcDsFxParamEq) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXParamEq pDsFxParamEq) PURE; +}; + +#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXI3DL2Reverb +// + +DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4); + +typedef struct _DSFXI3DL2Reverb +{ + LONG lRoom; // [-10000, 0] default: -1000 mB + LONG lRoomHF; // [-10000, 0] default: 0 mB + FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0 + FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s + FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83 + LONG lReflections; // [-10000, 1000] default: -2602 mB + FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s + LONG lReverb; // [-10000, 2000] default: 200 mB + FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s + FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 % + FLOAT flDensity; // [0.0, 100.0] default: 100.0 % + FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz +} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb; + +typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb; + +#define DSFX_I3DL2REVERB_ROOM_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOM_MAX 0 +#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000) + +#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000) +#define DSFX_I3DL2REVERB_ROOMHF_MAX 0 +#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100) + +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f +#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f + +#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f +#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f + +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f +#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f + +#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000) +#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000 +#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602) + +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f +#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f + +#define DSFX_I3DL2REVERB_REVERB_MIN (-10000) +#define DSFX_I3DL2REVERB_REVERB_MAX 2000 +#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200) + +#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f +#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f +#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f + +#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f +#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f +#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f +#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f +#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f + +#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f +#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f + +#define DSFX_I3DL2REVERB_QUALITY_MIN 0 +#define DSFX_I3DL2REVERB_QUALITY_MAX 3 +#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2 + +#undef INTERFACE +#define INTERFACE IDirectSoundFXI3DL2Reverb + +DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXI3DL2Reverb methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE; + STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE; + STDMETHOD(GetPreset) (THIS_ LPDWORD pdwPreset) PURE; + STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE; + STDMETHOD(GetQuality) (THIS_ LONG *plQuality) PURE; +}; + +#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a) +#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundFXWavesReverb +// + +DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25); + +typedef struct _DSFXWavesReverb +{ + FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB + FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db + FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms + FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001 +} DSFXWavesReverb, *LPDSFXWavesReverb; + +typedef const DSFXWavesReverb *LPCDSFXWavesReverb; + +#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f +#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f +#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f +#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f +#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f +#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f +#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f +#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f +#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f + +#undef INTERFACE +#define INTERFACE IDirectSoundFXWavesReverb + +DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFXWavesReverb methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSFXWavesReverb pcDsFxWavesReverb) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSFXWavesReverb pDsFxWavesReverb) PURE; +}; + +#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +// +// IDirectSoundCaptureFXAec +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65); + +typedef struct _DSCFXAec +{ + BOOL fEnable; + BOOL fNoiseFill; + DWORD dwMode; +} DSCFXAec, *LPDSCFXAec; + +typedef const DSCFXAec *LPCDSCFXAec; + +// These match the AEC_MODE_* constants in the DDK's ksmedia.h file +#define DSCFX_AEC_MODE_PASS_THROUGH 0x0 +#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1 +#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2 + +// These match the AEC_STATUS_* constants in ksmedia.h +#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0 +#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1 +#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2 +#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8 + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXAec + +DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXAec methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSCFXAec pDscFxAec) PURE; + STDMETHOD(GetStatus) (THIS_ PDWORD pdwStatus) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundCaptureFXNoiseSuppress +// + +DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca); + +typedef struct _DSCFXNoiseSuppress +{ + BOOL fEnable; +} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress; + +typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress; + +#undef INTERFACE +#define INTERFACE IDirectSoundCaptureFXNoiseSuppress + +DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundCaptureFXNoiseSuppress methods + STDMETHOD(SetAllParameters) (THIS_ LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE; + STDMETHOD(GetAllParameters) (THIS_ LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE; + STDMETHOD(Reset) (THIS) PURE; +}; + +#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a) +#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + + +// +// IDirectSoundFullDuplex +// + +#ifndef _IDirectSoundFullDuplex_ +#define _IDirectSoundFullDuplex_ + +#ifdef __cplusplus +// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined +struct IDirectSoundFullDuplex; +#endif // __cplusplus + +typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX; + +DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d); + +#undef INTERFACE +#define INTERFACE IDirectSoundFullDuplex + +DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown) +{ + // IUnknown methods + STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + + // IDirectSoundFullDuplex methods + STDMETHOD(Initialize) (THIS_ LPCGUID pCaptureGuid, LPCGUID pRenderGuid, LPCDSCBUFFERDESC lpDscBufferDesc, LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE; +}; + +#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b) +#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p) +#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p) + +#if !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h) +#else // !defined(__cplusplus) || defined(CINTERFACE) +#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h) +#endif // !defined(__cplusplus) || defined(CINTERFACE) + +#endif // _IDirectSoundFullDuplex_ + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +// +// Return Codes +// + +// The function completed successfully +#define DS_OK S_OK + +// The call succeeded, but we had to substitute the 3D algorithm +#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10) + +// The call failed because resources (such as a priority level) +// were already being used by another caller +#define DSERR_ALLOCATED MAKE_DSHRESULT(10) + +// The control (vol, pan, etc.) requested by the caller is not available +#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30) + +// An invalid parameter was passed to the returning function +#define DSERR_INVALIDPARAM E_INVALIDARG + +// This call is not valid for the current state of this object +#define DSERR_INVALIDCALL MAKE_DSHRESULT(50) + +// An undetermined error occurred inside the DirectSound subsystem +#define DSERR_GENERIC E_FAIL + +// The caller does not have the priority level required for the function to +// succeed +#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70) + +// Not enough free memory is available to complete the operation +#define DSERR_OUTOFMEMORY E_OUTOFMEMORY + +// The specified WAVE format is not supported +#define DSERR_BADFORMAT MAKE_DSHRESULT(100) + +// The function called is not supported at this time +#define DSERR_UNSUPPORTED E_NOTIMPL + +// No sound driver is available for use +#define DSERR_NODRIVER MAKE_DSHRESULT(120) +// This object is already initialized +#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130) + +// This object does not support aggregation +#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION + +// The buffer memory has been lost, and must be restored +#define DSERR_BUFFERLOST MAKE_DSHRESULT(150) + +// Another app has a higher priority level, preventing this call from +// succeeding +#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160) + +// This object has not been initialized +#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170) + +// The requested COM interface is not available +#define DSERR_NOINTERFACE E_NOINTERFACE + +// Access is denied +#define DSERR_ACCESSDENIED E_ACCESSDENIED + +// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds +#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180) + +// Attempt to use DirectSound 8 functionality on an older DirectSound object +#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190) + +// A circular loop of send effects was detected +#define DSERR_SENDLOOP MAKE_DSHRESULT(200) + +// The GUID specified in an audiopath file does not match a valid MIXIN buffer +#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210) + +// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND) +#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449) + +// The effects requested could not be found on the system, or they were found +// but in the wrong order, or in the wrong hardware/software locations. +#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220) + +// +// Flags +// + +#define DSCAPS_PRIMARYMONO 0x00000001 +#define DSCAPS_PRIMARYSTEREO 0x00000002 +#define DSCAPS_PRIMARY8BIT 0x00000004 +#define DSCAPS_PRIMARY16BIT 0x00000008 +#define DSCAPS_CONTINUOUSRATE 0x00000010 +#define DSCAPS_EMULDRIVER 0x00000020 +#define DSCAPS_CERTIFIED 0x00000040 +#define DSCAPS_SECONDARYMONO 0x00000100 +#define DSCAPS_SECONDARYSTEREO 0x00000200 +#define DSCAPS_SECONDARY8BIT 0x00000400 +#define DSCAPS_SECONDARY16BIT 0x00000800 + +#define DSSCL_NORMAL 0x00000001 +#define DSSCL_PRIORITY 0x00000002 +#define DSSCL_EXCLUSIVE 0x00000003 +#define DSSCL_WRITEPRIMARY 0x00000004 + +#define DSSPEAKER_DIRECTOUT 0x00000000 +#define DSSPEAKER_HEADPHONE 0x00000001 +#define DSSPEAKER_MONO 0x00000002 +#define DSSPEAKER_QUAD 0x00000003 +#define DSSPEAKER_STEREO 0x00000004 +#define DSSPEAKER_SURROUND 0x00000005 +#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting +#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting +#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting +#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1 +#if (DIRECTSOUND_VERSION >= 0x1000) + #define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting + #define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1 +#endif + +#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees +#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees +#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees +#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees + +#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16)) +#define DSSPEAKER_CONFIG(a) ((BYTE)(a)) +#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF)) + +#define DSBCAPS_PRIMARYBUFFER 0x00000001 +#define DSBCAPS_STATIC 0x00000002 +#define DSBCAPS_LOCHARDWARE 0x00000004 +#define DSBCAPS_LOCSOFTWARE 0x00000008 +#define DSBCAPS_CTRL3D 0x00000010 +#define DSBCAPS_CTRLFREQUENCY 0x00000020 +#define DSBCAPS_CTRLPAN 0x00000040 +#define DSBCAPS_CTRLVOLUME 0x00000080 +#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100 +#define DSBCAPS_CTRLFX 0x00000200 +#define DSBCAPS_STICKYFOCUS 0x00004000 +#define DSBCAPS_GLOBALFOCUS 0x00008000 +#define DSBCAPS_GETCURRENTPOSITION2 0x00010000 +#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000 +#define DSBCAPS_LOCDEFER 0x00040000 +#if (DIRECTSOUND_VERSION >= 0x1000) + // Force GetCurrentPosition() to return a buffer's true play position; + // unmodified by aids to enhance backward compatibility. + #define DSBCAPS_TRUEPLAYPOSITION 0x00080000 +#endif + +#define DSBPLAY_LOOPING 0x00000001 +#define DSBPLAY_LOCHARDWARE 0x00000002 +#define DSBPLAY_LOCSOFTWARE 0x00000004 +#define DSBPLAY_TERMINATEBY_TIME 0x00000008 +#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010 +#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020 + +#define DSBSTATUS_PLAYING 0x00000001 +#define DSBSTATUS_BUFFERLOST 0x00000002 +#define DSBSTATUS_LOOPING 0x00000004 +#define DSBSTATUS_LOCHARDWARE 0x00000008 +#define DSBSTATUS_LOCSOFTWARE 0x00000010 +#define DSBSTATUS_TERMINATED 0x00000020 + +#define DSBLOCK_FROMWRITECURSOR 0x00000001 +#define DSBLOCK_ENTIREBUFFER 0x00000002 + +#define DSBFREQUENCY_ORIGINAL 0 +#define DSBFREQUENCY_MIN 100 +#if DIRECTSOUND_VERSION >= 0x0900 +#define DSBFREQUENCY_MAX 200000 +#else +#define DSBFREQUENCY_MAX 100000 +#endif + +#define DSBPAN_LEFT -10000 +#define DSBPAN_CENTER 0 +#define DSBPAN_RIGHT 10000 + +#define DSBVOLUME_MIN -10000 +#define DSBVOLUME_MAX 0 + +#define DSBSIZE_MIN 4 +#define DSBSIZE_MAX 0x0FFFFFFF +#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes + +#define DSBNOTIFICATIONS_MAX 100000UL + +#define DS3DMODE_NORMAL 0x00000000 +#define DS3DMODE_HEADRELATIVE 0x00000001 +#define DS3DMODE_DISABLE 0x00000002 + +#define DS3D_IMMEDIATE 0x00000000 +#define DS3D_DEFERRED 0x00000001 + +#define DS3D_MINDISTANCEFACTOR FLT_MIN +#define DS3D_MAXDISTANCEFACTOR FLT_MAX +#define DS3D_DEFAULTDISTANCEFACTOR 1.0f + +#define DS3D_MINROLLOFFFACTOR 0.0f +#define DS3D_MAXROLLOFFFACTOR 10.0f +#define DS3D_DEFAULTROLLOFFFACTOR 1.0f + +#define DS3D_MINDOPPLERFACTOR 0.0f +#define DS3D_MAXDOPPLERFACTOR 10.0f +#define DS3D_DEFAULTDOPPLERFACTOR 1.0f + +#define DS3D_DEFAULTMINDISTANCE 1.0f +#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f + +#define DS3D_MINCONEANGLE 0 +#define DS3D_MAXCONEANGLE 360 +#define DS3D_DEFAULTCONEANGLE 360 + +#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX + +// IDirectSoundCapture attributes + +#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER +#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED +#define DSCCAPS_MULTIPLECAPTURE 0x00000001 + +// IDirectSoundCaptureBuffer attributes + +#define DSCBCAPS_WAVEMAPPED 0x80000000 + +#if DIRECTSOUND_VERSION >= 0x0800 +#define DSCBCAPS_CTRLFX 0x00000200 +#endif + + +#define DSCBLOCK_ENTIREBUFFER 0x00000001 + +#define DSCBSTATUS_CAPTURING 0x00000001 +#define DSCBSTATUS_LOOPING 0x00000002 + +#define DSCBSTART_LOOPING 0x00000001 + +#define DSBPN_OFFSETSTOP 0xFFFFFFFF + +#define DS_CERTIFIED 0x00000000 +#define DS_UNCERTIFIED 0x00000001 + + +// +// Flags for the I3DL2 effects +// + +// +// I3DL2 Material Presets +// + +enum +{ + DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW, + DSFX_I3DL2_MATERIAL_PRESET_THINDOOR, + DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR, + DSFX_I3DL2_MATERIAL_PRESET_WOODWALL, + DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL, + DSFX_I3DL2_MATERIAL_PRESET_STONEWALL, + DSFX_I3DL2_MATERIAL_PRESET_CURTAIN +}; + +#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f +#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f +#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f +#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f +#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f +#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f +#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f +#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f + +enum +{ + DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT, + DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC, + DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL, + DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM, + DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE, + DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA, + DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR, + DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY, + DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR, + DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY, + DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST, + DSFX_I3DL2_ENVIRONMENT_PRESET_CITY, + DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS, + DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN, + DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT, + DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE, + DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER, + DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM, + DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL, + DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE +}; + +// +// I3DL2 Reverberation Presets Values +// + +#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f + +// +// Examples simulating 'musical' reverb presets +// +// Name Decay time Description +// Small Room 1.1s A small size room with a length of 5m or so. +// Medium Room 1.3s A medium size room with a length of 10m or so. +// Large Room 1.5s A large size room suitable for live performances. +// Medium Hall 1.8s A medium size concert hall. +// Large Hall 1.8s A large size concert hall suitable for a full orchestra. +// Plate 1.3s A plate reverb simulation. +// + +#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f +#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f + +// +// DirectSound3D Algorithms +// + +// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000} +#define DS3DALG_DEFAULT GUID_NULL + +// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + +// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA} +DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca); + + +#if DIRECTSOUND_VERSION >= 0x0800 + +// +// DirectSound Internal Effect Algorithms +// + + +// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF} +DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf); + +// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6} +DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6); + +// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98} +DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98); + +// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D} +DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d); + +// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21} +DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21); + +// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57} +DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57); + +// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231} +DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31); + +// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4} +DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4); + +// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C} +DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c); + +// +// DirectSound Capture Effect Algorithms +// + + +// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1} +// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1); + +// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40} +DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40); + +// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810} +DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10); + +// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5} +// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h +DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5); + +// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D} +DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d); + +// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0} +DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0); + +#endif // DIRECTSOUND_VERSION >= 0x0800 + +#endif // __DSOUND_INCLUDED__ + + + +#ifdef __cplusplus +}; +#endif // __cplusplus + diff --git a/src/asio/ginclude.h b/src/include/ginclude.h similarity index 100% rename from src/asio/ginclude.h rename to src/include/ginclude.h diff --git a/src/asio/iasiodrv.h b/src/include/iasiodrv.h similarity index 100% rename from src/asio/iasiodrv.h rename to src/include/iasiodrv.h diff --git a/src/asio/iasiothiscallresolver.cpp b/src/include/iasiothiscallresolver.cpp similarity index 100% rename from src/asio/iasiothiscallresolver.cpp rename to src/include/iasiothiscallresolver.cpp diff --git a/src/asio/iasiothiscallresolver.h b/src/include/iasiothiscallresolver.h similarity index 100% rename from src/asio/iasiothiscallresolver.h rename to src/include/iasiothiscallresolver.h diff --git a/src/oss/soundcard.h b/src/include/soundcard.h similarity index 100% rename from src/oss/soundcard.h rename to src/include/soundcard.h