Пример #1
0
        public WavePlayer(WaveForm parent)
        {
            parentWindow = parent;
            parentHandle = parent.Handle;
            MsgQueue = new BlockingCollection<PlayerMsg>();

            hWaveOut = new IntPtr();
            h_pbuffer = new GCHandle();
            WaveOutProc = new WinmmHook.WaveDelegate(WOM_proc);
        }
Пример #2
0
 public void childDied(WaveForm child)
 {
     children.Remove(child);
     updateWindowMenu();
     if (children.Count == 1) {
         setActiveWindow(children[0]);
     } else {
         setActiveWindow(null);
     }
 }
Пример #3
0
        private void createChildWindow(string path = null)
        {
            WaveFile wave;
            WaveForm baby;
            if (path == null) {
                wave = new WaveFile();
                baby = new WaveForm(this, wave);
                baby.updateReport("New sine waves generated.");
            } else {
                try {
                    wave = new WaveFile(path);
                    baby = new WaveForm(this, wave);
                    baby.updateReport(wave.getName()+" opened successfully!");
                } catch (Exception e) {
                    MessageBox.Show("Opening Failed: " + e.Message);
                    return;
                }
            }

            children.Add(baby);
            activeChild = baby;
            baby.Show();
            updateWindowMenu();
        }
Пример #4
0
        private void createChildWindow(WaveFile wave)
        {
            WaveForm baby;
            baby = new WaveForm(this, wave);

            children.Add(baby);
            activeChild = baby;
            baby.Show();
            updateWindowMenu();
        }
Пример #5
0
 public void setActiveWindow(WaveForm child)
 {
     activeChild = child;
     updateWindowMenu();
     updateFidelityMenu();
     if (activeChild == null) {
         playbackUpdate(PlaybackStatus.Disabled);
     } else {
         playbackUpdate(activeChild.State);
     }
 }