Skip to content

Commit

Permalink
Open Beta 0.0.3 (Core and UI Update)
Browse files Browse the repository at this point in the history
  • Loading branch information
bedtwL committed Jan 11, 2023
1 parent 0e85665 commit b56821f
Show file tree
Hide file tree
Showing 15 changed files with 492 additions and 120 deletions.
Binary file added Icon/YoutubeEnchanted-64x64.ico
Binary file not shown.
Binary file added Icon/YoutubeEnchantedIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icon/YoutubeEnchantedIcon.psd
Binary file not shown.
4 changes: 2 additions & 2 deletions YoutubeEnchanted/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ internal class Program
public static BGN_VIDEO Mainwindow;
static void Main()
{

System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory + "Logs\\");
//APICore.Play(Console.ReadLine());
System.IO.File.WriteAllText(LogPath, "[" + DateTime.Now.ToString() + "] Log Started");

System.IO.Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory+"Logs\\");

API.APICore.Log("Youtube Enchanted "+ Application.ProductVersion.Substring(0, 5));
RunWindow();

Expand Down
4 changes: 2 additions & 2 deletions YoutubeEnchanted/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// 您可以指定所有的值,也可以使用 '*' 將組建和修訂編號
// 設為預設,如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.0.3")]
[assembly: AssemblyFileVersion("0.0.3")]
[assembly: AssemblyVersion("0.0.4")]
[assembly: AssemblyFileVersion("0.0.4")]
[assembly: NeutralResourcesLanguage("")]
2 changes: 1 addition & 1 deletion YoutubeEnchanted/Topic.db
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Cyberpunk Workout Music
彌豆子主題曲1hr
187 changes: 106 additions & 81 deletions YoutubeEnchanted/UI/BGN_VIDEO.Designer.cs

Large diffs are not rendered by default.

