Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MusicTrack.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: MusicTrack.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  MusicTrack class
13 */
14 
15 
16 #ifndef MusicTrack_h
17 #define MusicTrack_h
18 
19 #include "Types.h"
20 #include "List.h"
21 #include "Text.h"
22 
23 // +-------------------------------------------------------------------+
24 
25 class Sound;
26 
27 // +-------------------------------------------------------------------+
28 
30 {
31 public:
33 
34  MusicTrack(const Text& name, int mode=0, int index=0);
35  virtual ~MusicTrack();
36 
37  // Operations:
38  virtual void ExecFrame();
39 
40  virtual void Play();
41  virtual void Stop();
42  virtual void FadeIn();
43  virtual void FadeOut();
44 
45  // accessors / mutators
46  const Text& Name() const { return name; }
47  Sound* GetSound() const { return sound; }
48  int GetState() const { return state; }
49  int GetMode() const { return mode; }
50  int GetIndex() const { return index; }
51 
52  int IsReady() const;
53  int IsPlaying() const;
54  int IsDone() const;
55  int IsLooped() const;
56 
57  virtual long GetVolume() const;
58  virtual void SetVolume(long v);
59 
60  virtual double GetTotalTime() const;
61  virtual double GetTimeRemaining() const;
62  virtual double GetTimeElapsed() const;
63 
64  virtual double GetFadeTime() const { return fade_time; }
65  virtual void SetFadeTime(double t) { fade_time = t; }
66 
67 protected:
70  int state;
71  int mode;
72  int index;
73  double fade;
74  double fade_time;
75 };
76 
77 #endif MusicTrack_h