Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MusicDirector.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: MusicDirector.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Music Director class to manage selection, setup, and playback
13  of background music tracks for both menu and game modes
14 */
15 
16 
17 #ifndef MusicDirector_h
18 #define MusicDirector_h
19 
20 #include "Types.h"
21 #include "List.h"
22 #include "Text.h"
23 
24 // +-------------------------------------------------------------------+
25 
26 class MusicTrack;
27 
28 // +-------------------------------------------------------------------+
29 
31 {
32 public:
33  enum MODES {
35 
36  // menu modes:
37 
46 
47  // in game modes:
48 
53 
54  // special modes:
56  };
57 
58  enum TRANSITIONS {
59  CUT,
64  };
65 
66  MusicDirector();
68 
69  // Operations:
70  void ExecFrame();
71  void ScanTracks();
72 
73  int CheckMode(int mode);
74  int GetMode() const { return mode; }
75 
76  static void Initialize();
77  static void Close();
78  static MusicDirector* GetInstance();
79  static void SetMode(int mode);
80  static const char* GetModeName(int mode);
81  static bool IsNoMusic();
82 
83 protected:
84  void StartThread();
85  void StopThread();
86  void GetNextTrack(int index);
87  void ShuffleTracks();
88 
89  int mode;
91 
94 
107 
108  bool no_music;
109 
110  HANDLE hproc;
112 };
113 
114 #endif MusicDirector_h