Skip to content

Commit f0d2719

Browse files
committed
Merge branch 'dev' into beta
2 parents 6f18daa + 0591e4e commit f0d2719

File tree

10 files changed

+229
-55
lines changed

10 files changed

+229
-55
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<PackageVersion Include="FluentAssertions" Version="8.3.0" />
1010
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
1111
<PackageVersion Include="Job.Scheduler" Version="3.1.8" />
12-
<PackageVersion Include="Markdig" Version="0.41.2" />
12+
<PackageVersion Include="Markdig" Version="0.41.3" />
1313
<PackageVersion Include="MessagePack" Version="3.1.4" />
1414
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
1515
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.6" />

README.de.md

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ Wählen Sie zuerst, wie im vorigen Abschnitt beschrieben, Ihre gewünschten Ger
4343

4444
Wenn ein Mikrofon stummgeschaltet wird, erscheint ein dauerhaftes Banner auf Ihrem Bildschirm, um Sie daran zu erinnern, dass Ihr Mikrofon stummgeschaltet ist. Das Banner bleibt sichtbar, bis Sie die Stummschaltung des Mikrofons aufheben oder auf das Banner klicken, um es direkt zu aktivieren.
4545

46+
## 🖱️ Taskleisten-Symbol Aktionen
47+
48+
Das Taskleisten-Symbol unterstützt konfigurierbare Doppelklick-Aktionen. Sie können wählen, was beim Doppelklick auf das SoundSwitch-Symbol passiert:
49+
50+
- **🔊 Gerät wechseln** (Standard): Wechselt durch Ihre konfigurierten Wiedergabegeräte
51+
- **📋 Profil wechseln**: Wechselt durch Ihre konfigurierten Audio-Profile
52+
- **⚙️ Einstellungen öffnen**: Öffnet das SoundSwitch-Einstellungsfenster
53+
54+
Dieses Verhalten kann in den SoundSwitch-Einstellungen angepasst werden, um Ihrem bevorzugten Arbeitsablauf zu entsprechen.
55+
4656
## 💻 Kommandozeile (CLI)
4757

4858
SoundSwitch verfügt über eine leistungsfähige Kommandozeilen-Schnittstelle, mit der Sie die Anwendung über die Befehlszeile steuern können:
@@ -71,14 +81,38 @@ SoundSwitch bietet vier verschiedenen Arten der Benachrichtigung, wenn ein Gerä
7181

7282
## Profile
7383

74-
Mithilfe von Profilen ist es möglich zu einem bestimmten Gerät zu wechseln, wenn eine Bedingung eintritt. Profile können für die folgenden Zwecke definiert werden:
84+
Mithilfe von Profilen können Sie automatisch zu bestimmten Audiogeräten wechseln, wenn bestimmte Bedingungen erfüllt sind. Profile unterstützen mehrere Auslösertypen und erweiterte Geräteverwaltung:
85+
86+
### 🎯 Profil-Auslöser
87+
88+
- **⌨️ Hotkey-Auslöser**: Geräte mit benutzerdefinierten Tastenkombinationen wechseln. Mehrere Profile können dieselbe Tastenkombination verwenden und automatisch durchwechseln.
89+
90+
- **💫 Anwendungs-Auslöser**: Automatischer Gerätewechsel, wenn bestimmte Anwendungen den Fokus erhalten. Zum Beispiel Spotify auf Lautsprecher leiten, während Spiele das Headset verwenden.
91+
92+
- **🪟 Fenster-Auslöser**: Gerätewechsel basierend auf Fenstertiteln. Nützlich für Anwendungen, die ihre Fensternamen dynamisch ändern.
93+
94+
- **🎮 Steam Big Picture**: Spezielles Profil, das automatisch aktiviert wird, wenn der Steam Big Picture-Modus gestartet wird.
95+
96+
- **📱 UWP-App-Auslöser**: Unterstützung für Universal Windows Platform-Anwendungen mit automatischem Gerätewechsel.
97+
98+
- **🚀 Startup-Auslöser**: Profile, die automatisch aktiviert werden, wenn SoundSwitch startet.
99+
100+
- **🔄 Geräte-Geändert-Auslöser**: Erzwungene Profile, die bestimmte Gerätekonfigurationen beibehalten, auch wenn Windows versucht, sie zu ändern.
101+
102+
- **📋 Tray-Menü-Auslöser**: Profile, die direkt über das Kontextmenü der Taskleiste zugänglich sind.
103+
104+
### 🎚️ Erweiterte Profil-Funktionen
75105

