-
-
Notifications
You must be signed in to change notification settings - Fork 321
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Peek Copyright (c) 2015 by Philipp Wolfer <[email protected]> | ||
Peek Copyright (c) 2015-2016 by Philipp Wolfer <[email protected]> | ||
This file is part of Peek. | ||
|
@@ -36,7 +36,7 @@ public class PeekApplication : Gtk.Application { | |
} | ||
|
||
public override void activate () { | ||
var recorder = new ScreenRecorder (); | ||
var recorder = new FfmpegScreenRecorder (); | ||
main_window = new PeekApplicationWindow (this, recorder); | ||
main_window.present (); | ||
} | ||
|
34 changes: 4 additions & 30 deletions
34
src/screen-recorder.vala → ...reen-recorder/ffmpeg-screen-recorder.vala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,21 @@ | ||
/* | ||
Peek Copyright (c) 2015 by Philipp Wolfer <[email protected]> | ||
Peek Copyright (c) 2015-2016 by Philipp Wolfer <[email protected]> | ||
This file is part of Peek. | ||
This software is licensed under the GNU General Public License | ||
(version 3 or later). See the LICENSE file in this distribution. | ||
*/ | ||
|
||
using GLib; | ||
|
||
public struct RecordingArea { | ||
public int left; | ||
public int top; | ||
public int width; | ||
public int height; | ||
|
||
public bool equals (RecordingArea? other) { | ||
if (other == null) { | ||
return false; | ||
} | ||
|
||
return this.left == other.left | ||
&& this.top == other.top | ||
&& this.width == other.width | ||
&& this.height == other.height; | ||
} | ||
} | ||
|
||
public class ScreenRecorder : Object { | ||
public class FfmpegScreenRecorder : Object, ScreenRecorder { | ||
private IOChannel input; | ||
private string temp_file; | ||
|
||
public bool is_recording { get; private set; default = false; } | ||
public bool is_recording { get; protected set; default = false; } | ||
|
||
public int framerate { get; set; default = 15; } | ||
|
||
public signal void recording_started (); | ||
|
||
public signal void recording_finished (File file); | ||
|
||
public signal void recording_aborted (int status); | ||
|
||
~ScreenRecorder () { | ||
~FfmpegScreenRecorder () { | ||
cancel (); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
Peek Copyright (c) 2016 by Philipp Wolfer <[email protected]> | ||
This file is part of Peek. | ||
This software is licensed under the GNU General Public License | ||
(version 3 or later). See the LICENSE file in this distribution. | ||
*/ | ||
|
||
public struct RecordingArea { | ||
public int left; | ||
public int top; | ||
public int width; | ||
public int height; | ||
|
||
public bool equals (RecordingArea? other) { | ||
if (other == null) { | ||
return false; | ||
} | ||
|
||
return this.left == other.left | ||
&& this.top == other.top | ||
&& this.width == other.width | ||
&& this.height == other.height; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Peek Copyright (c) 2016 by Philipp Wolfer <[email protected]> | ||
This file is part of Peek. | ||
This software is licensed under the GNU General Public License | ||
(version 3 or later). See the LICENSE file in this distribution. | ||
*/ | ||
|
||
public interface ScreenRecorder : Object { | ||
public abstract bool is_recording { get; protected set; } | ||
|
||
public signal void recording_started (); | ||
|
||
public signal void recording_finished (File file); | ||
|
||
public signal void recording_aborted (int status); | ||
|
||
public abstract bool record (RecordingArea area); | ||
|
||
public abstract File? stop (); | ||
|
||
public abstract void cancel (); | ||
} |