Panda3D
nullAudioSound.h
1 // Filename: nullAudioSound.h
2 // Created by: skyler (June 6, 2001)
3 // Prior system by: cary
4 //
5 ////////////////////////////////////////////////////////////////////
6 //
7 // PANDA 3D SOFTWARE
8 // Copyright (c) Carnegie Mellon University. All rights reserved.
9 //
10 // All use of this software is subject to the terms of the revised BSD
11 // license. You should have received a copy of this license along
12 // with this source code in a file named "LICENSE."
13 //
14 ////////////////////////////////////////////////////////////////////
15 
16 #ifndef __NULL_AUDIO_SOUND_H__
17 #define __NULL_AUDIO_SOUND_H__
18 
19 #include "audioSound.h"
20 
21 
22 // This class intentionally does next to nothing.
23 // It's used as a placeholder when you don't want a sound
24 // system.
25 class EXPCL_PANDA_AUDIO NullAudioSound : public AudioSound {
26  // All of these methods are stubbed out to some degree.
27  // If you're looking for a starting place for a new AudioManager,
28  // please consider looking at the milesAudioManager.
29 
30 public:
31  ~NullAudioSound();
32 
33  void play();
34  void stop();
35 
36  void set_loop(bool);
37  bool get_loop() const;
38 
39  void set_loop_count(unsigned long);
40  unsigned long get_loop_count() const;
41 
42  void set_time(PN_stdfloat);
43  PN_stdfloat get_time() const;
44 
45  void set_volume(PN_stdfloat);
46  PN_stdfloat get_volume() const;
47 
48  void set_balance(PN_stdfloat);
49  PN_stdfloat get_balance() const;
50 
51  void set_play_rate(PN_stdfloat);
52  PN_stdfloat get_play_rate() const;
53 
54  void set_active(bool);
55  bool get_active() const;
56 
57  void set_finished_event(const string& event);
58  const string& get_finished_event() const;
59 
60  const string& get_name() const;
61 
62  PN_stdfloat length() const;
63 
64  void set_3d_attributes(PN_stdfloat px, PN_stdfloat py, PN_stdfloat pz, PN_stdfloat vx, PN_stdfloat vy, PN_stdfloat vz);
65  void get_3d_attributes(PN_stdfloat *px, PN_stdfloat *py, PN_stdfloat *pz, PN_stdfloat *vx, PN_stdfloat *vy, PN_stdfloat *vz);
66  void set_3d_min_distance(PN_stdfloat dist);
67  PN_stdfloat get_3d_min_distance() const;
68  void set_3d_max_distance(PN_stdfloat dist);
69  PN_stdfloat get_3d_max_distance() const;
70 
71  AudioSound::SoundStatus status() const;
72 
73 // why protect the constructor?!?
74 //protected:
76 
77 public:
78  static TypeHandle get_class_type() {
79  return _type_handle;
80  }
81  static void init_type() {
82  AudioSound::init_type();
83  register_type(_type_handle, "NullAudioSound",
84  AudioSound::get_class_type());
85  }
86  virtual TypeHandle get_type() const {
87  return get_class_type();
88  }
89  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
90 
91 private:
92  static TypeHandle _type_handle;
93 
94  friend class NullAudioManager;
95 };
96 
97 #endif /* __NULL_AUDIO_SOUND_H__ */
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85