/
Global.h
73 lines (53 loc) · 1.67 KB
/
Global.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Copyright (c) 2011 Dan Wilcox <danomatika@gmail.com>
*
* BSD Simplified License.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*
* See https://github.com/danomatika/robotcowboy for documentation
*
*/
#pragma once
#include "ofxOsc.h"
#include "AudioEngine.h"
#include "ScriptEngine.h"
#include "Osc.h"
#include "Midi.h"
#include "Gui.h"
class AppCore;
// a singleton for global variables
class Global {
public:
/// singleton data access
/// returns a reference to itself
/// creates a new object on the first call
static Global& instance();
/// \section Objects
AppCore *core; ///< global app pointer
AudioEngine audioEngine; ///< pd wrapper
ScriptEngine scriptEngine; ///< lua wrapper
Osc osc; ///< osc wrapper
Midi midi; ///< midi wrapper
Gui gui; ///< gui wrapper
/// \section Variables
string oscSendAddress;
int oscSendPort;
int oscReceivePort;
bool visualSendsOut;
bool audioSendsOut;
string scenePath; ///< absolute path to scene root
/// \section Functions
/// laod global settings from lua script
void loadSettings(string path);
/// setup objects
void setup(const int numOutChannels, const int numInChannels,
const int sampleRate, const int ticksPerBuffer);
/// clear all objects
void clear();
private:
// hide all the constructors, copy functions here
Global(); // singleton constructor
Global(Global const&); // not defined, not copyable
Global& operator = (Global const&); // not defined, not assignable
};