/[svn]/linuxsampler/trunk/src/scriptvm/ScriptVMFactory.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/scriptvm/ScriptVMFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2889 - (show annotations) (download)
Mon Apr 25 17:28:23 2016 UTC (7 years, 11 months ago) by schoenebeck
File size: 1059 byte(s)
* Added new C++ API class "ScriptVMFactory".
* Instrument Scripts: extended parser issues to provide not only first
  line and first column, but also last line and last column of issue
  (thus marking the precise span of the issue within the source code).
* Bumped version (2.0.0.svn7).

1 /*
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

  ViewVC Help
Powered by ViewVC