private void ActionDecrypt(SoundPanel sp)
        {
            Thread th = new Thread(new ThreadStart(() => { ThreadFunctionActionDecrypt(sp.GetFormatManager(), sp.GetDisplayName()); }));

            th.SetApartmentState(ApartmentState.STA);
            th.Start();
        }
        private void CommitProcessedSoundToInterface(WavFormatManager wfm, String displayName)
        {
            SoundPanel sp = new SoundPanel(wfm, displayName);

            sp.SetEncryptButtonHandler(new Action(() => { ActionEncrypt(sp); }));
            sp.SetDecryptButtonHandler(new Action(() => { ActionDecrypt(sp); }));
            sp.SetPlayButtonHandler(new Action(() => { ActionPlay(sp); }));
            sp.SetSaveButtonHandler(new Action(() => { ActionSave(sp); }));

            int z = soundPanelList.Count;

            stackPanelSoundItems.Children.Insert(z, sp);
            soundPanelList.Add(sp);
        }
        private void CommitLoadToInterface(WavFormatManager wfm, String displayName)
        {
            buttonAddSoundFromFile.IsEnabled = true;

            if (wfm != null)
            {
                SoundPanel sp = new SoundPanel(wfm, displayName);
                sp.SetEncryptButtonHandler(new Action(() => { ActionEncrypt(sp); }));
                sp.SetDecryptButtonHandler(new Action(() => { ActionDecrypt(sp); }));
                sp.SetPlayButtonHandler(new Action(() => { ActionPlay(sp); }));
                sp.SetSaveButtonHandler(new Action(() => { ActionSave(sp); }));

                int z = soundPanelList.Count;

                stackPanelSoundItems.Children.Insert(z, sp);
                soundPanelList.Add(sp);
            }
        }
 private void ActionPlay(SoundPanel sp)
 {
     StreamPlayer.Play(sp.GetFormatManager(), new PlotGraphsDelegate(DrawPlots), this);
     textBlockNowPlaying.Text = "Now playing: " + sp.GetDisplayName();
 }
        private void ActionSave(SoundPanel sp)
        {
            Thread th = new Thread(new ThreadStart(() => { ThreadFunctionActionSave(sp.GetFormatManager(), sp.GetDisplayName()); }));

            th.Start();
        }