Skip to content

Commit

Permalink
Rewrite largely from scratch
Browse files Browse the repository at this point in the history
  • Loading branch information
dvingerh committed Feb 27, 2022
1 parent 50b292f commit 5f13b52
Show file tree
Hide file tree
Showing 63 changed files with 3,001 additions and 3,470 deletions.
19 changes: 0 additions & 19 deletions Classes/AudioState.cs

This file was deleted.

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Drawing.Text;
using System.Windows.Forms;

namespace tbvolscroll.Classes.ExControls
namespace tb_vol_scroll.Classes.ControlsEx
{
public partial class FontList : UserControl
{
Expand Down Expand Up @@ -90,7 +90,7 @@ private void FontListComponentSelectedIndexChanged(object sender, EventArgs e)

private void TextSizeTextBoxTextChanged(object sender, EventArgs e)
{
if (!FontNameTextBox.Focused)
if (!FontNameTextBox.Focused)
return;

for (int i = 0; i < FontListComponent.Items.Count; i++)
Expand Down
13 changes: 5 additions & 8 deletions Classes/DropShadow.cs → Classes/ControlsEx/FormShadowEx.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace tbvolscroll.Classes
namespace tb_vol_scroll.Classes.ControlsEx
{
public class DropShadow
// By https://stackoverflow.com/a/60916421

public class FormShadowEx
{
#region Shadowing



#region Structures

[EditorBrowsable(EditorBrowsableState.Never)]
Expand Down Expand Up @@ -99,4 +95,5 @@ public void ApplyShadows(Form form)

#endregion
}

}
16 changes: 16 additions & 0 deletions Classes/ControlsEx/ListViewEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace tb_vol_scroll.Classes.ControlsExt
{
[ToolboxItem(true)]
[ToolboxBitmap(typeof(ListView))]
public class ListViewExt : ListView
{
public ListViewExt()
{
this.DoubleBuffered = true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using System.Threading.Tasks;
using System.ServiceProcess;

namespace tbvolscroll.Classes
namespace tb_vol_scroll.Classes.ControlsExt
{
// By https://stackoverflow.com/a/68154774

public class WinServicePoller : ServiceController
public class ServiceControllerExt : ServiceController
{
public event EventHandler<ServiceStatusEventArgs> StatusChanged;
private readonly Dictionary<ServiceControllerStatus, Task> _tasks = new Dictionary<ServiceControllerStatus, Task>();
Expand All @@ -21,7 +21,7 @@ public class WinServicePoller : ServiceController
}
}

public WinServicePoller(string ServiceName) : base(ServiceName)
public ServiceControllerExt(string ServiceName) : base(ServiceName)
{
foreach (ServiceControllerStatus status in Enum.GetValues(typeof(ServiceControllerStatus)))
{
Expand Down
25 changes: 25 additions & 0 deletions Classes/Enums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace tb_vol_scroll.Classes.Helpers
{
public static class Enums
{
public enum MouseWheelDirection
{
Up,
Down,
None
}

public enum ActionTriggerType
{
RegularVolumeScroll,
PreciseVolumeScroll,
MuteToggleScroll,
DeviceSwitchScroll,
InternalEvent,
AudioDisabled,
AudioEnabled,
ConfigurationApplied,
Startup
}
}
}
21 changes: 0 additions & 21 deletions Classes/ExControls/DoubleBufferedListView.cs

This file was deleted.

120 changes: 0 additions & 120 deletions Classes/ExControls/FontList.resx

This file was deleted.

33 changes: 0 additions & 33 deletions Classes/ExControls/TransparentPanel.cs

This file was deleted.

47 changes: 25 additions & 22 deletions Classes/Globals.cs
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
using System.Collections.Generic;
using System.Drawing;
using System.Threading;
using tbvolscroll.Forms;
using tb_vol_scroll.Classes.ControlsExt;
using tb_vol_scroll.Classes.Handlers;
using tb_vol_scroll.Classes.Helpers;
using tb_vol_scroll.Forms;

namespace tbvolscroll.Classes
namespace tb_vol_scroll.Classes
{
public static class Globals
{
private static Color defaultColor = Color.FromArgb(31, 143, 255);
private static int volumeBarAutoHideTimeout;
private static float dpiScale = Utils.GetDpiScale();
private static InputHandler inputHandler;
private static AudioHandler audioHandler;
private static bool isDisplayingVolumeBar = false;
private static bool displayTrayIcon = true;
private static MainForm mainForm;
private static AudioPlaybackDevicesForm audioPlaybackDevicesForm;
private static VolumeSliderControlForm volumeSliderControlForm;
private static ConfigurationForm configurationForm;
private static AudioPlaybackDevicesForm audioPlaybackDevicesForm;
private static InputHandler inputHandler;
private static AudioHandler audioHandler;
private static ServiceControllerExt audioServiceController = new ServiceControllerExt("audiosrv");
private static Mutex appMutex;
private static int textRenderingHintType;
public static int VolumeBarAutoHideTimeout { get => volumeBarAutoHideTimeout; set => volumeBarAutoHideTimeout = value; }
private static List<string> appArgs;

private static float dpiScale = Utils.GetDpiScale();
private static readonly Color defaultColor = Color.SkyBlue;
public static MainForm MainForm { get => mainForm; set => mainForm = value; }
public static InputHandler InputHandler { get => inputHandler; set => inputHandler = value; }
public static AudioHandler AudioHandler { get => audioHandler; set => audioHandler = value; }
public static bool IsDisplayingVolumeBar { get => isDisplayingVolumeBar; set => isDisplayingVolumeBar = value; }
public static MainForm MainForm { get => mainForm; set => mainForm = value; }
public static AudioPlaybackDevicesForm AudioPlaybackDevicesForm { get => audioPlaybackDevicesForm; set => audioPlaybackDevicesForm = value; }
public static VolumeSliderControlForm VolumeSliderControlForm { get => volumeSliderControlForm; set => volumeSliderControlForm = value; }
public static Mutex AppMutex { get => appMutex; set => appMutex = value; }
public static bool DisplayTrayIcon { get => displayTrayIcon; set => displayTrayIcon = value; }
public static ServiceControllerExt AudioServiceController { get => audioServiceController; set => audioServiceController = value; }
public static float DpiScale { get => dpiScale; set => dpiScale = value; }
public static int TextRenderingHintType { get => textRenderingHintType; set => textRenderingHintType = value; }
public static Color DefaultColor { get => defaultColor; set => defaultColor = value; }
public static ConfigurationForm ConfigurationForm { get => configurationForm; set => configurationForm = value; }
public static Mutex AppMutex { get => appMutex; set => appMutex = value; }
public static bool AudioAvailable { get => AudioHandler != null && AudioHandler.IsAudioAvailable(); }
public static bool InputAvailable { get => InputHandler.InputEnabled; }

public static Color DefaultColor => defaultColor;

public static VolumeSliderControlForm VolumeSliderControlForm { get => volumeSliderControlForm; set => volumeSliderControlForm = value; }
public static List<string> AppArgs { get => appArgs; set => appArgs = value; }
public static AudioPlaybackDevicesForm AudioPlaybackDevicesForm { get => audioPlaybackDevicesForm; set => audioPlaybackDevicesForm = value; }
}
}
Loading

0 comments on commit 5f13b52

Please sign in to comment.