diff --git a/.vs/STARK/v14/.suo b/.vs/STARK/v14/.suo index 81a1682..9a53f6d 100644 Binary files a/.vs/STARK/v14/.suo and b/.vs/STARK/v14/.suo differ diff --git a/STARK/AudioFileManager.cs b/STARK/AudioFileManager.cs index 4e985d7..37dd64f 100644 --- a/STARK/AudioFileManager.cs +++ b/STARK/AudioFileManager.cs @@ -2,7 +2,6 @@ using System.Collections.ObjectModel; using System.IO; using System.Text.RegularExpressions; -using System.Windows; namespace STARK { public class AudioFileManager : IDisposable{ @@ -53,8 +52,6 @@ public void ChangeWatchFolder(string watchFolder) { this.watchFolder = watchFolder; watcher.Path = this.watchFolder; - MessageBox.Show(this.watchFolder); - ClearCollection(); LoadCurrentFiles(); directoryExists = true; diff --git a/STARK/AudioPlaybackItem.cs b/STARK/AudioPlaybackItem.cs index 8f14e39..2bb7f06 100644 --- a/STARK/AudioPlaybackItem.cs +++ b/STARK/AudioPlaybackItem.cs @@ -2,8 +2,7 @@ using System.Collections.ObjectModel; using System.IO; using System.Text; -using System.Text.RegularExpressions; -using System.Windows; + namespace STARK { public class AudioPlaybackItem { @@ -49,7 +48,7 @@ public string GetPath() { private AudioFileManager getAFM() { AudioFileManager afm = null; App.Current.Dispatcher.Invoke(delegate { - afm = (Application.Current.MainWindow as MainWindow).getAFM(); + afm = (App.Current.MainWindow as MainWindow).getAFM(); }); if (afm == null) return null; diff --git a/STARK/Command.cs b/STARK/Command.cs index 894c25e..465032c 100644 --- a/STARK/Command.cs +++ b/STARK/Command.cs @@ -38,5 +38,9 @@ public string getCommand() { public string[] getSplitter() { return splitter; } + + public string getSplitterAsString() { + return splitter[0]; + } } } diff --git a/STARK/CommandReader.cs b/STARK/CommandReader.cs index 277992d..70672f9 100644 --- a/STARK/CommandReader.cs +++ b/STARK/CommandReader.cs @@ -2,7 +2,6 @@ using System.IO; using System.Text; using System.Timers; -using System.Windows; namespace STARK { class CommandReader : IDisposable{ @@ -38,11 +37,10 @@ public CommandReader(ref QueuedSpeechSynthesizer qss, ref AudioPlaybackEngine ap resumeCmd = CommandManager.resumeCmd; stopCmd = CommandManager.stopCmd; - StartReadLoop(); Setup(logFile); + StartReadLoop(); } - private void parseCommand(string line) { if (line != "") { if (ContainsCommand(line, synthCmd)) { @@ -92,7 +90,6 @@ private void StartReadLoop() { private void Setup(string path) { //makes a file if there is none if (!File.Exists(path)) File.CreateText(path).Close(); - //var fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); var bufferedStream = new BufferedStream(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)); reader = new StreamReader(bufferedStream); //skips the lines that are in the file on load so we don't get historic commands @@ -100,7 +97,7 @@ private void Setup(string path) { } private bool ContainsCommand(string line, Command command) { - if (line.Contains(command.getCommand())) return true; + if (line.Contains(command.getSplitterAsString())) return true; else return false; } diff --git a/STARK/MainWindow.xaml b/STARK/MainWindow.xaml index 4813e1b..12af526 100644 --- a/STARK/MainWindow.xaml +++ b/STARK/MainWindow.xaml @@ -99,10 +99,10 @@ - - - - + + + + diff --git a/STARK/MainWindow.xaml.cs b/STARK/MainWindow.xaml.cs index da47fd6..baea5e4 100644 --- a/STARK/MainWindow.xaml.cs +++ b/STARK/MainWindow.xaml.cs @@ -86,7 +86,6 @@ public MainWindow() { changeCombinedOutput(Setup_OutputCombined.SelectedIndex); changeLoopbackOutput(Setup_SynthesizerOnly.SelectedIndex); - FindSteamApps(); loaded = true; @@ -147,7 +146,7 @@ public void saveSettings() { settings.Loopback_Volume = (int) Audio_LoopbackVolumeSlider.Value; settings.Setup_Microphone_SelectedIndex = Setup_Microphone.SelectedIndex; - settings.Setup_Standard_Output_SelectedIndex = Setup_SynthesizerOnly.SelectedIndex; + settings.Setup_Loopback_Output_SelectedIndex = Setup_SynthesizerOnly.SelectedIndex; settings.Setup_Standard_Output_SelectedIndex = Setup_OutputCombined.SelectedIndex; settings.Setup_SteamApps_Folder = PathManager.steamApps; @@ -177,7 +176,7 @@ public void loadSettings() { Audio_LoopbackVolumeTextBox.Text = "" + settings.Loopback_Volume; Setup_Microphone.SelectedIndex = settings.Setup_Microphone_SelectedIndex; - Setup_SynthesizerOnly.SelectedIndex = settings.Setup_Standard_Output_SelectedIndex; + Setup_SynthesizerOnly.SelectedIndex = settings.Setup_Loopback_Output_SelectedIndex; Setup_OutputCombined.SelectedIndex = settings.Setup_Standard_Output_SelectedIndex; PathManager.steamApps = settings.Setup_SteamApps_Folder; @@ -663,13 +662,34 @@ public void Dispose() { } protected virtual void Dispose(bool disposing) { - if (qss != null) qss.Dispose(); - if (afm != null) afm.Dispose(); - if (ape != null) ape.Dispose(); + if (qss != null) { + qss.Dispose(); + qss = null; + } + if (afm != null) { + afm.Dispose(); + afm = null; + } + if (ape != null) { + ape.Dispose(); //rip Harambe + ape = null; + } + if (wiMicrophone != null) { + wiMicrophone.StopRecording(); + wiMicrophone.Dispose(); + wiMicrophone = null; + } + if (woLoopback != null) { + woLoopback.Stop(); + woLoopback.Dispose(); + woLoopback = null; + } + if (woStandard != null) { + woStandard.Stop(); + woStandard.Dispose(); + woStandard = null; + } - qss = null; - afm = null; - ape = null; } #endregion } diff --git a/STARK/bin/Debug/STARK.exe b/STARK/bin/Debug/STARK.exe index 5c5d658..f7e0f73 100644 Binary files a/STARK/bin/Debug/STARK.exe and b/STARK/bin/Debug/STARK.exe differ diff --git a/STARK/bin/Debug/STARK.pdb b/STARK/bin/Debug/STARK.pdb index 4756885..1fdbdab 100644 Binary files a/STARK/bin/Debug/STARK.pdb and b/STARK/bin/Debug/STARK.pdb differ diff --git a/STARK/bin/Release/STARK.exe b/STARK/bin/Release/STARK.exe index 785cb6b..7044721 100644 Binary files a/STARK/bin/Release/STARK.exe and b/STARK/bin/Release/STARK.exe differ diff --git a/STARK/bin/Release/STARK.pdb b/STARK/bin/Release/STARK.pdb index f4481a4..ae2f06d 100644 Binary files a/STARK/bin/Release/STARK.pdb and b/STARK/bin/Release/STARK.pdb differ diff --git a/STARK/obj/Debug/STARK.exe b/STARK/obj/Debug/STARK.exe index 5c5d658..f7e0f73 100644 Binary files a/STARK/obj/Debug/STARK.exe and b/STARK/obj/Debug/STARK.exe differ diff --git a/STARK/obj/Debug/STARK.pdb b/STARK/obj/Debug/STARK.pdb index 4756885..1fdbdab 100644 Binary files a/STARK/obj/Debug/STARK.pdb and b/STARK/obj/Debug/STARK.pdb differ diff --git a/STARK/obj/Release/GeneratedInternalTypeHelper.g.cs b/STARK/obj/Release/GeneratedInternalTypeHelper.g.cs index c65238f..136dd1b 100644 --- a/STARK/obj/Release/GeneratedInternalTypeHelper.g.cs +++ b/STARK/obj/Release/GeneratedInternalTypeHelper.g.cs @@ -1,2 +1,62 @@ - +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace XamlGeneratedNamespace { + + + /// + /// GeneratedInternalTypeHelper + /// + [System.Diagnostics.DebuggerNonUserCodeAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper { + + /// + /// CreateInstance + /// + protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) { + return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic) + | (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture); + } + + /// + /// GetPropertyValue + /// + protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) { + return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture); + } + + /// + /// SetPropertyValue + /// + protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) { + propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture); + } + + /// + /// CreateDelegate + /// + protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) { + return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod + | (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] { + delegateType, + handler}, null))); + } + + /// + /// AddEventHandler + /// + protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) { + eventInfo.AddEventHandler(target, handler); + } + } +} diff --git a/STARK/obj/Release/MainWindow.baml b/STARK/obj/Release/MainWindow.baml index 3b3230d..8773367 100644 Binary files a/STARK/obj/Release/MainWindow.baml and b/STARK/obj/Release/MainWindow.baml differ diff --git a/STARK/obj/Release/MainWindow.g.cs b/STARK/obj/Release/MainWindow.g.cs index 3b34b1d..1ecdf18 100644 --- a/STARK/obj/Release/MainWindow.g.cs +++ b/STARK/obj/Release/MainWindow.g.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "A0E54F4CDDBD8D025F2A4AE0EEC2C593" +#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "E81FFA8E9152EFA619D156525E644200" //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/STARK/obj/Release/MainWindow.g.i.cs b/STARK/obj/Release/MainWindow.g.i.cs index 3b34b1d..1ecdf18 100644 --- a/STARK/obj/Release/MainWindow.g.i.cs +++ b/STARK/obj/Release/MainWindow.g.i.cs @@ -1,4 +1,4 @@ -#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "A0E54F4CDDBD8D025F2A4AE0EEC2C593" +#pragma checksum "..\..\MainWindow.xaml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "E81FFA8E9152EFA619D156525E644200" //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/STARK/obj/Release/STARK.exe b/STARK/obj/Release/STARK.exe index 785cb6b..7044721 100644 Binary files a/STARK/obj/Release/STARK.exe and b/STARK/obj/Release/STARK.exe differ diff --git a/STARK/obj/Release/STARK.g.resources b/STARK/obj/Release/STARK.g.resources index eee138f..b8daec0 100644 Binary files a/STARK/obj/Release/STARK.g.resources and b/STARK/obj/Release/STARK.g.resources differ diff --git a/STARK/obj/Release/STARK.pdb b/STARK/obj/Release/STARK.pdb index f4481a4..ae2f06d 100644 Binary files a/STARK/obj/Release/STARK.pdb and b/STARK/obj/Release/STARK.pdb differ diff --git a/STARK/obj/Release/STARK_MarkupCompile.lref b/STARK/obj/Release/STARK_MarkupCompile.lref index baa9de3..9aad4ec 100644 --- a/STARK/obj/Release/STARK_MarkupCompile.lref +++ b/STARK/obj/Release/STARK_MarkupCompile.lref @@ -1,4 +1,4 @@ -F:\_Development\_Desktop\_Visual Studio\STARK\STARK\obj\Release\GeneratedInternalTypeHelper.g.cs + FF:\_Development\_Desktop\_Visual Studio\STARK\STARK\App.xaml;; FF:\_Development\_Desktop\_Visual Studio\STARK\STARK\MainWindow.xaml;;