Panda3D
movieAudio.h
1 // Filename: movieAudio.h
2 // Created by: jyelon (02Jul07)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef MOVIEAUDIO_H
16 #define MOVIEAUDIO_H
17 
18 #include "pandabase.h"
19 #include "namable.h"
20 #include "pointerTo.h"
21 #include "typedWritableReferenceCount.h"
22 
23 class MovieAudioCursor;
24 
25 #ifdef NOTIFY_DEBUG //[
26  // Non-release build:
27  #define movies_debug(msg) \
28  if (movies_cat.is_debug()) { \
29  movies_cat->debug() << msg << endl; \
30  } else {}
31 #else //][
32  // Release build:
33  #define movies_debug(msg) ((void)0);
34 #endif //]
35 
36 ////////////////////////////////////////////////////////////////////
37 // Class : MovieAudio
38 // Description : A MovieAudio is actually any source that provides
39 // a sequence of audio samples. That could include an
40 // AVI file, a microphone, or an internet TV station.
41 //
42 // The difference between a MovieAudio and a
43 // MovieAudioCursor is like the difference between a
44 // filename and a file handle. The MovieAudio just
45 // indicates a particular movie. The MovieAudioCursor
46 // is what allows access.
47 ////////////////////////////////////////////////////////////////////
48 class EXPCL_PANDA_MOVIES MovieAudio : public TypedWritableReferenceCount, public Namable {
49  PUBLISHED:
50  MovieAudio(const string &name = "Blank Audio");
51  virtual ~MovieAudio();
52  virtual PT(MovieAudioCursor) open();
53  static PT(MovieAudio) get(const Filename &name);
54 
55  INLINE const Filename &get_filename() const;
56 
57  protected:
58  Filename _filename;
59 
60  public:
61  static TypeHandle get_class_type() {
62  return _type_handle;
63  }
64  static void init_type() {
65  TypedWritableReferenceCount::init_type();
66  register_type(_type_handle, "MovieAudio",
67  TypedWritableReferenceCount::get_class_type());
68  }
69  virtual TypeHandle get_type() const {
70  return get_class_type();
71  }
72  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
73 
74  private:
75  static TypeHandle _type_handle;
76 };
77 
78 #include "movieAudio.I"
79 
80 #endif
A base class for all things which can have a name.
Definition: namable.h:29
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
A MovieAudio is actually any source that provides a sequence of audio samples.
A base class for things which need to inherit from both TypedWritable and from ReferenceCount.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition: movieAudio.h:48