[chronojump] DB:1.48 gstreamer 0.1, 1.0. Changes on preferences, repetitiveConditions windows



commit 43efedc7a04db65113bfb1b20606cbed9c0f0ce6
Author: Xavier de Blas <xaviblas gmail com>
Date:   Sat Oct 7 15:09:30 2017 +0200

    DB:1.48 gstreamer 0.1, 1.0. Changes on preferences, repetitiveConditions windows

 glade/preferences_win.glade       |  195 +++++++++++++++++++++++++++++++++++--
 glade/repetitive_conditions.glade |   11 ++
 src/execute/event.cs              |    7 +-
 src/execute/jump.cs               |   22 +++--
 src/execute/multiChronopic.cs     |    2 +-
 src/execute/pulse.cs              |    8 +-
 src/execute/reactionTime.cs       |    8 +-
 src/execute/run.cs                |   14 ++-
 src/gui/chronojump.cs             |   31 ++++--
 src/gui/encoder.cs                |    8 +-
 src/gui/eventExecute.cs           |   28 +++---
 src/gui/preferences.cs            |   47 +++++++++-
 src/gui/repetitiveConditions.cs   |   21 ++++-
 src/preferences.cs                |    4 +
 src/sqlite/main.cs                |   11 ++-
 src/sqlite/preferences.cs         |    4 +
 src/util.cs                       |   52 ++++++++--
 17 files changed, 399 insertions(+), 74 deletions(-)
---
diff --git a/glade/preferences_win.glade b/glade/preferences_win.glade
index f66b7b7..e6d6eb2 100644
--- a/glade/preferences_win.glade
+++ b/glade/preferences_win.glade
@@ -4537,16 +4537,193 @@ sensor</property>
                 <property name="border_width">16</property>
                 <property name="spacing">20</property>
                 <child>
-                  <widget class="GtkCheckButton" id="checkbutton_volume">
-                    <property name="label" translatable="yes">Play sounds while capturing</property>
+                  <widget class="GtkVBox" id="vbox25">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="receives_default">False</property>
-                    <property name="has_tooltip">True</property>
-                    <property name="tooltip" translatable="yes">Play sound (on / off)</property>
-                    <property name="relief">none</property>
-                    <property name="active">True</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">12</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="checkbutton_volume">
+                        <property name="label" translatable="yes">Play sounds while capturing</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="has_tooltip">True</property>
+                        <property name="tooltip" translatable="yes">Play sound (on / off)</property>
+                        <property name="relief">none</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">True</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment10">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="left_padding">20</property>
+                        <child>
+                          <widget class="GtkTable" id="table_gstreamer">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="n_rows">3</property>
+                            <property name="n_columns">2</property>
+                            <property name="column_spacing">12</property>
+                            <property name="row_spacing">10</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="radio_gstreamer_0_1">
+                                <property name="label">Gstreamer 0.1</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                              </widget>
+                              <packing>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkRadioButton" id="radio_gstreamer_1_0">
+                                <property name="label">Gstreamer 1.0</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">False</property>
+                                <property name="active">True</property>
+                                <property name="draw_indicator">True</property>
+                                <property name="group">radio_gstreamer_0_1</property>
+                              </widget>
+                              <packing>
+                                <property name="top_attach">1</property>
+                                <property name="bottom_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkHBox" id="hbox40">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="spacing">4</property>
+                                <child>
+                                  <widget class="GtkLabel" id="label68">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">(</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label66">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Recommended</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkLabel" id="label112">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="label">)</property>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">2</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"/>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkButton" id="button_test_sound">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="tooltip" translatable="yes">Test "Good" bell</property>
+                                <property name="use_underline">True</property>
+                                <signal name="clicked" handler="on_button_test_sound_clicked" swapped="no"/>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox41">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="spacing">6</property>
+                                    <child>
+                                      <widget class="GtkImage" id="image3">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="stock">gtk-media-play</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                    <child>
+                                      <widget class="GtkLabel" id="label113">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label" translatable="yes">Test sound</property>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">1</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                                <property name="x_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                            <child>
+                              <widget class="GtkLabel" id="label_test_sound_result">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                              </widget>
+                              <packing>
+                                <property name="left_attach">1</property>
+                                <property name="right_attach">2</property>
+                                <property name="top_attach">2</property>
+                                <property name="bottom_attach">3</property>
+                                <property name="x_options">GTK_FILL</property>
+                              </packing>
+                            </child>
+                          </widget>
+                        </child>
+                      </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>
diff --git a/glade/repetitive_conditions.glade b/glade/repetitive_conditions.glade
index e77ad33..2401864 100644
--- a/glade/repetitive_conditions.glade
+++ b/glade/repetitive_conditions.glade
@@ -3540,6 +3540,17 @@
                 <property name="position">2</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkLabel" id="label_test_sound_result">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">3</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="expand">False</property>
diff --git a/src/execute/event.cs b/src/execute/event.cs
index d5736ab..3f33bf3 100644
--- a/src/execute/event.cs
+++ b/src/execute/event.cs
@@ -76,6 +76,7 @@ public class EventExecute
        protected bool needEndEvent;
        
        protected bool volumeOn;
+       protected Preferences.GstreamerTypes gstreamer;
        protected double progressbarLimit;
        protected RepetitiveConditionsWindow repetitiveConditionsWin;
 
