Skip to content

Commit

Permalink
adds int textfield max value, corrects default device recognition, ch…
Browse files Browse the repository at this point in the history
…anges version for release
  • Loading branch information
Targor committed Sep 28, 2022
1 parent 1380649 commit 02efa85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
8 changes: 6 additions & 2 deletions JBLRecover/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" >
Expand All @@ -24,6 +24,7 @@
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="auto"></RowDefinition>
</Grid.RowDefinitions>

<Grid Grid.Row="0" Margin="0 10 0 0">
Expand Down Expand Up @@ -100,7 +101,10 @@
<Grid Grid.Row="8" Margin="0 10 0 0">
<TextBox IsReadOnly="True" Padding="0" Margin="0" FontSize="10">Get the source at: https://github.com/targor</TextBox>
</Grid>
<Grid Grid.Row="9" Margin="0 10 0 0"/>
<Grid Grid.Row="9" Margin="0 2 0 0">
<Label Name="VersionTxt" Padding="0" Margin="0" FontSize="10"/>
</Grid>
<Grid Grid.Row="10" Margin="0 10 0 0"/>
</Grid>
</Grid>
</Window>
14 changes: 10 additions & 4 deletions JBLRecover/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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"))
{
Expand Down Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions JBLRecover/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 02efa85

Please sign in to comment.