/[svn]/linuxsampler/trunk/src/engines/common/InstrumentScriptVMDynVars.cpp
ViewVC logotype

Contents of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMDynVars.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2948 - (show annotations) (download)
Fri Jul 15 15:29:04 2016 UTC (7 years, 8 months ago) by schoenebeck
File size: 1205 byte(s)
* NKSP: Implemented built-in script function "stop_wait()".
* NKSP: Implemented built-in script variable "$NI_CALLBACK_ID".
* NKSP: Implemented built-in script variable "$NI_CALLBACK_TYPE".
* NKSP: Implemented built-in script variable "$NKSP_IGNORE_WAIT".
* NKSP: Added support for read-only built-in variables
  (respectively handled by the script parser).
* NKSP: Added built-in script constant "$NI_CB_TYPE_INIT".
* NKSP: Added built-in script constant "$NI_CB_TYPE_NOTE".
* NKSP: Added built-in script constant "$NI_CB_TYPE_RELEASE".
* NKSP: Added built-in script constant "$NI_CB_TYPE_CONTROLLER".
* Bumped version (2.0.0.svn17).

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 "InstrumentScriptVMFunctions.h"
11 #include "InstrumentScriptVMDynVars.h"
12 #include "InstrumentScriptVM.h"
13 #include "../AbstractEngineChannel.h"
14
15 namespace LinuxSampler {
16
17 int InstrumentScriptVMDynVar_ENGINE_UPTIME::evalInt() {
18
19 AbstractEngineChannel* pEngineChannel =
20 static_cast<AbstractEngineChannel*>(m_vm->m_event->cause.pEngineChannel);
21
22 AbstractEngine* pEngine =
23 static_cast<AbstractEngine*>(pEngineChannel->GetEngine());
24
25 // engine's official playback time in milliseconds (offline bounce safe)
26 return int( double(pEngine->FrameTime + m_vm->m_event->cause.FragmentPos()) /
27 double(pEngine->SampleRate) * 1000.0 );
28 }
29
30 int InstrumentScriptVMDynVar_NI_CALLBACK_ID::evalInt() {
31
32 AbstractEngineChannel* pEngineChannel =
33 static_cast<AbstractEngineChannel*>(m_vm->m_event->cause.pEngineChannel);
34
35 return pEngineChannel->GetScriptCallbackID(m_vm->m_event);
36 }
37
38 } // namespace LinuxSampler

  ViewVC Help
Powered by ViewVC