[gnome-sound-recorder] application.js, record.js: reset all the record variables and delete the empty file if the recording



commit 4d358ce046c5d00d84487009ebe418211ab7e391
Author: Meg Ford <meg387 gmail com>
Date:   Sat Feb 15 18:24:29 2014 -0600

    application.js, record.js: reset all the record variables and delete the empty file if the recording 
pipeline returns a failure state

 src/application.js |    6 +++---
 src/record.js      |    2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 01df459..eff7cb4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -94,13 +94,13 @@ const Application = new Lang.Class({
     },
     
     onWindowDestroy: function() {
-        if (MainWindow.wave != null)
+        if (MainWindow.wave.pipeline)
             MainWindow.wave.pipeline.set_state(Gst.State.NULL);
             
-        if (MainWindow._record.pipeline.getState(Gst.Second) != null) 
+        if (MainWindow._record.pipeline) 
             MainWindow._record.pipeline.set_state(Gst.State.NULL);
         
-        if (MainWindow.play.play.getState(Gst.Second) != null) 
+        if (MainWindow.play.play) 
             MainWindow.play.play.set_state(Gst.State.NULL);        
     },
     
diff --git a/src/record.js b/src/record.js
index 1d93b77..6381b17 100644
--- a/src/record.js
+++ b/src/record.js
@@ -151,6 +151,7 @@ const Record = new Lang.Class({
         
         if (ret == Gst.StateChangeReturn.FAILURE) {
             this._showErrorDialog(_('Unable to set the pipeline \n to the recording state')); 
+            this.initialFileName.delete_async(GLib.PRIORITY_DEFAULT, null, null);
         } else {        
             MainWindow.view.setVolume(); 
         }
@@ -265,6 +266,7 @@ const Record = new Lang.Class({
             function() {
                 errorDialog.destroy();
                 MainWindow.view.onRecordStopClicked();
+                this.onEndOfStream();
             }));
         errorDialog.show();
     } 


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