76-
- ### 💫 Anwendungsprofil
106+
- **Multi-Geräte-Unterstützung**: Separate Geräte für Wiedergabe, Kommunikation, Aufnahme und Aufnahme-Kommunikation konfigurieren
107+
- **Intelligente Gerätewiederherstllung**: Automatische Wiederherstellung vorheriger Audioeinstellungen, wenn ein Profil deaktiviert wird
108+
- **Vordergrund-App-Wechsel**: Option, nur die Audio-Einstellungen der fokussierten Anwendung zu wechseln anstatt systemweit
109+
- **Standard-Geräte-Kontrolle**: Wählen Sie, ob Windows-Standardgeräte geändert oder nur anwendungsspezifisches Routing verwendet werden soll
110+
- **Benachrichtigungskontrolle**: Benachrichtigungen bei Profilaktivierung aktivieren/deaktivieren
111+
- **Gerätevalidierung**: Automatische Überprüfung der Geräteverfügbarkeit mit Fallback-Behandlung
77112

78-
Wenn eine Anwendung fokussiert wird, werden die Soundeinstellungen auf der Grundlage des Profils geändert. Erstelle zum Beispiel ein Profil für Spotify, damit nur Musik über den Lautsprecher wiedergegeben wird, während das Lieblingsspiel über das Headset läuft.
113+
### 🔄 Hotkey-Durchschaltung
79114

80-
- ### ⌨️ Hotkeyprofil
81-
Wenn eine bestimmte Tastenkombination gedrückt wird, werden die Soundeinstellungen auf der Grundlage des Profils geändert. Definiere zum Beispiel eine spezielle Kombination, um als Wiedergabegerät den Fernseher zu verwenden.
115+
Wenn mehrere Profile dieselbe Tastenkombination verwenden, wechselt SoundSwitch automatisch zwischen ihnen durch. Wenn das Schnellmenü aktiviert ist, erscheint ein visueller Selektor, mit dem Sie das spezifische zu aktivierende Profil auswählen können.
82116

83117
## Erweiterte Funktionen
84118

