-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMPI_AudioCallback.cpp
More file actions
38 lines (27 loc) · 900 Bytes
/
Copy pathMPI_AudioCallback.cpp
File metadata and controls
38 lines (27 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// MPI_AudioCallback.cpp
//
#include "MPI_AudioCallback.h"
#include "MPI_Audio.h"
#include "MPI_Application.h"
int MPI_AudioCallback::callback( char *buffer, int bufferSize, void *data )
{
// get the audio instance and fill the buffer
// FIXME why does this have to go through the application?
// just because it's a singleton and globally accessible?
// why not make the audio callback a singleton itself or something?
// this class shouldn't rely on the application to grab the audio instance.
MPI_Audio& audioinstance = MPI_Application::getInstance().getAudio();
// FIXME each of these ticks should be in a try/catch block (see rtsine.cpp)
audioinstance.tickBuffer( (double*) buffer, bufferSize );
return 0;
}
MPI_AudioCallback::MPI_AudioCallback()
{
// empty
}
MPI_AudioCallback::~MPI_AudioCallback()
{
// empty
}
// vim:sw=4:et:cindent: