diff --git a/Chuuu.sln b/Chuuu.sln new file mode 100644 index 0000000..cee5008 --- /dev/null +++ b/Chuuu.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chuuu", "Chuuu\Chuuu.csproj", "{6DECA061-FF01-4BB6-8612-CE34ABA7A612}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6DECA061-FF01-4BB6-8612-CE34ABA7A612}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6DECA061-FF01-4BB6-8612-CE34ABA7A612}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6DECA061-FF01-4BB6-8612-CE34ABA7A612}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6DECA061-FF01-4BB6-8612-CE34ABA7A612}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Chuuu/App.config b/Chuuu/App.config new file mode 100644 index 0000000..ea730fe --- /dev/null +++ b/Chuuu/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Chuuu/Audio/DirectSoundOutPlugin.cs b/Chuuu/Audio/DirectSoundOutPlugin.cs new file mode 100644 index 0000000..123312a --- /dev/null +++ b/Chuuu/Audio/DirectSoundOutPlugin.cs @@ -0,0 +1,44 @@ +using System; +using System.Linq; +using NAudio.Wave; +using System.Windows.Forms; + +namespace NAudioDemo.AudioPlaybackDemo +{ + class DirectSoundOutPlugin : IOutputDevicePlugin + { + private DirectSoundOutSettingsPanel settingsPanel; + private readonly bool isAvailable; + + public DirectSoundOutPlugin() + { + isAvailable = DirectSoundOut.Devices.Any(); + } + + public IWavePlayer CreateDevice(int latency) + { + return new DirectSoundOut(settingsPanel.SelectedDevice, latency); + } + + public UserControl CreateSettingsPanel() + { + settingsPanel = new DirectSoundOutSettingsPanel(); + return settingsPanel; + } + + public string Name + { + get { return "DirectSound"; } + } + + public bool IsAvailable + { + get { return isAvailable; } + } + + public int Priority + { + get { return 2; } + } + } +} diff --git a/Chuuu/Audio/DirectSoundOutSettingsPanel.cs b/Chuuu/Audio/DirectSoundOutSettingsPanel.cs new file mode 100644 index 0000000..7276c21 --- /dev/null +++ b/Chuuu/Audio/DirectSoundOutSettingsPanel.cs @@ -0,0 +1,28 @@ +using System; +using System.Linq; +using System.Windows.Forms; +using NAudio.Wave; + +namespace NAudioDemo.AudioPlaybackDemo +{ + public partial class DirectSoundOutSettingsPanel : UserControl + { + public DirectSoundOutSettingsPanel() + { + InitializeComponent(); + InitialiseDirectSoundControls(); + } + + private void InitialiseDirectSoundControls() + { + comboBoxDirectSound.DisplayMember = "Description"; + comboBoxDirectSound.ValueMember = "Guid"; + comboBoxDirectSound.DataSource = DirectSoundOut.Devices; + } + + public Guid SelectedDevice + { + get { return (Guid)comboBoxDirectSound.SelectedValue; } + } + } +} diff --git a/Chuuu/Audio/DirectSoundOutSettingsPanel.designer.cs b/Chuuu/Audio/DirectSoundOutSettingsPanel.designer.cs new file mode 100644 index 0000000..daae4c3 --- /dev/null +++ b/Chuuu/Audio/DirectSoundOutSettingsPanel.designer.cs @@ -0,0 +1,58 @@ +namespace NAudioDemo.AudioPlaybackDemo +{ + partial class DirectSoundOutSettingsPanel + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.comboBoxDirectSound = new System.Windows.Forms.ComboBox(); + this.SuspendLayout(); + // + // comboBoxDirectSound + // + this.comboBoxDirectSound.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxDirectSound.FormattingEnabled = true; + this.comboBoxDirectSound.Location = new System.Drawing.Point(3, 3); + this.comboBoxDirectSound.Name = "comboBoxDirectSound"; + this.comboBoxDirectSound.Size = new System.Drawing.Size(232, 21); + this.comboBoxDirectSound.TabIndex = 18; + // + // DirectSoundOutSettingsPanel + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.comboBoxDirectSound); + this.Name = "DirectSoundOutSettingsPanel"; + this.Size = new System.Drawing.Size(243, 38); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.ComboBox comboBoxDirectSound; + } +} diff --git a/Chuuu/Audio/DirectSoundOutSettingsPanel.resx b/Chuuu/Audio/DirectSoundOutSettingsPanel.resx new file mode 100644 index 0000000..5ea0895 --- /dev/null +++ b/Chuuu/Audio/DirectSoundOutSettingsPanel.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Chuuu/Audio/INAudioDemoPlugin.cs b/Chuuu/Audio/INAudioDemoPlugin.cs new file mode 100644 index 0000000..93ae50b --- /dev/null +++ b/Chuuu/Audio/INAudioDemoPlugin.cs @@ -0,0 +1,11 @@ +using System; +using System.Windows.Forms; + +namespace NAudioDemo +{ + public interface INAudioDemoPlugin + { + string Name { get; } + Control CreatePanel(); + } +} diff --git a/Chuuu/Audio/IOutputDevicePlugin.cs b/Chuuu/Audio/IOutputDevicePlugin.cs new file mode 100644 index 0000000..88d3c50 --- /dev/null +++ b/Chuuu/Audio/IOutputDevicePlugin.cs @@ -0,0 +1,16 @@ +using System; +using System.Linq; +using NAudio.Wave; +using System.Windows.Forms; + +namespace NAudioDemo.AudioPlaybackDemo +{ + public interface IOutputDevicePlugin + { + IWavePlayer CreateDevice(int latency); + UserControl CreateSettingsPanel(); + string Name { get; } + bool IsAvailable { get; } + int Priority { get; } + } +} diff --git a/Chuuu/Chuuu.csproj b/Chuuu/Chuuu.csproj new file mode 100644 index 0000000..e990a7a --- /dev/null +++ b/Chuuu/Chuuu.csproj @@ -0,0 +1,155 @@ + + + + + Debug + AnyCPU + {6DECA061-FF01-4BB6-8612-CE34ABA7A612} + WinExe + Properties + Chuuu + Chuuu + v4.5.2 + 512 + true + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + icon.ico + + + + ..\packages\NAudio.1.7.3\lib\net35\NAudio.dll + True + + + ..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll + True + + + + + + + + + + + + + + + + + UserControl + + + DirectSoundOutSettingsPanel.cs + + + + + Form + + + Form1.cs + + + Form + + + Hotkey Editor.cs + + + + + DirectSoundOutSettingsPanel.cs + + + Form1.cs + + + Hotkey Editor.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + Designer + + + + + + + + False + Microsoft .NET Framework 4.5.2 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/Chuuu/Chuuu.csproj.user b/Chuuu/Chuuu.csproj.user new file mode 100644 index 0000000..e990f23 --- /dev/null +++ b/Chuuu/Chuuu.csproj.user @@ -0,0 +1,13 @@ + + + + publish\ + + + + + + en-US + false + + \ No newline at end of file diff --git a/Chuuu/Form1.Designer.cs b/Chuuu/Form1.Designer.cs new file mode 100644 index 0000000..3225fc0 --- /dev/null +++ b/Chuuu/Form1.Designer.cs @@ -0,0 +1,124 @@ +namespace Chuuu +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.label1 = new System.Windows.Forms.Label(); + this.menuStrip1 = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.directSoundOutSettingsPanel1 = new NAudioDemo.AudioPlaybackDemo.DirectSoundOutSettingsPanel(); + this.addSNDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.menuStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.25F); + this.listBox1.FormattingEnabled = true; + this.listBox1.HorizontalScrollbar = true; + this.listBox1.Location = new System.Drawing.Point(12, 62); + this.listBox1.Name = "listBox1"; + this.listBox1.Size = new System.Drawing.Size(237, 108); + this.listBox1.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.Location = new System.Drawing.Point(45, 173); + this.label1.Name = "label1"; + this.label1.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.label1.Size = new System.Drawing.Size(169, 55); + this.label1.TabIndex = 4; + this.label1.Text = "Ready"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // menuStrip1 + // + this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem}); + this.menuStrip1.Location = new System.Drawing.Point(0, 0); + this.menuStrip1.Name = "menuStrip1"; + this.menuStrip1.Size = new System.Drawing.Size(264, 24); + this.menuStrip1.TabIndex = 7; + this.menuStrip1.Text = "menuStrip1"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.addSNDToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // directSoundOutSettingsPanel1 + // + this.directSoundOutSettingsPanel1.Location = new System.Drawing.Point(12, 27); + this.directSoundOutSettingsPanel1.Name = "directSoundOutSettingsPanel1"; + this.directSoundOutSettingsPanel1.Size = new System.Drawing.Size(237, 29); + this.directSoundOutSettingsPanel1.TabIndex = 0; + // + // addSNDToolStripMenuItem + // + this.addSNDToolStripMenuItem.Name = "addSNDToolStripMenuItem"; + this.addSNDToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.addSNDToolStripMenuItem.Text = "Add SND"; + this.addSNDToolStripMenuItem.Click += new System.EventHandler(this.addSNDToolStripMenuItem_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(264, 239); + this.Controls.Add(this.label1); + this.Controls.Add(this.listBox1); + this.Controls.Add(this.directSoundOutSettingsPanel1); + this.Controls.Add(this.menuStrip1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MainMenuStrip = this.menuStrip1; + this.MaximizeBox = false; + this.Name = "Form1"; + this.Text = "Chuuu"; + this.Load += new System.EventHandler(this.Form1_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown); + this.menuStrip1.ResumeLayout(false); + this.menuStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private NAudioDemo.AudioPlaybackDemo.DirectSoundOutSettingsPanel directSoundOutSettingsPanel1; + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.MenuStrip menuStrip1; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem addSNDToolStripMenuItem; + } +} + diff --git a/Chuuu/Form1.cs b/Chuuu/Form1.cs new file mode 100644 index 0000000..248b400 --- /dev/null +++ b/Chuuu/Form1.cs @@ -0,0 +1,280 @@ +using NAudio.Wave; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text.RegularExpressions; +using System.Windows.Forms; +using System.Xml; +using System.Xml.Linq; + +namespace Chuuu { + + public partial class Form1 : Form { + + [DllImport("user32.dll")] + public static extern bool RegisterHotKey(IntPtr hWnd, int id, int fsModifiers, int vlc); + + [DllImport("user32.dll")] + public static extern bool UnregisterHotKey(IntPtr hWnd, int id); + + private enum KeyModifier { + None = 0, + Alt = 1, + Control = 2, + Shift = 4, + WinKey = 8 + } + + public const int WM_HOTKEY = 0x0312; + public const int MOD_NOREPEAT = 0x4000; + + private List idNumber = new List(); + private int HighestNumber; + + private List AudioList = new List(); + + private String audioFile; + + private AudioFileReader reader; + + private bool CanPlaySound = true; + + private DirectSoundOut SNDout; + + private bool CanPlay = true; + private bool NotTyping = true; + + public Form1() { + InitializeComponent(); + regKeys(); + CanPlaySound = true; + if (!Directory.Exists(@"Data\snd\")) { + Directory.CreateDirectory(@"Data\snd\"); + File.Create(@"Data\iwannadie.( ͡° ͜ʖ ͡°)"); + } + + RegisterHotKey(this.Handle, 9999, (int)KeyModifier.None, (int)Keys.Pause); + } + + private void NumCount() { + HighestNumber = idNumber.Max(); + Console.WriteLine("This is the highest number " + HighestNumber); + } + + private void button1_Click(object sender, EventArgs e) { + } + + private void unregKeys() { + if (File.Exists("chuuu.xml") == true) { + XDocument doc = XDocument.Load("chuuu.xml"); + + if (new FileInfo("chuuu.xml").Length > 0) { + foreach (var coordinate in doc.Descendants("Key")) { + string idString = coordinate.Element("ID").Value; + + UnregisterHotKey(this.Handle, Convert.ToInt32(idString)); + } + } + } + } + + private void regKeys() { + listBox1.Items.Clear(); + if (File.Exists("chuuu.xml") == true) { + XDocument doc = XDocument.Load("chuuu.xml"); + + if (new FileInfo("chuuu.xml").Length > 0) { + foreach (var coordinate in doc.Descendants("Key")) { + string idString = coordinate.Element("ID").Value; + string SoundFile = coordinate.Element("SoundFile").Value; + string KeyHot = coordinate.Element("KeyHot").Value; + string KeyHotExtra = coordinate.Element("KeyHotExtra").Value; + int ID = Int32.Parse(idString); + idNumber.Add(ID); + AudioList.Add(SoundFile); + + UnregisterHotKey(this.Handle, Convert.ToInt32(idString)); + + Keys keyExtra; + Enum.TryParse(KeyHotExtra, out keyExtra); + Keys keyMain; + Enum.TryParse(KeyHot, out keyMain); + + if (KeyHotExtra == "Shift") { + RegisterHotKey(this.Handle, Convert.ToInt32(idString), (int)KeyModifier.Shift, (int)keyMain); + } + if (KeyHotExtra == "Alt") { + RegisterHotKey(this.Handle, Convert.ToInt32(idString), (int)KeyModifier.Alt, (int)keyMain); + } + if (KeyHotExtra == "Control") { + RegisterHotKey(this.Handle, Convert.ToInt32(idString), (int)KeyModifier.Control, (int)keyMain); + } + + listBox1.Items.Add("SND:" + Path.GetFileNameWithoutExtension(SoundFile) + " KEY:" + KeyHot + "+" + keyExtra); + } + } + NumCount(); + } + } + + private void playSnd(string AudioSND) { + reader = new AudioFileReader(AudioSND); + SNDout = new DirectSoundOut(directSoundOutSettingsPanel1.SelectedDevice); + SNDout.Init(reader); + SNDout.Play(); + } + + protected override void WndProc(ref Message m) { + base.WndProc(ref m); + var sndArray = AudioList.ToArray(); + if (CanPlaySound == true) { + if (m.Msg == WM_HOTKEY) { + Console.WriteLine(m.Msg); + //SendKeys.Send(m.HWnd); + if ((int)m.WParam == 9999) { + if (NotTyping == false) { + regKeys(); + label1.Text = "READY"; + NotTyping = true; + } else { + unregKeys(); + label1.Text = "TYPING"; + NotTyping = false; + } + } + + if (CanPlay == true && (int)m.WParam != 9999) { + if (NotTyping == true) { + playSnd(sndArray[(int)m.WParam - 1]); + CanPlay = false; + } + } else if ((int)m.WParam != 9999) { + SNDout.Stop(); + CanPlay = true; + } + } + } + } + + private void Form1_Load(object sender, EventArgs e) { + } + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) { + if (File.Exists("chuuu.xml") == true) { + XDocument doc = XDocument.Load("chuuu.xml"); + + if (new FileInfo("chuuu.xml").Length > 0) { + foreach (var coordinate in doc.Descendants("Key")) { + string idString = coordinate.Element("ID").Value; + + UnregisterHotKey(this.Handle, Convert.ToInt32(idString)); + } + } + } + } + + private void xmlCreator() { + string hotKey_Main = ""; + string hotKey_Extra = ""; + //Locals + Hotkey_Editor hkedit = new Hotkey_Editor(); + hkedit.StartPosition = FormStartPosition.CenterParent; + DialogResult dr = hkedit.ShowDialog(this); + + if (dr == DialogResult.OK) { + hotKey_Main = hkedit.comboBox2.SelectedItem.ToString(); + hotKey_Extra = hkedit.comboBox1.SelectedItem.ToString(); + } + hkedit.Dispose(); + hotKey_Main = Regex.Replace(hotKey_Main, @"\s+", ""); + hotKey_Extra = Regex.Replace(hotKey_Extra, @"\s+", ""); + + HighestNumber += 1; + var title = Regex.Replace(Path.GetFileNameWithoutExtension(audioFile), @"\s+", ""); + string soundPath = @"data\snd\" + Path.GetFileName(audioFile); + soundPath = soundPath.Replace(@"\\", @"\"); + if (File.Exists("chuuu.xml") == false) { + XmlWriterSettings xmlWriterSettings = new XmlWriterSettings(); + xmlWriterSettings.Indent = true; + xmlWriterSettings.NewLineOnAttributes = true; + + using (XmlWriter xmlWriter = XmlWriter.Create("chuuu.xml", xmlWriterSettings)) { + xmlWriter.WriteStartDocument(); + xmlWriter.WriteStartElement("Chuuu"); + + xmlWriter.WriteStartElement("Key"); + xmlWriter.WriteElementString("ID", "1"); + xmlWriter.WriteElementString("SoundFile", soundPath); + xmlWriter.WriteElementString("KeyHot", hotKey_Main); + xmlWriter.WriteElementString("KeyHotExtra", hotKey_Extra); + xmlWriter.WriteEndElement(); + + xmlWriter.WriteEndElement(); + xmlWriter.WriteEndDocument(); + xmlWriter.Flush(); + xmlWriter.Close(); + } + } else { + XDocument xDocument = XDocument.Load("chuuu.xml"); + XElement root = xDocument.Element("Chuuu"); + IEnumerable rows = root.Descendants("Key"); + XElement firstRow = rows.Last(); + firstRow.AddAfterSelf( + new XElement("Key", + new XElement("ID", HighestNumber), + new XElement("SoundFile", soundPath), + new XElement("KeyHot", hotKey_Main), + new XElement("KeyHotExtra", hotKey_Extra))); + xDocument.Save("chuuu.xml"); + } + regKeys(); + } + + private void button3_Click(object sender, EventArgs e) { + xmlCreator(); + } + + private static void WriteTop(string filename) { + string tempfile = Path.GetTempFileName(); + using (var writer = new StreamWriter(tempfile)) + using (var reader = new StreamReader(filename)) { + writer.WriteLine("["); + while (!reader.EndOfStream) + writer.WriteLine(reader.ReadLine()); + } + File.Copy(tempfile, filename, true); + } + + private void Form1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { + } + + private void addSNDToolStripMenuItem_Click(object sender, EventArgs e) { + OpenFileDialog myDialog = new OpenFileDialog(); + myDialog.Filter = "Sound Files(*.MP3;*.WAV;*.WMA;*.OGG;*.MID;)|*.MP3;*.WAV;*.WMA;*.OGG;*.MID|All files (*.*)|*.*"; + myDialog.CheckFileExists = true; + myDialog.Multiselect = false; + + if (myDialog.ShowDialog() == DialogResult.OK) { + audioFile = myDialog.FileName; + + if (File.Exists(audioFile)) { + try { + if (!File.Exists(@"data\snd\" + Path.GetFileName(audioFile))) { + Console.WriteLine(audioFile); + File.Copy(audioFile, @"data\snd\" + Path.GetFileName(audioFile), true); + xmlCreator(); + } else { + xmlCreator(); + Console.WriteLine("File Already In Folder"); + } + } + catch (System.IO.IOException) { + MessageBox.Show("The File Is Currlenty Open In Another Program."); + } + } + } + } + } +} \ No newline at end of file diff --git a/Chuuu/Form1.resx b/Chuuu/Form1.resx new file mode 100644 index 0000000..0f6d8eb --- /dev/null +++ b/Chuuu/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Chuuu/Hotkey Editor.Designer.cs b/Chuuu/Hotkey Editor.Designer.cs new file mode 100644 index 0000000..0675699 --- /dev/null +++ b/Chuuu/Hotkey Editor.Designer.cs @@ -0,0 +1,313 @@ +namespace Chuuu { + partial class Hotkey_Editor { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() { + this.comboBox1 = new System.Windows.Forms.ComboBox(); + this.comboBox2 = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.OK = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "Shift", + "Alt", + "Control"}); + this.comboBox1.Location = new System.Drawing.Point(12, 96); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(121, 21); + this.comboBox1.TabIndex = 0; + // + // comboBox2 + // + this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.comboBox2.FormattingEnabled = true; + this.comboBox2.Items.AddRange(new object[] { + "A\t", + "Add\t", + "Alt\t", + "Apps\t", + "Attn\t", + "B\t", + "Back\t", + "BrowserBack\t", + "BrowserFavorites\t", + "BrowserForward\t", + "BrowserHome\t", + "BrowserRefresh\t", + "BrowserSearch\t", + "BrowserStop\t", + "C\t", + "Cancel\t", + "Capital\t", + "CapsLock\t", + "Clear\t", + "Control\t", + "ControlKey\t", + "Crsel\t", + "D\t", + "D0\t", + "D1\t", + "D2\t", + "D3\t", + "D4\t", + "D5\t", + "D6\t", + "D7\t", + "D8\t", + "D9\t", + "Decimal\t", + "Delete\t", + "Divide\t", + "Down\t", + "E\t", + "End\t", + "Enter\t", + "EraseEof\t", + "Escape\t", + "Execute\t", + "Exsel\t", + "F\t", + "F1\t", + "F10\t", + "F11\t", + "F12\t", + "F13\t", + "F14\t", + "F15\t", + "F16\t", + "F17\t", + "F18\t", + "F19\t", + "F2\t", + "F20\t", + "F21\t", + "F22\t", + "F23\t", + "F24\t", + "F3\t", + "F4\t", + "F5\t", + "F6\t", + "F7\t", + "F8\t", + "F9\t", + "FinalMode\t", + "G\t", + "H\t", + "HanguelMode\t", + "HangulMode\t", + "HanjaMode\t", + "Help\t", + "Home\t", + "I\t", + "IMEAccept\t", + "IMEAceept\t", + "IMEConvert\t", + "IMEModeChange\t", + "IMENonconvert\t", + "Insert\t", + "J\t", + "JunjaMode\t", + "K\t", + "KanaMode\t", + "KanjiMode\t", + "KeyCode\t", + "L\t", + "LaunchApplication1\t", + "LaunchApplication2\t", + "LaunchMail\t", + "LButton\t", + "LControlKey\t", + "Left\t", + "LineFeed\t", + "LMenu\t", + "LShiftKey\t", + "LWin\t", + "M\t", + "MButton\t", + "MediaNextTrack\t", + "MediaPlayPause\t", + "MediaPreviousTrack\t", + "MediaStop\t", + "Menu\t", + "Modifiers\t", + "Multiply\t", + "N\t", + "Next\t", + "NoName\t", + "None\t", + "NumLock\t", + "NumPad0\t", + "NumPad1\t", + "NumPad2\t", + "NumPad3\t", + "NumPad4\t", + "NumPad5\t", + "NumPad6\t", + "NumPad7\t", + "NumPad8\t", + "NumPad9\t", + "O\t", + "Oem1\t", + "Oem102\t", + "Oem2\t", + "Oem3\t", + "Oem4\t", + "Oem5\t", + "Oem6\t", + "Oem7\t", + "Oem8\t", + "OemBackslash\t", + "OemClear\t", + "OemCloseBrackets\t", + "Oemcomma\t", + "OemMinus\t", + "OemOpenBrackets\t", + "OemPeriod\t", + "OemPipe\t", + "Oemplus\t", + "OemQuestion\t", + "OemQuotes\t", + "OemSemicolon\t", + "Oemtilde\t", + "P\t", + "Pa1\t", + "Packet\t", + "PageDown\t", + "PageUp\t", + "Pause\t", + "Play\t", + "Print\t", + "PrintScreen\t", + "Prior\t", + "ProcessKey\t", + "Q\t", + "R\t", + "RButton\t", + "RControlKey\t", + "Return\t", + "Right\t", + "RMenu\t", + "RShiftKey\t", + "RWin\t", + "S\t", + "Scroll\t", + "Select\t", + "SelectMedia\t", + "Separator\t", + "Shift\t", + "ShiftKey\t", + "Sleep\t", + "Snapshot\t", + "Space\t", + "Subtract\t", + "T\t", + "Tab\t", + "U\t", + "Up\t", + "V\t", + "VolumeDown\t", + "VolumeMute\t", + "VolumeUp\t", + "W\t", + "X\t", + "XButton1\t", + "XButton2\t", + "Y\t", + "Z\t", + "Zoom\t", + "The ZOOM key."}); + this.comboBox2.Location = new System.Drawing.Point(12, 29); + this.comboBox2.Name = "comboBox2"; + this.comboBox2.Size = new System.Drawing.Size(121, 21); + this.comboBox2.TabIndex = 1; + this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Font = new System.Drawing.Font("Segoe UI", 12F); + this.label1.Location = new System.Drawing.Point(8, 5); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 21); + this.label1.TabIndex = 2; + this.label1.Text = "Key"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.Location = new System.Drawing.Point(8, 72); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(73, 21); + this.label2.TabIndex = 3; + this.label2.Text = "Extra Key"; + this.label2.Click += new System.EventHandler(this.label2_Click); + // + // OK + // + this.OK.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.OK.Font = new System.Drawing.Font("Segoe UI", 12F); + this.OK.Location = new System.Drawing.Point(34, 129); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 4; + this.OK.Text = "Submit"; + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.OK_Click); + // + // Hotkey_Editor + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.ControlDarkDark; + this.ClientSize = new System.Drawing.Size(145, 164); + this.Controls.Add(this.OK); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.comboBox2); + this.Controls.Add(this.comboBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; + this.Name = "Hotkey_Editor"; + this.Text = "Hotkey_Editor"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button OK; + public System.Windows.Forms.ComboBox comboBox1; + public System.Windows.Forms.ComboBox comboBox2; + } +} \ No newline at end of file diff --git a/Chuuu/Hotkey Editor.cs b/Chuuu/Hotkey Editor.cs new file mode 100644 index 0000000..f69d5be --- /dev/null +++ b/Chuuu/Hotkey Editor.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Chuuu { + public partial class Hotkey_Editor : Form { + public Hotkey_Editor() { + InitializeComponent(); + OK.DialogResult = DialogResult.OK; + comboBox1.SelectedIndex = 0; + comboBox2.SelectedIndex = 0; + } + + private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) { + + } + + private void label2_Click(object sender, EventArgs e) { + + } + + private void OK_Click(object sender, EventArgs e) { + + } + } +} diff --git a/Chuuu/Hotkey Editor.resx b/Chuuu/Hotkey Editor.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Chuuu/Hotkey Editor.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Chuuu/Program.cs b/Chuuu/Program.cs new file mode 100644 index 0000000..e47163d --- /dev/null +++ b/Chuuu/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Chuuu +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/Chuuu/Properties/AssemblyInfo.cs b/Chuuu/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c3dacbf --- /dev/null +++ b/Chuuu/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Chuuu")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Chuuu")] +[assembly: AssemblyCopyright("Copyright Liam G/Merubokkusu © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6deca061-ff01-4bb6-8612-ce34aba7a612")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Chuuu/Properties/Resources.Designer.cs b/Chuuu/Properties/Resources.Designer.cs new file mode 100644 index 0000000..dbd781d --- /dev/null +++ b/Chuuu/Properties/Resources.Designer.cs @@ -0,0 +1,69 @@ +//------------------------------------------------------------------------------ +// +// 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 Chuuu.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Chuuu.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/Chuuu/Properties/Resources.resx b/Chuuu/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/Chuuu/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Chuuu/Properties/Settings.Designer.cs b/Chuuu/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7d22ba8 --- /dev/null +++ b/Chuuu/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// 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 Chuuu.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/Chuuu/Properties/Settings.settings b/Chuuu/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/Chuuu/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Chuuu/icon.ico b/Chuuu/icon.ico new file mode 100644 index 0000000..abf21a1 Binary files /dev/null and b/Chuuu/icon.ico differ diff --git a/Chuuu/packages.config b/Chuuu/packages.config new file mode 100644 index 0000000..b9ab075 --- /dev/null +++ b/Chuuu/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file