Signed-off-by: mbrucedogs <mbrucedogs@gmail.com>
This commit is contained in:
parent
f47fb454e8
commit
da237479c3
@ -19,7 +19,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SongCrawler", "SongCrawler\
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Herse.Models", "Herse.Models\Herse.Models.csproj", "{F02EDA00-AA8F-47EF-AC7F-66DC315AA13D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BillboardPlaylistUpdater", "BillboardPlaylistUpdater\BillboardPlaylistUpdater.csproj", "{AE892DF7-C43E-422A-B82E-29B5E6E0341C}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SongListUpdater", "SongListUpdater\SongListUpdater.csproj", "{AE892DF7-C43E-422A-B82E-29B5E6E0341C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SingsALot", "SingsALot\SingsALot.csproj", "{40954789-DA71-4C0B-8D03-184B19248982}"
|
||||
EndProject
|
||||
|
||||
20
KaraokePlayer/SongInfoForm.Designer.cs
generated
20
KaraokePlayer/SongInfoForm.Designer.cs
generated
@ -51,13 +51,12 @@
|
||||
//
|
||||
// songTitleLabel
|
||||
//
|
||||
this.songTitleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.songTitleLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.songTitleLabel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.songTitleLabel.Font = new System.Drawing.Font("Segoe UI", 48F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.songTitleLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(215)))), ((int)(((byte)(0)))));
|
||||
this.songTitleLabel.Location = new System.Drawing.Point(50, 450);
|
||||
this.songTitleLabel.Location = new System.Drawing.Point(50, 530);
|
||||
this.songTitleLabel.Name = "songTitleLabel";
|
||||
this.songTitleLabel.Size = new System.Drawing.Size(1100, 200);
|
||||
this.songTitleLabel.TabIndex = 3;
|
||||
@ -67,13 +66,12 @@
|
||||
//
|
||||
// artistLabel
|
||||
//
|
||||
this.artistLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.artistLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.artistLabel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.artistLabel.Font = new System.Drawing.Font("Segoe UI", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.artistLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(200)))), ((int)(((byte)(200)))), ((int)(((byte)(200)))));
|
||||
this.artistLabel.Location = new System.Drawing.Point(50, 350);
|
||||
this.artistLabel.Location = new System.Drawing.Point(50, 420);
|
||||
this.artistLabel.Name = "artistLabel";
|
||||
this.artistLabel.Size = new System.Drawing.Size(1100, 80);
|
||||
this.artistLabel.TabIndex = 2;
|
||||
@ -83,13 +81,12 @@
|
||||
//
|
||||
// singerLabel
|
||||
//
|
||||
this.singerLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.singerLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.singerLabel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.singerLabel.Font = new System.Drawing.Font("Segoe UI", 42F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.singerLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(255)))), ((int)(((byte)(255)))));
|
||||
this.singerLabel.Location = new System.Drawing.Point(50, 200);
|
||||
this.singerLabel.Location = new System.Drawing.Point(50, 270);
|
||||
this.singerLabel.Name = "singerLabel";
|
||||
this.singerLabel.Size = new System.Drawing.Size(1100, 120);
|
||||
this.singerLabel.TabIndex = 1;
|
||||
@ -99,13 +96,12 @@
|
||||
//
|
||||
// upNextLabel
|
||||
//
|
||||
this.upNextLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
this.upNextLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.upNextLabel.BackColor = System.Drawing.Color.Transparent;
|
||||
this.upNextLabel.Font = new System.Drawing.Font("Segoe UI", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.upNextLabel.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(0)))));
|
||||
this.upNextLabel.Location = new System.Drawing.Point(50, 100);
|
||||
this.upNextLabel.Location = new System.Drawing.Point(50, 170);
|
||||
this.upNextLabel.Name = "upNextLabel";
|
||||
this.upNextLabel.Size = new System.Drawing.Size(1100, 60);
|
||||
this.upNextLabel.TabIndex = 0;
|
||||
|
||||
@ -1,147 +1,85 @@
|
||||
using Herse.Models;
|
||||
using KaraokePlayer.Classes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace KaraokePlayer
|
||||
{
|
||||
public partial class SongInfoForm : Form
|
||||
{
|
||||
private Timer fadeTimer;
|
||||
private Timer pulseTimer;
|
||||
private int fadeAlpha = 0;
|
||||
private bool isFadingIn = true;
|
||||
private int pulseAlpha = 255;
|
||||
private bool pulseDirection = false;
|
||||
|
||||
public SongInfoForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
|
||||
this.WindowState = FormWindowState.Normal;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
|
||||
this.WindowState = FormWindowState.Maximized;
|
||||
this.ShowInTaskbar = false;
|
||||
this.TopMost = true;
|
||||
|
||||
// Enable double buffering to prevent flickering
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);
|
||||
|
||||
// Add paint event for gradient background
|
||||
mainPanel.Paint += MainPanel_Paint;
|
||||
|
||||
// Setup fade timer
|
||||
fadeTimer = new Timer();
|
||||
fadeTimer.Interval = 20;
|
||||
fadeTimer.Tick += FadeTimer_Tick;
|
||||
|
||||
// Setup pulse timer for "UP NEXT" label
|
||||
pulseTimer = new Timer();
|
||||
pulseTimer.Interval = 50;
|
||||
pulseTimer.Tick += PulseTimer_Tick;
|
||||
|
||||
// Start fade in effect
|
||||
StartFadeIn();
|
||||
// Calculate dynamic positioning after form is loaded
|
||||
this.Load += SongInfoForm_Load;
|
||||
}
|
||||
|
||||
private void StartFadeIn()
|
||||
private void SongInfoForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
fadeAlpha = 0;
|
||||
isFadingIn = true;
|
||||
fadeTimer.Start();
|
||||
pulseTimer.Start();
|
||||
CalculateDynamicPositions();
|
||||
}
|
||||
|
||||
private void PulseTimer_Tick(object sender, EventArgs e)
|
||||
private void CalculateDynamicPositions()
|
||||
{
|
||||
if (pulseDirection)
|
||||
// Get the actual screen dimensions
|
||||
int screenHeight = this.ClientSize.Height;
|
||||
int screenWidth = this.ClientSize.Width;
|
||||
|
||||
// Calculate font scaling factor based on screen size
|
||||
// Base scaling on the smaller dimension to ensure everything fits
|
||||
float baseScale = Math.Min(screenHeight / 800f, screenWidth / 1200f);
|
||||
float fontScale = Math.Max(0.8f, Math.Min(2.0f, baseScale)); // Limit scale between 0.8x and 2.0x
|
||||
|
||||
// Calculate spacing between labels (increases with font size)
|
||||
int labelSpacing = (int)(30 * fontScale);
|
||||
|
||||
// Update font sizes
|
||||
upNextLabel.Font = new Font("Segoe UI", 24 * fontScale, FontStyle.Regular);
|
||||
singerLabel.Font = new Font("Segoe UI", 42 * fontScale, FontStyle.Bold);
|
||||
artistLabel.Font = new Font("Segoe UI", 36 * fontScale, FontStyle.Regular);
|
||||
songTitleLabel.Font = new Font("Segoe UI", 48 * fontScale, FontStyle.Bold);
|
||||
|
||||
// Calculate proper label heights using font metrics
|
||||
using (Graphics g = this.CreateGraphics())
|
||||
{
|
||||
pulseAlpha += 5;
|
||||
if (pulseAlpha >= 255)
|
||||
{
|
||||
pulseAlpha = 255;
|
||||
pulseDirection = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pulseAlpha -= 5;
|
||||
if (pulseAlpha <= 150)
|
||||
{
|
||||
pulseAlpha = 150;
|
||||
pulseDirection = true;
|
||||
}
|
||||
// Get font metrics for each label
|
||||
SizeF upNextSize = g.MeasureString(upNextLabel.Text, upNextLabel.Font);
|
||||
SizeF singerSize = g.MeasureString(singerLabel.Text, singerLabel.Font);
|
||||
SizeF artistSize = g.MeasureString(artistLabel.Text, artistLabel.Font);
|
||||
SizeF songTitleSize = g.MeasureString(songTitleLabel.Text, songTitleLabel.Font);
|
||||
|
||||
// Add extra padding for descenders (about 20% of font size)
|
||||
int descenderPadding = (int)(fontScale * 8);
|
||||
int totalLabelHeight = (int)(upNextSize.Height + descenderPadding) +
|
||||
(int)(singerSize.Height + descenderPadding) +
|
||||
(int)(artistSize.Height + descenderPadding) +
|
||||
(int)(songTitleSize.Height + descenderPadding);
|
||||
totalLabelHeight += (labelSpacing * 3); // Add spacing between labels
|
||||
|
||||
// Calculate available space and top padding
|
||||
int availableSpace = screenHeight - totalLabelHeight;
|
||||
int topPadding = availableSpace / 2;
|
||||
|
||||
// Resize labels to fit the actual text height plus descender padding
|
||||
upNextLabel.Size = new Size(upNextLabel.Width, (int)upNextSize.Height + descenderPadding);
|
||||
singerLabel.Size = new Size(singerLabel.Width, (int)singerSize.Height + descenderPadding);
|
||||
artistLabel.Size = new Size(artistLabel.Width, (int)artistSize.Height + descenderPadding);
|
||||
songTitleLabel.Size = new Size(songTitleLabel.Width, (int)songTitleSize.Height + descenderPadding);
|
||||
|
||||
// Position labels dynamically with spacing
|
||||
upNextLabel.Location = new Point(upNextLabel.Location.X, topPadding);
|
||||
singerLabel.Location = new Point(singerLabel.Location.X, topPadding + upNextLabel.Height + labelSpacing);
|
||||
artistLabel.Location = new Point(artistLabel.Location.X, topPadding + upNextLabel.Height + labelSpacing + singerLabel.Height + labelSpacing);
|
||||
songTitleLabel.Location = new Point(songTitleLabel.Location.X, topPadding + upNextLabel.Height + labelSpacing + singerLabel.Height + labelSpacing + artistLabel.Height + labelSpacing);
|
||||
}
|
||||
|
||||
upNextLabel.ForeColor = System.Drawing.Color.FromArgb(pulseAlpha, 255, 128, 0);
|
||||
}
|
||||
|
||||
private void FadeTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
if (isFadingIn)
|
||||
{
|
||||
fadeAlpha += 10;
|
||||
if (fadeAlpha >= 255)
|
||||
{
|
||||
fadeAlpha = 255;
|
||||
fadeTimer.Stop();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fadeAlpha -= 10;
|
||||
if (fadeAlpha <= 0)
|
||||
{
|
||||
fadeAlpha = 0;
|
||||
fadeTimer.Stop();
|
||||
this.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Update opacity
|
||||
this.Opacity = fadeAlpha / 255.0;
|
||||
mainPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void MainPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
|
||||
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit;
|
||||
|
||||
// Create gradient background
|
||||
using (LinearGradientBrush brush = new LinearGradientBrush(
|
||||
mainPanel.ClientRectangle,
|
||||
System.Drawing.Color.FromArgb(30, 30, 50),
|
||||
System.Drawing.Color.FromArgb(20, 20, 30),
|
||||
LinearGradientMode.Vertical))
|
||||
{
|
||||
e.Graphics.FillRectangle(brush, mainPanel.ClientRectangle);
|
||||
}
|
||||
|
||||
// Add subtle radial gradient overlay for depth
|
||||
using (GraphicsPath path = new GraphicsPath())
|
||||
{
|
||||
path.AddEllipse(-300, -300, mainPanel.Width + 600, mainPanel.Height + 600);
|
||||
using (PathGradientBrush pgb = new PathGradientBrush(path))
|
||||
{
|
||||
pgb.CenterColor = System.Drawing.Color.FromArgb(40, 40, 80);
|
||||
pgb.SurroundColors = new System.Drawing.Color[] { System.Drawing.Color.FromArgb(0, 0, 0) };
|
||||
e.Graphics.FillPath(pgb, path);
|
||||
}
|
||||
}
|
||||
|
||||
// Add subtle border glow
|
||||
using (Pen glowPen = new Pen(System.Drawing.Color.FromArgb(50, 100, 200), 2))
|
||||
{
|
||||
glowPen.LineJoin = LineJoin.Round;
|
||||
e.Graphics.DrawRectangle(glowPen, 2, 2, mainPanel.Width - 4, mainPanel.Height - 4);
|
||||
}
|
||||
}
|
||||
|
||||
public void Update(QueueItem queueItem)
|
||||
@ -157,17 +95,8 @@ namespace KaraokePlayer
|
||||
songTitleLabel.Text = queueItem.Song.Title;
|
||||
}
|
||||
|
||||
// Force a repaint to update the gradient
|
||||
mainPanel.Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
{
|
||||
fadeTimer?.Stop();
|
||||
fadeTimer?.Dispose();
|
||||
pulseTimer?.Stop();
|
||||
pulseTimer?.Dispose();
|
||||
base.OnFormClosing(e);
|
||||
// Recalculate positioning after text changes to ensure proper sizing
|
||||
CalculateDynamicPositions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<Grid>
|
||||
<Button x:Name="launchPlayerButton" Content="Launch Player" HorizontalAlignment="Left" Margin="9,97,0,0" VerticalAlignment="Top" Width="145" Height="44" IsEnabled="False" Click="launchPlayerButton_Click"/>
|
||||
<Button x:Name="syncLibraryButton" Content="Sync Library" HorizontalAlignment="Left" Margin="160,97,0,0" VerticalAlignment="Top" Width="145" Height="44" IsEnabled="False" Click="syncLibraryButton_Click"/>
|
||||
<Button x:Name="updateBillboardButton" Content="Update Billboard" HorizontalAlignment="Left" Margin="310,97,0,0" VerticalAlignment="Top" Width="145" Height="44" IsEnabled="False" Click="updateBillboardButton_Click"/>
|
||||
<Button x:Name="updateBillboardButton" Content="Update Song Lists" HorizontalAlignment="Left" Margin="310,97,0,0" VerticalAlignment="Top" Width="145" Height="44" IsEnabled="False" Click="updateBillboardButton_Click"/>
|
||||
<Button x:Name="deleteSongs" Content="Delete Songs" HorizontalAlignment="Left" Margin="310,10,0,0" VerticalAlignment="Top" Width="145" Height="22" IsEnabled="True" Click="deleteSongsButton_Click"/>
|
||||
<TextBox x:Name="controllerName" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="295" TextChanged="controllerName_TextChanged"/>
|
||||
<TextBox x:Name="songsLocation" HorizontalAlignment="Left" Height="23" Margin="10,38,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="295" TextChanged="songsLocation_TextChanged"/>
|
||||
|
||||
@ -129,7 +129,7 @@ namespace SingsALot
|
||||
private void updateBillboardButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ProcessStartInfo startInfo = new ProcessStartInfo();
|
||||
startInfo.FileName = "BillboardPlaylistUpdater.exe";
|
||||
startInfo.FileName = "SongListUpdater.exe";
|
||||
startInfo.Arguments = this.settings.controllerName;
|
||||
Process.Start(startInfo);
|
||||
}
|
||||
|
||||
@ -124,9 +124,9 @@
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BillboardPlaylistUpdater\BillboardPlaylistUpdater.csproj">
|
||||
<ProjectReference Include="..\SongListUpdater\SongListUpdater.csproj">
|
||||
<Project>{ae892df7-c43e-422a-b82e-29b5e6e0341c}</Project>
|
||||
<Name>BillboardPlaylistUpdater</Name>
|
||||
<Name>SongListUpdater</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\KaraokePlayer\KaraokePlayer.csproj">
|
||||
<Project>{2cf318e2-04b5-40fc-9577-6dac62b86fb2}</Project>
|
||||
|
||||
@ -15,7 +15,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BillboardPlaylistUpdater
|
||||
namespace SongListUpdater
|
||||
{
|
||||
class Program
|
||||
{
|
||||
@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("BillboardPlaylistUpdater")]
|
||||
[assembly: AssemblyTitle("SongListUpdater")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("BillboardPlaylistUpdater")]
|
||||
[assembly: AssemblyProduct("SongListUpdater")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
@ -7,8 +7,8 @@
|
||||
<ProjectGuid>{AE892DF7-C43E-422A-B82E-29B5E6E0341C}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>BillboardPlaylistUpdater</RootNamespace>
|
||||
<AssemblyName>BillboardPlaylistUpdater</AssemblyName>
|
||||
<RootNamespace>SongListUpdater</RootNamespace>
|
||||
<AssemblyName>SongListUpdater</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
Loading…
Reference in New Issue
Block a user