1 # -*- coding: ISO-8859-1 -*-
2 #===============================================================================
3 # VLC Player Plugin by A. Lätsch 2007
4 # modified by Volker Christian 2008
6 # This is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2, or (at your option) any later
10 #===============================================================================
13 from Plugins.Plugin import PluginDescriptor
15 from VlcServerList import VlcServerListScreen
16 from VlcMediaList import VlcMediaListScreen
17 from VlcServerConfig import vlcServerConfig
22 t = gettext.dgettext("VlcPlayer", txt)
24 print "[VLC] fallback to default translation for", txt
25 t = gettext.gettext(txt)
30 def __init__(self, session):
31 print "[VLC] VlcManager"
32 self.session = session
34 def startSession(self):
35 defaultServer = vlcServerConfig.getDefaultServer()
36 if defaultServer is None:
39 self.openMedialist(defaultServer)
41 def openServerlist(self):
42 print "[VLC] openServerlist"
43 defaultServer = vlcServerConfig.getDefaultServer()
44 self.session.openWithCallback(self.serverlistClosed, VlcServerListScreen, defaultServer)
46 def serverlistClosed(self, selectedServer, defaultServer):
47 vlcServerConfig.setAsDefault(defaultServer)
48 self.openMedialist(selectedServer)
50 def openMedialist(self, selectedServer):
51 print "[VLC] openMedialist"
52 if selectedServer is not None:
53 self.session.openWithCallback(self.medialistClosed, VlcMediaListScreen, selectedServer).keyUpdate()
55 def medialistClosed(self, proceed = False):
56 print "[VLC] medialistClosed"
61 def main(session, **kwargs):
62 __VlcManager(session).startSession()
65 def Plugins(**kwargs):
66 return PluginDescriptor(
67 name="VLC Video Player",
68 description=_("A video streaming solution based on VLC"),
69 where = [ PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_PLUGINMENU ],
70 icon = "plugin.png", fnc = main)