Add support for the new alert sounds.

This commit is contained in:
GlenCFL 2017-12-07 06:49:25 -05:00
parent 2cf6a5953b
commit 010e0dda31
47 changed files with 1314 additions and 895 deletions

View File

@ -0,0 +1,50 @@
using System.Windows.Media;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
public abstract class StrIntBlockItem : BlockItemBase, IAudioVisualBlockItem
{
private string _value;
private int _secondValue;
protected StrIntBlockItem()
{
}
protected StrIntBlockItem(string value, int secondValue)
{
Value = value;
SecondValue = secondValue;
Value = value;
SecondValue = secondValue;
}
public override string OutputText => PrefixText + " " + Value + " " + SecondValue;
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
public string Value
{
get { return _value; }
set
{
_value = value;
IsDirty = true;
OnPropertyChanged();
}
}
public int SecondValue
{
get { return _secondValue; }
set
{
_secondValue = value;
IsDirty = true;
OnPropertyChanged();
}
}
}
}

View File

@ -0,0 +1,22 @@
using Filtration.ObjectModel.BlockItemBaseTypes;
namespace Filtration.ObjectModel.BlockItemTypes
{
public class PositionalSoundBlockItem : DualIntegerBlockItem
{
public PositionalSoundBlockItem()
{
Value = 1;
SecondValue = 79;
}
public PositionalSoundBlockItem(int value, int secondValue) : base(value, secondValue)
{
}
public override string PrefixText => "PlayAlertSoundPositional";
public override int MaximumAllowed => 1;
public override string DisplayHeading => "Play Positional Alert Sound";
public override int SortOrder => 18;
}
}

View File

@ -2,15 +2,15 @@
namespace Filtration.ObjectModel.BlockItemTypes namespace Filtration.ObjectModel.BlockItemTypes
{ {
public class SoundBlockItem : DualIntegerBlockItem public class SoundBlockItem : StrIntBlockItem
{ {
public SoundBlockItem() public SoundBlockItem()
{ {
Value = 1; Value = "1";
SecondValue = 79; SecondValue = 79;
} }
public SoundBlockItem(int value, int secondValue) : base(value, secondValue) public SoundBlockItem(string value, int secondValue) : base(value, secondValue)
{ {
} }

View File

@ -47,6 +47,7 @@
<Compile Include="BlockItemBaseTypes\BooleanBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\BooleanBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\ColorBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\DualIntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringIntBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\IntegerBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\NumericFilterPredicateBlockItem.cs" />
<Compile Include="BlockItemBaseTypes\StringListBlockItem.cs" /> <Compile Include="BlockItemBaseTypes\StringListBlockItem.cs" />
@ -68,6 +69,7 @@
<Compile Include="BlockItemTypes\RarityBlockItem.cs" /> <Compile Include="BlockItemTypes\RarityBlockItem.cs" />
<Compile Include="BlockItemTypes\SocketGroupBlockItem.cs" /> <Compile Include="BlockItemTypes\SocketGroupBlockItem.cs" />
<Compile Include="BlockItemTypes\SocketsBlockItem.cs" /> <Compile Include="BlockItemTypes\SocketsBlockItem.cs" />
<Compile Include="BlockItemTypes\PositionalSoundBlockItem.cs" />
<Compile Include="BlockItemTypes\SoundBlockItem.cs" /> <Compile Include="BlockItemTypes\SoundBlockItem.cs" />
<Compile Include="BlockItemTypes\TextColorBlockItem.cs" /> <Compile Include="BlockItemTypes\TextColorBlockItem.cs" />
<Compile Include="BlockItemTypes\WidthBlockItem.cs" /> <Compile Include="BlockItemTypes\WidthBlockItem.cs" />

View File

@ -1432,7 +1432,7 @@ namespace Filtration.Parser.Tests.Services
var expectedResult = "Show" + Environment.NewLine + var expectedResult = "Show" + Environment.NewLine +
" PlayAlertSound 2 50"; " PlayAlertSound 2 50";
_testUtility.TestBlock.BlockItems.Add(new SoundBlockItem(2, 50)); _testUtility.TestBlock.BlockItems.Add(new SoundBlockItem("2", 50));
// Act // Act
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock); var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
@ -1573,7 +1573,7 @@ namespace Filtration.Parser.Tests.Services
_testUtility.TestBlock.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 0, G = 0, B = 0 })); _testUtility.TestBlock.BlockItems.Add(new BackgroundColorBlockItem(new Color { A = 255, R = 0, G = 0, B = 0 }));
_testUtility.TestBlock.BlockItems.Add(new BorderColorBlockItem(new Color { A = 255, R = 255, G = 1, B = 254 })); _testUtility.TestBlock.BlockItems.Add(new BorderColorBlockItem(new Color { A = 255, R = 255, G = 1, B = 254 }));
_testUtility.TestBlock.BlockItems.Add(new FontSizeBlockItem(50)); _testUtility.TestBlock.BlockItems.Add(new FontSizeBlockItem(50));
_testUtility.TestBlock.BlockItems.Add(new SoundBlockItem(6, 90)); _testUtility.TestBlock.BlockItems.Add(new SoundBlockItem("6", 90));
// Act // Act
var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock); var result = _testUtility.Translator.TranslateItemFilterBlockToString(_testUtility.TestBlock);
@ -1609,7 +1609,7 @@ namespace Filtration.Parser.Tests.Services
var testInputString = "PlayAlertSound 7 280"; var testInputString = "PlayAlertSound 7 280";
var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>(); var testInputBlockItems = new ObservableCollection<IItemFilterBlockItem>();
var testInputBlockItem = new SoundBlockItem(12,30); var testInputBlockItem = new SoundBlockItem("12",30);
testInputBlockItems.Add(testInputBlockItem); testInputBlockItems.Add(testInputBlockItem);
// Act // Act
@ -1676,7 +1676,7 @@ namespace Filtration.Parser.Tests.Services
var testInputTextColorBlockItem = new TextColorBlockItem(Colors.Red); var testInputTextColorBlockItem = new TextColorBlockItem(Colors.Red);
var testInputBackgroundColorBlockItem = new BackgroundColorBlockItem(Colors.Blue); var testInputBackgroundColorBlockItem = new BackgroundColorBlockItem(Colors.Blue);
var testInputBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow); var testInputBorderColorBlockItem = new BorderColorBlockItem(Colors.Yellow);
var testInputSoundBlockItem = new SoundBlockItem(1, 1); var testInputSoundBlockItem = new SoundBlockItem("1", 1);
testInputBlockItems.Add(testInputTextColorBlockItem); testInputBlockItems.Add(testInputTextColorBlockItem);
testInputBlockItems.Add(testInputBackgroundColorBlockItem); testInputBlockItems.Add(testInputBackgroundColorBlockItem);

