Skip to content

Commit

Permalink
Fix FullScreen Fade
Browse files Browse the repository at this point in the history
  • Loading branch information
luvletter2333 committed May 15, 2021
1 parent 92d9ad8 commit db554a5
Show file tree
Hide file tree
Showing 6 changed files with 289 additions and 142 deletions.
38 changes: 22 additions & 16 deletions Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum RenderMode
SubTitle Previewing = SubTitle.Empty;

JObject Config;
NDIConfig NDI_Config;
RenderConfig NDI_Config;
NDIRender Renderer;
CancellationTokenSource cancelNDI;
float Font_Size;
Expand Down Expand Up @@ -70,9 +70,9 @@ private void Form1_Load(object sender, EventArgs e)
{
Config = JObject.Parse(File.ReadAllText(config_path));
if (Config.ContainsKey("NDI"))
NDI_Config = NDIConfig.ReadNDIConfig(Config["NDI"] as JObject);
NDI_Config = RenderConfig.ReadNDIConfig(Config["NDI"] as JObject);
else
NDI_Config = new NDIConfig(true);
NDI_Config = new RenderConfig(true);
if (Config.ContainsKey("Font-Size"))
Font_Size = Convert.ToSingle(Config["Font-Size"].ToString());
else
Expand All @@ -82,7 +82,7 @@ private void Form1_Load(object sender, EventArgs e)
{
Console.WriteLine("Reading Config File Failed");
Console.WriteLine(ex.ToString());
NDI_Config = new NDIConfig(true);
NDI_Config = new RenderConfig(true);
Font_Size = 50;
}
}
Expand Down Expand Up @@ -309,21 +309,31 @@ private void btn_Clear_Fade_Click(object sender = null, EventArgs e = null)
{
if (render_form == null)
return;

render_form.Fade(SubTitle.Empty);
Program(SubTitle.Empty);
}
}

private void btn_fade_Click(object sender = null, EventArgs e = null) //Fade
{
if (Renderer == null)
return;
if (subTitles.Count == 0)
return;
if (lst_SubTitle.SelectedIndex < 0)
return;
if (subTitles.Count > lst_SubTitle.SelectedIndex)
{
Renderer.Fade(Previewing);
if (render_mode == RenderMode.FullScreen)
{
if (render_form == null)
return;
render_form.Fade(Previewing);
}
else
{
if (Renderer == null)
return;
Renderer.Fade(Previewing);
}
Program(Previewing);
run_printer = Previewing.id + 1;
if (run_printer != subTitles.Count)
Expand All @@ -342,21 +352,17 @@ private void btn_Hard_Click(object sender = null, EventArgs e = null)//Send Dire
{
if (render_form == null) return;
render_form.Cut(Previewing);
Program(Previewing);
run_printer = Previewing.id + 1;
if (run_printer != subTitles.Count)
lst_SubTitle.SetSelected(run_printer, true);
}
else
{
if (Renderer == null)
return;
Renderer.Cut(Previewing);
Program(Previewing);
run_printer = Previewing.id + 1;
if (run_printer != subTitles.Count)
lst_SubTitle.SetSelected(run_printer, true);
}
Program(Previewing);
run_printer = Previewing.id + 1;
if (run_printer != subTitles.Count)
lst_SubTitle.SetSelected(run_printer, true);
}

private void btn_Clear_Click(object sender = null, EventArgs e = null)
Expand Down
Loading

0 comments on commit db554a5

Please sign in to comment.