1 |
schoenebeck |
2889 |
/* |
2 |
|
|
* Copyright (c) 2016 Christian Schoenebeck |
3 |
|
|
* |
4 |
|
|
* http://www.linuxsampler.org |
5 |
|
|
* |
6 |
|
|
* This file is part of LinuxSampler and released under the same terms. |
7 |
|
|
* See README file for details. |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include "ScriptVMFactory.h" |
11 |
|
|
#include <algorithm> |
12 |
|
|
#include "../engines/common/InstrumentScriptVM.h" |
13 |
|
|
#include "../engines/gig/InstrumentScriptVM.h" |
14 |
|
|
|
15 |
|
|
namespace LinuxSampler { |
16 |
|
|
|
17 |
|
|
ScriptVM* ScriptVMFactory::Create(String EngineName) { |
18 |
|
|
std::transform(EngineName.begin(), EngineName.end(), EngineName.begin(), ::tolower); |
19 |
|
|
if (EngineName == "core") |
20 |
|
|
return new ScriptVM; |
21 |
|
|
else if (EngineName == "gig") |
22 |
|
|
return new gig::InstrumentScriptVM; |
23 |
|
|
else if (EngineName == "sf2") |
24 |
|
|
return new InstrumentScriptVM; |
25 |
|
|
else if (EngineName == "sfz") |
26 |
|
|
return new InstrumentScriptVM; |
27 |
|
|
else |
28 |
|
|
return NULL; |
29 |
|
|
} |
30 |
|
|
|
31 |
|
|
std::vector<String> ScriptVMFactory::AvailableEngines() { |
32 |
|
|
std::vector<String> v; |
33 |
|
|
v.push_back("core"); |
34 |
|
|
v.push_back("gig"); |
35 |
|
|
v.push_back("sf2"); |
36 |
|
|
v.push_back("sfz"); |
37 |
|
|
return v; |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
} // namespace LinuxSampler |