the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#pragma once
2
3#include "..\..\..\Minecraft.World\SoundTypes.h"
4
5#ifdef _XBOX
6
7#elif defined (__PS3__)
8#undef __in
9#undef __out
10#include "..\..\PS3\Miles\include\mss.h"
11#elif defined (__PSVITA__)
12#include "..\..\PSVITA\Miles\include\mss.h"
13#elif defined _DURANGO
14// 4J Stu - Temp define to get Miles to link, can likely be removed when we get a new version of Miles
15#define _SEKRIT
16#include "..\..\Durango\Miles\include\mss.h"
17#elif defined _WINDOWS64
18#include "..\..\windows64\Miles\include\mss.h"
19#else // PS4
20// 4J Stu - Temp define to get Miles to link, can likely be removed when we get a new version of Miles
21#define _SEKRIT2
22#include "..\..\Orbis\Miles\include\mss.h"
23#endif
24
25typedef struct
26{
27 float x,y,z;
28}
29AUDIO_VECTOR;
30
31typedef struct
32{
33 bool bValid;
34 AUDIO_VECTOR vPosition;
35 AUDIO_VECTOR vOrientFront;
36}
37AUDIO_LISTENER;
38
39class Options;
40
41class ConsoleSoundEngine
42{
43public:
44
45 ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){};
46 virtual void tick(shared_ptr<Mob> *players, float a) =0;
47 virtual void destroy()=0;
48 virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0;
49 virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0;
50 virtual void playUI(int iSound, float volume, float pitch) =0;
51 virtual void updateMusicVolume(float fVal) =0;
52 virtual void updateSystemMusicPlaying(bool isPlaying) = 0;
53 virtual void updateSoundEffectVolume(float fVal) =0;
54 virtual void init(Options *) =0 ;
55 virtual void add(const wstring& name, File *file) =0;
56 virtual void addMusic(const wstring& name, File *file) =0;
57 virtual void addStreaming(const wstring& name, File *file) =0;
58 virtual char *ConvertSoundPathToName(const wstring& name, bool bConvertSpaces) =0;
59 virtual void playMusicTick() =0;
60
61 virtual bool GetIsPlayingStreamingCDMusic() ;
62 virtual bool GetIsPlayingStreamingGameMusic() ;
63 virtual void SetIsPlayingStreamingCDMusic(bool bVal) ;
64 virtual void SetIsPlayingStreamingGameMusic(bool bVal) ;
65 virtual bool GetIsPlayingEndMusic() ;
66 virtual bool GetIsPlayingNetherMusic() ;
67 virtual void SetIsPlayingEndMusic(bool bVal) ;
68 virtual void SetIsPlayingNetherMusic(bool bVal) ;
69 static const WCHAR *wchSoundNames[eSoundType_MAX];
70 static const WCHAR *wchUISoundNames[eSFX_MAX];
71
72public:
73 void tick();
74 void schedule(int iSound, float x, float y, float z, float volume, float pitch, int delayTicks);
75
76private:
77 class ScheduledSound
78 {
79 public:
80 int iSound;
81 float x, y, z;
82 float volume, pitch;
83 int delay;
84
85 public:
86 ScheduledSound(int iSound, float x, float y, float z, float volume, float pitch, int delay);
87 };
88
89 vector<ScheduledSound *> scheduledSounds;
90
91private:
92 // platform specific functions
93
94 virtual int initAudioHardware(int iMinSpeakers)=0;
95
96 bool m_bIsPlayingStreamingCDMusic;
97 bool m_bIsPlayingStreamingGameMusic;
98 bool m_bIsPlayingEndMusic;
99 bool m_bIsPlayingNetherMusic;
100};