lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
Engine.h
Go to the documentation of this file.
1
/*
2
* Engine.h - engine-system of LMMS
3
*
4
* Copyright (c) 2006-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
5
*
6
* This file is part of LMMS - https://lmms.io
7
*
8
* This program is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
12
*
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
17
*
18
* You should have received a copy of the GNU General Public
19
* License along with this program (see COPYING); if not, write to the
20
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301 USA.
22
*
23
*/
24
25
#ifndef LMMS_ENGINE_H
26
#define LMMS_ENGINE_H
27
28
#include <QString>
29
#include <QObject>
30
31
#include "lmmsconfig.h"
32
#include "lmms_export.h"
33
#include "
LmmsTypes.h
"
34
35
namespace
lmms
36
{
37
38
class
AudioEngine
;
39
class
Mixer
;
40
class
PatternStore
;
41
class
ProjectJournal
;
42
class
Song
;
43
class
Ladspa2LMMS
;
44
45
namespace
gui
46
{
47
class
GuiApplication
;
48
}
49
50
51
class
LMMS_EXPORT
Engine
:
public
QObject
52
{
53
Q_OBJECT
54
public
:
55
static
void
init
(
bool
renderOnly );
56
static
void
destroy
();
57
58
// core
59
static
AudioEngine
*
audioEngine
()
60
{
61
return
s_audioEngine
;
62
}
63
64
static
Mixer
*
mixer
()
65
{
66
return
s_mixer
;
67
}
68
69
static
Song
*
getSong
()
70
{
71
return
s_song
;
72
}
73
74
static
PatternStore
*
patternStore
()
75
{
76
return
s_patternStore
;
77
}
78
79
static
ProjectJournal
*
projectJournal
()
80
{
81
return
s_projectJournal
;
82
}
83
84
#ifdef LMMS_HAVE_LV2
85
static
class
Lv2Manager
*
getLv2Manager
()
86
{
87
return
s_lv2Manager
;
88
}
89
#endif
90
91
static
Ladspa2LMMS
*
getLADSPAManager
()
92
{
93
return
s_ladspaManager
;
94
}
95
96
static
float
framesPerTick
()
97
{
98
return
s_framesPerTick
;
99
}
100
101
static
float
framesPerTick(
sample_rate_t
sample_rate);
102
103
static
void
updateFramesPerTick();
104
105
static
inline
Engine
*
inst
()
106
{
107
if
(
s_instanceOfMe
==
nullptr
)
108
{
109
s_instanceOfMe
=
new
Engine
();
110
}
111
return
s_instanceOfMe
;
112
}
113
114
static
void
setDndPluginKey(
void
* newKey);
115
static
void
* pickDndPluginKey();
116
117
signals:
118
void
initProgress
(
const
QString &msg);
119
120
121
private
:
122
// small helper function which sets the pointer to NULL before actually deleting
123
// the object it refers to
124
template
<
class
T>
125
static
inline
void
deleteHelper
(T** ptr)
126
{
127
T* tmp = *ptr;
128
*ptr =
nullptr
;
129
delete
tmp;
130
}
131
132
static
float
s_framesPerTick
;
133
134
// core
135
static
AudioEngine
*
s_audioEngine
;
136
static
Mixer
*
s_mixer
;
137
static
Song
*
s_song
;
138
static
PatternStore
*
s_patternStore
;
139
static
ProjectJournal
*
s_projectJournal
;
140
141
#ifdef LMMS_HAVE_LV2
142
static
class
Lv2Manager
*
s_lv2Manager
;
143
#endif
144
static
Ladspa2LMMS
*
s_ladspaManager
;
145
static
void
*
s_dndPluginKey
;
146
147
// even though most methods are static, an instance is needed for Qt slots/signals
148
static
Engine
*
s_instanceOfMe
;
149
150
friend
class
gui::GuiApplication
;
151
};
152
153
154
}
// namespace lmms
155
156
#endif
// LMMS_ENGINE_H
LmmsTypes.h
lmms::AudioEngine
Definition
AudioEngine.h:66
lmms::Engine
Definition
Engine.h:52
lmms::Engine::init
static void init(bool renderOnly)
Definition
Engine.cpp:58
lmms::Engine::s_patternStore
static PatternStore * s_patternStore
Definition
Engine.h:138
lmms::Engine::destroy
static void destroy()
Definition
Engine.cpp:95
lmms::Engine::initProgress
void initProgress(const QString &msg)
lmms::Engine::framesPerTick
static float framesPerTick()
Definition
Engine.h:96
lmms::Engine::deleteHelper
static void deleteHelper(T **ptr)
Definition
Engine.h:125
lmms::Engine::audioEngine
static AudioEngine * audioEngine()
Definition
Engine.h:59
lmms::Engine::getLv2Manager
static class Lv2Manager * getLv2Manager()
Definition
Engine.h:85
lmms::Engine::getLADSPAManager
static Ladspa2LMMS * getLADSPAManager()
Definition
Engine.h:91
lmms::Engine::s_framesPerTick
static float s_framesPerTick
Definition
Engine.h:132
lmms::Engine::getSong
static Song * getSong()
Definition
Engine.h:69
lmms::Engine::s_audioEngine
static AudioEngine * s_audioEngine
Definition
Engine.h:135
lmms::Engine::s_lv2Manager
static class Lv2Manager * s_lv2Manager
Definition
Engine.h:142
lmms::Engine::mixer
static Mixer * mixer()
Definition
Engine.h:64
lmms::Engine::s_mixer
static Mixer * s_mixer
Definition
Engine.h:136
lmms::Engine::patternStore
static PatternStore * patternStore()
Definition
Engine.h:74
lmms::Engine::inst
static Engine * inst()
Definition
Engine.h:105
lmms::Engine::projectJournal
static ProjectJournal * projectJournal()
Definition
Engine.h:79
lmms::Engine::s_song
static Song * s_song
Definition
Engine.h:137
lmms::Engine::s_projectJournal
static ProjectJournal * s_projectJournal
Definition
Engine.h:139
lmms::Engine::s_instanceOfMe
static Engine * s_instanceOfMe
Definition
Engine.h:148
lmms::Engine::s_dndPluginKey
static void * s_dndPluginKey
Definition
Engine.h:145
lmms::Engine::s_ladspaManager
static Ladspa2LMMS * s_ladspaManager
Definition
Engine.h:144
lmms::Ladspa2LMMS
Definition
Ladspa2LMMS.h:37
lmms::Lv2Manager
Class to keep track of all LV2 plugins.
Definition
Lv2Manager.h:82
lmms::Mixer
Definition
Mixer.h:139
lmms::PatternStore
Definition
PatternStore.h:65
lmms::ProjectJournal
Definition
ProjectJournal.h:44
lmms::Song
Definition
Song.h:67
lmms::gui::GuiApplication
Definition
GuiApplication.h:50
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
lmms::sample_rate_t
std::uint32_t sample_rate_t
Definition
LmmsTypes.h:42
Generated on
for lmms by
1.18.0