[xiph-commits] r15080 - trunk/subtle
jmesquita at svn.xiph.org
jmesquita at svn.xiph.org
Fri Jun 27 20:25:29 PDT 2008
Author: jmesquita
Date: 2008-06-27 20:25:28 -0700 (Fri, 27 Jun 2008)
New Revision: 15080
Modified:
trunk/subtle/Subtle.py
trunk/subtle/subtle.glade
Log:
* We are now able to jump a few seconds up or down on a video being played
* A new GUI change was made to be able to select how many seconds
Modified: trunk/subtle/Subtle.py
===================================================================
--- trunk/subtle/Subtle.py 2008-06-28 01:09:58 UTC (rev 15079)
+++ trunk/subtle/Subtle.py 2008-06-28 03:25:28 UTC (rev 15080)
@@ -84,10 +84,10 @@
"on_main_file_open_activate": self.mainFileOpen, \
"on_TOOL_PLAY_clicked": self.playerPlay,\
"on_TOOL_STOP_clicked": self.playerStop,\
+ "on_TOOL_SM_clicked": self.playerSlowMotion,\
+ "on_TOOL_FF_clicked":self.playerFastForward,\
"on_TOOL_SEEK_FORWARD_clicked": self.playerSeekForward,\
"on_TOOL_SEEK_REWIND_clicked": self.playerSeekRewind,\
- "on_TOOL_SM_clicked": self.playerSlowMotion,\
- "on_TOOL_FF_clicked":self.playerFastForward,\
"on_TOOL_HIDE_STREAMS_clicked": self.cb_hideStreamsPane,\
"on_TOOL_HIDE_SUBLIST_clicked": self.cb_hideSubPane,\
"on_MEDIA_ADJUSTMENT_button_press_event": self.buttonPressAdjustment,\
@@ -189,6 +189,7 @@
self.subtitle_pane = self.wTree.get_widget("subtitle_pane")
self.txt_subedit = self.wTree.get_widget("txt_subedit")
self.tgl_mode = self.wTree.get_widget("tgl_mode")
+ self.spin_seek_value = self.wTree.get_widget("spin_seek_value")
self.subList = SUBLIST
#self.windowMainWindow.maximize()
return
@@ -766,18 +767,26 @@
def playerSeekForward(self, widget):
"""
- Jump some time beyond current position
+ Jump some time or frames (depends on the subtitle format
+ we are using) beyond current position
"""
- #TODO: Implement it
- pass
+ # TODO: Here we have to add support for more subtitle formats
+ cur_position = self.player.query_position()[0]
+ next_position = cur_position + ( self.spin_seek_value.get_value_as_int()*1000000000 )
+ self.player.seek(next_position)
+ return
def playerSeekRewind(self, widget):
"""
- Jump back some time
+ Jump back some time or frames (depends on the subtitle format
+ we are using)
"""
- #TODO: Implement it
- pass
+ # TODO: Here we have to add support for more subtitle formats
+ cur_position = self.player.query_position()[0]
+ next_position = cur_position - ( self.spin_seek_value.get_value_as_int()*1000000000 )
+ self.player.seek(next_position)
+ return
def mainFileOpen(self, widget):
Modified: trunk/subtle/subtle.glade
===================================================================
--- trunk/subtle/subtle.glade 2008-06-28 01:09:58 UTC (rev 15079)
+++ trunk/subtle/subtle.glade 2008-06-28 03:25:28 UTC (rev 15080)
@@ -261,8 +261,8 @@
<property name="use_underline">True</property>
<property name="stock_id">gtk-go-down</property>
<signal name="clicked" handler="on_TOOL_IN_SUB_clicked"/>
+ <accelerator key="C" modifiers="GDK_MOD1_MASK" signal="clicked"/>
<accelerator key="c" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="C" modifiers="GDK_MOD1_MASK" signal="clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -275,8 +275,8 @@
<property name="use_underline">True</property>
<property name="stock_id">gtk-go-up</property>
<signal name="clicked" handler="on_TOOL_OUT_SUB_clicked"/>
+ <accelerator key="v" modifiers="GDK_MOD1_MASK" signal="clicked"/>
<accelerator key="V" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="v" modifiers="GDK_MOD1_MASK" signal="clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -384,86 +384,124 @@
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<child>
- <widget class="GtkToolbar" id="VIDEO_TOOLS">
+ <widget class="GtkHBox" id="hbox4">
<property name="visible">True</property>
- <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
- <property name="icon_size">GTK_ICON_SIZE_MENU</property>
<child>
- <widget class="GtkToolButton" id="TOOL_SM">
+ <widget class="GtkToolbar" id="VIDEO_TOOLS">
<property name="visible">True</property>
- <property name="tooltip" translatable="yes">Slow Motion</property>
- <property name="stock_id">gtk-media-previous</property>
- <signal name="clicked" handler="on_TOOL_SM_clicked"/>
+ <property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
+ <property name="icon_size">GTK_ICON_SIZE_MENU</property>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_SM">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Slow Motion</property>
+ <property name="stock_id">gtk-media-previous</property>
+ <signal name="clicked" handler="on_TOOL_SM_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_PLAY">
+ <property name="visible">True</property>
+ <property name="stock_id">gtk-media-play</property>
+ <signal name="clicked" handler="on_TOOL_PLAY_clicked"/>
+ <accelerator key="space" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_STOP">
+ <property name="visible">True</property>
+ <property name="stock_id">gtk-media-stop</property>
+ <signal name="clicked" handler="on_TOOL_STOP_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_FF">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Fast Forward</property>
+ <property name="use_underline">True</property>
+ <property name="stock_id">gtk-media-next</property>
+ <signal name="clicked" handler="on_TOOL_FF_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSeparatorToolItem" id="toolbutton1">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="homogeneous">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_SEEK_REWIND">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Seek video backward</property>
+ <property name="stock_id">gtk-media-rewind</property>
+ <signal name="clicked" handler="on_TOOL_SEEK_REWIND_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkToolButton" id="TOOL_SEEK_FORWARD">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Seek video forward</property>
+ <property name="stock_id">gtk-media-forward</property>
+ <signal name="clicked" handler="on_TOOL_SEEK_FORWARD_clicked"/>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ </packing>
+ </child>
</widget>
- <packing>
- <property name="expand">False</property>
- </packing>
</child>
<child>
- <widget class="GtkToolButton" id="TOOL_PLAY">
+ <widget class="GtkVBox" id="vbox7">
<property name="visible">True</property>
- <property name="stock_id">gtk-media-play</property>
- <signal name="clicked" handler="on_TOOL_PLAY_clicked"/>
- <accelerator key="space" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ <child>
+ <widget class="GtkLabel" id="lbl_seek_format">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Seconds</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkSpinButton" id="spin_seek_value">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="adjustment">1 0 100 1 10 10</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
</packing>
</child>
- <child>
- <widget class="GtkToolButton" id="TOOL_STOP">
- <property name="visible">True</property>
- <property name="stock_id">gtk-media-stop</property>
- <signal name="clicked" handler="on_TOOL_STOP_clicked"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolButton" id="TOOL_FF">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Fast Forward</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-media-next</property>
- <signal name="clicked" handler="on_TOOL_FF_clicked"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSeparatorToolItem" id="toolbutton1">
- <property name="visible">True</property>
- <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolButton" id="TOOL_SEEK_REWIND">
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-media-rewind</property>
- <signal name="clicked" handler="on_TOOL_SEEK_REWIND_clicked"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
- <child>
- <widget class="GtkToolButton" id="TOOL_SEEK_FORWARD">
- <property name="visible">True</property>
- <property name="use_underline">True</property>
- <property name="stock_id">gtk-media-forward</property>
- <signal name="clicked" handler="on_TOOL_SEEK_FORWARD_clicked"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- </packing>
- </child>
</widget>
</child>
</widget>
@@ -1057,8 +1095,8 @@
<property name="use_underline">True</property>
<property name="stock_id">gtk-go-down</property>
<signal name="clicked" handler="on_TOOL_IN_SUB_clicked"/>
+ <accelerator key="C" modifiers="GDK_MOD1_MASK" signal="clicked"/>
<accelerator key="c" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="C" modifiers="GDK_MOD1_MASK" signal="clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -1071,8 +1109,8 @@
<property name="use_underline">True</property>
<property name="stock_id">gtk-go-up</property>
<signal name="clicked" handler="on_TOOL_OUT_SUB_clicked"/>
+ <accelerator key="v" modifiers="GDK_MOD1_MASK" signal="clicked"/>
<accelerator key="V" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="v" modifiers="GDK_MOD1_MASK" signal="clicked"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -1168,8 +1206,8 @@
<property name="window_position">GTK_WIN_POS_CENTER</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_CENTER</property>
+ <property name="do_overwrite_confirmation">True</property>
<property name="show_hidden">True</property>
- <property name="do_overwrite_confirmation">True</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2">
<property name="visible">True</property>
More information about the commits
mailing list