Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ambulantglue.py
blob: 476f4e310f3c3c2cdba7c9212ffdbddbdb0b9dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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)