mirror of
https://github.com/thestk/stk
synced 2026-02-02 07:46:14 +00:00
Version 4.1.2
This commit is contained in:
committed by
Stephen Sinclair
parent
6e0d1955a8
commit
586b0add5f
@@ -3,10 +3,10 @@
|
||||
\brief STK base class
|
||||
|
||||
Nearly all STK classes inherit from this class.
|
||||
The global sample rate can be queried and
|
||||
modified via Stk. In addition, this class
|
||||
provides error handling and byte-swapping
|
||||
functions.
|
||||
The global sample rate and rawwave path variables
|
||||
can be queried and modified via Stk. In addition,
|
||||
this class provides error handling and
|
||||
byte-swapping functions.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
||||
*/
|
||||
@@ -15,11 +15,24 @@
|
||||
#if !defined(__STK_H)
|
||||
#define __STK_H
|
||||
|
||||
// Most data in STK is passed and calculated with the following
|
||||
// user-definable floating-point type. You can change this to "float"
|
||||
// if you prefer or perhaps a "long double" in the future.
|
||||
#include <string>
|
||||
|
||||
// Most data in STK is passed and calculated with the
|
||||
// following user-definable floating-point type. You
|
||||
// can change this to "float" if you prefer or perhaps
|
||||
// a "long double" in the future.
|
||||
typedef double MY_FLOAT;
|
||||
|
||||
// The "MY_FLOAT" type will be deprecated in STK
|
||||
// versions higher than 4.1.2 and replaced with the variable
|
||||
// "StkFloat".
|
||||
//typedef double StkFloat;
|
||||
//#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
|
||||
// #pragma deprecated(MY_FLOAT)
|
||||
//#else
|
||||
// typedef StkFloat MY_FLOAT __attribute__ ((deprecated));
|
||||
//#endif
|
||||
|
||||
//! STK error handling class.
|
||||
/*!
|
||||
This is a fairly abstract exception handling class. There could
|
||||
@@ -74,8 +87,8 @@ public:
|
||||
static const STK_FORMAT STK_SINT8; /*!< -128 to +127 */
|
||||
static const STK_FORMAT STK_SINT16; /*!< -32768 to +32767 */
|
||||
static const STK_FORMAT STK_SINT32; /*!< -2147483648 to +2147483647. */
|
||||
static const STK_FORMAT STK_FLOAT32; /*!< Normalized between plus/minus 1.0. */
|
||||
static const STK_FORMAT STK_FLOAT64; /*!< Normalized between plus/minus 1.0. */
|
||||
static const STK_FORMAT MY_FLOAT32; /*!< Normalized between plus/minus 1.0. */
|
||||
static const STK_FORMAT MY_FLOAT64; /*!< Normalized between plus/minus 1.0. */
|
||||
|
||||
//! Static method which returns the current STK sample rate.
|
||||
static MY_FLOAT sampleRate(void);
|
||||
@@ -91,6 +104,12 @@ public:
|
||||
*/
|
||||
static void setSampleRate(MY_FLOAT newRate);
|
||||
|
||||
//! Static method which returns the current rawwave path.
|
||||
static std::string rawwavePath(void);
|
||||
|
||||
//! Static method which sets the STK rawwave path.
|
||||
static void setRawwavePath(std::string newPath);
|
||||
|
||||
//! Static method which byte-swaps a 16-bit data type.
|
||||
static void swap16(unsigned char *ptr);
|
||||
|
||||
@@ -105,6 +124,7 @@ public:
|
||||
|
||||
private:
|
||||
static MY_FLOAT srate;
|
||||
static std::string rawwavepath;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -130,22 +150,23 @@ typedef double FLOAT64;
|
||||
#define TRUE 1
|
||||
|
||||
// The default sampling rate.
|
||||
#define SRATE (MY_FLOAT) 22050.0
|
||||
|
||||
// Real-time audio input and output buffer size. If clicks are
|
||||
// occuring in the input and/or output sound stream, a larger buffer
|
||||
// size may help. Larger buffer sizes, however, produce more latency.
|
||||
#define SRATE (MY_FLOAT) 44100.0
|
||||
|
||||
// The default real-time audio input and output buffer size. If
|
||||
// clicks are occuring in the input and/or output sound stream, a
|
||||
// larger buffer size may help. Larger buffer sizes, however, produce
|
||||
// more latency.
|
||||
#define RT_BUFFER_SIZE 512
|
||||
|
||||
// The RAWWAVE_PATH definition is concatenated to the beginning of all
|
||||
// references to rawwave files in the various STK core classes
|
||||
// (ex. Clarinet.cpp). If you wish to move the rawwaves directory to
|
||||
// a different location in your file system, you will need to set this
|
||||
// path definition appropriately. The current definition is a
|
||||
// relative reference that will work for the programs in the STK
|
||||
// projects directory. The path can also be specified to configure and
|
||||
// set via the Makefiles.
|
||||
// The default rawwave path value is set with the preprocessor
|
||||
// definition RAWWAVE_PATH. This can be specified as an argument to
|
||||
// the configure script, in an integrated development environment, or
|
||||
// below. The global STK rawwave path variable can be dynamically set
|
||||
// with the Stk::setRawwavePath() function. This value is
|
||||
// concatenated to the beginning of all references to rawwave files in
|
||||
// the various STK core classes (ex. Clarinet.cpp). If you wish to
|
||||
// move the rawwaves directory to a different location in your file
|
||||
// system, you will need to set this path definition appropriately.
|
||||
#if !defined(RAWWAVE_PATH)
|
||||
#define RAWWAVE_PATH "../../rawwaves/"
|
||||
#endif
|
||||
@@ -158,7 +179,7 @@ typedef double FLOAT64;
|
||||
#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)
|
||||
#define __OS_WINDOWS__
|
||||
#define __STK_REALTIME__
|
||||
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__)
|
||||
#elif defined(__LINUX_OSS__) || defined(__LINUX_ALSA__) || defined(__LINUX_JACK__)
|
||||
#define __OS_LINUX__
|
||||
#define __STK_REALTIME__
|
||||
#elif defined(__IRIX_AL__)
|
||||
|
||||
Reference in New Issue
Block a user