From 406760bca2f7d08dec9c5f2c4becaaf0c8f1d197 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Thu, 21 Jan 2021 13:54:52 -0600 Subject: [PATCH] Version Beta 1.5.0.0 as marked by the aboutForm dialog. --- .vs/SoundBoard/v16/.suo | Bin 0 -> 51712 bytes SoundBoard.v11.suo | Bin 51200 -> 51712 bytes SoundBoard/GenerateRandomPlayList.cs | 13 + SoundBoard/Properties/AssemblyInfo.cs | 4 +- SoundBoard/SoundBoard.csproj | 1 + SoundBoard/aboutForm.Designer.cs | 2 +- SoundBoard/mainForm.Designer.cs | 22 +- SoundBoard/mainForm.cs | 361 +++++++++++++++----------- 8 files changed, 241 insertions(+), 162 deletions(-) create mode 100644 .vs/SoundBoard/v16/.suo create mode 100644 SoundBoard/GenerateRandomPlayList.cs diff --git a/.vs/SoundBoard/v16/.suo b/.vs/SoundBoard/v16/.suo new file mode 100644 index 0000000000000000000000000000000000000000..4a81323800bb40c0b09a4da859f0e1614db1310e GIT binary patch literal 51712 zcmca`Uhu)fjZzO8(10BSGsD0CoD6J8;*1Oo3`{V-00RRTl>hJl|NkIiW(Ed^|D#|? zg+LHPK0`i334;QID?=Vb2}2P>B`7M1#$pVt@Hkf`pzA`5y6M^63yg{k3=9V}Ac_MR ziWu@4vKTxW@)*(>@)=wiDj*U>l41-@jK~2_jJA0U3=9HLg&_=y48;uD3_c8*48;s3 z4519g45Ckjaq8kiwA9P|o1X zkjRk7kjRh@c7Yy409Y=MA(bJ8!HuDaA(0`MA(a8uMP>|4;PB@s!Tvc63=BL_`z09| z82%y$Ae0Tt)1nLv4B}98p~7&A9fvqbp9}*711L|UU3fgzcJfgy!~fk6a^I%GZ6WYaVMAK0Kri~J8x z|FAHDCTqOZX#Pj!e^|J|$^lUR1m$~}I4J+KGB7Z(K+`dy^a;`r%Kw}U3=FvPKg?_x zJ)HADH#9#Jlm9_wGAvB!MRzhVFf=hRFf=nTFtk9+#5M*7hIR%9h7Ksdi-Ccmn}LC$ z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PrDQ(|&U(69;{Bcr2lW^z$}@#L%f z?0GntKrUrq{qz6-|HSecVqTmo`CNSC&aXR%{W4k%p|!{mZfb5fH_ zQd7{KMukv_0@S0$@kZ@34_f9 zca>0j^KzKU1U49uYMYljnMc}04v z+!F+O$HRcZVDtaJgN))J9%%d#OO21kgP`6bCg8=h5{uGPO9FBdOVaX-a%qr2@TCtyjC?Zr%svmS*~1w$R0+x%$k~JN5K$sXix4zR qLy7{&!IOEy@dXZQ*x=1Pj>fe$!Jt~-DIb(rm?wuyWlTP?KNtYoDRhVc diff --git a/SoundBoard/GenerateRandomPlayList.cs b/SoundBoard/GenerateRandomPlayList.cs new file mode 100644 index 0000000..95fb791 --- /dev/null +++ b/SoundBoard/GenerateRandomPlayList.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SoundBoard +{ + class GenerateRandomPlayList + { + + } +} diff --git a/SoundBoard/Properties/AssemblyInfo.cs b/SoundBoard/Properties/AssemblyInfo.cs index 6d39fad..553382a 100644 --- a/SoundBoard/Properties/AssemblyInfo.cs +++ b/SoundBoard/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 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("0.9.0.0")] -[assembly: AssemblyFileVersion("0.9.0.0")] +[assembly: AssemblyVersion("1.5.0.0")] +[assembly: AssemblyFileVersion("1.5.0.0")] diff --git a/SoundBoard/SoundBoard.csproj b/SoundBoard/SoundBoard.csproj index 37e1640..c707641 100644 --- a/SoundBoard/SoundBoard.csproj +++ b/SoundBoard/SoundBoard.csproj @@ -96,6 +96,7 @@ aboutForm.cs + Form diff --git a/SoundBoard/aboutForm.Designer.cs b/SoundBoard/aboutForm.Designer.cs index 6ec8ad7..7f681d1 100644 --- a/SoundBoard/aboutForm.Designer.cs +++ b/SoundBoard/aboutForm.Designer.cs @@ -58,7 +58,7 @@ this.applicationVersionLabel.Name = "applicationVersionLabel"; this.applicationVersionLabel.Size = new System.Drawing.Size(246, 80); this.applicationVersionLabel.TabIndex = 1; - this.applicationVersionLabel.Text = "Dynamic Soundboard \r\n\r\nVersion Beta 0.9.0.0\r\nMP3 sound format supported!"; + this.applicationVersionLabel.Text = "Dynamic Soundboard \r\n\r\nVersion Beta 1.5.0.0\r\nMP3 sound format supported!"; // // lordBalgruufPortrait // diff --git a/SoundBoard/mainForm.Designer.cs b/SoundBoard/mainForm.Designer.cs index aa7d2c9..bdba877 100644 --- a/SoundBoard/mainForm.Designer.cs +++ b/SoundBoard/mainForm.Designer.cs @@ -42,6 +42,7 @@ this.soundboardTabControl = new System.Windows.Forms.TabControl(); this.loopSelectedSoundCheckBox = new System.Windows.Forms.CheckBox(); this.fileSystemWatcherMain = new System.IO.FileSystemWatcher(); + this.label1 = new System.Windows.Forms.Label(); this.mainMenu.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.randomIterationNumericUpDown)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.fileSystemWatcherMain)).BeginInit(); @@ -52,7 +53,8 @@ this.btnRandom.Location = new System.Drawing.Point(7, 545); this.btnRandom.Name = "btnRandom"; this.btnRandom.Size = new System.Drawing.Size(81, 23); - this.btnRandom.TabIndex = 1; + this.btnRandom.TabIndex = 0; + this.btnRandom.TabStop = false; this.btnRandom.Text = "Random"; this.btnRandom.UseVisualStyleBackColor = true; this.btnRandom.Click += new System.EventHandler(this.btnRandom_Click); @@ -132,7 +134,7 @@ 0}); this.randomIterationNumericUpDown.Name = "randomIterationNumericUpDown"; this.randomIterationNumericUpDown.Size = new System.Drawing.Size(58, 20); - this.randomIterationNumericUpDown.TabIndex = 4; + this.randomIterationNumericUpDown.TabIndex = 1; this.randomIterationNumericUpDown.TabStop = false; this.randomIterationNumericUpDown.Value = new decimal(new int[] { 1, @@ -148,6 +150,7 @@ this.soundboardTabControl.SelectedIndex = 0; this.soundboardTabControl.Size = new System.Drawing.Size(425, 506); this.soundboardTabControl.TabIndex = 0; + this.soundboardTabControl.TabStop = false; // // loopSelectedSoundCheckBox // @@ -155,7 +158,8 @@ this.loopSelectedSoundCheckBox.Location = new System.Drawing.Point(158, 549); this.loopSelectedSoundCheckBox.Name = "loopSelectedSoundCheckBox"; this.loopSelectedSoundCheckBox.Size = new System.Drawing.Size(129, 17); - this.loopSelectedSoundCheckBox.TabIndex = 3; + this.loopSelectedSoundCheckBox.TabIndex = 2; + this.loopSelectedSoundCheckBox.TabStop = false; this.loopSelectedSoundCheckBox.Text = "Loop Selected Sound"; this.loopSelectedSoundCheckBox.UseVisualStyleBackColor = true; this.loopSelectedSoundCheckBox.CheckedChanged += new System.EventHandler(this.loopSelectedSoundCheckBox_CheckedChanged); @@ -165,17 +169,28 @@ this.fileSystemWatcherMain.EnableRaisingEvents = true; this.fileSystemWatcherMain.SynchronizingObject = this; // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(294, 548); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 4; + this.label1.Text = "label1"; + // // formMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(425, 578); + this.Controls.Add(this.label1); this.Controls.Add(this.loopSelectedSoundCheckBox); this.Controls.Add(this.randomIterationNumericUpDown); this.Controls.Add(this.soundboardTabControl); this.Controls.Add(this.btnRandom); this.Controls.Add(this.mainMenu); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.KeyPreview = true; this.MainMenuStrip = this.mainMenu; this.Name = "formMain"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; @@ -205,6 +220,7 @@ private System.Windows.Forms.ToolStripMenuItem mainMenuHelpAbout; private System.Windows.Forms.CheckBox loopSelectedSoundCheckBox; private System.IO.FileSystemWatcher fileSystemWatcherMain; + public System.Windows.Forms.Label label1; } } diff --git a/SoundBoard/mainForm.cs b/SoundBoard/mainForm.cs index 832aaca..72bc94c 100644 --- a/SoundBoard/mainForm.cs +++ b/SoundBoard/mainForm.cs @@ -1,26 +1,25 @@ using System; using System.Collections.Generic; using System.ComponentModel; +using System.Runtime.InteropServices; using System.Data; using System.Drawing; using System.Linq; using System.Text; -using System.Threading; using System.Windows.Forms; using System.IO; using System.Diagnostics; -using System.Reflection; + namespace SoundBoard { - public partial class formMain : Form + public partial class formMain : Form, IMessageFilter { + private const int WM_KEYDOWN = 0x100; public WMPLib.WindowsMediaPlayer Player = new WMPLib.WindowsMediaPlayer(); public Random randomNum = new Random(); - public ListBox listBoxEntity = new ListBox(); - ProcessStartInfo process = new ProcessStartInfo(); - BackgroundWorker worker = new BackgroundWorker(); - public string _workingDirectory; + public ListView listViewEntity = new ListView(); + public string _workingDirectory = Path.GetDirectoryName(Application.ExecutablePath); public string[] _soundFiles; public string[] _soundDirectories; @@ -31,29 +30,27 @@ namespace SoundBoard private void formMain_Load(object sender, EventArgs e) { - _workingDirectory = Path.GetDirectoryName(Application.ExecutablePath); _soundFiles = Directory.GetFiles(_workingDirectory); + //Build the UI, foreach directory create one TabPage and one ListView object foreach (string sound in _soundFiles) { CreateUITabs("Working Directory", _workingDirectory); } - - _soundDirectories = Directory.GetDirectories(_workingDirectory); + _soundDirectories = Directory.GetDirectories(_workingDirectory, "*", SearchOption.TopDirectoryOnly); foreach (string sounds in _soundDirectories) { CreateUITabs(Path.GetFileName(sounds), sounds); } - worker.WorkerSupportsCancellation = true; - worker.WorkerReportsProgress = true; - fileSystemWatcherMain.Path = _workingDirectory; - fileSystemWatcherMain.IncludeSubdirectories = true; + Application.AddMessageFilter(this); + fileSystemWatcherMain.Path = _workingDirectory; //watch in the application's working directory + fileSystemWatcherMain.IncludeSubdirectories = true; //and watch in the subfolders for changes, but only one layer down from the app's directory fileSystemWatcherMain.Created += new FileSystemEventHandler(fileSystemUpdateDetected); //file or folder created fileSystemWatcherMain.Deleted += new FileSystemEventHandler(fileSystemUpdateDetected); //file or folder moved or deleted fileSystemWatcherMain.Renamed += new RenamedEventHandler(fileSystemUpdateDetected); //for any file changes like file extension changes - soundboardTabControl.SelectedIndexChanged += new EventHandler(CheckForDisabledListBox); //disables ore enables the Show on Disk file menu object - Player.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(WMP_PlayStateChange); - //check to see if the listBox is empty on form load + soundboardTabControl.SelectedIndexChanged += new EventHandler(CheckForDisabledListBox); //disables or enables the Show on Disk file menu object + Player.PlayStateChange += new WMPLib._WMPOCXEvents_PlayStateChangeEventHandler(WMP_PlayStateChange); //eventhandler for the playstate of the Player object + //check to see if the listView is empty on form load if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) { mainMenuFileShowOnDisk.Enabled = true; @@ -64,10 +61,41 @@ namespace SoundBoard mainMenuFileShowOnDisk.Enabled = false; btnRandom.Enabled = false; } + soundboardTabControl.Select(); } private void WMP_PlayStateChange(int newState) { + //check to see if the random play functions are running + if (btnRandom.Enabled == false) + { + if (Player.playState == WMPLib.WMPPlayState.wmppsTransitioning) + { + //Player is transitioning, so keep the controls disabled + btnRandom.Enabled = false; + loopSelectedSoundCheckBox.Enabled = false; + } + else if (Player.playState == WMPLib.WMPPlayState.wmppsPlaying) + { + //player is still playing the random playlist, keep the controls disbaled + btnRandom.Enabled = false; + loopSelectedSoundCheckBox.Enabled = false; + } + else if (Player.playState == WMPLib.WMPPlayState.wmppsReady) + { + //renable the controls, the Random functions are done + //first check to see if the loop checkBox is checked, if so set the player to "loop" + if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) + { + btnRandom.Enabled = true; + } + if (loopSelectedSoundCheckBox.Checked == true) + { + Player.settings.setMode("loop", true); + } + loopSelectedSoundCheckBox.Enabled = true; + } + } } private void fileSystemUpdateDetected(object sender, FileSystemEventArgs e) @@ -78,17 +106,16 @@ namespace SoundBoard private void CheckForDisabledListBox(object sender, EventArgs e) { - ListBox listBoxEntity = new ListBox(); try { - listBoxEntity = (ListBox)soundboardTabControl.SelectedTab.Controls[0]; + listViewEntity = (ListView)soundboardTabControl.SelectedTab.Controls[0]; } catch (Exception spam) { return; } - if (listBoxEntity.Enabled == false) + if (listViewEntity.Enabled == false) { mainMenuFileShowOnDisk.Enabled = false; btnRandom.Enabled = false; @@ -107,9 +134,9 @@ namespace SoundBoard foreach (TabPage tabPage in soundboardTabControl.TabPages) { - foreach (ListBox listBox in tabPage.Controls) + foreach (ListView listView in tabPage.Controls) { - listBox.Dispose(); + listView.Dispose(); } tabPage.Dispose(); } @@ -122,7 +149,7 @@ namespace SoundBoard { CreateUITabs(Path.GetFileName(files), files); } - //check to see if the listBox is empty + //check to see if the listView is empty if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) { mainMenuFileShowOnDisk.Enabled = true; @@ -137,12 +164,14 @@ namespace SoundBoard private void CreateUITabs(string tabName, string directoryPath) { - //add tabs dynamically + //Add tabs dynamically int soundControlHeight = soundboardTabControl.Height; int soundControlWidth = soundboardTabControl.Width; - string[] directoryFiles; //files in the target directory + string[] directoryFiles; //Files in the target directory TabPage tab = new TabPage(); - ListBox localListBox = new ListBox(); + ListView localListView = new ListView(); + string[] columnNames = new string[2]; //Perhaps include a compatibility column to flag files that cause errors? + ListViewItem listItemObject; if (soundboardTabControl.Controls.ContainsKey(tabName.Replace(" ", "") + "Tab")) { @@ -150,38 +179,60 @@ namespace SoundBoard } else { - tab.Text = tabName; //display the folder's full name to the user + //Construct the TabPage and its properties + tab.Text = tabName; //Display the folder's full name to the user tab.Name = tabName.Replace(" ", "") + "Tab"; //create a legal name for the tab's (name) property tab.Height = soundControlHeight; tab.Height = soundControlWidth; soundboardTabControl.Controls.Add(tab); - localListBox.Height = soundControlHeight - 25; - localListBox.Width = soundControlWidth - 5; - localListBox.Name = tabName.Replace(" ", "") + "ListBox"; - tab.Controls.Add(localListBox); - localListBox.Click += new EventHandler((sender, e) => ListBoxOnLeftClick(sender, e, localListBox)); //create event handler for the lsit box and pass the object in + //Construct the ListView and its properties + localListView.Height = soundControlHeight - 25; + localListView.Width = soundControlWidth - 5; + localListView.Name = tabName.Replace(" ", "") + "ListView"; + localListView.FullRowSelect = true; + localListView.MultiSelect = false; + localListView.GridLines = true; + localListView.View = View.Details; + localListView.Activation = ItemActivation.OneClick; + localListView.TabStop = false; + tab.Controls.Add(localListView); + localListView.Columns.Add("File Name", 340, HorizontalAlignment.Left); + localListView.Columns.Add("File Ext", 50, HorizontalAlignment.Left); + localListView.ItemActivate += new EventHandler((sender, e) => ListViewOnLeftClick(sender, e, localListView)); } directoryFiles = Directory.GetFiles(Path.GetFullPath(directoryPath)); - foreach (string files in directoryFiles) + foreach (string file in directoryFiles) { - switch (Path.GetExtension(files))//check to make sure the file is a sound file + switch (Path.GetExtension(file).ToLower()) { - case ".wav": + //Only include sound files in the ListView case ".mp3": - localListBox.Items.Add(Path.GetFileNameWithoutExtension(files)); + case ".wav": + columnNames[0] = Path.GetFileNameWithoutExtension(file); + columnNames[1] = Path.GetExtension(file); + listItemObject = new ListViewItem(columnNames); + localListView.Items.Add(listItemObject); break; default: break; } } - if (localListBox.Items.Count == 0) + if (localListView.Items.Count == 0) { - localListBox.Items.Add("No sound files found in the " + tabName + " directory."); - localListBox.Enabled = false; + if (tab.Name == "WorkingDirectoryTab") + { + localListView.Items.Add("No sound files detected in the application's working directory."); + } + else + { + localListView.Items.Add("No sound files detected in the " + tabName + " directory"); + } + + localListView.Enabled = false; if (soundboardTabControl.SelectedIndex == 0) { mainMenuFileShowOnDisk.Enabled = false; @@ -190,59 +241,59 @@ namespace SoundBoard } } - private void ListBoxOnLeftClick(object sender, EventArgs e, ListBox list) + private void ListViewOnLeftClick(object sender, EventArgs e, ListView listView) { - //check to make sure something is actually selected - if (list.SelectedItem == null) + if (btnRandom.Enabled == false) { + //If the btnRandom button is disabled that means a randomise function is running, so don't interupt it return; } - //get the file's location on disk, double back if it's not a .wav file + string fileName; + string fileExt; string fileLocation; - WMPLib.IWMPPlaylist _playList = Player.playlistCollection.newPlaylist("myPlayList"); //build the playlist object + + fileName = listView.SelectedItems[0].SubItems[0].Text; + fileExt = listView.SelectedItems[0].SubItems[1].Text; + if (soundboardTabControl.SelectedIndex == 0) { - fileLocation = _workingDirectory + "\\" + list.SelectedItem.ToString() + ".wav"; - if (!File.Exists(fileLocation)) + if (File.Exists(_workingDirectory + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + list.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + fileName + fileExt; + } + else + { + return; } } else { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + list.SelectedItem.ToString() + ".wav"; - if (!File.Exists(fileLocation)) + if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + list.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt; + } + else + { + return; } } - if (File.Exists(fileLocation))//check for the file's existance - { - PlaySoundFile(fileLocation, list.SelectedItem.ToString()); //if the file exists then play it - } - else - { - MessageBox.Show("The file '" + list.SelectedItem.ToString() + "' couldn't be found.", "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); - } - } - - private void PlayRandomSounds() - { + PlaySoundFile(fileLocation); } private void btnRandom_Click(object sender, EventArgs e) { int iterations = (int)randomIterationNumericUpDown.Value; - listBoxEntity = (ListBox)soundboardTabControl.SelectedTab.Controls[0]; + listViewEntity = (ListView)soundboardTabControl.SelectedTab.Controls[0]; + Player.currentPlaylist.clear(); - if (listBoxEntity.Enabled == false) + //DOuble check to see if the ListView has any items that can be played + if (listViewEntity.Enabled == false) { - //the ListBox is disabled and therefore contains no sounds, so return + //the ListView disabled and therefore contains no sounds, so return return; } - //disable the Random Button and the NumericUpDown box + //disable the Random Button and the loop checkbox btnRandom.Enabled = false; - randomIterationNumericUpDown.Enabled = false; loopSelectedSoundCheckBox.Enabled = false; if (mainMenuPlayAll.Checked == true) @@ -252,101 +303,82 @@ namespace SoundBoard { btnRandom.Enabled = true; } - randomIterationNumericUpDown.Enabled = true; loopSelectedSoundCheckBox.Enabled = true; return; } for (int i = 0; i < iterations; i++) { - string fileLocation; + string fileLocation = ""; + string fileExt; + string fileName; + //Check to see if the selected tab is the working directory's tab if (soundboardTabControl.SelectedIndex == 0) { - listBoxEntity.SelectedIndex = randomNum.Next(listBoxEntity.Items.Count); - if (File.Exists(_workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + listViewEntity.Items[randomNum.Next(listViewEntity.Items.Count)].Selected = true; + fileName = listViewEntity.SelectedItems[0].SubItems[0].Text; + fileExt = listViewEntity.SelectedItems[0].SubItems[1].Text; + + if (File.Exists(_workingDirectory + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav"; - } - else if (File.Exists(_workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3")) - { - fileLocation = _workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + fileName + fileExt; } else { - MessageBox.Show("The file '" + listBoxEntity.SelectedItem.ToString() + "' couldn't be found.", "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("The file couldn't be found.", "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) { btnRandom.Enabled = true; } - - randomIterationNumericUpDown.Enabled = true; loopSelectedSoundCheckBox.Enabled = true; + Player.currentPlaylist.clear(); return; } } else { - listBoxEntity.SelectedIndex = randomNum.Next(listBoxEntity.Items.Count); - if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + listViewEntity.Items[randomNum.Next(listViewEntity.Items.Count)].Selected = true; + fileName = listViewEntity.SelectedItems[0].SubItems[0].Text; + fileExt = listViewEntity.SelectedItems[0].SubItems[1].Text; + + if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav"; - } - else if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3")) - { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt; } else { - MessageBox.Show("The file '" + listBoxEntity.SelectedItem.ToString() + "' couldn't be found.", "File Not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt, "Not Found"); if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) { btnRandom.Enabled = true; } - - randomIterationNumericUpDown.Enabled = true; loopSelectedSoundCheckBox.Enabled = true; - return; + Player.currentPlaylist.clear(); + return; } } - //play the sound file - PlaySoundFile(fileLocation, listBoxEntity.SelectedItem.ToString(), false); + //load the player with the randomly chosen sounds + enumeratePlayerPlayList(fileLocation); } - //renable the controls - if (soundboardTabControl.SelectedTab.Controls[0].Enabled == true) - { - btnRandom.Enabled = true; - } - randomIterationNumericUpDown.Enabled = true; - loopSelectedSoundCheckBox.Enabled = true; + //prepare the Player object and play the playlist + btnRandom.Enabled = false; + Player.settings.setMode("loop", false); + PlayPlayList(); } - private void PlaySoundFile(string fileLocation, string fileName, bool willLoop = true) + private void PlaySoundFile(string fileLocation) { + //Set the file to be played's location Player.URL = fileLocation; - + + //Attempt to play the file try { - if (Player.settings.getMode("loop")) - { - if (!willLoop) - { - Player.settings.setMode("loop", false); - Player.controls.play(); - } - else - { - Player.controls.play(); - } - Player.settings.setMode("loop", true); - } - else - { - Player.controls.play(); - } + Player.controls.play(); } catch (InvalidOperationException Ex) { - MessageBox.Show("The file '" + fileName + "' couldn't be played.", "Invalid Sound File", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("The file couldn't be played.", "Invalid Sound File", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } @@ -360,15 +392,16 @@ namespace SoundBoard else { Player.settings.setMode("loop", false); - Player.close(); } } private void playRandomSoundBothColumns(int iterations) { int tempRandomNumber; - string fileLocation; - listBoxEntity = (ListBox)soundboardTabControl.SelectedTab.Controls[0]; + string fileLocation = ""; + string fileName; + string fileExt; + listViewEntity = (ListView)soundboardTabControl.SelectedTab.Controls[0]; for (int i = 0; i <= iterations; i++) { @@ -379,13 +412,13 @@ namespace SoundBoard soundboardTabControl.SelectedIndex = tempRandomNumber; if (soundboardTabControl.SelectedIndex == 0) { - if (File.Exists(_workingDirectory + "\\" + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + listViewEntity.Items[randomNum.Next(listViewEntity.Items.Count)].Selected = true; + fileName = listViewEntity.SelectedItems[0].SubItems[0].Text; + fileExt = listViewEntity.SelectedItems[0].SubItems[1].Text; + + if (File.Exists(_workingDirectory + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav"; - } - else if (File.Exists(_workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3")) - { - fileLocation = _workingDirectory + "\\" + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + fileName + fileExt; } else { @@ -394,58 +427,50 @@ namespace SoundBoard } else { - soundboardTabControl.SelectedIndex = tempRandomNumber; - listBoxEntity.SelectedIndex = randomNum.Next(listBoxEntity.Items.Count); - if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + listViewEntity.Items[randomNum.Next(listViewEntity.Items.Count)].Selected = true; + fileName = listViewEntity.SelectedItems[0].SubItems[0].Text; + fileExt = listViewEntity.SelectedItems[0].SubItems[1].Text; + + if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt)) { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav"; - } - else if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3")) - { - fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3"; + fileLocation = _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt; } else { return; } } - PlaySoundFile(fileLocation, soundboardTabControl.SelectedTab.Text, false); + enumeratePlayerPlayList(fileLocation); } else { - playRandomSoundBothColumns(iterations); + playRandomSoundBothColumns(iterations - i); } } + PlayPlayList(); } private void mainMenuFileShowOnDisk_Click(object sender, EventArgs e) { - listBoxEntity = (ListBox)soundboardTabControl.SelectedTab.Controls[0]; - if ((String)listBoxEntity.SelectedItem == null) - { - MessageBox.Show("No sound file selected...", soundboardTabControl.SelectedTab.Name, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } + listViewEntity = (ListView)soundboardTabControl.SelectedTab.Controls[0]; + string fileName; + string fileExt; + + fileName = listViewEntity.SelectedItems[0].SubItems[0].Text; + fileExt = listViewEntity.SelectedItems[0].SubItems[1].Text; + if (soundboardTabControl.SelectedIndex == 0) { - if (File.Exists(_workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + if (File.Exists(_workingDirectory + "\\" + fileName + fileExt)) { - Process.Start("explorer.exe", "/select, " + '"' + _workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav" + '"'); - } - else - { - Process.Start("explorer.exe", "/select, " + '"' + _workingDirectory + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3" + '"'); + Process.Start("explorer.exe", "/select, \"" + _workingDirectory + "\\" + fileName + fileExt + "\""); } } else { - if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav")) + if (File.Exists(_workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt)) { - Process.Start("explorer.exe", "/select, " + '"' + _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".wav" + '"'); - } - else - { - Process.Start("explorer.exe", "/select, " + '"' + _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + listBoxEntity.SelectedItem.ToString() + ".mp3" + '"'); + Process.Start("explorer.exe", "/select, \"" + _workingDirectory + "\\" + soundboardTabControl.SelectedTab.Text + "\\" + fileName + fileExt + "\""); } } } @@ -461,5 +486,29 @@ namespace SoundBoard { Close(); } + + private void enumeratePlayerPlayList(string fileLocation) + { + WMPLib.IWMPMedia playList = Player.newMedia(fileLocation); + Player.currentPlaylist.appendItem(playList); + } + + private void PlayPlayList() + { + Player.controls.play(); + } + //Handles all messages being sent to controls + public bool PreFilterMessage(ref Message m) + { + Keys keyCode = (Keys)(int)m.WParam & Keys.KeyCode; + bool retVal = false; + + if (m.Msg == WM_KEYDOWN) + { + // Handle the keypress + label1.Text = keyCode.ToString(); + } + return retVal; + } } }