add single-step mode
Stefan Schuermans

Stefan Schuermans commited on 2014-05-01 11:46:03
Showing 2 changed files, with 37 additions and 4 deletions.

... ...
@@ -598,6 +598,36 @@ a blinkenarea.org project - https://www.blinkenarea.org/</property>
598 598
             <property name="position">3</property>
599 599
           </packing>
600 600
         </child>
601
+        <child>
602
+          <object class="GtkBox" id="SettingsBox">
603
+            <property name="visible">True</property>
604
+            <property name="can_focus">False</property>
605
+            <property name="border_width">3</property>
606
+            <property name="orientation">vertical</property>
607
+            <child>
608
+              <object class="GtkCheckButton" id="SingleStep">
609
+                <property name="label" translatable="yes">single-step mode</property>
610
+                <property name="use_action_appearance">False</property>
611
+                <property name="visible">True</property>
612
+                <property name="can_focus">True</property>
613
+                <property name="receives_default">False</property>
614
+                <property name="use_action_appearance">False</property>
615
+                <property name="xalign">0</property>
616
+                <property name="draw_indicator">True</property>
617
+              </object>
618
+              <packing>
619
+                <property name="expand">False</property>
620
+                <property name="fill">True</property>
621
+                <property name="position">0</property>
622
+              </packing>
623
+            </child>
624
+          </object>
625
+          <packing>
626
+            <property name="expand">False</property>
627
+            <property name="fill">True</property>
628
+            <property name="position">4</property>
629
+          </packing>
630
+        </child>
601 631
         <child>
602 632
           <object class="GtkStatusbar" id="Status">
603 633
             <property name="visible">True</property>
... ...
@@ -608,7 +638,7 @@ a blinkenarea.org project - https://www.blinkenarea.org/</property>
608 638
           <packing>
609 639
             <property name="expand">False</property>
610 640
             <property name="fill">True</property>
611
-            <property name="position">4</property>
641
+            <property name="position">5</property>
612 642
           </packing>
613 643
         </child>
614 644
       </object>
... ...
@@ -37,6 +37,7 @@ class StageDirector:
37 37
     self.widLogoPlay = self.builder.get_object("LogoPlay")
38 38
     self.widLogoUdpErr = self.builder.get_object("LogoUdpErr")
39 39
     self.widLogoUdpOk = self.builder.get_object("LogoUdpOk")
40
+    self.widSingleStep = self.builder.get_object("SingleStep")
40 41
     self.widStatus = self.builder.get_object("Status")
41 42
     handlers = {
42 43
       "onDestroy":           self.onDestroy,
... ...
@@ -132,10 +133,12 @@ class StageDirector:
132 133
         weight = Pango.Weight.NORMAL
133 134
       model.set(it, 1, weight)
134 135
     self.widPlaylistStore.foreach(update, None)
135
-    # playing and (no entry or stop entry)
136
+    # playing and (no entry or stop entry or single-step mode)
136 137
     # -> stop playing and update button visibility
137
-    if self.stPlaying and (self.stEntryIdx < 0 or \
138
-       self.playlist.entries[self.stEntryIdx]["type"] == "stop"):
138
+    if self.stPlaying and \
139
+       (self.stEntryIdx < 0 or \
140
+        self.playlist.entries[self.stEntryIdx]["type"] == "stop" or \
141
+        self.widSingleStep.get_active()):
139 142
       self.stPlaying = False
140 143
       self.updateButtonVisibility()
141 144
     # update duration, position, ...
142 145