Compare commits

...

4 Commits

Author SHA1 Message Date
minster586
5bc4aaaf00 ReadME 2025-09-08 16:40:23 -04:00
minster586
18ad5c1440 Added Dark mode 2025-09-08 16:38:29 -04:00
minster586
8fa429575d This should be done 2025-08-27 18:16:59 -04:00
minster586
12cdde5044 This should be complete 2025-08-27 18:16:16 -04:00
13 changed files with 757 additions and 297 deletions

1
.gitignore vendored
View File

@@ -361,3 +361,4 @@ MigrationBackup/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/README.md

View File

@@ -37,9 +37,11 @@
this.menuStrip2 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.restAPISettingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loggingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.onToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.offToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
@@ -49,10 +51,12 @@
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.uicolor = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.statusStrip1.SuspendLayout();
this.menuStrip2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// statusStrip1
@@ -113,6 +117,7 @@
//
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.restAPISettingToolStripMenuItem,
this.loggingToolStripMenuItem,
this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
@@ -121,14 +126,36 @@
// restAPISettingToolStripMenuItem
//
this.restAPISettingToolStripMenuItem.Name = "restAPISettingToolStripMenuItem";
this.restAPISettingToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.restAPISettingToolStripMenuItem.Size = new System.Drawing.Size(118, 22);
this.restAPISettingToolStripMenuItem.Text = "Setting";
this.restAPISettingToolStripMenuItem.Click += new System.EventHandler(this.restAPISettingToolStripMenuItem_Click);
//
// loggingToolStripMenuItem
//
this.loggingToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.onToolStripMenuItem,
this.offToolStripMenuItem});
this.loggingToolStripMenuItem.Enabled = false;
this.loggingToolStripMenuItem.Name = "loggingToolStripMenuItem";
this.loggingToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.loggingToolStripMenuItem.Text = "Logging";
//
// onToolStripMenuItem
//
this.onToolStripMenuItem.Name = "onToolStripMenuItem";
this.onToolStripMenuItem.Size = new System.Drawing.Size(91, 22);
this.onToolStripMenuItem.Text = "On";
//
// offToolStripMenuItem
//
this.offToolStripMenuItem.Name = "offToolStripMenuItem";
this.offToolStripMenuItem.Size = new System.Drawing.Size(91, 22);
this.offToolStripMenuItem.Text = "Off";
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(118, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
@@ -139,14 +166,6 @@
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(13, 37);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(180, 173);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label6);
@@ -165,28 +184,25 @@
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(170, 130);
this.label6.Location = new System.Drawing.Point(99, 129);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(65, 16);
this.label6.Size = new System.Drawing.Size(266, 17);
this.label6.TabIndex = 5;
this.label6.Text = "No album";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(170, 83);
this.label5.Location = new System.Drawing.Point(99, 83);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 16);
this.label5.Size = new System.Drawing.Size(266, 17);
this.label5.TabIndex = 4;
this.label5.Text = "No artist";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(170, 39);
this.label4.Location = new System.Drawing.Point(99, 39);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 16);
this.label4.Size = new System.Drawing.Size(266, 16);
this.label4.TabIndex = 3;
this.label4.Text = "No title";
//
@@ -240,11 +256,29 @@
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// uicolor
//
this.uicolor.Image = global::RadioDJViewer.Properties.Resources.MdiWeatherNight;
this.uicolor.Location = new System.Drawing.Point(13, 234);
this.uicolor.Name = "uicolor";
this.uicolor.Size = new System.Drawing.Size(28, 23);
this.uicolor.TabIndex = 7;
this.uicolor.UseVisualStyleBackColor = true;
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(13, 37);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(180, 173);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// Main
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(612, 293);
this.Controls.Add(this.uicolor);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.groupBox1);
@@ -258,9 +292,9 @@
this.statusStrip1.PerformLayout();
this.menuStrip2.ResumeLayout(false);
this.menuStrip2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -288,6 +322,10 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.ToolStripMenuItem loggingToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem onToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem offToolStripMenuItem;
private System.Windows.Forms.Button uicolor;
}
}

View File

