Logo
Sound.h
1#pragma once
2
3#include "Types.h"
4#include "snd/Sound.h"
5#include "Math/Vector3.h"
6
7namespace SharpKmyAudio
8{
9 public ref class Sound
10 {
11 private:
12 int sePlayerId = -1;
13 u32 pausePos = 0;
14 int typeIndex;
15 float pan;
16 float volume;
17 float tempo;
18 bool loop;
19 bool is3D = false;
20 float x;
21 float y;
22 float z;
23
24
25 public:
26 kmySound::WaveSound *obj = NULL;
27 void Release()
28 {
29 obj->unref();
30 obj = NULL;
31 }
32
33 static Sound^ load(System::String ^path);
34
35 bool play();
36 bool play(bool loop, int typeIndex);
37 void stop();
38 void pause();
39 void setLoopInfo(int start, int end);
40 void setPan(float pan);
41 void setVolume(float volume);
42 void setTempo(float tempo);
43 float getPan() { return pan; }
44 float getVolume() { return volume; }
45 float getTempo() { return tempo; }
47 bool isPlaying();
48 bool isAvailable();
49
50 cli::array<s16> ^getWaveform();
51 u32 getSamplingRate() { return (obj == nullptr) ? 0 : obj->getSamplingRate(); }
52 int getChannelCount() { return (obj == nullptr) ? 0 : obj->getChannelCount(); }
53
54 static void initializeSETypeCount(cli::array<int>^ seCounts);
56 static void setDistanceScaleMaxDistance(float distanceOfZeroVolume);
57 };
58}
Definition: Sound.h:10
static Sound load(System::String ^path)
Definition: Sound.cpp:8
void setPan(float pan)
Definition: Sound.cpp:149
void setLoopInfo(int start, int end)
Definition: Sound.cpp:134
static void initializeSETypeCount(cli::array< int >^ seCounts)
Definition: Sound.cpp:207
void stop()
Definition: Sound.cpp:115
static void setListenerMatrix(SharpKmyMath::Matrix4 mtx)
Definition: Sound.cpp:217
u32 getSamplingRate()
Definition: Sound.h:51
float getTempo()
Definition: Sound.h:45
void setVolume(float volume)
Definition: Sound.cpp:155
void Release()
Definition: Sound.h:27
bool isPlaying()
Definition: Sound.cpp:139
float getVolume()
Definition: Sound.h:44
int getChannelCount()
Definition: Sound.h:52
float getPan()
Definition: Sound.h:43
void setTempo(float tempo)
Definition: Sound.cpp:161
bool play()
Definition: Sound.cpp:29
void setPosition(SharpKmyMath::Vector3 ^pos)
Definition: Sound.cpp:167
kmySound::WaveSound * obj
Definition: Sound.h:26
bool isAvailable()
Definition: Sound.cpp:185
void pause()
Definition: Sound.cpp:124
cli::array< s16 > getWaveform()
Definition: Sound.cpp:190
static void setDistanceScaleMaxDistance(float distanceOfZeroVolume)
Definition: Sound.cpp:225
Definition: Matrix4.h:10
Definition: Sound.cpp:5
Definition: Vector3.h:8