[orca] Fix for bgo#585417 - Allow pauses to be inserted in speech output



commit 7c94115c601e6f06c5e6ad79b6b50433f9309380
Author: Willie Walker <william walker sun com>
Date:   Thu Jul 23 09:04:22 2009 -0400

    Fix for bgo#585417 - Allow pauses to be inserted in speech output
    
    This adds a user option to send speech to the speech synthesis system
    immediately when a pause is encountered in the formatting string.

 src/orca/orca-setup.ui     |   22 +++++++++++++++++++++-
 src/orca/orca_gui_prefs.py |   13 +++++++++++++
 src/orca/settings.py       |    3 ++-
 src/orca/speech.py         |    2 +-
 4 files changed, 37 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/orca-setup.ui b/src/orca/orca-setup.ui
index 0497bf6..4345764 100644
--- a/src/orca/orca-setup.ui
+++ b/src/orca/orca-setup.ui
@@ -1367,7 +1367,7 @@
                         <child>
                           <object class="GtkTable" id="checkBoxTable">
                             <property name="visible">True</property>
-                            <property name="n_rows">3</property>
+                            <property name="n_rows">4</property>
                             <property name="n_columns">2</property>
                             <property name="homogeneous">False</property>
                             <child>
@@ -1572,6 +1572,26 @@
                               </packing>
                             </child>
                             <child>
+                              <object class="GtkCheckButton" id="pauseBreaksCheckButton">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property comments="Translators: different speech systems and speech engines work differently when it comes to handling pauses (e.g., sentence boundaries).  This property allows the user to specify whether speech should be sent to the speech synthesis system immediately when a pause directive is enountered or if it should be queued up and sent to the speech synthesis system once the entire set of utterances has been calculated." name="label" translatable="yes">Break speech into ch_unks between pauses</property>
+                                <property name="use_underline">True</property>
+                                <property name="relief">GTK_RELIEF_NORMAL</property>
+                                <property name="focus_on_click">True</property>
+                                <property name="active">True</property>
+                                <property name="inconsistent">False</property>
+                                <property name="draw_indicator">True</property>
+                                <signal handler="pauseBreaksToggled" last_modification_time="Mon, 04 Aug 2008 17:11:04 GMT" name="toggled"/>
+                              </object>
+                              <packing>
+                                <property name="left_attach">0</property>
+                                <property name="right_attach">1</property>
+                                <property name="top_attach">3</property>
+                                <property name="bottom_attach">4</property>
+                              </packing>
+                            </child>
+                            <child>
                               <object class="GtkCheckButton" id="speakMnemonicsCheckButton">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index e131333..6b6b405 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -1515,6 +1515,9 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         self.get_widget("speakTutorialMessagesCheckButton").set_active(\
             prefs["enableTutorialMessages"])
 
+        self.get_widget("pauseBreaksCheckButton").set_active(\
+            prefs["enablePauseBreaks"])
+
         self.get_widget("speakMnemonicsCheckButton").set_active(\
             prefs["enableMnemonicSpeaking"])
 
@@ -2561,6 +2564,16 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
 
         self.prefsDict["enableTutorialMessages"] = widget.get_active()
 
+    def pauseBreaksToggled (self, widget):
+        """Signal handler for the "toggled" signal for the
+           pauseBreaksCheckButton GtkCheckButton widget.
+
+        Arguments:
+        - widget: the component that generated the signal.
+        """
+
+        self.prefsDict["enablePauseBreaks"] = widget.get_active()
+
     def mnemonicSpeakingChecked (self, widget):
         """Signal handler for the "toggled" signal for the
            speakMnemonicsCheckButton GtkCheckButton widget.
diff --git a/src/orca/settings.py b/src/orca/settings.py
index 6a65714..8738228 100644
--- a/src/orca/settings.py
+++ b/src/orca/settings.py
@@ -104,6 +104,7 @@ userCustomizableSettings = [
     "enableFunctionKeys",
     "enableActionKeys",
     "enableNavigationKeys",
+    "enablePauseBreaks",
     "enableTutorialMessages",
     "enableMnemonicSpeaking",
     "enableBraille",
@@ -1348,4 +1349,4 @@ useExperimentalSpeechProsody = True
 # adaptation to how different systems handle queued speech.  For example,
 # some introduce unnaturally long pauses between requests to speak.
 #
-emitSpeechOnPauses = True
+enablePauseBreaks = True
diff --git a/src/orca/speech.py b/src/orca/speech.py
index 1ab9b6a..7ffca92 100644
--- a/src/orca/speech.py
+++ b/src/orca/speech.py
@@ -192,7 +192,7 @@ def speak(content, acss=None, interrupt=True):
                 if subString:
                     if subString[-1] != ".":
                         subString += "."
-                    if settings.emitSpeechOnPauses:
+                    if settings.enablePauseBreaks:
                         _speak(subString, acss, interrupt)
                         subString = None
             elif isinstance(element, speech_generator.LineBreak):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]