diff options
author | Wim Taymans <wtaymans@redhat.com> | 2014-06-12 16:52:52 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2014-06-12 16:52:52 +0200 |
commit | 3c68baa27f5477f6b9ef9f0ac7897d7670047dea (patch) | |
tree | 1c4d10053779d347da459e7be8497b0fa985c706 | |
parent | b15231d4ee01c09d09d6589289d0873535a8391c (diff) |
-rw-r--r-- | data/new-recording-dialog.ui | 2 | ||||
-rw-r--r-- | src/app/window.js | 48 |
2 files changed, 34 insertions, 16 deletions
diff --git a/data/new-recording-dialog.ui b/data/new-recording-dialog.ui index d89dee7..bb1164c 100644 --- a/data/new-recording-dialog.ui +++ b/data/new-recording-dialog.ui @@ -119,7 +119,7 @@ </packing> </child> <child> - <object class="GtkCheckButton" id="checkbutton1"> + <object class="GtkCheckButton" id="record-audio"> <property name="label" translatable="yes">Record audio</property> <property name="visible">True</property> <property name="can_focus">True</property> diff --git a/src/app/window.js b/src/app/window.js index 90ee000..83ddb54 100644 --- a/src/app/window.js +++ b/src/app/window.js @@ -91,23 +91,23 @@ const NewScreenshotController = new Lang.Class({ let method_name, method_params; if (this._buttonScreenshotAll.get_active()) { - method_name = 'Screenshot'; - method_params = new GLib.Variant ('(bbs)', + method_name = 'Screenshot'; + method_params = new GLib.Variant ('(bbs)', [true, /* cursor */ true, /* flash */ '/tmp/ss-test']); } else if (this._buttonScreenshotWindow.get_active()) { - method_name = 'ScreenshotWindow'; - method_params = new GLib.Variant ('(bbbs)', + method_name = 'ScreenshotWindow'; + method_params = new GLib.Variant ('(bbbs)', [true, /* frame */ true, /* cursor */ true, /* flash */ '/tmp/ss-test']); } else if (this._buttonScreenshotArea.get_active()) { - let area = _selectArea(connection); + let area = _selectArea(connection); - method_name = 'ScreenshotArea'; - method_params = new GLib.Variant ('(iiiibs)', + method_name = 'ScreenshotArea'; + method_params = new GLib.Variant ('(iiiibs)', [area[0], area[1], area[2], @@ -142,6 +142,7 @@ const NewRecordingController = new Lang.Class({ this._buttonRecordAll = builder.get_object('record-all'); this._buttonRecordArea = builder.get_object('record-area'); + this._buttonRecordAudio = builder.get_object('record-audio'); let dialog = builder.get_object('recording-dialog'); @@ -166,23 +167,40 @@ const NewRecordingController = new Lang.Class({ let connection = Gio.Application.get_default().get_dbus_connection(); let method_name, method_params; + let options = {}; + + print (this._buttonRecordAudio); + + if (this._buttonRecordAudio.get_active()) { + options = { pipeline: new GLib.Variant('s', + "vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T " + + "! queue " + + "! webmmux name=mux " + + "pulsesrc " + + "! vorbisenc " + + "! queue " + + "! mux.")}; + } else { + options = null; + } + print (options); if (this._buttonRecordAll.get_active()) { - method_name = 'Screencast'; - method_params = new GLib.Variant ('(sa{sv})', + method_name = 'Screencast'; + method_params = new GLib.Variant ('(sa{sv})', ['/tmp/sc-test', - null]); + options ]); } else if (this._buttonRecordArea.get_active()) { - let area = _selectArea(connection); + let area = _selectArea(connection); - method_name = 'ScreencastArea'; - method_params = new GLib.Variant ('(iiiisa{sv})', + method_name = 'ScreencastArea'; + method_params = new GLib.Variant ('(iiiisa{sv})', [area[0], area[1], area[2], area[3], '/tmp/sc-test-area', - null]); + options]); } connection.call_sync ('org.gnome.Shell.Screencast', @@ -368,7 +386,7 @@ const MainWindow = new Lang.Class({ }, _getTitle: function() { - return [_("Screen Recordings"), null]; + return [_("Screen Recordings"), null]; }, _goToPage: function(page) { |