[xiph-commits] r11795 - trunk/souffleur
daraku at svn.xiph.org
daraku at svn.xiph.org
Sun Aug 20 11:02:37 PDT 2006
Author: daraku
Date: 2006-08-20 11:02:31 -0700 (Sun, 20 Aug 2006)
New Revision: 11795
Modified:
trunk/souffleur/GPlayer.py
trunk/souffleur/Souffleur.py
trunk/souffleur/souffleur.glade
Log:
Fix GstPLayer.stop() function.
Fix bug whith not showing subs in stop/pause player state, that occur providing bad seek.
Added callbacks for TOOL_FIRST and TOOL_LAST widget.
Added View menu, "Streams window" and "Subtitles window" sub menu of View, and callbacks.
Modified: trunk/souffleur/GPlayer.py
===================================================================
--- trunk/souffleur/GPlayer.py 2006-08-18 21:56:09 UTC (rev 11794)
+++ trunk/souffleur/GPlayer.py 2006-08-20 18:02:31 UTC (rev 11795)
@@ -108,6 +108,7 @@
def stop(self):
self.player.set_state(gst.STATE_NULL)
+ self.playing = False
gst.info("stopped player")
def get_state(self, timeout=1):
Modified: trunk/souffleur/Souffleur.py
===================================================================
--- trunk/souffleur/Souffleur.py 2006-08-18 21:56:09 UTC (rev 11794)
+++ trunk/souffleur/Souffleur.py 2006-08-20 18:02:31 UTC (rev 11795)
@@ -104,6 +104,10 @@
"on_main_file_save_activate": self.cb_onSaveMenu,\
"on_main_file_save_as_activate": self.cb_onSaveAsMenu,\
"on_main_file_new_activate": self.cb_onNewMenu,\
+ "on_TOOL_FIRST_clicked": self.cb_onToolFirst,\
+ "on_TOOL_LAST_clicked": self.cb_onToolLast,\
+ "on_MAIN_VIEW_STREAMS_activate": self.cb_onStreamsWindow,\
+ "on_MAIN_VIEW_SUBTITLES_activate": self.cb_onSubtitleWindow,\
"on_LIST_SUBS_cursor_changed": self.cb_onSubsListSelect}
self.wTree.signal_autoconnect (dic)
@@ -115,7 +119,8 @@
dic = {"on_TOOL_DEL_STREAM_clicked": self.cb_delStream,\
"on_TOOL_MOD_STREAM_clicked": self.cb_modStream,\
"on_TOOL_SAVE_STREAM_clicked": self.cb_saveStream,\
- "on_TOOL_ADD_STREAM_clicked": self.cb_addNewStream}
+ "on_TOOL_ADD_STREAM_clicked": self.cb_addNewStream,\
+ "on_STREAM_WINDOW_delete_event": self.cb_StreamWindowDelete}
self.windowStreams.signal_autoconnect (dic)
### Setup LIST_STREAMS
LIST = self.windowStreams.get_widget("LIST_STREAMS")
@@ -127,7 +132,8 @@
LIST.append_column(tvcolumn)
self.windowSubsList=gtk.glade.XML (self.gladefile,"SUBS_LIST")
- dic = {"on_LIST_SUBS_cursor_changed": self.cb_onSubsListSelect}
+ dic = {"on_LIST_SUBS_cursor_changed": self.cb_onSubsListSelect,\
+ "on_SUBS_LIST_delete_event": self.cb_onSubsWindowDelete}
self.windowSubsList.signal_autoconnect (dic)
SUBLIST = self.windowSubsList.get_widget("LIST_SUBS")
if SUBLIST:
@@ -161,6 +167,36 @@
self.playButton = self.wTree.get_widget("TOOL_PLAY")
return
#==============================================================================
+ def cb_onSubsWindowDelete(self, widget, event):
+ widget.hide()
+ return True
+#==============================================================================
+ def cb_StreamWindowDelete(self, widget, event):
+ widget.hide()
+ return True
+#==============================================================================
+ def cb_onSubtitleWindow(self, menu):
+ if self.windowSubsList:
+ WND=self.windowSubsList.get_widget("SUBS_LIST")
+ WND.show()
+#==============================================================================
+ def cb_onStreamsWindow(self, menu):
+ if self.windowStreams:
+ WND=self.windowStreams.get_widget("STREAM_WINDOW")
+ WND.show()
+#==============================================================================
+ def cb_onToolLast(self, widget):
+ if self.Subtitle:
+ time = self.Subtitle.subKeys[-1]
+ self.setEditSubtitle(self.Subtitle.getSub(time))
+ self.player.seek(time*1000000)
+#==============================================================================
+ def cb_onToolFirst(self, widget):
+ if self.Subtitle:
+ time = self.Subtitle.subKeys[0]
+ self.setEditSubtitle(self.Subtitle.getSub(time))
+ self.player.seek(time*1000000)
+#==============================================================================
def getSubtitle(self, source):
for i in self.Subtitles:
if i.subSource==source:
@@ -549,10 +585,11 @@
Hour = tmSec/60
if self.Subtitle:
TText = self.Subtitle.getSub(MSec)
- if TText:
- self.setEditSubtitle(TText)
- else:
- self.setEditSubtitle(None)
+ if self.player.is_playing():
+ if TText:
+ self.setEditSubtitle(TText)
+ else:
+ self.setEditSubtitle(None)
if (self.p_position != gst.CLOCK_TIME_NONE):# and (not self.scroll):
value = self.p_position
self.adjustment.set_value(value)
Modified: trunk/souffleur/souffleur.glade
===================================================================
--- trunk/souffleur/souffleur.glade 2006-08-18 21:56:09 UTC (rev 11794)
+++ trunk/souffleur/souffleur.glade 2006-08-20 18:02:31 UTC (rev 11795)
@@ -97,6 +97,37 @@
</child>
<child>
+ <widget class="GtkMenuItem" id="MAIN_VIEW">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_VIew</property>
+ <property name="use_underline">True</property>
+
+ <child>
+ <widget class="GtkMenu" id="MAIN_VIEW_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="MAIN_VIEW_STREAMS">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Streams window</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_MAIN_VIEW_STREAMS_activate" last_modification_time="Sun, 20 Aug 2006 17:44:48 GMT"/>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkMenuItem" id="MAIN_VIEW_SUBTITLES">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">S_ubtitles window</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_MAIN_VIEW_SUBTITLES_activate" last_modification_time="Sun, 20 Aug 2006 17:44:48 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
<widget class="GtkMenuItem" id="MAIN_HELP_MENU">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
@@ -173,7 +204,6 @@
<child>
<widget class="GtkToolButton" id="TOOL_PREV">
- <property name="visible">True</property>
<property name="stock_id">gtk-media-previous</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
@@ -187,7 +217,6 @@
<child>
<widget class="GtkToolButton" id="TOOL_NEXT">
- <property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-next</property>
@@ -203,7 +232,6 @@
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem1">
- <property name="visible">True</property>
<property name="draw">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
@@ -266,6 +294,7 @@
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
+ <signal name="clicked" handler="on_TOOL_FIRST_clicked" last_modification_time="Sun, 20 Aug 2006 17:31:43 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -282,6 +311,7 @@
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
+ <signal name="clicked" handler="on_TOOL_LAST_clicked" last_modification_time="Sun, 20 Aug 2006 17:31:48 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
@@ -1150,7 +1180,7 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
- <signal name="destroy" handler="on_STREAM_WINDOW_destroy" last_modification_time="Sat, 03 Jun 2006 16:29:02 GMT"/>
+ <signal name="delete_event" handler="on_STREAM_WINDOW_delete_event" last_modification_time="Sun, 20 Aug 2006 17:53:42 GMT"/>
<child>
<widget class="GtkVBox" id="vbox3">
@@ -1283,6 +1313,7 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
+ <signal name="delete_event" handler="on_SUBS_LIST_delete_event" last_modification_time="Sun, 20 Aug 2006 17:56:03 GMT"/>
<child>
<widget class="GtkVBox" id="vbox4">
@@ -1367,7 +1398,6 @@
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="cursor_changed" handler="on_LIST_SUBS_cursor_changed" last_modification_time="Wed, 02 Aug 2006 05:34:48 GMT"/>
- <signal name="move_cursor" handler="on_LIST_SUBS_move_cursor" last_modification_time="Wed, 02 Aug 2006 05:42:07 GMT"/>
</widget>
</child>
</widget>
More information about the commits
mailing list