Panda3D
movieTypeRegistry.h
1 // Filename: movieTypeRegistry.h
2 // Created by: rdb (24Aug13)
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 MOVIETYPEREGISTRY_H
16 #define MOVIETYPEREGISTRY_H
17 
18 #include "pandabase.h"
19 #include "movieAudio.h"
20 #include "movieVideo.h"
21 #include "filename.h"
22 #include "pmap.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : MovieTypeRegistry
26 // Description : This class records the different types of MovieAudio
27 // and MovieVideo that are available for loading.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_MOVIES MovieTypeRegistry {
30 public:
31  typedef PT(MovieAudio) (*MakeAudioFunc)(const Filename&);
32  PT(MovieAudio) make_audio(const Filename &name);
33  void register_audio_type(MakeAudioFunc func, const string &extensions);
34  void load_audio_types();
35 
36  typedef PT(MovieVideo) (*MakeVideoFunc)(const Filename&);
37  PT(MovieVideo) make_video(const Filename &name);
38  void register_video_type(MakeVideoFunc func, const string &extensions);
39  void load_video_types();
40 
41  void load_movie_library(const string &name);
42 
43  INLINE static MovieTypeRegistry *get_global_ptr();
44 
45 private:
46  static MovieTypeRegistry *_global_ptr;
47 
48  pmap<string, MakeAudioFunc> _audio_type_registry;
49  pmap<string, string> _deferred_audio_types;
50 
51  pmap<string, MakeVideoFunc> _video_type_registry;
52  pmap<string, string> _deferred_video_types;
53 };
54 
55 #include "movieTypeRegistry.I"
56 
57 #endif
This class records the different types of MovieAudio and MovieVideo that are available for loading...
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
A MovieVideo is actually any source that provides a sequence of video frames.
Definition: movieVideo.h:42
A MovieAudio is actually any source that provides a sequence of audio samples.
Definition: movieAudio.h:48