@@ -463,11 +464,11 @@ public class EventExecute
        }
 
        protected virtual void goodEvent() {
-               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn);
+               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn, gstreamer);
        } 
        
        protected virtual void badEvent() {
-               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
        } 
        
        public virtual void Manage2() {
@@ -490,7 +491,7 @@ public class EventExecute
                errorWin = ErrorWindow.Show( 
                                Catalog.GetString("Chronopic seems disconnected. Reconnect again on Chronopic 
Window."));
 
-               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
                errorWin.Button_accept.Clicked += new EventHandler(cancel_event_before_start);
        }
        
diff --git a/src/execute/jump.cs b/src/execute/jump.cs
index b6297de..5302d36 100644
--- a/src/execute/jump.cs
+++ b/src/execute/jump.cs
@@ -54,7 +54,8 @@ public class JumpExecute : EventExecute
 
        //jump execution
        public JumpExecute(int personID, string personName, int sessionID, string type, double fall, double 
weight,  
-                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
volumeOn,
+                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        double progressbarLimit, ExecutingGraphData egd, string description
                        )
        {
@@ -71,6 +72,7 @@ public class JumpExecute : EventExecute
 
                this.pDN = pDN;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
                this.description = description;
@@ -131,7 +133,7 @@ public class JumpExecute : EventExecute
                if (platformState==Chronopic.Plataforma.ON) {
                        feedbackMessage = Catalog.GetString("You are IN, JUMP when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
                        loggedState = States.ON;
 
@@ -157,7 +159,7 @@ public class JumpExecute : EventExecute
                        confirmWin = ConfirmWindow.Show(Catalog.GetString(
                                                "You are OUT, please enter the platform, prepare for jump and 
press the 'accept' button"), "", "");
 
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManage);
@@ -210,7 +212,7 @@ public class JumpExecute : EventExecute
                        }
 
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
 
                        //useful also for tracking the jump phases
@@ -246,7 +248,7 @@ public class JumpExecute : EventExecute
 
                        confirmWin = ConfirmWindow.Show(message, "", "");
 
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManageFall);
@@ -540,7 +542,8 @@ public class JumpRjExecute : JumpExecute
                        int sessionID, string type, double fall, double weight, 
                        double limitAsDouble, bool jumpsLimited, 
                        Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
allowFinishAfterTime, 
-                       bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
+                       RepetitiveConditionsWindow repetitiveConditionsWin,
                        double progressbarLimit, ExecutingGraphData egd
                        )
        {
@@ -566,6 +569,7 @@ public class JumpRjExecute : JumpExecute
                this.pDN = pDN;
                this.allowFinishAfterTime = allowFinishAfterTime;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
                this.repetitiveConditionsWin = repetitiveConditionsWin;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
@@ -615,12 +619,12 @@ public class JumpRjExecute : JumpExecute
                if (platformState==Chronopic.Plataforma.OFF && hasFall ) {
                        feedbackMessage = Catalog.GetString("You are OUT, JUMP when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
                        success = true;
                } else if (platformState==Chronopic.Plataforma.ON && ! hasFall ) {
                        feedbackMessage = Catalog.GetString("You are IN, JUMP when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
                        success = true;
                } else {
                        string myMessage = Catalog.GetString("You are IN, please leave the platform, and 
press the 'accept' button");
@@ -629,7 +633,7 @@ public class JumpRjExecute : JumpExecute
                        }
                        ConfirmWindow confirmWin;               
                        confirmWin = ConfirmWindow.Show(myMessage, "","");
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManage);
diff --git a/src/execute/multiChronopic.cs b/src/execute/multiChronopic.cs
index 2b9f667..78e64a8 100644
--- a/src/execute/multiChronopic.cs
+++ b/src/execute/multiChronopic.cs
@@ -302,7 +302,7 @@ public class MultiChronopicExecute : EventExecute
                        confirmWin = ConfirmWindow.Show( 
                                        string.Format(Catalog.GetString("There's contact in {0}. Please 
leave."), platformsProblems), "", "");
 
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManage);
diff --git a/src/execute/pulse.cs b/src/execute/pulse.cs
index c72f7f2..b22e5f8 100644
--- a/src/execute/pulse.cs
+++ b/src/execute/pulse.cs
@@ -54,7 +54,8 @@ public class PulseExecute : EventExecute
 
        //execution
        public PulseExecute(int personID, string personName, int sessionID, string type, double fixedPulse, 
int totalPulsesNum,  
-                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
volumeOn,
+                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        //double progressbarLimit, 
                        ExecutingGraphData egd
                        )
@@ -73,6 +74,7 @@ public class PulseExecute : EventExecute
 
                this.pDN = pDN;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
 //             this.progressbarLimit = progressbarLimit;
                this.egd = egd;
        
@@ -128,7 +130,7 @@ public class PulseExecute : EventExecute
 
                        ConfirmWindow confirmWin;               
                        confirmWin = ConfirmWindow.Show(myMessage, "", "");
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManage);
@@ -138,7 +140,7 @@ public class PulseExecute : EventExecute
                } else if (platformState==Chronopic.Plataforma.OFF) {
                        feedbackMessage = Catalog.GetString("You are OUT, start when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
                        loggedState = States.OFF;
 
diff --git a/src/execute/reactionTime.cs b/src/execute/reactionTime.cs
index 7741c64..6cc39f5 100644
--- a/src/execute/reactionTime.cs
+++ b/src/execute/reactionTime.cs
@@ -39,7 +39,8 @@ public class ReactionTimeExecute : EventExecute
 
        //reactionTime execution
        public ReactionTimeExecute(int personID, string personName, int sessionID, string type,
-                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
volumeOn,
+                       Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        double progressbarLimit, ExecutingGraphData egd, string description
                        )
        {
@@ -54,6 +55,7 @@ public class ReactionTimeExecute : EventExecute
 
                this.pDN = pDN;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
                this.description = description;
@@ -117,7 +119,7 @@ public class ReactionTimeExecute : EventExecute
                if (canStart) {
                        feedbackMessage = Catalog.GetString("You are IN, RELEASE when prepared!"); //TODO: 
change this
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
                        if(StartIn)
                                loggedState = States.ON;
@@ -145,7 +147,7 @@ public class ReactionTimeExecute : EventExecute
                        confirmWin = ConfirmWindow.Show( 
                                        Catalog.GetString("You are OUT, come inside and press the 'accept' 
button"), "", ""); //TODO:change this
                        //System.Media.SystemSounds.Beep.Play();
-                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, gstreamer);
 
                        //we call again this function
                        confirmWin.Button_accept.Clicked += new EventHandler(callAgainManage);
diff --git a/src/execute/run.cs b/src/execute/run.cs
index 00432af..90f56d7 100644
--- a/src/execute/run.cs
+++ b/src/execute/run.cs
@@ -54,7 +54,8 @@ public class RunExecute : EventExecute
        //run execution
        public RunExecute(int personID, int sessionID, string type, double distance,   
                        Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, 
-                       int pDN, bool metersSecondsPreferred, bool volumeOn,
+                       int pDN, bool metersSecondsPreferred,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        double progressbarLimit, ExecutingGraphData egd,
                        Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime, 
                        bool speedStartArrival
@@ -72,6 +73,7 @@ public class RunExecute : EventExecute
                this.pDN = pDN;
                this.metersSecondsPreferred = metersSecondsPreferred;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
                this.checkDoubleContactMode = checkDoubleContactMode;
@@ -125,7 +127,7 @@ public class RunExecute : EventExecute
                if (platformState==Chronopic.Plataforma.ON) {
                        feedbackMessage = Catalog.GetString("You are IN, RUN when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
                        loggedState = States.ON;
                        startIn = true;
@@ -133,7 +135,7 @@ public class RunExecute : EventExecute
                } else if (platformState==Chronopic.Plataforma.OFF) {
                        feedbackMessage = Catalog.GetString("You are OUT, RUN when prepared!");
                        needShowFeedbackMessage = true; 
-                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn);
+                       Util.PlaySound(Constants.SoundTypes.CAN_START, volumeOn, gstreamer);
 
                        loggedState = States.OFF;
                        startIn = false;
@@ -459,7 +461,8 @@ public class RunIntervalExecute : RunExecute
        //run execution
        public RunIntervalExecute(int personID, int sessionID, string type, double distanceInterval, double 
limitAsDouble, bool tracksLimited,  
                        Chronopic cp, Gtk.Label event_execute_label_message, Gtk.Window app, int pDN, bool 
metersSecondsPreferred, 
-                       bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
+                       RepetitiveConditionsWindow repetitiveConditionsWin,
                        double progressbarLimit, ExecutingGraphData egd ,
                        Constants.DoubleContact checkDoubleContactMode, int checkDoubleContactTime, 
                        bool speedStartArrival
@@ -495,6 +498,7 @@ public class RunIntervalExecute : RunExecute
                this.metersSecondsPreferred = metersSecondsPreferred;
                this.pDN = pDN;
                this.volumeOn = volumeOn;
+               this.gstreamer = gstreamer;
                this.repetitiveConditionsWin = repetitiveConditionsWin;
                this.progressbarLimit = progressbarLimit;
                this.egd = egd;
@@ -753,7 +757,7 @@ public class RunIntervalExecute : RunExecute
 
                if (waitSeconds < 0) {
                        if(! RSABellDone) {
-                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn);
+                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn, gstreamer);
                                RSABellDone = true;
                        }
                        return Catalog.GetString("Go!");
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index f3d61a3..b9b48e7 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2823,7 +2823,10 @@ public partial class ChronoJumpWindow
                configInitFromPreferences();
 
                if(repetitiveConditionsWin != null)
+               {
                        repetitiveConditionsWin.VolumeOn = preferences.volumeOn;
+                       repetitiveConditionsWin.Gstreamer = preferences.gstreamer;
+               }
 
                try {
                        if(createdStatsWin) {
@@ -3964,7 +3967,8 @@ public partial class ChronoJumpWindow
                currentEventExecute = new JumpExecute(currentPerson.UniqueID, currentPerson.Name, 
                                currentSession.UniqueID, currentJumpType.Name, myFall, jumpWeight,
                                //chronopicWin.CP, event_execute_label_message, app1, 
preferences.digitsNumber, preferences.volumeOn,
-                               cp2016.CP, event_execute_label_message, app1, preferences.digitsNumber, 
preferences.volumeOn,
+                               cp2016.CP, event_execute_label_message, app1, preferences.digitsNumber,
+                               preferences.volumeOn, preferences.gstreamer,
                                progressbarLimit, egd, description);
 
 
@@ -4224,7 +4228,8 @@ public partial class ChronoJumpWindow
                                currentSession.UniqueID, currentJumpRjType.Name, myFall, jumpWeight, 
                                progressbarLimit, currentJumpRjType.JumpsLimited, 
                                cp2016.CP, event_execute_label_message, app1, preferences.digitsNumber,
-                               checkbutton_allow_finish_rj_after_time.Active, preferences.volumeOn, 
+                               checkbutton_allow_finish_rj_after_time.Active,
+                               preferences.volumeOn, preferences.gstreamer,
                                repetitiveConditionsWin, progressbarLimit, egd
                                );
                
@@ -4353,7 +4358,8 @@ public partial class ChronoJumpWindow
                                currentPerson.UniqueID, currentSession.UniqueID, 
                                currentRunType.Name, myDistance, 
                                cp2016.CP, event_execute_label_message, app1,
-                               preferences.digitsNumber, preferences.metersSecondsPreferred, 
preferences.volumeOn, 
+                               preferences.digitsNumber, preferences.metersSecondsPreferred,
+                               preferences.volumeOn, preferences.gstreamer,
                                progressbarLimit, egd,
                                preferences.runDoubleContactsMode,
                                preferences.runDoubleContactsMS,
@@ -4475,7 +4481,9 @@ public partial class ChronoJumpWindow
                                currentPerson.UniqueID, currentSession.UniqueID, currentRunIntervalType.Name, 
                                distanceInterval, progressbarLimit, currentRunIntervalType.TracksLimited, 
                                cp2016.CP, event_execute_label_message, app1,
-                               preferences.digitsNumber, preferences.metersSecondsPreferred, 
preferences.volumeOn, repetitiveConditionsWin, 
+                               preferences.digitsNumber, preferences.metersSecondsPreferred,
+                               preferences.volumeOn, preferences.gstreamer,
+                               repetitiveConditionsWin,
                                progressbarLimit, egd,
                                preferences.runIDoubleContactsMode,
                                preferences.runIDoubleContactsMS,
@@ -4683,7 +4691,8 @@ public partial class ChronoJumpWindow
 
                currentEventExecute = new ReactionTimeExecute(currentPerson.UniqueID, currentPerson.Name, 
                                currentSession.UniqueID, currentReactionTimeType.Name, 
-                               cp2016.CP, event_execute_label_message, app1, preferences.digitsNumber, 
preferences.volumeOn,
+                               cp2016.CP, event_execute_label_message, app1, preferences.digitsNumber,
+                               preferences.volumeOn, preferences.gstreamer,
                                progressbarLimit, egd, description
                                );
 
@@ -4837,7 +4846,8 @@ public partial class ChronoJumpWindow
                currentEventExecute = new PulseExecute(currentPerson.UniqueID, currentPerson.Name, 
                                currentSession.UniqueID, currentPulseType.Name, pulseStep, totalPulses, 
                                cp2016.CP, event_execute_label_message,
-                               app1, preferences.digitsNumber, preferences.volumeOn, egd
+                               app1, preferences.digitsNumber,
+                               preferences.volumeOn, preferences.gstreamer, egd
                                );
                
                if(! canCaptureC)
@@ -5209,7 +5219,8 @@ LogB.Debug("X");
                                        else if(current_menuitem_mode == 
Constants.Menuitem_modes.JUMPSREACTIVE)
                                                PrepareJumpReactiveGraph(
                                                                Util.GetLast(currentJumpRj.TvString), 
Util.GetLast(currentJumpRj.TcString),
-                                                               currentJumpRj.TvString, 
currentJumpRj.TcString, preferences.volumeOn, repetitiveConditionsWin);
+                                                               currentJumpRj.TvString, 
currentJumpRj.TcString,
+                                                               preferences.volumeOn, preferences.gstreamer, 
repetitiveConditionsWin);
                                        break;
                                case EventType.Types.RUN:
                                        if(lastRunIsSimple && current_menuitem_mode == 
Constants.Menuitem_modes.RUNSSIMPLE)
@@ -5231,7 +5242,7 @@ LogB.Debug("X");
                                                                distanceTotal,
                                                                runType.DistancesString,
                                                                currentRunInterval.StartIn,
-                                                               preferences.volumeOn, 
repetitiveConditionsWin);
+                                                               preferences.volumeOn, preferences.gstreamer, 
repetitiveConditionsWin);
                                        }
                                        break;
                                case EventType.Types.FORCESENSOR:
@@ -6635,11 +6646,11 @@ LogB.Debug("X");
        }
                
        private void on_button_rj_bells_clicked(object o, EventArgs args) {
-               repetitiveConditionsWin.View(Constants.BellModes.JUMPS, preferences.volumeOn);
+               repetitiveConditionsWin.View(Constants.BellModes.JUMPS, preferences.volumeOn, 
preferences.gstreamer);
        }
 
        private void on_button_time_bells_clicked(object o, EventArgs args) {
-               repetitiveConditionsWin.View(Constants.BellModes.RUNS, preferences.volumeOn);
+               repetitiveConditionsWin.View(Constants.BellModes.RUNS, preferences.volumeOn, 
preferences.gstreamer);
        }
        
        private void on_repetitive_conditions_closed(object o, EventArgs args)
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index 2acb1c5..b4bbeea 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -595,9 +595,9 @@ public partial class ChronoJumpWindow
        private void on_button_encoder_bells_clicked(object o, EventArgs args)
        {
                if(current_menuitem_mode == Constants.Menuitem_modes.POWERGRAVITATORY)
-                       repetitiveConditionsWin.View(Constants.BellModes.ENCODERGRAVITATORY, 
preferences.volumeOn);
+                       repetitiveConditionsWin.View(Constants.BellModes.ENCODERGRAVITATORY, 
preferences.volumeOn, preferences.gstreamer);
                else
-                       repetitiveConditionsWin.View(Constants.BellModes.ENCODERINERTIAL, 
preferences.volumeOn);
+                       repetitiveConditionsWin.View(Constants.BellModes.ENCODERINERTIAL, 
preferences.volumeOn, preferences.gstreamer);
        }
 
        /*
@@ -4742,7 +4742,7 @@ public partial class ChronoJumpWindow
                                my_pen_con = pen_green_encoder_capture;
                                //play sound if value is high, volumeOn == true, is last value, capturing
                                if(preferences.volumeOn && count == data.Count -1 && capturing)
-                                       Util.PlaySound(Constants.SoundTypes.GOOD, preferences.volumeOn);
+                                       Util.PlaySound(Constants.SoundTypes.GOOD, preferences.volumeOn, 
preferences.gstreamer);
                        }
                        else if( ! discarded && ( myColor == UtilGtk.ColorBad || (mainVariableLower != -1 && 
d <= mainVariableLower) ) )
                        {
@@ -4751,7 +4751,7 @@ public partial class ChronoJumpWindow
                                my_pen_con = pen_red_encoder_capture;
                                //play sound if value is low, volumeOn == true, is last value, capturing
                                if(preferences.volumeOn && count == data.Count -1 && capturing)
-                                       Util.PlaySound(Constants.SoundTypes.BAD, preferences.volumeOn);
+                                       Util.PlaySound(Constants.SoundTypes.BAD, preferences.volumeOn, 
preferences.gstreamer);
                        }
                        else {
                                my_pen_ecc_con_e = pen_blue_dark_encoder_capture;
diff --git a/src/gui/eventExecute.cs b/src/gui/eventExecute.cs
index e1adeb0..37ecc55 100644
--- a/src/gui/eventExecute.cs
+++ b/src/gui/eventExecute.cs
@@ -577,7 +577,7 @@ public partial class ChronoJumpWindow
        
        // Reactive jump 
        public void PrepareJumpReactiveGraph(double lastTv, double lastTc, string tvString, string tcString, 
-                       bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin) {
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer, RepetitiveConditionsWindow 
repetitiveConditionsWin) {
                //check graph properties window is not null (propably user has closed it with the DeleteEvent
                //then create it, but not show it
                if(eventGraphConfigureWin == null)
@@ -612,7 +612,7 @@ public partial class ChronoJumpWindow
                paintJumpReactive (event_execute_drawingarea, lastTv, lastTc, tvString, tcString, 
Util.GetAverage(tvString), Util.GetAverage(tcString), 
                                maxValue, minValue, jumps, topMargin, bottomMargin, 
                                bestOrWorstTvTcIndex(true, tvString, tcString), bestOrWorstTvTcIndex(false, 
tvString, tcString), 
-                               volumeOn, repetitiveConditionsWin);
+                               volumeOn, gstreamer, repetitiveConditionsWin);
                
                // -- refresh
                event_execute_drawingarea.QueueDraw();
@@ -706,7 +706,9 @@ public partial class ChronoJumpWindow
        // distanceTotal is passed because it can change in variable distances test
        public void PrepareRunIntervalGraph(double distance, double lastTime, string timesString,
                        double distanceTotal, string distancesString,
-                       bool startIn, bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin) {
+                       bool startIn, bool volumeOn, Preferences.GstreamerTypes gstreamer,
+                       RepetitiveConditionsWindow repetitiveConditionsWin)
+       {
                //check graph properties window is not null (propably user has closed it with the DeleteEvent
                //then create it, but not show it
                if(eventGraphConfigureWin == null)
@@ -748,7 +750,7 @@ public partial class ChronoJumpWindow
                                lastTime, timesString, Util.GetAverage(timesString), 
                                maxValue, minValue, tracks, topMargin, bottomMargin,
                                Util.GetPosMax(timesString), Util.GetPosMin(timesString), startIn,
-                               volumeOn, repetitiveConditionsWin);
+                               volumeOn, gstreamer, repetitiveConditionsWin);
                
                // -- refresh
                event_execute_drawingarea.QueueDraw();
@@ -1234,7 +1236,8 @@ public partial class ChronoJumpWindow
        
        private void paintJumpReactive (Gtk.DrawingArea drawingarea, double lastTv, double lastTc, string 
tvString, string tcString, 
                        double avgTV, double avgTC, double maxValue, double minValue, int jumps, 
-                       int topMargin, int bottomMargin, int posMax, int posMin, bool volumeOn,
+                       int topMargin, int bottomMargin, int posMax, int posMin,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
                        RepetitiveConditionsWindow repetitiveConditionsWin)
        {
                //int topMargin = 10; 
@@ -1372,9 +1375,9 @@ public partial class ChronoJumpWindow
 
 
                        if(showHeightGood || showTfGood || showTcGood || showTfTcGood)
-                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn);
+                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn, preferences.gstreamer);
                        if(showHeightBad || showTfBad || showTcBad || showTfTcBad)
-                               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, preferences.gstreamer);
 
                        if(showHeightGood)
                                event_execute_image_jump_reactive_height_good.Show();
@@ -1431,7 +1434,8 @@ public partial class ChronoJumpWindow
                        double lastTime, string timesString, double avgTime, 
                        double maxValue, double minValue, int tracks, int topMargin, int bottomMargin, 
                        int hightValuePosition, int lowValuePosition, bool startIn,
-                       bool volumeOn, RepetitiveConditionsWindow repetitiveConditionsWin)
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer,
+                       RepetitiveConditionsWindow repetitiveConditionsWin)
        {
                //int topMargin = 10; 
                int ancho=drawingarea.Allocation.Width;
@@ -1577,11 +1581,11 @@ public partial class ChronoJumpWindow
                                showTimeBad = true;
 
                        if(showTimeGood) {
-                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn);
+                               Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn, preferences.gstreamer);
                                event_execute_image_run_interval_time_good.Show();
                        }
                        if(showTimeBad) {
-                               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn);
+                               Util.PlaySound(Constants.SoundTypes.BAD, volumeOn, preferences.gstreamer);
                                event_execute_image_run_interval_time_bad.Show();
                        }
                        
@@ -1957,7 +1961,7 @@ public partial class ChronoJumpWindow
                                                        
currentEventExecute.PrepareEventGraphJumpReactiveObject.lastTc,
                                                        
currentEventExecute.PrepareEventGraphJumpReactiveObject.tvString,
                                                        
currentEventExecute.PrepareEventGraphJumpReactiveObject.tcString,
-                                                       preferences.volumeOn, repetitiveConditionsWin);
+                                                       preferences.volumeOn, preferences.gstreamer, 
repetitiveConditionsWin);
                                }
                                break;
                        case EventType.Types.RUN:
@@ -1976,7 +1980,7 @@ public partial class ChronoJumpWindow
                                                        
currentEventExecute.PrepareEventGraphRunIntervalObject.distanceTotal,
                                                        
currentEventExecute.PrepareEventGraphRunIntervalObject.distancesString,
                                                        
currentEventExecute.PrepareEventGraphRunIntervalObject.startIn,
-                                                       volumeOnHere, repetitiveConditionsWin);
+                                                       volumeOnHere, preferences.gstreamer, 
repetitiveConditionsWin);
                                }
                                break;
                        case EventType.Types.REACTIONTIME:
diff --git a/src/gui/preferences.cs b/src/gui/preferences.cs
index d4c47be..1935be4 100644
--- a/src/gui/preferences.cs
+++ b/src/gui/preferences.cs
@@ -190,6 +190,10 @@ public class PreferencesWindow
 
        //multimedia tab
        [Widget] Gtk.CheckButton checkbutton_volume;
+       [Widget] Gtk.Table table_gstreamer;
+       [Widget] Gtk.RadioButton radio_gstreamer_0_1;
+       [Widget] Gtk.RadioButton radio_gstreamer_1_0;
+       [Widget] Gtk.Label label_test_sound_result;
        [Widget] Gtk.Box hbox_combo_camera;
        [Widget] Gtk.ComboBox combo_camera;
 
@@ -310,6 +314,14 @@ public class PreferencesWindow
                else 
                        PreferencesWindowBox.checkbutton_volume.Active = false; 
 
+               PreferencesWindowBox.table_gstreamer.Visible = ! UtilAll.IsWindows();
+
+               if(preferences.gstreamer == Preferences.GstreamerTypes.GST_0_1)
+                       PreferencesWindowBox.radio_gstreamer_0_1.Active = true;
+               else
+                       PreferencesWindowBox.radio_gstreamer_1_0.Active = true;
+               PreferencesWindowBox.label_test_sound_result.Text = "";
+
                PreferencesWindowBox.createComboCamera(UtilVideo.GetVideoDevices(), 
preferences.videoDeviceNum);
        
 
@@ -879,9 +891,31 @@ public class PreferencesWindow
 
        // ---- end of Force sensor stuff
 
+       // ---- multimedia stuff
+
+       private void on_button_test_sound_clicked (object o, EventArgs args)
+       {
+               label_test_sound_result.Text = "";
+               Util.SoundCodes sc;
+               Util.TestSound = true;
+
+               if(radio_gstreamer_0_1.Active)
+                       sc = Util.PlaySound(Constants.SoundTypes.GOOD, true, 
Preferences.GstreamerTypes.GST_0_1);
+               else // radio_gstreamer_1_0.Active
+                       sc = Util.PlaySound(Constants.SoundTypes.GOOD, true, 
Preferences.GstreamerTypes.GST_1_0);
+
+               if(sc == Util.SoundCodes.OK)
+                       label_test_sound_result.Text = Catalog.GetString("Sound working");
+               else
+                       label_test_sound_result.Text = Catalog.GetString("Sound not working");
+
+               Util.TestSound = false;
+       }
+
+       // ---- end of multimedia stuff
 
        // ---- Language stuff
-       
+
        private void createComboLanguage() {
                
                combo_language = ComboBox.NewText ();
@@ -1684,6 +1718,17 @@ public class PreferencesWindow
                        preferences.volumeOn = PreferencesWindowBox.checkbutton_volume.Active;
                }
 
+               if( preferences.gstreamer == Preferences.GstreamerTypes.GST_0_1 && radio_gstreamer_1_0.Active)
+               {
+                       SqlitePreferences.Update(Preferences.GstreamerStr, 
Preferences.GstreamerTypes.GST_1_0.ToString(), true);
+                       preferences.gstreamer = Preferences.GstreamerTypes.GST_1_0;
+               }
+               else if( preferences.gstreamer == Preferences.GstreamerTypes.GST_1_0 && 
radio_gstreamer_0_1.Active)
+               {
+                       SqlitePreferences.Update(Preferences.GstreamerStr, 
Preferences.GstreamerTypes.GST_0_1.ToString(), true);
+                       preferences.gstreamer = Preferences.GstreamerTypes.GST_0_1;
+               }
+
                if( preferences.videoDeviceNum != UtilGtk.ComboGetActivePos(combo_camera) ) {
                        SqlitePreferences.Update("videoDevice", 
UtilGtk.ComboGetActivePos(combo_camera).ToString(), true);
                        preferences.videoDeviceNum = UtilGtk.ComboGetActivePos(combo_camera);
diff --git a/src/gui/repetitiveConditions.cs b/src/gui/repetitiveConditions.cs
index 0fb26b1..4156f62 100644
--- a/src/gui/repetitiveConditions.cs
+++ b/src/gui/repetitiveConditions.cs
@@ -115,6 +115,7 @@ public class RepetitiveConditionsWindow
 
 
        [Widget] Gtk.Button button_test_good;
+       [Widget] Gtk.Label label_test_sound_result;
        [Widget] Gtk.Button button_close;
 
        //bells good (green)
@@ -239,6 +240,8 @@ public class RepetitiveConditionsWindow
                        if(bellMode == Constants.BellModes.ENCODERINERTIAL)
                                checkbutton_inertial_discard_first_three.Show();
                }
+
+               label_test_sound_result.Text = "";
        }
                
        private void createComboEncoderAutomaticVariable()
@@ -309,11 +312,23 @@ public class RepetitiveConditionsWindow
 
        void on_button_test_clicked (object o, EventArgs args)
        {
-               if(volumeOn) {
+               if(volumeOn)
+               {
+                       Util.TestSound = true;
+
+                       label_test_sound_result.Text = "";
+                       Util.SoundCodes sc;
                        if (o == button_test_good) 
-                               Util.PlaySound(Constants.SoundTypes.GOOD, true, gstreamer);
+                               sc = Util.PlaySound(Constants.SoundTypes.GOOD, true, gstreamer);
                        else //button_test_bad
-                               Util.PlaySound(Constants.SoundTypes.BAD, true, gstreamer);
+                               sc = Util.PlaySound(Constants.SoundTypes.BAD, true, gstreamer);
+
+                       if(sc == Util.SoundCodes.OK)
+                               label_test_sound_result.Text = Catalog.GetString("Sound working");
+                       else
+                               label_test_sound_result.Text = Catalog.GetString("Sound not working");
+
+                       Util.TestSound = false;
                } else
                        new DialogMessage(Constants.MessageTypes.INFO, 
                                        Catalog.GetString("You need to activate sounds in preferences / 
multimedia."));
diff --git a/src/preferences.cs b/src/preferences.cs
index 5b2a335..2c0cb51 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -97,6 +97,10 @@ public class Preferences
                                
        public int encoderCaptureTimeIM = 120; //hardcoded 2 minutes.
 
+       public enum GstreamerTypes { GST_0_1, GST_1_0 };
+       public GstreamerTypes gstreamer;
+       public static string GstreamerStr = "gstreamer"; //in order to ensure write correctly on SQL
+
        /*
         * these are unused on SqlitePreferences.SelectAll
         */
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index cc7aa9a..8c50fcb 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -125,7 +125,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.47";
+       static string lastChronojumpDatabaseVersion = "1.48";
 
        public Sqlite() {
        }
@@ -2242,6 +2242,14 @@ class Sqlite
 
                                currentVersion = updateVersion("1.47");
                        }
+                       if(currentVersion == "1.47")
+                       {
+                               LogB.SQL("Updated preferences: added gstreamer");
+
+                               SqlitePreferences.Insert (Preferences.GstreamerStr, 
Preferences.GstreamerTypes.GST_0_1.ToString());
+
+                               currentVersion = updateVersion("1.48");
+                       }
 
 
                        // --- add more updates here
@@ -2423,6 +2431,7 @@ class Sqlite
                SqlitePreferences.initializeTable(lastChronojumpDatabaseVersion, creatingBlankDatabase);
 
                //changes [from - to - desc]
+               //1.47 - 1.48 Converted DB to 1.48 Updated preferences: added gstreamer
                //1.46 - 1.47 Converted DB to 1.47 Added encoderCaptureBarplotFontSize at preferences
                //1.45 - 1.46 Converted DB to 1.46 Added muteLogs at preferences
                //1.44 - 1.45 Converted DB to 1.45 Added ForceSensorImpulse value
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 0476bd8..c96846e 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -79,6 +79,7 @@ class SqlitePreferences : Sqlite
                                Insert ("language", "", dbcmdTr); 
                                Insert ("allowFinishRjAfterTime", "True", dbcmdTr); 
                                Insert ("volumeOn", "True", dbcmdTr); 
+                               Insert (Preferences.GstreamerStr, 
Preferences.GstreamerTypes.GST_0_1.ToString(), dbcmdTr);
                                Insert ("videoOn", "True", dbcmdTr); 
                                Insert ("evaluatorServerID", "-1", dbcmdTr);
                                Insert ("versionAvailable", "", dbcmdTr);
@@ -312,6 +313,9 @@ class SqlitePreferences : Sqlite
                                preferences.allowFinishRjAfterTime = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "volumeOn")
                                preferences.volumeOn = reader[1].ToString() == "True";
+                       else if(reader[0].ToString() == Preferences.GstreamerStr)
+                               preferences.gstreamer = (Preferences.GstreamerTypes)
+                                       Enum.Parse(typeof(Preferences.GstreamerTypes), reader[1].ToString());
                        else if(reader[0].ToString() == "videoOn")
                                preferences.videoOn = reader[1].ToString() == "True";
                        else if(reader[0].ToString() == "evaluatorServerID")
diff --git a/src/util.cs b/src/util.cs
index 9b86c42..31980b3 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -1316,9 +1316,14 @@ public class Util
         * ------------- sound stuff -----------
         */
 
-       public static void PlaySound (Constants.SoundTypes mySound, bool volumeOn) {
+       public enum SoundCodes { VOLUME_OFF, OK, PROBLEM_NO_FILE, PROBLEM_OTHER };
+       public static bool TestSound;
+
+       public static SoundCodes PlaySound (Constants.SoundTypes mySound,
+                       bool volumeOn, Preferences.GstreamerTypes gstreamer)
+       {
                if ( ! volumeOn )
-                       return;
+                       return SoundCodes.VOLUME_OFF;
                
                /*
                 * Using GstreamerMethod because .Net method makes crash some Linux ALSA,
@@ -1327,12 +1332,13 @@ public class Util
 
                if( UtilAll.GetOSEnum() == UtilAll.OperatingSystems.LINUX ||
                                UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX )
-                       playSoundGstreamer(mySound);
+                       return playSoundGstreamer(mySound, gstreamer);
                else //Windows
-                       playSoundWindows(mySound);
+                       return playSoundWindows(mySound);
        }
        
-       private static void playSoundGstreamer (Constants.SoundTypes mySound) 
+//     private enum gstreamerVersions { GST_0_1, GST_1_0 }
+       private static SoundCodes playSoundGstreamer (Constants.SoundTypes mySound, 
Preferences.GstreamerTypes gstreamer)
        {
                string fileName = "";
                switch(mySound) {
@@ -1357,29 +1363,52 @@ public class Util
 
                if(! File.Exists(fileName)) {
                        LogB.Warning("Cannot found this sound file: " + fileName);
-                       return;
+                       return SoundCodes.PROBLEM_NO_FILE;
                }
 
+               Process p;
                try {
                        ProcessStartInfo pinfo = new ProcessStartInfo();
-                       string pBin="gst-launch-0.10";
+
+                       string pBin= "";
+                       if(gstreamer == Preferences.GstreamerTypes.GST_0_1) {
+                               pBin="gst-launch-0.10";
+                               pinfo.Arguments = "playbin2 " + @"uri=file://" + fileName;
+                       }
+                       else { //gstreamer == Preferences.GstreamerTypes.GST_1_0
+                               pBin="gst-launch-1.0";
+                               pinfo.Arguments = "playbin " + @"uri=file://" + fileName;
+                       }
 
                        pinfo.FileName=pBin;
-                       pinfo.Arguments = "playbin2 " + @"uri=file://" + fileName;
+
                        LogB.Information("Arguments:", pinfo.Arguments);
                        pinfo.CreateNoWindow = true;
                        pinfo.UseShellExecute = false;
 
-                       Process p = new Process();
+                       if(TestSound)
+                               pinfo.RedirectStandardError = true;
+
+                       p = new Process();
                        p.StartInfo = pinfo;
                        p.Start();
                } catch {
                        LogB.Error("Cannot playSoundGstreamer");
+                       return SoundCodes.PROBLEM_OTHER;
+               }
+
+               if(TestSound)
+               {
+                       string stderr = p.StandardError.ReadToEnd ().TrimEnd ('\n');
+                       if(stderr != "")
+                               return SoundCodes.PROBLEM_OTHER;
                }
+
+               return SoundCodes.OK;
        }
 
        //maybe in the future this method will be deprecated and it only will be used the Gstreamer method
-       private static void playSoundWindows (Constants.SoundTypes mySound) 
+       private static SoundCodes playSoundWindows (Constants.SoundTypes mySound)
        {
                try {
                        switch(mySound) {
@@ -1396,7 +1425,10 @@ public class Util
                        }
                } catch {
                        LogB.Error("Cannot playSoundWindows");
+                       return SoundCodes.PROBLEM_OTHER;
                }
+
+               return SoundCodes.OK;
        }
        
        /*


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