@@ -28,27 +28,53 @@ namespace RadioDJViewer
private System.Windows.Forms.Timer apiTimer;
private string lastApiXml = null;
private System.Windows.Forms.Timer marqueeTimerTitle;
private System.Windows.Forms.Timer marqueeTimerArtist;
private System.Windows.Forms.Timer marqueeTimerAlbum;
private int marqueeOffsetTitle = 0;
private int marqueeOffsetArtist = 0;
private int marqueeOffsetAlbum = 0;
private string marqueeTextTitle = "";
private string marqueeTextArtist = "";
private string marqueeTextAlbum = "";
private Timer pauseTimerTitle;
private Timer pauseTimerArtist;
private Timer pauseTimerAlbum;
private int marqueeScrollSpeed = 100; // Default to Medium
private int marqueePauseTime = 6000; // Default to 6 seconds
private string marqueeSeparator = " | "; // Default separator
private bool loggingEnabled = false;
private string logFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "RadioDJViewer.log");
private bool isDarkMode = false; // New field for dark mode
public Main()
{
InitializeComponent();
EnsureDefaultImageExists();
UpdateStatusBar();
// Auto-load profiles if profiles.json exists
AutoLoadProfiles();
// Set up timer for polling API every 3 seconds
apiTimer = new System.Windows.Forms.Timer();
apiTimer.Interval = 3000; // 3 seconds
apiTimer.Tick += ApiTimer_Tick;
// Set up marquee timer for title
marqueeTimer = new System.Windows.Forms.Timer();
marqueeTimer.Interval = 100; // Adjust speed as needed
marqueeTimer.Tick += MarqueeTimer_Tick;
// Marquee timers for each label
marqueeTimerTitle = new System.Windows.Forms.Timer();
marqueeTimerTitle.Interval = marqueeScrollSpeed;
marqueeTimerTitle.Tick += MarqueeTimerTitle_Tick;
marqueeTimerArtist = new System.Windows.Forms.Timer();
marqueeTimerArtist.Interval = marqueeScrollSpeed;
marqueeTimerArtist.Tick += MarqueeTimerArtist_Tick;
marqueeTimerAlbum = new System.Windows.Forms.Timer();
marqueeTimerAlbum.Interval = marqueeScrollSpeed;
marqueeTimerAlbum.Tick += MarqueeTimerAlbum_Tick;
// Wire up dark mode button
this.uicolor.Click += Uicolor_Click;
UpdateTheme();
// Auto-load profiles if profiles.json exists
AutoLoadProfiles();
}
private System.Windows.Forms.Timer marqueeTimer;
private int marqueeOffset = 0;
private string marqueeText = "";
private void EnsureDefaultImageExists()
{
if (!File.Exists(defaultImagePath))
@@ -62,22 +88,136 @@ namespace RadioDJViewer
}
}
private void MarqueeTimer_Tick(object sender, EventArgs e)
public void SetMarqueeScrollSpeed(string speed)
{
if (marqueeText.Length > 0)
switch (speed)
{
int visibleChars = 30; // Adjust for label width
if (marqueeText.Length > visibleChars)
case "Very Slow": marqueeScrollSpeed = 300; break;
case "Slow": marqueeScrollSpeed = 200; break;
case "Medium": marqueeScrollSpeed = 100; break;
case "Fast": marqueeScrollSpeed = 60; break;
case "Very Fast": marqueeScrollSpeed = 30; break;
default: marqueeScrollSpeed = 100; break;
}
marqueeTimerTitle.Interval = marqueeScrollSpeed;
marqueeTimerArtist.Interval = marqueeScrollSpeed;
marqueeTimerAlbum.Interval = marqueeScrollSpeed;
}
public void SetMarqueePauseTime(int seconds)
{
marqueePauseTime = seconds * 1000;
}
public void SetMarqueeSeparator(string separator)
{
marqueeSeparator = separator;
}
private void LogMessage(string message)
{
if (!loggingEnabled) return;
try
{
File.AppendAllText(logFilePath, $"[{DateTime.Now:yyyy-MM-dd HH:mm:ss}] {message}\r\n");
}
catch { }
}
private void MarqueeTimerTitle_Tick(object sender, EventArgs e)
{
int visibleChars = 30; // Adjust for label width
if (marqueeTextTitle.Length > visibleChars)
{
string separator = string.IsNullOrEmpty(marqueeSeparator) ? "" : marqueeSeparator;
string scrollText = marqueeTextTitle + separator;
string repeatedScrollText = scrollText + scrollText;
marqueeOffsetTitle = (marqueeOffsetTitle + 1) % scrollText.Length;
label4.Text = repeatedScrollText.Substring(marqueeOffsetTitle, visibleChars);
LogMessage($"MarqueeTitle: separator='{separator}', scrollText='{scrollText}', offset={marqueeOffsetTitle}");
if (marqueeOffsetTitle == 0)
{
marqueeOffset = (marqueeOffset + 1) % marqueeText.Length;
string display = marqueeText.Substring(marqueeOffset) + " " + marqueeText.Substring(0, marqueeOffset);
label4.Text = display.Substring(0, Math.Min(visibleChars, display.Length));
marqueeTimerTitle.Stop();
if (pauseTimerTitle == null)
{
pauseTimerTitle = new Timer();
pauseTimerTitle.Tick += (s, args) => {
pauseTimerTitle.Stop();
marqueeTimerTitle.Start();
};
}
pauseTimerTitle.Interval = marqueePauseTime;
pauseTimerTitle.Start();
}
else
}
else
{
label4.Text = marqueeTextTitle;
}
}
private void MarqueeTimerArtist_Tick(object sender, EventArgs e)
{
int visibleChars = 30;
if (marqueeTextArtist.Length > visibleChars)
{
string separator = string.IsNullOrEmpty(marqueeSeparator) ? "" : marqueeSeparator;
string scrollText = marqueeTextArtist + separator;
string repeatedScrollText = scrollText + scrollText;
marqueeOffsetArtist = (marqueeOffsetArtist + 1) % scrollText.Length;
label5.Text = repeatedScrollText.Substring(marqueeOffsetArtist, visibleChars);
LogMessage($"MarqueeArtist: separator='{separator}', scrollText='{scrollText}', offset={marqueeOffsetArtist}");
if (marqueeOffsetArtist == 0)
{
label4.Text = marqueeText;
marqueeTimerArtist.Stop();
if (pauseTimerArtist == null)
{
pauseTimerArtist = new Timer();
pauseTimerArtist.Tick += (s, args) => {
pauseTimerArtist.Stop();
marqueeTimerArtist.Start();
};
}
pauseTimerArtist.Interval = marqueePauseTime;
pauseTimerArtist.Start();
}
}
else
{
label5.Text = marqueeTextArtist;
}
}
private void MarqueeTimerAlbum_Tick(object sender, EventArgs e)
{
int visibleChars = 30;
if (marqueeTextAlbum.Length > visibleChars)
{
string separator = string.IsNullOrEmpty(marqueeSeparator) ? "" : marqueeSeparator;
string scrollText = marqueeTextAlbum + separator;
string repeatedScrollText = scrollText + scrollText;
marqueeOffsetAlbum = (marqueeOffsetAlbum + 1) % scrollText.Length;
label6.Text = repeatedScrollText.Substring(marqueeOffsetAlbum, visibleChars);
LogMessage($"MarqueeAlbum: separator='{separator}', scrollText='{scrollText}', offset={marqueeOffsetAlbum}");
if (marqueeOffsetAlbum == 0)
{
marqueeTimerAlbum.Stop();
if (pauseTimerAlbum == null)
{
pauseTimerAlbum = new Timer();
pauseTimerAlbum.Tick += (s, args) => {
pauseTimerAlbum.Stop();
marqueeTimerAlbum.Start();
};
}
pauseTimerAlbum.Interval = marqueePauseTime;
pauseTimerAlbum.Start();
}
}
else
{
label6.Text = marqueeTextAlbum;
}
}
private void ApiTimer_Tick(object sender, EventArgs e)
@@ -166,8 +306,6 @@ namespace RadioDJViewer
return;
}
string url = loadedProfile.UrlFormat;
// Debug: Show the URL before and after replacement
string debugBefore = url;
if (!string.IsNullOrWhiteSpace(url))
{
url = url.Replace("{ip}", loadedProfile.IP ?? "")
@@ -181,8 +319,6 @@ namespace RadioDJViewer
UpdateStatusBar();
return;
}
string debugAfter = url;
MessageBox.Show($"Connecting to: {debugAfter}\n(Original: {debugBefore})", "Debug", MessageBoxButtons.OK, MessageBoxIcon.Information);
try
{
var client = new System.Net.Http.HttpClient();
@@ -280,6 +416,23 @@ namespace RadioDJViewer
}
}
private void StartMarqueeTimers()
{
marqueeOffsetTitle = 0;
marqueeOffsetArtist = 0;
marqueeOffsetAlbum = 0;
marqueeTimerTitle.Start();
marqueeTimerArtist.Start();
marqueeTimerAlbum.Start();
}
private void StopMarqueeTimers()
{
marqueeTimerTitle.Stop();
marqueeTimerArtist.Stop();
marqueeTimerAlbum.Stop();
}
private void ParseAndDisplaySongInfo(string xml)
{
try
@@ -292,18 +445,17 @@ namespace RadioDJViewer
string album = doc.SelectSingleNode("//*[translate(local-name(), 'ALBUM', 'album')='album']")?.InnerText;
string albumArt = doc.SelectSingleNode("//*[translate(local-name(), 'ALBUMART', 'albumart')='albumart']")?.InnerText;
marqueeText = !string.IsNullOrWhiteSpace(title) ? title : "No title";
marqueeOffset = 0;
marqueeTimer.Start();
label5.Text = !string.IsNullOrWhiteSpace(artist) ? artist : "No artist";
label6.Text = !string.IsNullOrWhiteSpace(album) ? album : "No album";
marqueeTextTitle = !string.IsNullOrWhiteSpace(title) ? title : "No title";
marqueeTextArtist = !string.IsNullOrWhiteSpace(artist) ? artist : "No artist";
marqueeTextAlbum = !string.IsNullOrWhiteSpace(album) ? album : "No album";
StartMarqueeTimers();
// Write to output files
if (!string.IsNullOrEmpty(outputFolderPath))
{
File.WriteAllText(Path.Combine(outputFolderPath, "title.txt"), marqueeText);
File.WriteAllText(Path.Combine(outputFolderPath, "artist.txt"), label5.Text);
File.WriteAllText(Path.Combine(outputFolderPath, "album.txt"), label6.Text);
File.WriteAllText(Path.Combine(outputFolderPath, "title.txt"), marqueeTextTitle);
File.WriteAllText(Path.Combine(outputFolderPath, "artist.txt"), marqueeTextArtist);
File.WriteAllText(Path.Combine(outputFolderPath, "album.txt"), marqueeTextAlbum);
}
// Handle album art image
@@ -318,11 +470,10 @@ namespace RadioDJViewer
}
catch
{
marqueeText = "No title";
marqueeOffset = 0;
marqueeTimer.Start();
label5.Text = "No artist";
label6.Text = "No album";
marqueeTextTitle = "No title";
marqueeTextArtist = "No artist";
marqueeTextAlbum = "No album";
StartMarqueeTimers();
pictureBox1.Image = null;
}
}
@@ -341,12 +492,16 @@ namespace RadioDJViewer
{
// Open settings/profile dialog
var settingsForm = new Form1();
settingsForm.ApplyTheme(isDarkMode); // Pass current color mode
settingsForm.ShowDialog();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
string version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
var assembly = System.Reflection.Assembly.GetExecutingAssembly();
var versionAttr = assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyFileVersionAttribute), false)
.OfType<System.Reflection.AssemblyFileVersionAttribute>().FirstOrDefault();
string version = versionAttr != null ? versionAttr.Version : assembly.GetName().Version.ToString();
string message = $"RadioDJViewer\nVersion: {version}\nGitHub: https://git.smartcraft.me/minster586/RadioDJViewer";
MessageBox.Show(message, "About RadioDJViewer", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
@@ -369,8 +524,74 @@ namespace RadioDJViewer
outputFolderPath = profile.OutputFolder;
mainImagesFolderPath = profile.MainImagesFolder; // Update new field
loadedProfile = profile; // Store loaded profile for REST API connection
// Update polling rate when profile is loaded
int pollingRate = loadedProfile?.PollingRateSeconds > 0 ? loadedProfile.PollingRateSeconds : 3;
apiTimer.Interval = pollingRate * 1000;
SetMarqueeScrollSpeed(profile.MarqueeScrollSpeed ?? "Medium");
SetMarqueePauseTime(profile.MarqueePauseTime > 0 ? profile.MarqueePauseTime : 6);
SetMarqueeSeparator(profile.MarqueeSeparator ?? " | ");
UpdateStatusBar();
// You can add more logic to update other fields if needed
}
private void Uicolor_Click(object sender, EventArgs e)
{
isDarkMode = !isDarkMode;
UpdateTheme();
}
private Bitmap InvertIcon(Bitmap original)
{
Bitmap inverted = new Bitmap(original.Width, original.Height);
for (int y = 0; y < original.Height; y++)
{
for (int x = 0; x < original.Width; x++)
{
Color pixel = original.GetPixel(x, y);
Color inv = Color.FromArgb(pixel.A, 255 - pixel.R, 255 - pixel.G, 255 - pixel.B);
inverted.SetPixel(x, y, inv);
}
}
return inverted;
}
private void UpdateTheme()
{
// Set icon
Bitmap icon = isDarkMode ? Properties.Resources.MdiWeatherSunny : Properties.Resources.MdiWeatherNight;
// Invert sun icon for visibility in dark mode
if (isDarkMode && icon != null)
{
icon = InvertIcon(icon);
}
// Resize icon to fit button and center it
if (icon != null)
{
int btnW = uicolor.Width;
int btnH = uicolor.Height;
var resizedIcon = new Bitmap(icon, btnW - 8, btnH - 8); // Padding for centering
uicolor.Image = resizedIcon;
uicolor.ImageAlign = ContentAlignment.MiddleCenter;
}
// Set colors
Color backColor = isDarkMode ? Color.FromArgb(32, 32, 32) : SystemColors.Control;
Color foreColor = isDarkMode ? Color.White : SystemColors.ControlText;
this.BackColor = backColor;
this.ForeColor = foreColor;
foreach (Control c in this.Controls)
{
ApplyThemeRecursive(c, backColor, foreColor);
}
}
private void ApplyThemeRecursive(Control control, Color backColor, Color foreColor)
{
control.BackColor = backColor;
control.ForeColor = foreColor;
foreach (Control child in control.Controls)
{
ApplyThemeRecursive(child, backColor, foreColor);
}
}
}
}

