Blame view

ios/Runner/Wowgame/Classes/game_toy/ToySoundsRepo.h 2.15 KB
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
  //
  //  ToySoundsRepo.h
  //  WattsenglishToyApp
  //
  //  Created by Katarzyna Kalinowska-Górska on 26/11/2019.
  //
  
  #ifndef ToySoundsRepo_h
  #define ToySoundsRepo_h
  
  #include <map>
  #include "audio/include/AudioEngine.h"
  
  class ToySoundsRepo {
  
  public:
      
      static std::string soundsFolder;
      static std::string musicBgFilePath;
      static std::map<std::string, float> soundDurations;
      
      static int currentMusicSoundId;
      
      struct SoundInfo {
          SoundInfo(std::string fp, float sd){
              filePath = fp;
              soundDuration = sd;
          };
          std::string filePath;
          float soundDuration;
      };
      
      static SoundInfo introSound();
      static SoundInfo hooraySound();
      static SoundInfo oopsSound();
      static SoundInfo pureOopsSound();
      static SoundInfo noSound();
      static SoundInfo pickLevelSound();
      static SoundInfo changeLevelSound();
      static SoundInfo gameFinishedSound();
      static SoundInfo scoreSound();
      static SoundInfo gameLostSound();
      static SoundInfo gameTNCIntroSound();
      static SoundInfo gameLetsStartIntroSound();
      static SoundInfo typeRequestSound(int game, int itemType);
      static SoundInfo typeConfirmSound(int game, int itemType);
      static SoundInfo typeWrongSound(int game, int itemType);
      static SoundInfo wrongItemEffectSound();
      static SoundInfo rightItemEffectSound();
      static SoundInfo hurryUpSound();
      static SoundInfo tooSlowSound();
      static SoundInfo wrongThreeTimesSound();
      
      static int playSound(const std::string soundFilepath, bool stopOtherEffects = true);
      static int playMusic(const std::string musicFilepath);
      static void stopAllSounds();
      static void stopSoundById(int audioId);
      static void stopMusic();
      static void pauseAllSounds();
      static void resumeAllSounds();
      static float soundDuration(const std::string soundFilepath);
      static void preloadSoundEffect(std::string soundPath);
      static void preloadAllLoadedSoundEffects();
      
      static void loadSoundsList();
      static void parseSoundInfoFile(std::string soundFolderPath, std::string filePath, std::map<std::string, float>& mapToFill);
  };
      
  #endif /* ToySoundsRepo_h */