Skip to content

Commit

Permalink
Improved the multi-language support, this includes: (#157)
Browse files Browse the repository at this point in the history
* Added *.suo VS files to .gitignore.

* Improved the multi-language support, this includes:

- Added the possibility to specify which language is used. The specified language is saved in the configuration.
- If a new/empty or older configuration is present without a specified language, the language is automatically determinated based on the system language. If the system language is supported by SoundSwitch this language is used. If not, English is used.
- The language is loaded once at startup. If it's changed later inside the settings form a restart of the application is required.
- Added German as third supported language.

Code relevant changes:
- New directory for all localization files /Localization.
- Moved all control localizations from the *.Designer.cs files to it's own methods outside of the *.Designer.cs files.
- Naming for all localizations is lowerCamelCase.
- While updating the localizations i also changed some English texts. As a result these strings are untranslated now in French.
- Tweaked some labels to support a different length - that's important if a string is in another language longer then in English.

Important:
- If ANY text inside the forms (designer) is changer or the other way around any English texts inside the *.resx files - they needed to be synchronized!

Other by-the-way changes:
- Minor code-style changes in various files which doesn't affect the functionality.
- Synchronized all file headers and updated copyright notices.

ToDo:
- Update Readme.md and include Zeta Resource Editor project file for further translations as well as a new - for example - wiki article how language changes should be done.
- Translate missing french strings.

* Updated README.md.

- Added Customized Sound Notification note.
- Added Multi-Language Support section.
- Added a preview image.
- Minor changes.

Included Zeta Resource Editor project file for further translations.
Included ReSharper project settings - if someone else uses it.

ToDo:
- Create wiki article how language changes should be done.
- Translate missing french strings.

* The user will now be notified after changing the language that this requires a restart.

- Added the possibility to restart the application right after changing the language.
- Added a small script which removes various informations (like absolute file paths) from the Zeta Resource Editor project file.

Run the script after opening/closing the *.zreproj project file.
  • Loading branch information
FireEmerald authored and Belphemur committed Mar 4, 2017
1 parent 44b6184 commit 0bc54a4
Show file tree
Hide file tree
Showing 117 changed files with 5,871 additions and 4,701 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ bin/
obj/
Debug/
Release/
ipch/
ipch/
*.suo
*.opensdf
*.sdf
Final
Expand All @@ -53,4 +54,4 @@ packages/
/SoundSwitch160228.vspx
/SoundSwitch.VC.VC.opendb
/SoundSwitch.VC.db
/SoundSwitch.psess
/SoundSwitch.psess
37 changes: 24 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# SoundSwitch [![Last Release](https://img.shields.io/github/release/Belphemur/SoundSwitch.svg)](https://github.com/Belphemur/SoundSwitch/releases) [![Downloads for last Release](https://img.shields.io/github/downloads/Belphemur/SoundSwitch/total.svg)](https://www.aaflalo.me/downloads/) [![AppVeyor branch](https://img.shields.io/badge/Donate-paypal%2Fcc-blue.svg)](https://www.aaflalo.me/donate/)
SoundSwitch makes it easier to switch playback devices (sound cards).

Normally, to switch a Playback device you need to right click the sound icon in the bottom right corner of your screen (system tray), choose Playback devices” and then change the default playback device. Every time you want to switch.
Normally, to switch a playback device you need to right click the sound icon in the bottom right corner of your screen (system tray), choose 'Playback Devices' and then change the Default Playback Device. Every time you want to switch.

With SoundSwitch you just configure once between which Playback devices you want to toggle and then you can press Ctrl+Alt+F11 to toggle automatically!
With SoundSwitch you just configure once between which playback devices you want to toggle and then you can press Ctrl+Alt+F11 to toggle automatically!

## Preview image
![preview](img/preview.gif)

## Dependencies
You need .NET 4.6.2 installed to work: [Microsoft .NET Framework 4.6.2 (Web Installer)](https://www.microsoft.com/en-us/download/details.aspx?id=53345)
Expand All @@ -14,12 +17,12 @@ You also need [Visual C++ Redistributable for Visual Studio 2015](https://www.mi
If you want to donate for the development don't hesite to do it here: https://www.aaflalo.me/donate/

## Configuration
Right click the SoundSwitch icon in your system tray and choose Settings. Now select the devices between which you want to toggle. Optionally you can also change the keyboard combination, by default this is {Ctrl + Alt + F11} If you want the application to start automatically when your PC boots up, check the box “Run at startup”.
Right click the SoundSwitch icon in your system tray and choose Settings. Now select the devices between which you want to toggle. Optionally you can also change the keyboard combination, by default this is {Ctrl + Alt + F11} If you want the application to start automatically when your PC boots up, check the box 'Start automatically with Windows'.

## Usage
Press Ctrl + Alt + F11 to cycle through the playback devices. (Or a different key combination if you changed it)

For Recording devices the default is: Ctrl + Alt + F7
For recording devices the default is: Ctrl + Alt + F7

### Double clicks
You can also double click on the systray icon to switch audio devices.
Expand All @@ -30,34 +33,42 @@ If you use the left click on the systray icon, you'll see a menu appear where yo
## Features

### Recording Devices
SoundSwitch can also take care of your recording devices. You can set specifics HotKeys as for the Playback devices.
SoundSwitch can also take care of your recording devices. You can set specifics HotKeys as for the playback devices.

### Auto-Updater
This is one of the interesting feature added in Isabelline Gold, the auto-updater. Every 12h SoundSwitch will check the GitHub repository (thanks to the GitHub API) for a new release, if a new one is available, the user will get a notification and the No Update” in the context menu will change to Update Available (X.X.X) where X.X.X represent the new version number. When the user clicks on it, a new Window opens with a progress bar (see screenshots). The new version gets automatically downloaded in the temp folder of the user. When the download is finished, the user can install the Update by just clicking the install button. A changelog is also provided by getting the information set in the release on GitHub.
This is one of the interesting feature added in Isabelline Gold, the auto-updater. Every 24h SoundSwitch will check the GitHub repository (thanks to the GitHub API) for a new release. If a new one is available the user will get a notification and the 'No update available' in the context menu will change to 'Update Available (X.X.X)' where X.X.X represent the new version number. When the user clicks on it, a new window opens with a progress bar (see screenshots). The new version gets automatically downloaded in the temp folder of the user. When the download is finished, the user can install the Update by just clicking the install button. A changelog is also provided by getting the information set in the release on GitHub.

#### Stealth Update
If you don't want to install manually the update, you can activate this feature to let SoundSwitch update itself when the AutoUpdater find a new suitable version (Enabled by default).
#### Update Modes
There are three different options available: Silent, means the program updates itself in the background without any prompts. Notify, you will be notified when there's an update available. Never, well this is self-explained.

### Communications
SoundSwitch can also change the communications devices when asked in the Settings. Windows make a differentiation between Multimedia and Communication; it means if an application asks to have access to Communications Audio Device, it will receive the default Communications device. By default SoundSwitch only change the Multimedia device and not the communications. Now if the checkbox is checked in the settings, it will also change the Communications device.
SoundSwitch can also change the 'Default Communication Device' when asked in the Settings. Windows makes a differentiation between Multimedia and Communication; it means if an application asks to have access to communications audio device, it will receive the Default Communication Device. By default SoundSwitch only changes the multimedia device and not the communication. Now if the checkbox is checked in the settings, it will also change the Communication Device.

### Notifications
SoundSwitch provides three types of notification.
SoundSwitch provides four types of notification.

#### Windows Notification
This is the default notification; it uses the balloon tip of Windows. In the case of Windows 7, it's the little balloon that opens next to the systray icon. For Windows 10, it's the notification system that slides from the right corner of the screen.

#### Sound Notification
This notification is a sound played on the switched device. This way when you are switching device, the new device will "chime" to tell you it's selected.
This notification is a sound played on the switched device. This way when you are switching devices, the new device will 'chime' to tell you it's selected.

### Customized Sound Notification
The same as a Sound Notification but you can specify the sound which is played.

#### Toast Notification (>=Win 8)
If you are on Windows 8 or more, you can use this type of Toast notification. More personalization is possible, by default the notification is silent, but you can set a custom sound for it (mp3 or wav for now).
#### Toast Notification (Win 8)
If you are on Windows 8 or later, you can use this type of Toast Notification. More personalization is possible, by default the notification is silent, but you can set a custom sound for it (mp3 or wav for now).

If you want to return to a silent Toast notification, open the file selector, and just do Cancel. Doing that will remove the set sound.

#### No Notification
In case you're not interested in getting any notification.

### Multi-Language Support
There are three languages available: English, French and German.

Would you like to help us with the localization? Great! See [Add or modify another language](../../wiki/Add-or-modify-another-language) for further informations.

## Awards

### Giga 5 Stars
Expand Down
2 changes: 2 additions & 0 deletions SoundSwitch.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>
37 changes: 37 additions & 0 deletions SoundSwitch/CleanTranslationProjectFile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@echo off
REM *
REM * Removes various informations (like absolute file paths) from the Zeta Resource Editor project file.
REM * Run this script if you opened the *.zreproj project file at least once.
REM *
set filename="SoundSwitch.zreproj"

setlocal
setlocal enableDelayedExpansion
if not exist %filename% call :error "file"
findstr /v "<userSetting </userSetting>" %filename% >%filename%.nouserdata || call :error %errorlevel%, "user"
type "%filename%.nouserdata"|repl "absoluteFilePath=\q.*\q (/>)" "$1" x >%filename%.clean
if not %errorlevel%==0 call :error %errorlevel%, "abspath"
move /y %filename%.clean %filename% || call :error
del %filename%.nouserdata || call :error

echo %filename% successfully cleaned.
goto :end

:error
if "%~1"=="file" (
echo %filename% doesn't exist.
) else if "%~1"=="1" (
if "%~2"=="user" (
echo userSettings not found, skipped.
) else if "%~2"=="abspath" (
echo absoluteFilePath attribute not found, skipped.
)
) else (
echo Unknown error occured.
goto :end
)
exit /b 0

:end
pause
exit
6 changes: 3 additions & 3 deletions SoundSwitch/Framework/AppLogger.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/********************************************************************
* Copyright (C) 2015 Jeroen Pelgrims
* Copyright (C) 2015 Antoine Aflalo
*
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Expand Down
6 changes: 3 additions & 3 deletions SoundSwitch/Framework/ApplicationPath.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/********************************************************************
* Copyright (C) 2015 Antoine Aflalo
*
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Expand Down
14 changes: 14 additions & 0 deletions SoundSwitch/Framework/Audio/CachedSound.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using System.Collections.Generic;
using System.IO;
Expand Down
14 changes: 14 additions & 0 deletions SoundSwitch/Framework/Audio/CachedSoundFileNotExistsException.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using System.Runtime.Serialization;

Expand Down
14 changes: 14 additions & 0 deletions SoundSwitch/Framework/Audio/CachedSoundWaveStream.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using NAudio.Wave;

Expand Down
6 changes: 3 additions & 3 deletions SoundSwitch/Framework/AutoStart.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/********************************************************************
* Copyright (C) 2015 Antoine Aflalo
*
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Expand Down
12 changes: 5 additions & 7 deletions SoundSwitch/Framework/Configuration/AppConfigs.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/********************************************************************
* Copyright (C) 2015 Antoine Aflalo
*
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Expand All @@ -16,9 +16,7 @@ namespace SoundSwitch.Framework.Configuration
{
public static class AppConfigs
{
public static ISoundSwitchConfiguration Configuration { get; private set; } =
ConfigurationManager.LoadConfiguration<SoundSwitchConfiguration>();
public static IIPCConfiguration IPCConfiguration { get; private set; } =
ConfigurationManager.LoadConfiguration<IPCConfiguration>();
public static ISoundSwitchConfiguration Configuration { get; private set; } = ConfigurationManager.LoadConfiguration<SoundSwitchConfiguration>();
public static IIPCConfiguration IPCConfiguration { get; private set; } = ConfigurationManager.LoadConfiguration<IPCConfiguration>();
}
}
18 changes: 8 additions & 10 deletions SoundSwitch/Framework/Configuration/ConfigurationManager.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
/********************************************************************
* Copyright (C) 2015 Antoine Aflalo
*
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;
using System.Diagnostics;
using System.IO;
using System.Windows.Forms;
using Newtonsoft.Json;

namespace SoundSwitch.Framework.Configuration
{
public interface IConfiguration
{
/// <summary>
/// Where is the configuration saved
/// Any change to this will be discarded at the next loading of the configuration
/// Where is the configuration saved
/// Any change to this will be discarded at the next loading of the configuration
/// </summary>
string FileLocation { get; set; }

Expand All @@ -44,7 +42,7 @@ static ConfigurationManager()
}

/// <summary>
/// Load a ConfigurationManager from its file
/// Load a ConfigurationManager from its file
/// </summary>
/// <returns>The loaded configuration if the file exists, else a new instance of the configuration</returns>
public static T LoadConfiguration<T>() where T : IConfiguration, new()
Expand All @@ -61,7 +59,7 @@ static ConfigurationManager()
obj = JsonConvert.DeserializeObject<T>(contents);
if (obj == null)
{
Trace.WriteLine("Problem with Deserializer");
Trace.WriteLine("Problem with deserialization");
Trace.WriteLine("Contents: " + contents);
obj = new T();
}
Expand All @@ -77,7 +75,7 @@ static ConfigurationManager()
}

/// <summary>
/// Save the configuration in a json file.
/// Save the configuration in a json file.
/// </summary>
/// <param name="configuration">configuration object to save</param>
public static void SaveConfiguration<T>(T configuration) where T : IConfiguration, new()
Expand Down
16 changes: 15 additions & 1 deletion SoundSwitch/Framework/Configuration/IIPCConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
namespace SoundSwitch.Framework.Configuration
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

namespace SoundSwitch.Framework.Configuration
{
public interface IIPCConfiguration : IConfiguration
{
Expand Down
20 changes: 16 additions & 4 deletions SoundSwitch/Framework/Configuration/IPCConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
using System;
using System.Linq;
using System.Security.Cryptography;
/********************************************************************
* Copyright (C) 2015-2017 Antoine Aflalo
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
********************************************************************/

using System;

namespace SoundSwitch.Framework.Configuration
{
Expand Down Expand Up @@ -39,6 +51,6 @@ public void Save()
{
ConfigurationManager.SaveConfiguration(this);
}

}
}
Loading

0 comments on commit 0bc54a4

Please sign in to comment.