#encoding: utf-8
#Copyright 2009 - 2010 Paul Hänsch
-#This file is part of Viper.
-
-#Viper is free software: you can redistribute it and/or modify
-#it under the terms of the GNU General Public License as published by
-#the Free Software Foundation, either version 3 of the License, or
-#(at your option) any later version.
-
-#Viper is distributed in the hope that it will be useful,
-#but WITHOUT ANY WARRANTY; without even the implied warranty of
-#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#GNU General Public License for more details.
-
-#You should have received a copy of the GNU General Public License
-#along with Viper. If not, see <http://www.gnu.org/licenses/>
+# This file is part of Viper.
+#
+# Viper is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Viper is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Viper. If not, see <http://www.gnu.org/licenses/>
from Tkinter import *
from player import *
self.subgets['main_ctl'].params = params
def prev_apply(self):
+ """
+ Put video from preview to main display
+ """
self.subgets['ext_player'].stop_video()
self.after(100, self.subgets['ext_ctl'].play)
def c_ext_fullscreen(self):
+ """
+ Toggle fullscreen mode of main displaye
+ """
if self.ext_fullscreen.get():
#self.subgets['view'].overrideredirect(1)
self.subgets['ext_view'].geometry(
self.subgets['prev_player'].stop_video()
def b_ext_display(self):
+ """
+ Button handler. Move External video window to X11 display given in entry box.
+ """
try:
Tk(screenName=self.subgets['e_display'].get()).destroy()
print self.subgets['e_display'].get()
self.subgets['e_display'].configure(bg='#FF4444')
def detach_view(self):
+ """
+ Spawn a detached video display, replacing the display area with a preview tab
+ and a control tab. A currently playing video continues to run as preview.
+ """
self.subgets['main_ctl'].forget()
self.subgets['prev_surf'].forget()
self.subgets['ext_view'] = Tk()
self.subgets['ext_view'].title('Viper Display')
self.subgets['ext_view'].config(width = 320, height = 240, bg = '#000000')
- self.subgets['ext_view'].protocol('WM_DELETE_WINDOW', self.attach_view)
+ self.subgets['ext_view'].protocol('WM_DELETE_WINDOW', self.attach_view) #Callback to attach_view when window is closed
self.subgets['ext_player'].configure(surface = self.subgets['ext_view'])
self.subgets['prev_surf'].pack(in_ = self.subgets['preview'],
self.attached_view = False
def attach_view(self):
+ """
+ Reembed detached view into the main interface, stopping the playing video.
+ """
self.subgets['ext_player'].stop_video()
self.subgets['prev_player'].stop_video()
self.subgets['ext_view'].destroy()
fill = BOTH, expand = True)
self.subgets['main_ctl'].pack(side = BOTTOM, anchor = W, fill = X)
self.subgets['main_ctl'].configure(self.subgets['prev_player'])
+ self.subgets['main_ctl'].status('stopped')
self.attached_view = True