Panda3D
 All Classes Functions Variables Enumerations
config_movies.cxx
1 // Filename: config_movies.cxx
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 #include "config_movies.h"
16 #include "dconfig.h"
17 #include "inkblotVideo.h"
18 #include "inkblotVideoCursor.h"
19 #include "microphoneAudio.h"
20 #include "movieAudio.h"
21 #include "movieAudioCursor.h"
22 #include "movieTypeRegistry.h"
23 #include "movieVideo.h"
24 #include "movieVideoCursor.h"
25 #include "userDataAudio.h"
26 #include "userDataAudioCursor.h"
27 #include "vorbisAudio.h"
28 #include "vorbisAudioCursor.h"
29 #include "wavAudio.h"
30 #include "wavAudioCursor.h"
31 
32 ConfigureDef(config_movies);
33 NotifyCategoryDef(movies, "");
34 
35 ConfigureFn(config_movies) {
36  init_libmovies();
37 }
38 
39 ConfigVariableList load_audio_type
40 ("load-audio-type",
41  PRC_DESC("List the audio loader modules that Panda will automatically "
42  "import when a new, unknown audio type is loaded. This may be "
43  "either the name of a module, or a space-separate list of filename "
44  "extensions, followed by the name of the module."));
45 
46 ConfigVariableList load_video_type
47 ("load-video-type",
48  PRC_DESC("List the video loader modules that Panda will automatically "
49  "import when a new, unknown video type is loaded. This may be "
50  "either the name of a module, or a space-separate list of filename "
51  "extensions, followed by the name of the module."));
52 
53 ConfigVariableBool vorbis_enable_seek
54 ("vorbis-enable-seek", true,
55  PRC_DESC("Set this to false if you're having trouble with seeking while "
56  "using the Ogg Vorbis decoder."));
57 
58 ConfigVariableBool vorbis_seek_lap
59 ("vorbis-seek-lap", true,
60  PRC_DESC("If this is set to true, the Ogg Vorbis decoder will automatically "
61  "crosslap the transition from the previous playback position into "
62  "the new playback position when seeking in order to eliminate "
63  "clicking and boundary discontinuities."));
64 
65 ////////////////////////////////////////////////////////////////////
66 // Function: init_libmovies
67 // Description: Initializes the library. This must be called at
68 // least once before any of the functions or classes in
69 // this library can be used. Normally it will be
70 // called by the static initializers and need not be
71 // called explicitly, but special cases exist.
72 ////////////////////////////////////////////////////////////////////
73 void
74 init_libmovies() {
75  static bool initialized = false;
76  if (initialized) {
77  return;
78  }
79  initialized = true;
80 
81  InkblotVideo::init_type();
82  InkblotVideoCursor::init_type();
83  MicrophoneAudio::init_type();
84  MovieAudio::init_type();
85  MovieAudioCursor::init_type();
86  MovieVideo::init_type();
87  MovieVideoCursor::init_type();
88  UserDataAudio::init_type();
89  UserDataAudioCursor::init_type();
90  WavAudio::init_type();
91  WavAudioCursor::init_type();
92 
93 #ifdef HAVE_VORBIS
94  VorbisAudio::init_type();
95  VorbisAudioCursor::init_type();
96 #endif
97 
99  reg->register_audio_type(&WavAudio::make, "wav wave");
100 
101 #ifdef HAVE_VORBIS
102  reg->register_audio_type(&VorbisAudio::make, "ogg oga");
103 #endif
104 }
void register_audio_type(MakeAudioFunc func, const string &extensions)
Registers a MovieAudio type, so that files with any of the given extensions will be loaded as this ty...
This is a convenience class to specialize ConfigVariable as a boolean type.
This class records the different types of MovieAudio and MovieVideo that are available for loading...
This class is similar to ConfigVariable, but it reports its value as a list of strings.
static MovieTypeRegistry * get_global_ptr()
Returns a pointer to the global MovieTypeRegistry instance.