Skip to content

Commit

Permalink
Leave some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ryonakano committed Aug 13, 2023
1 parent 87571eb commit bb78c52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
14 changes: 8 additions & 6 deletions src/Services/Recorder.vala
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ public class Recorder : Object {
public signal void save_file (string tmp_full_path, string suffix);

public enum RecordingState {
STOPPED,
PAUSED,
RECORDING
STOPPED, // Not recording
PAUSED, // Recording is paused
RECORDING // Recording is ongoing
}

// Convert from RecordingState to Gst.State
private const Gst.State GST_STATE_TABLE[] = {
Gst.State.NULL,
Gst.State.PAUSED,
Gst.State.PLAYING
Gst.State.NULL, // RecordingState.STOPPED
Gst.State.PAUSED, // RecordingState.PAUSED
Gst.State.PLAYING // RecordingState.RECORDING
};

public RecordingState state {
Expand All @@ -29,6 +30,7 @@ public class Recorder : Object {
}

set {
// Control actual recording to stop, start, or pause
pipeline.set_state (GST_STATE_TABLE[value]);
_state = value;
}
Expand Down
7 changes: 4 additions & 3 deletions src/Widgets/LevelBar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ public class LevelBar : Gtk.Box {
serie.line.color = { 0.7f, 0.1f, 0.2f, 1.0f };

if (timestamp == -1) {
timestamp = GLib.get_real_time () / 1000;
// Seek on the timeline
config.time.current = GLib.get_real_time () / config.time.conv_us;
// Seek to the current timestamp
int64 now_msec = GLib.get_real_time () / 1000;
timestamp = now_msec;
config.time.current = now_msec;
}

update_graph_timeout = Timeout.add (REFRESH_USEC, () => {
Expand Down

0 comments on commit bb78c52

Please sign in to comment.