View File

@ -217,35 +217,34 @@ namespace Filtration.Parser.Services
break; break;
} }
case "PlayAlertSound": case "PlayAlertSound":
case "PlayAlertSoundPositional":
{ {
// Only ever use the last PlayAlertSound item encountered as multiples aren't valid. // Only ever use the last PlayAlertSound item encountered as multiples aren't valid.
RemoveExistingBlockItemsOfType<SoundBlockItem>(block); RemoveExistingBlockItemsOfType<SoundBlockItem>(block);
RemoveExistingBlockItemsOfType<PositionalSoundBlockItem>(block);
var matches = Regex.Matches(trimmedLine, @"\s+(\d+)"); var match = Regex.Match(trimmedLine, @"\S+\s+(\S+)\s+(\d+)?");
switch (matches.Count)
if (match.Success)
{ {
case 1: if (match.Groups.Count == 2)
if (matches[0].Success) {
var blockItemValue = new SoundBlockItem
{ {
var blockItemValue = new SoundBlockItem Value = match.Groups[1].Value,
{ SecondValue = 79
Value = Convert.ToInt16(matches[0].Value), };
SecondValue = 79 block.BlockItems.Add(blockItemValue);
}; }
block.BlockItems.Add(blockItemValue); else if(match.Groups.Count == 3)
} {
break; var blockItemValue = new SoundBlockItem
case 2:
if (matches[0].Success && matches[1].Success)
{ {
var blockItemValue = new SoundBlockItem Value = match.Groups[1].Value,
{ SecondValue = Int16.Parse(match.Groups[2].Value)
Value = Convert.ToInt16(matches[0].Value), };
SecondValue = Convert.ToInt16(matches[1].Value) block.BlockItems.Add(blockItemValue);
}; }
block.BlockItems.Add(blockItemValue);
}
break;
} }
break; break;
} }
@ -373,9 +372,9 @@ namespace Filtration.Parser.Services
{ {
case "PlayAlertSound": case "PlayAlertSound":
{ {
var match = Regex.Match(line, @"\s+(\d+) (\d+)"); var match = Regex.Match(line, @"\s+(\S+) (\d+)");
if (!match.Success) break; if (!match.Success) break;
blockItems.Add(new SoundBlockItem(Convert.ToInt16(match.Groups[1].Value), Convert.ToInt16(match.Groups[2].Value))); blockItems.Add(new SoundBlockItem(match.Groups[1].Value, Convert.ToInt16(match.Groups[2].Value)));
break; break;
} }
case "SetTextColor": case "SetTextColor":

View File

@ -15,6 +15,21 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -409,9 +424,6 @@
<Resource Include="Resources\groundtile.png" /> <Resource Include="Resources\groundtile.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound8.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Resource Include="Resources\logo.png" /> <Resource Include="Resources\logo.png" />
<Resource Include="Resources\Icons\add_block_icon.png" /> <Resource Include="Resources\Icons\add_block_icon.png" />
<Resource Include="Resources\Icons\add_section_icon.png" /> <Resource Include="Resources\Icons\add_section_icon.png" />
@ -447,49 +459,87 @@
<Resource Include="Resources\Icons\ThemeComponentDelete.ico" /> <Resource Include="Resources\Icons\ThemeComponentDelete.ico" />
<Resource Include="Resources\Icons\standby_disabled_icon.png" /> <Resource Include="Resources\Icons\standby_disabled_icon.png" />
<Resource Include="Resources\Icons\standby_enabled_icon.png" /> <Resource Include="Resources\Icons\standby_enabled_icon.png" />
<None Include="Resources\AlertSounds\AlertSound_01.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_02.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_03.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_04.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_05.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_06.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_07.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_08.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_09.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_10.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_11.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_12.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_13.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_14.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_15.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\AlertSound_16.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Alchemy.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Blessed.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Chaos.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Divine.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Exalted.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Fusing.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22General.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Mirror.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Regal.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Resources\AlertSounds\SH22Vaal.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Content Include="Resources\ItemBaseTypes.txt" /> <Content Include="Resources\ItemBaseTypes.txt" />
<Content Include="Resources\ItemClasses.txt" /> <Content Include="Resources\ItemClasses.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound9.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound7.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound6.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound4.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound5.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound2.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound3.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Resources\AlertSounds\AlertSound1.wav">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Filtration.Common\Filtration.Common.csproj"> <ProjectReference Include="..\Filtration.Common\Filtration.Common.csproj">
<Project>{8cb44f28-2956-4c2a-9314-72727262edd4}</Project> <Project>{8cb44f28-2956-4c2a-9314-72727262edd4}</Project>
@ -519,6 +569,18 @@
<ItemGroup> <ItemGroup>
<Folder Include="Translators\" /> <Folder Include="Translators\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(XamlSpyInstallPath)MSBuild\FirstFloor.XamlSpy.WPF.targets" Condition="'$(XamlSpyInstallPath)' != '' and '$(Configuration)' == 'DEBUG'" /> <Import Project="$(XamlSpyInstallPath)MSBuild\FirstFloor.XamlSpy.WPF.targets" Condition="'$(XamlSpyInstallPath)' != '' and '$(Configuration)' == 'DEBUG'" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -19,7 +19,7 @@ namespace Filtration.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources { internal class Resources {
@ -63,81 +63,144 @@ namespace Filtration.Properties {
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound1 { internal static System.IO.UnmanagedMemoryStream AlertSound_01 {
get { get {
return ResourceManager.GetStream("AlertSound1", resourceCulture); return ResourceManager.GetStream("AlertSound_01", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound2 { internal static System.IO.UnmanagedMemoryStream AlertSound_02 {
get { get {
return ResourceManager.GetStream("AlertSound2", resourceCulture); return ResourceManager.GetStream("AlertSound_02", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound3 { internal static System.IO.UnmanagedMemoryStream AlertSound_03 {
get { get {
return ResourceManager.GetStream("AlertSound3", resourceCulture); return ResourceManager.GetStream("AlertSound_03", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound4 { internal static System.IO.UnmanagedMemoryStream AlertSound_04 {
get { get {
return ResourceManager.GetStream("AlertSound4", resourceCulture); return ResourceManager.GetStream("AlertSound_04", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound5 { internal static System.IO.UnmanagedMemoryStream AlertSound_05 {
get { get {
return ResourceManager.GetStream("AlertSound5", resourceCulture); return ResourceManager.GetStream("AlertSound_05", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound6 { internal static System.IO.UnmanagedMemoryStream AlertSound_06 {
get { get {
return ResourceManager.GetStream("AlertSound6", resourceCulture); return ResourceManager.GetStream("AlertSound_06", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound7 { internal static System.IO.UnmanagedMemoryStream AlertSound_07 {
get { get {
return ResourceManager.GetStream("AlertSound7", resourceCulture); return ResourceManager.GetStream("AlertSound_07", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound8 { internal static System.IO.UnmanagedMemoryStream AlertSound_08 {
get { get {
return ResourceManager.GetStream("AlertSound8", resourceCulture); return ResourceManager.GetStream("AlertSound_08", resourceCulture);
} }
} }
/// <summary> /// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream. /// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary> /// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound9 { internal static System.IO.UnmanagedMemoryStream AlertSound_09 {
get { get {
return ResourceManager.GetStream("AlertSound9", resourceCulture); return ResourceManager.GetStream("AlertSound_09", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_10 {
get {
return ResourceManager.GetStream("AlertSound_10", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_11 {
get {
return ResourceManager.GetStream("AlertSound_11", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_12 {
get {
return ResourceManager.GetStream("AlertSound_12", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_13 {
get {
return ResourceManager.GetStream("AlertSound_13", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_14 {
get {
return ResourceManager.GetStream("AlertSound_14", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_15 {
get {
return ResourceManager.GetStream("AlertSound_15", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream AlertSound_16 {
get {
return ResourceManager.GetStream("AlertSound_16", resourceCulture);
} }
} }
@ -160,5 +223,95 @@ namespace Filtration.Properties {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Alchemy {
get {
return ResourceManager.GetStream("SH22Alchemy", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Blessed {
get {
return ResourceManager.GetStream("SH22Blessed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Chaos {
get {
return ResourceManager.GetStream("SH22Chaos", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Divine {
get {
return ResourceManager.GetStream("SH22Divine", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Exalted {
get {
return ResourceManager.GetStream("SH22Exalted", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Fusing {
get {
return ResourceManager.GetStream("SH22Fusing", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22General {
get {
return ResourceManager.GetStream("SH22General", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Mirror {
get {
return ResourceManager.GetStream("SH22Mirror", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Regal {
get {
return ResourceManager.GetStream("SH22Regal", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.IO.UnmanagedMemoryStream similar to System.IO.MemoryStream.
/// </summary>
internal static System.IO.UnmanagedMemoryStream SH22Vaal {
get {
return ResourceManager.GetStream("SH22Vaal", resourceCulture);
}
}
} }
} }

View File

@ -118,32 +118,53 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="AlertSound1" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_01" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound1.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_01.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound2" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_02" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound2.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_02.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound3" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_03" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound3.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_03.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound4" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_04" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound4.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_04.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound5" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_05" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound5.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_05.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound6" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_06" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound6.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_06.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound7" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_07" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound7.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_07.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound8" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_08" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound8.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_08.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="AlertSound9" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="AlertSound_09" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound9.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\AlertSounds\AlertSound_09.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_10" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_10.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_11" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_11.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_12" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_12.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_13" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_13.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_14" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_14.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_15" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_15.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="AlertSound_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\AlertSound_16.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="Fontin_SmallCaps" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Fontin_SmallCaps" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Fontin-SmallCaps.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\Fontin-SmallCaps.ttf;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@ -151,4 +172,34 @@
<data name="groundtile" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="groundtile" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\groundtile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\groundtile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="SH22Alchemy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Alchemy.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Blessed" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Blessed.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Chaos" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Chaos.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Divine" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Divine.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Exalted" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Exalted.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Fusing" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Fusing.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22General" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22General.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Mirror" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Mirror.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Regal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Regal.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="SH22Vaal" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\AlertSounds\SH22Vaal.wav;System.IO.MemoryStream, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,11 +13,11 @@
xmlns:views="clr-namespace:Filtration.Views" xmlns:views="clr-namespace:Filtration.Views"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}" d:DataContext="{d:DesignInstance Type=userControls:BlockItemControl}"
d:DesignHeight="200" d:DesignWidth="160"> d:DesignHeight="200" d:DesignWidth="190">
<UserControl.Resources> <UserControl.Resources>
<commonConverters:BooleanInverterConverter x:Key="BooleanInverterConverter"></commonConverters:BooleanInverterConverter> <commonConverters:BooleanInverterConverter x:Key="BooleanInverterConverter"></commonConverters:BooleanInverterConverter>
</UserControl.Resources> </UserControl.Resources>
<Border Style="{StaticResource BlockItemBorder}" Width="150"> <Border Style="{StaticResource BlockItemBorder}" Width="180">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />

View File

@ -82,7 +82,11 @@ namespace Filtration.UserControls
public ObservableCollection<ColorItem> AvailableColors => PathOfExileColors.DefaultColors; public ObservableCollection<ColorItem> AvailableColors => PathOfExileColors.DefaultColors;
public List<int> SoundsAvailable => new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; public List<string> SoundsAvailable => new List<string> {
"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
"ShGeneral", "ShBlessed", "ShChaos", "ShDivine", "ShExalted", "ShMirror", "ShAlchemy",
"ShFusing", "ShRegal", "ShVaal"
};
private void OnSetBlockColorCommmand() private void OnSetBlockColorCommmand()
{ {

View File

@ -201,7 +201,8 @@ namespace Filtration.ViewModels
typeof (BackgroundColorBlockItem), typeof (BackgroundColorBlockItem),
typeof (BorderColorBlockItem), typeof (BorderColorBlockItem),
typeof (FontSizeBlockItem), typeof (FontSizeBlockItem),
typeof (SoundBlockItem) typeof (SoundBlockItem),
typeof (PositionalSoundBlockItem)
}; };
public bool BlockEnabled public bool BlockEnabled
@ -242,7 +243,8 @@ namespace Filtration.ViewModels
public Color DisplayBorderColor => Block.DisplayBorderColor; public Color DisplayBorderColor => Block.DisplayBorderColor;
public double DisplayFontSize => Block.DisplayFontSize/1.8; public double DisplayFontSize => Block.DisplayFontSize/1.8;
public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>(); public bool HasSound => Block.HasBlockItemOfType<SoundBlockItem>() ||
Block.HasBlockItemOfType<PositionalSoundBlockItem>();
public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any(); public bool HasAudioVisualBlockItems => AudioVisualBlockItems.Any();
@ -350,11 +352,85 @@ namespace Filtration.ViewModels
return blockCount < blockItem.MaximumAllowed; return blockCount < blockItem.MaximumAllowed;
} }
private string ComputeFilePartFromNumber(string identifier)
{
if (Int32.TryParse(identifier, out int x))
{
if (x <= 9)
{
return "AlertSound_0" + x + ".wav";
}
else
{
return "AlertSound_" + x + ".wav";
}
}
return "";
}
private string ComputeFilePartFromID(string identifier)
{
string filePart;
switch (identifier) {
case "ShGeneral":
filePart = "SH22General.wav";
break;
case "ShBlessed":
filePart = "SH22Blessed.wav";
break;
case "SH22Chaos":
filePart = "SH22Chaos.wav";
break;
case "ShDivine":
filePart = "SH22Divine.wav";
break;
case "ShExalted":
filePart = "SH22Exalted.wav";
break;
case "ShMirror":
filePart = "SH22Mirror.wav";
break;
case "ShAlchemy":
filePart = "SH22Alchemy.wav";
break;
case "ShFusing":
filePart = "SH22Fusing.wav";
break;
case "ShRegal":
filePart = "SH22Regal.wav";
break;
case "ShVaal":
filePart = "SH22Vaal.wav";
break;
default:
filePart = ComputeFilePartFromNumber(identifier);
break;
}
return filePart;
}
private void OnPlaySoundCommand() private void OnPlaySoundCommand()
{ {
var soundUri = "Resources/AlertSounds/AlertSound" + BlockItems.OfType<SoundBlockItem>().First().Value + ".wav"; var identifier = BlockItems.OfType<SoundBlockItem>().First().Value;
_mediaPlayer.Open(new Uri(soundUri, UriKind.Relative)); var prefix = "Resources/AlertSounds/";
_mediaPlayer.Play(); var filePart = ComputeFilePartFromID(identifier);
if (filePart == "")
{
return;
}
else
{
_mediaPlayer.Open(new Uri(prefix + filePart, UriKind.Relative));
_mediaPlayer.Play();
}
}
private void OnPlayPositionalSoundCommand()
{
} }
private void OnBlockItemChanged(object sender, EventArgs e) private void OnBlockItemChanged(object sender, EventArgs e)