1 //-----------------------------------------------------------------------------
2 // Copyright (c) 2015-2018 Marcelo Fernandez
3 //
4 // Permission is hereby granted, free of charge, to any person obtaining a copy
5 // of this software and associated documentation files (the "Software"), to
6 // deal in the Software without restriction, including without limitation the
7 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 // sell copies of the Software, and to permit persons to whom the Software is
9 // furnished to do so, subject to the following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included in
12 // all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 // IN THE SOFTWARE.
21 //-----------------------------------------------------------------------------
22 
23 #ifndef __OAMLUNITYPLUGIN_H__
24 #define __OAMLUNITYPLUGIN_H__
25 
26 extern "C" {
27 	DLLEXPORT int oamlInit(const char *defsFilename);
28 	DLLEXPORT int oamlReadDefsFile(const char *defsFilename);
29 	DLLEXPORT int oamlInitString(const char *defs);
30 	DLLEXPORT void oamlShutdown();
31 	DLLEXPORT void oamlSetAudioFormat(int freq, int channels, int bytesPerSample);
32 	DLLEXPORT void oamlSetVolume(float vol);
33 	DLLEXPORT float oamlGetVolume();
34 	DLLEXPORT int oamlPlayTrack(const char *name);
35 	DLLEXPORT int oamlPlayTrackWithStringRandom(const char *str);
36 	DLLEXPORT void oamlStopPlaying();
37 	DLLEXPORT void oamlPause();
38 	DLLEXPORT void oamlResume();
39 	DLLEXPORT void oamlPauseToggle();
40 	DLLEXPORT bool oamlIsPaused();
41 	DLLEXPORT bool oamlIsTrackPlaying(const char *name);
42 	DLLEXPORT bool oamlIsPlaying();
43 	DLLEXPORT oamlTracksInfo *oamlGetTracksInfo();
44 	DLLEXPORT void oamlAddTension(int value);
45 	DLLEXPORT void oamlSetMainLoopCondition(int value);
46 	DLLEXPORT void oamlSetCondition(int id, int value);
47 	DLLEXPORT void oamlMixToBuffer(void *buffer, int size);
48 	DLLEXPORT void oamlUpdate();
49 	DLLEXPORT void oamlSetDebugClipping(bool option);
50 	DLLEXPORT void oamlSetWriteAudioAtShutdown(bool option);
51 	DLLEXPORT void oamlEnableDynamicCompressor(bool enable = true, double thresholdDb = -3, double ratio = 4.0);
52 	DLLEXPORT void oamlSetFileCallbacks(oamlFileCallbacks *cbs);
53 	DLLEXPORT const char* oamlGetDefsFile();
54 	DLLEXPORT const char* oamlGetPlayingInfo();
55 }
56 
57 #endif
58