View File

@@ -16,6 +16,10 @@ namespace RadioDJViewer
public string OutputFolder { get; set; }
public string OutputImageName { get; set; }
public string UrlFormat { get; set; }
public int PollingRateSeconds { get; set; } // Add polling rate property
public string MarqueeScrollSpeed { get; set; } // "Very Slow", etc.
public int MarqueePauseTime { get; set; } // in seconds
public string MarqueeSeparator { get; set; } // e.g. " | "
}
public static class ProfileStorage

View File

@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0")]
[assembly: AssemblyFileVersion("1.1.0")]

View File

@@ -80,6 +80,26 @@ namespace RadioDJViewer.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MdiWeatherNight {
get {
object obj = ResourceManager.GetObject("MdiWeatherNight", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap MdiWeatherSunny {
get {
object obj = ResourceManager.GetObject("MdiWeatherSunny", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -124,6 +124,12 @@
<data name="green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\green.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MdiWeatherNight" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MdiWeatherNight.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="MdiWeatherSunny" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\MdiWeatherSunny.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="red" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\red.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View File

@@ -12,7 +12,7 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<ApplicationIcon>icon.ico</ApplicationIcon>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -109,6 +109,8 @@
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<None Include="Resources\MdiWeatherSunny.png" />
<None Include="Resources\MdiWeatherNight.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -34,30 +34,40 @@
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.label6 = new System.Windows.Forms.Label();
this.button6 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.textBox6 = new System.Windows.Forms.TextBox();
this.label11 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox4 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.buttonSelectOutputFolder = new System.Windows.Forms.Button();
this.labelOutputFolderPath = new System.Windows.Forms.Label();
this.textBox5 = new System.Windows.Forms.TextBox();
this.label10 = new System.Windows.Forms.Label();
this.button4 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.textBox4 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.textBox3 = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label11 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.textBox7 = new System.Windows.Forms.TextBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.comboBoxScrollSpeed = new System.Windows.Forms.ComboBox();
this.textBoxPauseTime = new System.Windows.Forms.TextBox();
this.separatingcharacterformatbox = new System.Windows.Forms.TextBox();
this.textBox9 = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
@@ -89,7 +99,7 @@
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 569);
this.button1.Location = new System.Drawing.Point(35, 584);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(157, 23);
this.button1.TabIndex = 1;
@@ -98,20 +108,218 @@
//
// button2
//
this.button2.Location = new System.Drawing.Point(259, 569);
this.button2.Location = new System.Drawing.Point(357, 584);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(157, 23);
this.button2.TabIndex = 2;
this.button2.Text = "Cancel";
this.button2.UseVisualStyleBackColor = true;
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(120, 27);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(290, 21);
this.comboBox1.TabIndex = 0;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(20, 30);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Profiles";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(20, 100);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(57, 13);
this.label3.TabIndex = 2;
this.label3.Text = "IP address";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(120, 97);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(290, 20);
this.textBox2.TabIndex = 3;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(20, 135);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(26, 13);
this.label4.TabIndex = 4;
this.label4.Text = "Port";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(120, 132);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(290, 20);
this.textBox3.TabIndex = 5;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(20, 170);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(53, 13);
this.label5.TabIndex = 6;
this.label5.Text = "Password";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(120, 167);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(290, 20);
this.textBox4.TabIndex = 7;
//
// button3
//
this.button3.Location = new System.Drawing.Point(60, 419);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(120, 30);
this.button3.TabIndex = 8;
this.button3.Text = "Save Profile";
this.button3.UseVisualStyleBackColor = true;
//
// button4
//
this.button4.Location = new System.Drawing.Point(216, 419);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(120, 30);
this.button4.TabIndex = 9;
this.button4.Text = "Remove Profile";
this.button4.UseVisualStyleBackColor = true;
//
// groupBox3
//
this.groupBox3.Controls.Add(this.buttonSelectOutputFolder);
this.groupBox3.Controls.Add(this.labelOutputFolderPath);
this.groupBox3.Controls.Add(this.textBox5);
this.groupBox3.Controls.Add(this.label10);
this.groupBox3.Location = new System.Drawing.Point(20, 298);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(482, 115);
this.groupBox3.TabIndex = 12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Output Setting";
//
// buttonSelectOutputFolder
//
this.buttonSelectOutputFolder.Location = new System.Drawing.Point(20, 36);
this.buttonSelectOutputFolder.Name = "buttonSelectOutputFolder";
this.buttonSelectOutputFolder.Size = new System.Drawing.Size(140, 23);
this.buttonSelectOutputFolder.TabIndex = 17;
this.buttonSelectOutputFolder.Text = "Select Output Folder";
this.buttonSelectOutputFolder.UseVisualStyleBackColor = true;
//
// labelOutputFolderPath
//
this.labelOutputFolderPath.AutoSize = true;
this.labelOutputFolderPath.Location = new System.Drawing.Point(166, 41);
this.labelOutputFolderPath.Name = "labelOutputFolderPath";
this.labelOutputFolderPath.Size = new System.Drawing.Size(93, 13);
this.labelOutputFolderPath.TabIndex = 16;
this.labelOutputFolderPath.Text = "No folder selected";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(149, 80);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(247, 20);
this.textBox5.TabIndex = 16;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(17, 83);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(126, 13);
this.label10.TabIndex = 15;
this.label10.Text = "Output Image save name";
//
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(20, 65);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(67, 13);
this.label11.TabIndex = 14;
this.label11.Text = "Profile Name";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(120, 62);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(290, 20);
this.textBox6.TabIndex = 15;
//
// button5
//
this.button5.Location = new System.Drawing.Point(382, 419);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(120, 30);
this.button5.TabIndex = 16;
this.button5.Text = "Load Profile";
this.button5.UseVisualStyleBackColor = true;
//
// button6
//
this.button6.Location = new System.Drawing.Point(23, 269);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(140, 23);
this.button6.TabIndex = 18;
this.button6.Text = "Select Main Image Folder";
this.button6.UseVisualStyleBackColor = true;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(169, 274);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(93, 13);
this.label6.TabIndex = 19;
this.label6.Text = "No folder selected";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(20, 211);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(124, 13);
this.label7.TabIndex = 20;
this.label7.Text = "Polling Rate (in seconds)";
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(150, 208);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(63, 20);
this.textBox7.TabIndex = 21;
//
// groupBox2
//
this.groupBox2.Controls.Add(this.label13);
this.groupBox2.Controls.Add(this.comboBoxScrollSpeed);
this.groupBox2.Controls.Add(this.textBoxPauseTime);
this.groupBox2.Controls.Add(this.separatingcharacterformatbox);
this.groupBox2.Controls.Add(this.textBox6);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.textBox9);
this.groupBox2.Controls.Add(this.label9);
this.groupBox2.Controls.Add(this.label8);
this.groupBox2.Controls.Add(this.textBox7);
this.groupBox2.Controls.Add(this.label7);
this.groupBox2.Controls.Add(this.label6);
this.groupBox2.Controls.Add(this.button6);
this.groupBox2.Controls.Add(this.button5);
this.groupBox2.Controls.Add(this.textBox6);
this.groupBox2.Controls.Add(this.label11);
this.groupBox2.Controls.Add(this.groupBox3);
this.groupBox2.Controls.Add(this.button4);
this.groupBox2.Controls.Add(this.button3);
@@ -130,184 +338,84 @@
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Profiles";
//
// label6
// comboBoxScrollSpeed
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(177, 207);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(93, 13);
this.label6.TabIndex = 19;
this.label6.Text = "No folder selected";
this.comboBoxScrollSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxScrollSpeed.FormattingEnabled = true;
this.comboBoxScrollSpeed.Items.AddRange(new object[] {
"Very Slow",
"Slow",
"Medium",
"Fast",
"Very Fast"});
this.comboBoxScrollSpeed.Location = new System.Drawing.Point(382, 207);
this.comboBoxScrollSpeed.Name = "comboBoxScrollSpeed";
this.comboBoxScrollSpeed.Size = new System.Drawing.Size(97, 21);
this.comboBoxScrollSpeed.TabIndex = 29;
//
// button6
// textBoxPauseTime
//
this.button6.Location = new System.Drawing.Point(23, 202);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(140, 23);
this.button6.TabIndex = 18;
this.button6.Text = "Select Main Image Folder";
this.button6.UseVisualStyleBackColor = true;
this.textBoxPauseTime.Location = new System.Drawing.Point(382, 237);
this.textBoxPauseTime.Name = "textBoxPauseTime";
this.textBoxPauseTime.Size = new System.Drawing.Size(97, 20);
this.textBoxPauseTime.TabIndex = 30;
//
// button5
// separatingcharacterformatbox
//
this.button5.Location = new System.Drawing.Point(322, 419);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(120, 30);
this.button5.TabIndex = 16;
this.button5.Text = "Load Profile";
this.button5.UseVisualStyleBackColor = true;
this.separatingcharacterformatbox.Location = new System.Drawing.Point(164, 237);
this.separatingcharacterformatbox.Name = "separatingcharacterformatbox";
this.separatingcharacterformatbox.Size = new System.Drawing.Size(49, 20);
this.separatingcharacterformatbox.TabIndex = 31;
//
// textBox6
// textBox9
//
this.textBox6.Location = new System.Drawing.Point(120, 62);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(290, 20);
this.textBox6.TabIndex = 15;
this.textBox9.Location = new System.Drawing.Point(382, 237);
this.textBox9.Name = "textBox9";
this.textBox9.Size = new System.Drawing.Size(97, 20);
this.textBox9.TabIndex = 25;
//
// label11
// label9
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(20, 65);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(67, 13);
this.label11.TabIndex = 14;
this.label11.Text = "Profile Name";
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(239, 240);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(119, 13);
this.label9.TabIndex = 24;
this.label9.Text = "Pause time (in seconds)";
//
// groupBox3
// label8
//
this.groupBox3.Controls.Add(this.buttonSelectOutputFolder);
this.groupBox3.Controls.Add(this.labelOutputFolderPath);
this.groupBox3.Controls.Add(this.textBox5);
this.groupBox3.Controls.Add(this.label10);
this.groupBox3.Location = new System.Drawing.Point(20, 258);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(482, 135);
this.groupBox3.TabIndex = 12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Output Setting";
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(239, 211);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(127, 13);
this.label8.TabIndex = 22;
this.label8.Text = "Scroll Speed (in Main UI)";
this.label8.Click += new System.EventHandler(this.label8_Click);
//
// buttonSelectOutputFolder
// label12
//
this.buttonSelectOutputFolder.Location = new System.Drawing.Point(20, 36);
this.buttonSelectOutputFolder.Name = "buttonSelectOutputFolder";
this.buttonSelectOutputFolder.Size = new System.Drawing.Size(140, 23);
this.buttonSelectOutputFolder.TabIndex = 17;
this.buttonSelectOutputFolder.Text = "Select Output Folder";
this.buttonSelectOutputFolder.UseVisualStyleBackColor = true;
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(20, 240);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(138, 13);
this.label12.TabIndex = 27;
this.label12.Text = "Separating character format";
//
// labelOutputFolderPath
// label13
//
this.labelOutputFolderPath.AutoSize = true;
this.labelOutputFolderPath.Location = new System.Drawing.Point(187, 46);
this.labelOutputFolderPath.Name = "labelOutputFolderPath";
this.labelOutputFolderPath.Size = new System.Drawing.Size(93, 13);
this.labelOutputFolderPath.TabIndex = 16;
this.labelOutputFolderPath.Text = "No folder selected";
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(72, 87);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(350, 20);
this.textBox5.TabIndex = 16;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(157, 71);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(181, 13);
this.label10.TabIndex = 15;
this.label10.Text = "Output Image save name and loction";
//
// button4
//
this.button4.Location = new System.Drawing.Point(180, 419);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(120, 30);
this.button4.TabIndex = 9;
this.button4.Text = "Remove Profile";
this.button4.UseVisualStyleBackColor = true;
//
// button3
//
this.button3.Location = new System.Drawing.Point(40, 419);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(120, 30);
this.button3.TabIndex = 8;
this.button3.Text = "Save Profile";
this.button3.UseVisualStyleBackColor = true;
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(120, 167);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(290, 20);
this.textBox4.TabIndex = 7;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(20, 170);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(53, 13);
this.label5.TabIndex = 6;
this.label5.Text = "Password";
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(120, 132);
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(290, 20);
this.textBox3.TabIndex = 5;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(20, 135);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(26, 13);
this.label4.TabIndex = 4;
this.label4.Text = "Port";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(120, 97);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(290, 20);
this.textBox2.TabIndex = 3;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(20, 100);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(57, 13);
this.label3.TabIndex = 2;
this.label3.Text = "IP address";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(20, 30);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 1;
this.label2.Text = "Profiles";
//
// comboBox1
//
this.comboBox1.FormattingEnabled = true;
this.comboBox1.Location = new System.Drawing.Point(120, 27);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(290, 21);
this.comboBox1.TabIndex = 0;
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(20, 240);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(142, 13);
this.label13.TabIndex = 32;
this.label13.Text = "Separating Character Format";
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(543, 604);
this.ClientSize = new System.Drawing.Size(543, 619);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
@@ -317,10 +425,10 @@
this.Text = "Settings";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.ResumeLayout(false);
}
@@ -332,26 +440,38 @@
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button buttonSelectOutputFolder;
private System.Windows.Forms.Label labelOutputFolderPath;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox7;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.TextBox textBox9;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.TextBox textBox8;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.ComboBox comboBoxScrollSpeed;
private System.Windows.Forms.TextBox textBoxPauseTime;
private System.Windows.Forms.TextBox separatingcharacterformatbox;
private System.Windows.Forms.Label label13;
}
}

View File

@@ -19,6 +19,16 @@ namespace RadioDJViewer
public Form1()
{
InitializeComponent();
textBox4.UseSystemPasswordChar = true; // Obscure password field
comboBoxScrollSpeed.Items.Clear();
comboBoxScrollSpeed.Items.AddRange(new object[] {
"Very Slow",
"Slow",
"Medium",
"Fast",
"Very Fast"
});
comboBoxScrollSpeed.SelectedItem = "Medium";
this.buttonSelectOutputFolder.Click += ButtonSelectOutputFolder_Click;
this.button6.Click += ButtonSelectMainImagesFolder_Click;
this.button3.Click += button3_Click;
@@ -64,6 +74,11 @@ namespace RadioDJViewer
label6.Text = mainImagesFolderPath;
textBox5.Text = profile.OutputImageName;
textBox1.Text = profile.UrlFormat;
// Default polling rate to 3 if missing or zero
textBox7.Text = (profile.PollingRateSeconds > 0 ? profile.PollingRateSeconds : 3).ToString();
comboBoxScrollSpeed.SelectedItem = profile.MarqueeScrollSpeed ?? "Medium";
textBoxPauseTime.Text = profile.MarqueePauseTime > 0 ? profile.MarqueePauseTime.ToString() : "6";
separatingcharacterformatbox.Text = profile.MarqueeSeparator ?? " | ";
}
}
}
@@ -100,6 +115,8 @@ namespace RadioDJViewer
MessageBox.Show("Profile name is required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
int pollingRate = 3;
int.TryParse(textBox7.Text, out pollingRate);
var profile = new Profile
{
Name = textBox6.Text,
@@ -109,7 +126,11 @@ namespace RadioDJViewer
OutputFolder = outputFolderPath,
MainImagesFolder = mainImagesFolderPath,
OutputImageName = textBox5.Text,
UrlFormat = textBox1.Text
UrlFormat = textBox1.Text,
PollingRateSeconds = pollingRate,
MarqueeScrollSpeed = comboBoxScrollSpeed.SelectedItem?.ToString() ?? "Medium",
MarqueePauseTime = int.TryParse(textBoxPauseTime.Text, out int pt) ? pt : 6,
MarqueeSeparator = separatingcharacterformatbox.Text
};
ProfileStorage.SaveProfile(profile);
// Refresh profile list
@@ -171,5 +192,32 @@ namespace RadioDJViewer
// Cancel (bottom Cancel button) - close the settings window without saving
this.Close();
}
private void label8_Click(object sender, EventArgs e)
{
}
public void ApplyTheme(bool darkMode)
{
Color backColor = darkMode ? Color.FromArgb(32, 32, 32) : SystemColors.Control;
Color foreColor = darkMode ? Color.White : SystemColors.ControlText;
this.BackColor = backColor;
this.ForeColor = foreColor;
foreach (Control c in this.Controls)
{
ApplyThemeRecursive(c, backColor, foreColor);
}
}
private void ApplyThemeRecursive(Control control, Color backColor, Color foreColor)
{
control.BackColor = backColor;
control.ForeColor = foreColor;
foreach (Control child in control.Controls)
{
ApplyThemeRecursive(child, backColor, foreColor);
}
}
}
}