WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. Source
  4. Sound.h
Mission NodeSDK 6.2C++sound.h

Sound.h

SDK Source File: Sound.h

Source / SDK 6.2 / C++ / Core

Sound.h

Sound.h
CPP
1/* Copyright Statement:
2 *
3 * (C) 2021-2024 Cubios Inc. All rights reserved.
4 */
5
6#ifndef WASMLIBS_CPP_SOUND_H_
7#define WASMLIBS_CPP_SOUND_H_
8
9#include <string>
10#include <vector>
11#include "native.h"
12#include "Object.h"
13
14namespace Cubios
15{
16class Sound: public Object
17{
18 public:
19 explicit Sound(const std::string& name);
20 ~Sound();
21 void Play(uint8_t volume = 100);
22
23 static void Stop();
24 static bool IsPlaying();
25
26 private:
27 soundID_t id;
28};
29
30class SoundCollection
31{
32 public:
33 SoundCollection(std::vector<std::string>& names);
34 SoundCollection(std::vector<Cubios::Sound*>& sounds);
35
36 virtual ~SoundCollection();
37
38 bool PlayRandomSound(uint8_t volume = 100, bool stopCurrent = true);
39 bool RepeatRandomSounds(uint8_t volume, int delayMin, int delayMax, int deltaTime);
40
41 void Stop();
42 bool IsPlaying();
43
44 private:
45 std::vector<Cubios::Sound*> sounds;
46 size_t numSounds;
47 bool external;
48 int16_t delay;
49 Cubios::Sound* currentSound;
50};
51
52}
53#endif // WASMLIBS_CPP_SOUND_H_
54
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.
Context Rail

Related nodes

AppManager.cpp
Source / SDK 6.2 / C++ / Core
AppManager.h
Source / SDK 6.2 / C++ / Core
Gfx.h
Source / SDK 6.2 / C++ / Core
native access.h
Source / SDK 6.2 / C++ / Core
Previous Node
Sound.cpp
Source / SDK 6.2 / C++ / Core
Next Node
Splashscreen.cpp
Source / SDK 6.2 / C++ / Core