75 changes: 54 additions & 21 deletions YoutubeEnchanted/UI/BGN_VIDEO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,27 @@ private async void UpdateVideo(string id, string top)
private async void Tick()
{
await Task.Delay(1000);
this.Controls.Add(MainSec = new UI.MainPage() { Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom, Size = this.Size });
this.Controls.Add(MainSec = new UI.MainPage() { Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top | AnchorStyles.Bottom, Size = this.Size,Location=new Point(0,10) });
Message(new UI.Message("You are using YoutubeEnchanted v" + Application.ProductVersion.Substring(0, 5)));
do
{
try
{

if (APICore.FullScreen && this.FormBorderStyle == FormBorderStyle.Sizable)
{ pictureBox7.Visible = true; this.FormBorderStyle = FormBorderStyle.None; this.TopMost = true; }
else if (APICore.FullScreen == false) { pictureBox7.Visible = false; this.FormBorderStyle = FormBorderStyle.Sizable; this.TopMost = false; }
{ Message(new UI.Message("Full Screen is Enabled")); this.WindowState = FormWindowState.Normal; await Task.Delay(100); pictureBox7.Visible = true; this.FormBorderStyle = FormBorderStyle.None;this.WindowState = FormWindowState.Maximized; this.TopMost = true; }
else if (APICore.FullScreen == false&&this.FormBorderStyle==FormBorderStyle.None) { Message(new UI.Message("Full Screen is Disabled")); this.WindowState = FormWindowState.Normal; await Task.Delay(100); pictureBox7.Visible = false; this.FormBorderStyle = FormBorderStyle.Sizable;this.WindowState = FormWindowState.Maximized; this.TopMost = false; }
if (APICore.ShowPlayControlMenu)
{
//APICore.PARSED_URL = false;
if (nowurl == APICore._PARSE_URL)
{
pictureBox4.Visible = true;
label6.Visible = true;
label4.Visible = true;

label3.Visible = true;
label2.Visible = true;
switch (videoPlayCore.State)
{
case Vlc.DotNet.Core.Interops.Signatures.MediaStates.NothingSpecial:
Expand Down Expand Up @@ -109,13 +115,14 @@ private async void Tick()
}
else
{
panel4.Visible = true;
pictureBox4.Visible = true;
label6.Visible = true;
label4.Visible = true;
label5.Visible = true;

label3.Visible = true;
label2.Visible = true;

flowLayoutPanel1.Visible = true;
nowurl = APICore._PARSE_URL;
panel2.Visible = true;
Expand Down Expand Up @@ -149,20 +156,21 @@ private async void Tick()
videoPlayCore.Play(APICore._PARSE_URL);

UpdateVideo(APICore.NOW_URL, APICore.Topic);
label5.Text = APICore.VideoDes;



label4.Text = APICore.Title;
UpdateVideoAuthor(APICore.Topic);
UpdateVideoAuthor(APICore.NOW_URL);
API.APICore.Log("Playing " + APICore._PARSE_URL);
}

}
else
{
panel4.Visible = false;
label6.Visible = false;
label4.Visible = false;
label5.Visible = false;

label3.Visible = false;
pictureBox4.Visible = false;
flowLayoutPanel1.Visible = false;
Expand Down Expand Up @@ -206,15 +214,17 @@ private async void UpdateVideoAuthor(string vidUrl)
try
{
var vid = await yt.Videos.GetAsync(vidUrl);

panel4.Visible = true;
richTextBox1.Text=vid.Description;
var us = await yt.Channels.GetAsync(vid.Author.ChannelUrl);
label6.Text = us.Title;
pictureBox4.LoadAsync(us.Thumbnails[0].Url);

}
catch
catch(Exception ex)
{
pictureBox4.Image = null;
Message(new Message("Cannot Load Author Info due to "+ex.Message+"\n"+ex.StackTrace));

}
}
Expand All @@ -234,15 +244,12 @@ private void panel2_Paint(object sender, PaintEventArgs e)
private void colorSlider1_Scroll(object sender, ScrollEventArgs e)
{
if (videoPlayCore.State == Vlc.DotNet.Core.Interops.Signatures.MediaStates.Ended)
{
videoPlayCore.Play(_PARSE_URL);
}
{ videoPlayCore.Play(_PARSE_URL); }
else { videoPlayCore.Time = long.Parse(colorSlider1.Value.ToString()) * 1000; }

}
private async void panel1_VisibleChanged(object sender, EventArgs e)
{
await Task.Delay(5000);
await Task.Delay(10000);
panel1.Visible = false;
}

Expand All @@ -259,6 +266,10 @@ private void colorSlider2_Scroll(object sender, ScrollEventArgs e)
private void pictureBox1_Click_1(object sender, EventArgs e)
{
videoPlayCore.Pause();
if (videoPlayCore.State == Vlc.DotNet.Core.Interops.Signatures.MediaStates.Ended)
{
videoPlayCore.Play(_PARSE_URL);
}
}
private void BGN_VIDEO_Load(object sender, EventArgs e)
{
Expand Down Expand Up @@ -310,8 +321,15 @@ private void BGN_VIDEO_KeyUp(object sender, KeyEventArgs e)
{

case Keys.Enter:
MainSec.StartSerch(textBox1.Text);
textBox1.Text = "";
if (textBox1.Text == "")
{ }
else
{
APICore.ShowPlayControlMenu = false;

MainSec.StartSerch(textBox1.Text);
textBox1.Text = "";
}
break;
case Keys.Space:
try { videoPlayCore.Pause(); } catch (Exception ex) { APICore.Log("User Press Space but " + ex.Message); APICore.Log(ex.StackTrace); }
Expand All @@ -325,16 +343,25 @@ private void BGN_VIDEO_KeyUp(object sender, KeyEventArgs e)
case Keys.F11:
APICore.FullScreen = APICore.ToggleBool(APICore.FullScreen);
break;
case Keys.BrowserHome:
APICore.ShowPlayControlMenu = false;
break;


}
}

private void pictureBox5_Click(object sender, EventArgs e)
{
MainSec.StartSerch(textBox1.Text);
APICore.ShowPlayControlMenu = false;
textBox1.Text = "";
if (textBox1.Text == "")
{ }
else {
APICore.ShowPlayControlMenu = false;

MainSec.StartSerch(textBox1.Text);
textBox1.Text = "";
}

}
int createsize = 10;
private void flowLayoutPanel1_ControlAdded(object sender, ControlEventArgs e)
Expand Down Expand Up @@ -426,7 +453,8 @@ private async void flowLayoutPanel2_ControlAdded(object sender, ControlEventArgs

private void pictureBox7_MouseEnter(object sender, EventArgs e)
{
pictureBox8.Visible = true;
if (APICore.FullScreen) { pictureBox8.Visible = true; }

//panel4.Visible = true;
}

Expand Down Expand Up @@ -570,5 +598,10 @@ private async void panel4_VisibleChanged(object sender, EventArgs e)
await Task.Delay(5000);
//panel4.Visible = false;
}

private void pictureBox3_Paint(object sender, PaintEventArgs e)
{
pictureBox3.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, flowLayoutPanel2.Width, flowLayoutPanel2.Height, 20, 20));
}
}
}
Loading

0 comments on commit b56821f

Please sign in to comment.