Skip to content

Commit

Permalink
Background recording settings
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Jun 14, 2016
1 parent 3fed3c7 commit 6afb1aa
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 20 deletions.
135 changes: 120 additions & 15 deletions GameDVR_ConfigForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 33 additions & 3 deletions GameDVR_ConfigForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ private void GameDVR_ConfigForm_Load(object sender, EventArgs e)
HeightTextBox.Text = GetInt("CustomVideoEncodingHeight", 720).ToString();
ForceSoftwareMFTCheckBox.Checked = GetBool("ForceSoftwareMFT", false);
DisableCursorBlendingCheckBox.Checked = GetBool("DisableCursorBlending", false);
BackgroundRecordingCheckBox.Checked = GetBool("HistoricalCaptureEnabled", false);
RecordTheLastTextBox.Text = GetInt("HistoricalBufferLength", 15).ToString();
RecordOnBatteryCheckBox.Checked = GetBool("HistoricalCaptureOnBatteryAllowed", true);
RecordOnWirelessDisplayCheckBox.Checked = GetBool("HistoricalCaptureOnWirelessDisplayAllowed", true);

SetInt("VideoEncodingBitrateMode", 0);
}
Expand Down Expand Up @@ -67,7 +71,7 @@ private void VideoBitrateTextBox_TextChanged(object sender, EventArgs e)
try { videoBitrate = Convert.ToInt32(VideoBitrateTextBox.Text) * 1000; }
catch { videoBitrate = 4000000; }

SetInt("CustomVideoEncodingBitrate", videoBitrate);
SetInt("CustomVideoEncodingBitrate", videoBitrate > 30000000 ? 30000000 : videoBitrate);
}

private void ResizeVideoCheckBox_CheckedChanged(object sender, EventArgs e)
Expand All @@ -82,7 +86,7 @@ private void WidthTextBox_TextChanged(object sender, EventArgs e)
try { width = Convert.ToInt32(WidthTextBox.Text); }
catch { width = 1280; }

SetInt("CustomVideoEncodingWidth", width);
SetInt("CustomVideoEncodingWidth", width > 1920 ? 1920 : width);
}

private void HeightTextBox_TextChanged(object sender, EventArgs e)
Expand All @@ -91,7 +95,7 @@ private void HeightTextBox_TextChanged(object sender, EventArgs e)
try { height = Convert.ToInt32(HeightTextBox.Text); }
catch { height = 720; }

SetInt("CustomVideoEncodingHeight", height);
SetInt("CustomVideoEncodingHeight", height > 1080 ? 1080 : height);
}

private void ForceSoftwareMFTCheckBox_CheckedChanged(object sender, EventArgs e)
Expand All @@ -105,6 +109,32 @@ private void DisableCursorBlendingCheckBox_CheckedChanged(object sender, EventAr
SetBool("DisableCursorBlending", DisableCursorBlendingCheckBox.Checked);
}

private void BackgroundRecordingCheckBox_CheckedChanged(object sender, EventArgs e)
{
SetBool("HistoricalCaptureEnabled", BackgroundRecordingCheckBox.Checked);
RecordTheLastLabel.Enabled = RecordTheLastTextBox.Enabled = RecordOnBatteryCheckBox.Enabled =
RecordOnWirelessDisplayCheckBox.Enabled = SecondsLabel.Enabled = BackgroundRecordingCheckBox.Checked;
}

private void RecordTheLastTextBox_TextChanged(object sender, EventArgs e)
{
int seconds;
try { seconds = Convert.ToInt32(RecordTheLastTextBox.Text); }
catch { seconds = 15; }

SetInt("HistoricalBufferLength", seconds);
}

private void RecordOnBatteryCheckBox_CheckedChanged(object sender, EventArgs e)
{
SetBool("HistoricalCaptureOnBatteryAllowed", RecordOnBatteryCheckBox.Checked);
}

private void RecordOnWirelessDisplayCheckBox_CheckedChanged(object sender, EventArgs e)
{
SetBool("HistoricalCaptureOnWirelessDisplayAllowed", RecordOnWirelessDisplayCheckBox.Checked);
}

int GetInt(string valueName, int defaultValue)
{
try { return (int)Registry.GetValue(keyName, valueName, defaultValue.ToString()); }
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyVersion("1.2.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")]

0 comments on commit 6afb1aa

Please sign in to comment.