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