[gnome-sound-recorder] listview.js, play.js: Code cleanup
- From: Meg Ford (Margaret) <megford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-sound-recorder] listview.js, play.js: Code cleanup
- Date: Mon, 2 Jun 2014 06:15:29 +0000 (UTC)
commit 9468c2dbf076fb6c3a012c9760a775c4fb67bd89
Author: Meg Ford <megford gnome org>
Date: Mon Jun 2 00:45:03 2014 -0500
listview.js, play.js: Code cleanup
src/listview.js | 6 ++++--
src/play.js | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/listview.js b/src/listview.js
index 0254d5a..531e843 100644
--- a/src/listview.js
+++ b/src/listview.js
@@ -198,7 +198,7 @@ const Listview = new Lang.Class({
_onDiscovererFinished: function(res, info, err) {
this.result = res;
- if (this.result == GstPbutils.DiscovererResult.OK) {
+ if (this.result == GstPbutils.DiscovererResult.OK && allFilesInfo[this.idx]) {
this.tagInfo = info.get_tags(info);
let appString = "";
let dateTimeCreatedString = "";
@@ -227,6 +227,7 @@ const Listview = new Lang.Class({
this._getCapsForList(info);
} else {
// don't index files we can't play
+ allFilesInfo.splice(this.idx, 1);
log("File cannot be played");
}
@@ -255,7 +256,8 @@ const Listview = new Lang.Class({
_onDirChanged: function(dirMonitor, file1, file2, eventType) {
if (eventType == Gio.FileMonitorEvent.DELETED ||
- (eventType == Gio.FileMonitorEvent.CHANGES_DONE_HINT && MainWindow.recordPipeline ==
MainWindow.RecordPipelineStates.STOPPED)) {
+ (eventType == Gio.FileMonitorEvent.CHANGES_DONE_HINT
+ && MainWindow.recordPipeline == MainWindow.RecordPipelineStates.STOPPED)) {
stopVal = EnumeratorState.ACTIVE;
allFilesInfo.length = 0;
fileInfo.length = 0;
diff --git a/src/play.js b/src/play.js
index 48bd76a..78530d8 100644
--- a/src/play.js
+++ b/src/play.js
@@ -114,7 +114,8 @@ const _TENTH_SEC = 100000000;
this.timeout = null;
}
- MainWindow.wave.endDrawing();
+ if (MainWindow.wave != null)
+ MainWindow.wave.endDrawing();
},
onEndOfStream: function() {
@@ -207,7 +208,6 @@ const _TENTH_SEC = 100000000;
this._updateTime));
}
},
-
setVolume: function(value) {
this.play.set_volume(GstAudio.StreamVolumeFormat.CUBIC, value);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]