From 02efa857f981c39cda6329af3fb537e5901a796a Mon Sep 17 00:00:00 2001
From: Targor <>
Date: Wed, 28 Sep 2022 12:12:27 +0200
Subject: [PATCH] adds int textfield max value, corrects default device
recognition, changes version for release
---
JBLRecover/MainWindow.xaml | 8 ++++++--
JBLRecover/MainWindow.xaml.cs | 14 ++++++++++----
JBLRecover/Properties/AssemblyInfo.cs | 4 ++--
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/JBLRecover/MainWindow.xaml b/JBLRecover/MainWindow.xaml
index 9435265..378407f 100644
--- a/JBLRecover/MainWindow.xaml
+++ b/JBLRecover/MainWindow.xaml
@@ -8,7 +8,7 @@
Loaded="Window_Loaded"
Initialized="Window_Initialized"
StateChanged="Window_StateChanged"
- Title="JBL Recover" Height="260" Width="500" HorizontalAlignment="Stretch"
+ Title="JBL Recover" Height="310" Width="500" HorizontalAlignment="Stretch"
ResizeMode="CanMinimize"
Icon=" pack://application:,,,/JBLRecover;component/shower.ico"
WindowStartupLocation="CenterScreen" >
@@ -24,6 +24,7 @@
+
@@ -100,7 +101,10 @@
Get the source at: https://github.com/targor
-
+
+
+
+
diff --git a/JBLRecover/MainWindow.xaml.cs b/JBLRecover/MainWindow.xaml.cs
index b5bcb12..2e19bed 100644
--- a/JBLRecover/MainWindow.xaml.cs
+++ b/JBLRecover/MainWindow.xaml.cs
@@ -7,6 +7,7 @@
using System.IO;
using System.Linq;
using System.Media;
+using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
@@ -186,9 +187,12 @@ private void LoadAudioDevices()
foreach (object o in devices.Items)
{
CapsWrapper c = (CapsWrapper)o;
- if (c.ToString().ToLower().Contains("jbl")
- &&
- c.Device.AudioEndpointVolume.MasterVolumeLevel != 0.0f && c.Device.DataFlow==DataFlow.Render)
+ String x = c.ToString().ToLower();
+ if (
+ x.Contains("jbl") &&
+ c.Device.DataFlow == DataFlow.Render &&
+ (c.Device.AudioEndpointVolume.MasterVolumeLevel != 0.0f || c.Device.AudioEndpointVolume.MasterVolumeLevelScalar != 0.0f )
+ )
{
devices.SelectedItem = o;
Play();
@@ -256,7 +260,8 @@ public static DirectoryInfo GetCurrentPath()
private void Window_Loaded(object sender, RoutedEventArgs e)
{
- foreach(FileInfo f in GetCurrentPath().GetFiles())
+ VersionTxt.Content = "Version: " + Assembly.GetExecutingAssembly().GetName().Version.ToString();
+ foreach (FileInfo f in GetCurrentPath().GetFiles())
{
if (f.Extension.ToLower().Equals(".wav"))
{
@@ -335,6 +340,7 @@ private void txtwavetime_TextChanged(object sender, TextChangedEventArgs e)
{
int timeinminutes = defaultPlayTime;
int.TryParse(txtwavetime.Text, out timeinminutes);
+ if (timeinminutes > 120) { timeinminutes = defaultPlayTime; }
this.playtime = 60 * timeinminutes;
}
}
diff --git a/JBLRecover/Properties/AssemblyInfo.cs b/JBLRecover/Properties/AssemblyInfo.cs
index 106e32e..f3b72bf 100644
--- a/JBLRecover/Properties/AssemblyInfo.cs
+++ b/JBLRecover/Properties/AssemblyInfo.cs
@@ -51,5 +51,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.7.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.8.0")]
+[assembly: AssemblyFileVersion("1.0.8.0")]