Home
Information
Classes
Download
Usage
Mail List
Requirements
Links
FAQ
Tutorial
include
RtWvOut.h
1
#ifndef STK_RTWVOUT_H
2
#define STK_RTWVOUT_H
3
4
#include "WvOut.h"
5
#include "
RtAudio.h
"
6
#include "Mutex.h"
7
8
namespace
stk {
9
10
/***************************************************/
28
/***************************************************/
29
30
class
RtWvOut
:
public
WvOut
31
{
32
public
:
33
35
42
RtWvOut
(
unsigned
int
nChannels = 1, StkFloat
sampleRate
=
Stk::sampleRate
(),
43
int
device = 0,
int
bufferFrames = RT_BUFFER_SIZE,
int
nBuffers = 20 );
44
46
~RtWvOut
();
47
49
53
void
start
(
void
);
54
56
60
void
stop
(
void
);
61
63
66
void
tick
(
const
StkFloat sample );
67
69
76
void
tick
(
const
StkFrames
& frames );
77
78
// This function is not intended for general use but must be
79
// public for access from the audio callback function.
80
int
readBuffer(
void
*buffer,
unsigned
int
frameCount );
81
82
protected
:
83
84
RtAudio
dac_;
85
Mutex
mutex_;
86
bool
stopped_;
87
unsigned
int
readIndex_;
88
unsigned
int
writeIndex_;
89
long
framesFilled_;
90
unsigned
int
status_;
// running = 0, emptying buffer = 1, finished = 2
91
92
};
93
94
}
// stk namespace
95
96
#endif
The Synthesis ToolKit in C++ (STK)
©1995--2019 Perry R. Cook and Gary P. Scavone. All Rights Reserved.