diff --git a/LICENSE.md b/LICENSE.md index 4cc035f32ac31e38f5e92502a96494ccd5a95a35..d601e5a1ac9242c6211517fb1871360f880ffba0 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,3 +1,13 @@ Copyright 2015-2016 Institute of Technical Acoustics, RWTH Aachen University -Any usage and distribution is prohibited, unless explicitly granted by the authors. \ No newline at end of file +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use files of this project except in compliance with the License. +You may obtain a copy of the License at + + + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index b877e9be2d9595de06ed474f8ec1b6c7e7557a73..0f47459115b5ad34e1cf8b9150dd3631d0710de5 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,15 @@ VAMatlab is a binding to the VA interface for Matlab. It uses the VA network connection to forward commands and receive information to a VA server, usually the VAServer application. + ### License -Copyright 2015-2016 Institute of Technical Acoustics, RWTH Aachen University +See [LICENSE](LICENSE.md) file. -Any usage and distribution is prohibited, unless explicitly granted by the authors. ### Quick build guide + #### Matlab executable Open Matlab and run the script `VAMatlabExecutable_build.m`. @@ -18,12 +19,14 @@ There is a switch that can link the VACore into the Matlab executable, hence no To activate this, the preprocessor flag `VAMATLAB_WITH_LOCAL_CORE` has to be defined and set to 1. Use the switch in the build script configuration section. To also include a lightweight Optitrack tracker connection using the NatNetSDK, define the preprocessor flag `VAMATLAB_WITH_OPTITRACK` and set it to 1. Use the switch in the build script configuration section. + #### itaVA class To ease usage, a facade class called `itaVA` can be generated that will also add volatile help on the available functionality of VA. To create this Matlab class, run `itaVA_build.m`, which will create a class file `itaVA.m` based on stubs that are filled by calls to the VAMatlab executable, which has to be build prior. > Make sure that Matlab will use the correct VA Matlab executable and not an older version of it which might have been added to the PATH of Matlab. + #### Deploy Deploying the Matlab executable will require to copy all necessary DLLs into a deploy directory (next to the VAMatlab executable file). diff --git a/src/VAMatlabExecutable.cpp b/src/VAMatlabExecutable.cpp index 1ddde0eb40a1985cc26e8a0e3da96c1331c100b1..ddb65c923581716be491f820bb1b9a89ed9d8d2b 100644 --- a/src/VAMatlabExecutable.cpp +++ b/src/VAMatlabExecutable.cpp @@ -3115,7 +3115,7 @@ void setReproductionModuleGain( int nlhs, mxArray *plhs[], int nrhs, const mxArr CVAMatlabConnection* pConnection = g_vpConnections[hHandle]; std::string sID = matlabGetString( prhs[1], "sModuleID" ); - double dGain = matlabGetIntegerScalar( prhs[2], "dGain" ); + double dGain = matlabGetRealScalar( prhs[2], "dGain" ); pConnection->pCoreInterface->SetReproductionModuleGain( sID, dGain ); } @@ -3187,7 +3187,7 @@ void setRenderingModuleGain( int nlhs, mxArray *plhs[], int nrhs, const mxArray CVAMatlabConnection* pConnection = g_vpConnections[hHandle]; std::string sID = matlabGetString( prhs[1], "sModuleID" ); - double dGain = matlabGetIntegerScalar( prhs[2], "dGain" ); + double dGain = matlabGetRealScalar( prhs[2], "dGain" ); pConnection->pCoreInterface->SetRenderingModuleGain( sID, dGain ); } @@ -3255,19 +3255,27 @@ void getRenderingModuleGain( int nlhs, mxArray *plhs[], int nrhs, const mxArray #ifdef WIN32 // Wächter, der automatisch das Kernel-Handle freigibt, wenn die DLL entladen wird -class HandleGuard { +class HandleGuard +{ public: HANDLE hHandle; - HandleGuard() : hHandle(0) {} - ~HandleGuard() { Reset(); } + inline HandleGuard() + : hHandle( 0 ) {}; + + inline ~HandleGuard() + { + Reset(); + }; - void Reset() { - if (hHandle != 0) { - CloseHandle(hHandle); + inline void Reset() + { + if( hHandle != 0 ) + { + CloseHandle( hHandle ); hHandle = 0; } - } + }; }; static HandleGuard g_oTimerHandle;