README.md

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
[![.NET](https://github.com/Belphemur/SoundSwitch/actions/workflows/dotnet.yml/badge.svg)](https://github.com/Belphemur/SoundSwitch/actions/workflows/dotnet.yml)[![Last Release](https://img.shields.io/github/release/Belphemur/SoundSwitch.svg)](https://soundswitch.aaflalo.me) [![Downloads for last Release](https://img.shields.io/github/downloads/Belphemur/SoundSwitch/total.svg)](https://soundswitch.aaflalo.me/) [![Translate](https://hosted.weblate.org/widgets/soundswitch/-/svg-badge.svg)](https://hosted.weblate.org/projects/soundswitch/) [![Donate](https://img.shields.io/badge/Donate-paypal%2Fcc-blue.svg)](https://soundswitch.aaflalo.me) [![Help](https://img.shields.io/badge/Discord-Community%20&%20Help-green?style=flat-square&logo=discord)](https://discord.gg/gUCw3Ue)
44

55
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
6+
67
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
8+
79
<!-- ALL-CONTRIBUTORS-BADGE:END -->
810

911
**SoundSwitch** offers you the opportunity to switch your playback and recording devices using simple **hotkeys**.
@@ -47,7 +49,17 @@ First set up your devices you want to cycle through, using _right click_ on the
4749

4850
When a microphone is muted, a persistent banner will appear on your screen to remind you that your microphone is muted. The banner will remain visible until you unmute the microphone or click on the banner to unmute it directly.
4951

50-
## 💻 Command Line Interface
52+
## 🖱️ System Tray Icon Actions
53+
54+
The system tray icon supports configurable double-click actions. You can choose what happens when you double-click the SoundSwitch icon:
55+
56+
- **🔊 Switch Device** (default): Cycles through your configured playback devices
57+
- **📋 Switch Profile**: Cycles through your configured audio profiles
58+
- **⚙️ Open Settings**: Opens the SoundSwitch settings window
59+
60+
This behavior can be customized in the SoundSwitch settings to match your preferred workflow.
61+
62+
## Command Line Interface
5163

5264
SoundSwitch includes a powerful CLI that allows you to control the application through command line:
5365

@@ -75,14 +87,38 @@ SoundSwitch provides four types of notification when a device is changed:
7587

7688
## Profiles
7789

78-
Using profiles, it is possible to switch to a specific device when a condition occurs. Profiles can be defined for the following purposes:
90+
Using profiles, you can automatically switch to specific audio devices when certain conditions are met. Profiles support multiple trigger types and advanced device management:
91+
92+
### 🎯 Profile Triggers
93+
94+
- **⌨️ Hotkey Triggers**: Switch devices using custom key combinations. Multiple profiles can share the same hotkey and cycle through them automatically.
95+
96+
- **💫 Application Triggers**: Automatically switch devices when specific applications gain focus. For example, route Spotify to speakers while games use your headset.
97+
98+
- **🪟 Window Triggers**: Switch devices based on window titles. Useful for applications that change their window names dynamically.
99+
100+
- **🎮 Steam Big Picture**: Special profile that activates automatically when Steam Big Picture mode is launched.
101+
102+
- **📱 UWP App Triggers**: Support for Universal Windows Platform applications with automatic device switching.
103+
104+
- **🚀 Startup Triggers**: Profiles that activate automatically when SoundSwitch starts.
105+
106+
- **🔄 Device Changed Triggers**: Force profiles that maintain specific device configurations even when Windows tries to change them.
107+
108+
- **📋 Tray Menu Triggers**: Profiles accessible directly from the system tray context menu.
109+
110+
### 🎚️ Advanced Profile Features
79111

80-
- ### 💫 Application profile
112+
- **Multi-Device Support**: Configure separate devices for playback, communication, recording, and recording communication
113+
- **Smart Device Restoration**: Automatically restore previous audio settings when a profile deactivates
114+
- **Foreground App Switching**: Option to switch only the focused application's audio instead of system-wide
115+
- **Default Device Control**: Choose whether to change Windows default devices or only application-specific routing
116+
- **Notification Control**: Enable/disable notifications when profiles activate
117+
- **Device Validation**: Automatic checking for device availability with fallback handling
81118

82-
When a application is focused, the sound settings are switched based on the profile. For example create a profile for Spotify to only play music on your speaker, while your favorite game is using your headset.
119+
### 🔄 Hotkey Cycling
83120

84-
- ### ⌨️ Hot key profile
85-
When a hot key combination is pressed, the sound settings are switched based on the profile. For example you define a special combination to switch your playback device to your television.
121+
When multiple profiles share the same hotkey, SoundSwitch automatically cycles through them. If Quick Menu is enabled, a visual selector appears allowing you to choose the specific profile to activate.
86122

87123
## Advanced
88124

SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IIconDoubleClick.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,16 @@
1616

1717
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick.Action;
1818

19-
public interface IIconDoubleClick : IEnumImpl<IconDoubleClickEnum>;
19+
/// <summary>
20+
/// Defines the contract for system tray icon double-click action implementations.
21+
/// Each implementation represents a specific action that can be performed when the user double-clicks the SoundSwitch system tray icon.
22+
/// </summary>
23+
public interface IIconDoubleClick : IEnumImpl<IconDoubleClickEnum>
24+
{
25+
/// <summary>
26+
/// Executes the double-click action.
27+
/// This method is called when the user double-clicks the system tray icon and this action is configured.
28+
/// </summary>
29+
/// <param name="trayIcon">The TrayIcon instance that can be used to access UI functionality</param>
30+
void Execute(UI.Component.TrayIcon trayIcon);
31+
}

SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickOpenSettings.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,29 @@
1616

1717
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick.Action;
1818

19+
/// <summary>
20+
/// Implementation for the "Open Settings" double-click action.
21+
/// When the user double-clicks the system tray icon, this action opens the SoundSwitch settings window.
22+
/// This provides quick access to application configuration and customization options.
23+
/// </summary>
1924
internal class IconDoubleClickOpenSettings : IIconDoubleClick
2025
{
26+
/// <summary>
27+
/// Gets the enum type that this implementation corresponds to.
28+
/// </summary>
2129
public IconDoubleClickEnum TypeEnum => IconDoubleClickEnum.OpenSettings;
30+
31+
/// <summary>
32+
/// Gets the localized label for this action as displayed in the user interface.
33+
/// </summary>
2234
public string Label => SettingsStrings.openSettings;
35+
36+
/// <summary>
37+
/// Executes the open settings action by showing the settings window.
38+
/// </summary>
39+
/// <param name="trayIcon">The TrayIcon instance used to show the settings window</param>
40+
public void Execute(UI.Component.TrayIcon trayIcon)
41+
{
42+
trayIcon.ShowSettings();
43+
}
2344
}

SoundSwitch/Framework/TrayIcon/IconDoubleClick/Action/IconDoubleClickSwitchDevice.cs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,35 @@
1212
* GNU General Public License for more details.
1313
********************************************************************/
1414

15+
using NAudio.CoreAudioApi;
1516
using SoundSwitch.Localization;
17+
using SoundSwitch.Model;
1618

1719
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick.Action;
1820

19-
internal class IconDoubleClickSwitchDevice: IIconDoubleClick
21+
/// <summary>
22+
/// Implementation for the "Switch Device" double-click action.
23+
/// When the user double-clicks the system tray icon, this action cycles through the configured playback devices.
24+
/// This is the default behavior and provides the traditional SoundSwitch functionality of device switching.
25+
/// </summary>
26+
internal class IconDoubleClickSwitchDevice : IIconDoubleClick
2027
{
28+
/// <summary>
29+
/// Gets the enum type that this implementation corresponds to.
30+
/// </summary>
2131
public IconDoubleClickEnum TypeEnum => IconDoubleClickEnum.SwitchDevice;
32+
33+
/// <summary>
34+
/// Gets the localized label for this action as displayed in the user interface.
35+
/// </summary>
2236
public string Label => SettingsStrings.switchDevice;
37+
38+
/// <summary>
39+
/// Executes the switch device action by cycling through configured playback devices.
40+
/// </summary>
41+
/// <param name="trayIcon">The TrayIcon instance (not used for this action)</param>
42+
public void Execute(UI.Component.TrayIcon trayIcon)
43+
{
44+
AppModel.Instance.CycleActiveDevice(DataFlow.Render);
45+
}
2346
}
Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
11

2-
using SoundSwitch.Localization;
2+
using System.Linq;
3+
using Serilog;
4+
using SoundSwitch.Framework.Profile.Trigger;
5+
using SoundSwitch.Localization;
6+
using SoundSwitch.Model;
37

48
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick.Action;
59

6-
internal class IconDoubleClickSwitchProfile: IIconDoubleClick
10+
/// <summary>
11+
/// Implementation for the "Switch Profile" double-click action.
12+
/// When the user double-clicks the system tray icon, this action cycles through the configured audio profiles.
13+
/// This allows users to quickly switch between different audio device configurations and setups.
14+
/// </summary>
15+
internal class IconDoubleClickSwitchProfile : IIconDoubleClick
716
{
17+
private Profile.Profile _activeTrayProfile;
18+
19+
/// <summary>
20+
/// Gets the enum type that this implementation corresponds to.
21+
/// </summary>
822
public IconDoubleClickEnum TypeEnum => IconDoubleClickEnum.SwitchProfile;
23+
24+
/// <summary>
25+
/// Gets the localized label for this action as displayed in the user interface.
26+
/// </summary>
927
public string Label => SettingsStrings.switchProfile;
28+
29+
/// <summary>
30+
/// Executes the switch profile action by cycling through profiles with tray menu triggers.
31+
/// </summary>
32+
/// <param name="trayIcon">The TrayIcon instance (not used for this action)</param>
33+
public void Execute(UI.Component.TrayIcon trayIcon)
34+
{
35+
// Check if there are any profiles with tray menu triggers
36+
var profiles = AppModel.Instance.ProfileManager.Profiles
37+
.Where(profile => profile.Triggers.Any(trigger => trigger.Type == TriggerFactory.Enum.TrayMenu))
38+
.ToList();
39+
40+
if (!profiles.Any())
41+
{
42+
Log.Warning("No profiles available for tray icon double click");
43+
return;
44+
}
45+
46+
var nextProfile = _activeTrayProfile != null && profiles.Contains(_activeTrayProfile)
47+
? profiles[(profiles.IndexOf(_activeTrayProfile) + 1) % profiles.Count]
48+
: profiles.First();
49+
50+
_activeTrayProfile = nextProfile;
51+
52+
Log.Information("Switching to profile {profile}", nextProfile.Name);
53+
AppModel.Instance.ProfileManager.SwitchAudio(nextProfile);
54+
}
1055
}

SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClickEnum.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,27 @@
1414

1515
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick;
1616

17+
/// <summary>
18+
/// Defines the available actions that can be performed when double-clicking the SoundSwitch system tray icon.
19+
/// These actions are configurable by the user in the application settings.
20+
/// </summary>
1721
public enum IconDoubleClickEnum
1822
{
23+
/// <summary>
24+
/// Cycles through the configured playback devices.
25+
/// This is the default behavior and matches the traditional SoundSwitch functionality.
26+
/// </summary>
1927
SwitchDevice = 0,
28+
29+
/// <summary>
30+
/// Opens the SoundSwitch settings window.
31+
/// Provides quick access to application configuration.
32+
/// </summary>
2033
OpenSettings = 1,
34+
35+
/// <summary>
36+
/// Cycles through the configured audio profiles.
37+
/// Allows users to quickly switch between different audio device configurations.
38+
/// </summary>
2139
SwitchProfile = 2,
2240
}

SoundSwitch/Framework/TrayIcon/IconDoubleClick/IconDoubleClickFactory.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,33 @@
1717

1818
namespace SoundSwitch.Framework.TrayIcon.IconDoubleClick;
1919

20+
/// <summary>
21+
/// Factory class for creating and managing system tray icon double-click action implementations.
22+
/// Provides access to all available double-click actions that users can configure for the SoundSwitch system tray icon.
23+
/// </summary>
2024
public class IconDoubleClickFactory() : AbstractFactory<IconDoubleClickEnum, IIconDoubleClick>(DoubleClick)
2125
{
26+
/// <summary>
27+
/// Collection of all available double-click action implementations.
28+
/// Each implementation corresponds to a specific action users can perform by double-clicking the system tray icon.
29+
/// </summary>
2230
private static readonly IEnumImplList<IconDoubleClickEnum, IIconDoubleClick> DoubleClick = new EnumImplList
2331
<IconDoubleClickEnum, IIconDoubleClick>
2432
{
2533
new IconDoubleClickSwitchDevice(),
2634
new IconDoubleClickSwitchProfile(),
2735
new IconDoubleClickOpenSettings()
2836
};
37+
38+
/// <summary>
39+
/// Executes the specified double-click action.
40+
/// This method eliminates the need for switch statements in the calling code.
41+
/// </summary>
42+
/// <param name="actionType">The type of action to execute</param>
43+
/// <param name="trayIcon">The TrayIcon instance to pass to the action</param>
44+
public void ExecuteAction(IconDoubleClickEnum actionType, UI.Component.TrayIcon trayIcon)
45+
{
46+
var action = Get(actionType);
47+
action.Execute(trayIcon);
48+
}
2949
}

0 commit comments

Comments
 (0)