diff options
author | Tony Anderson <tony_anderson@usa.net> | 2009-08-11 06:39:32 (GMT) |
---|---|---|
committer | Tony Anderson <tony_anderson@usa.net> | 2009-08-11 06:39:32 (GMT) |
commit | a9c66189f458d883bb940f11d744d00d0aa89683 (patch) | |
tree | 4968d84f8888208503a4fcb64e1d438afd87eb84 /ambulantglue.py |
Initial commit
Diffstat (limited to 'ambulantglue.py')
-rwxr-xr-x | ambulantglue.py | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/ambulantglue.py b/ambulantglue.py new file mode 100755 index 0000000..476f4e3 --- /dev/null +++ b/ambulantglue.py @@ -0,0 +1,74 @@ +import ambulant +import gobject + +class jaja: + pass + +class Glue(ambulant.gui_player, ambulant.factories): + + def __init__(self, filename, widget): + ambulant.gui_player.__init__(self) + self.widget = widget + print 'init factories' + + # + # Initialize the gui_player infrastructure + # + self.init_factories() + # XXX The init_*_factory methods should have been called + # by init_factories, but they aren't??? + self.init_window_factory() + self.init_playable_factory() + self.init_datasource_factory() + self.init_parser_factory() + self.init_plugins() + + # + # Parse the document, create and initialize the player + # + print 'parse the document' + self.document = ambulant.create_from_file(self, filename) + print 'doc' + player = ambulant.create_smil2_player(self.document, self, None) + print 'initialize player', type(player) + player.initialize() + print 'set_player' + self.set_player(player) + print 'initialization done' + + def gtkwidget_to_ambulant(self, widget): + """Nothing necessary to do here""" + return widget + + # + # Initialization methods - create the various factories + # + + def init_window_factory(self): + gwa = self.gtkwidget_to_ambulant(self.widget) + wf = ambulant.create_gtk_window_factory_unsafe(gwa, self) + self.set_window_factory(wf) + + def init_playable_factory(self): + gpf = ambulant.get_global_playable_factory() + gpf.add_factory(ambulant.create_gtk_renderer_factory(self)) + gpf.add_factory(ambulant.create_gtk_video_factory(self)) + #gpf.add_factory(ambulant.create_gstreamer_renderer_factory(self)) + #gpf.add_factory(ambulant.create_arts_renderer_factory(self)) + gpf.add_factory(ambulant.create_sdl_playable_factory(self)) + self.set_playable_factory(gpf) + + def init_datasource_factory(self): + gdf = ambulant.datasource_factory() + #gdf.add_raw_factory(ambulant.create_posix_datasource_factory()) + gdf.add_raw_factory(ambulant.get_ffmpeg_raw_datasource_factory()) + gdf.add_video_factory(ambulant.get_ffmpeg_video_datasource_factory()) + gdf.add_audio_factory(ambulant.get_ffmpeg_audio_datasource_factory()) + #gdf.add_audio_parser_finder(get_ffmpeg_audio_parser_finder()) + gdf.add_audio_filter_finder(ambulant.get_ffmpeg_audio_filter_finder()) + self.set_datasource_factory(gdf) + + def init_parser_factory(self): + pf = ambulant.get_parser_factory() + self.set_parser_factory(pf) + |