public void updateButtons(SynthWaveProvider.PlayerState pstate)
 {
     if (pstate != SynthWaveProvider.PlayerState.Stopped)
         pictureBox2.Image = Properties.Resources.stop;
     else
         pictureBox2.Image = Properties.Resources.play;
 }
 public SynthThread()
 {
     synth          = new Synthesizer(Properties.Settings.Default.SampleRate, 2, Properties.Settings.Default.BufferSize, Properties.Settings.Default.BufferCount, Properties.Settings.Default.poly);
     mseq           = new MidiFileSequencer(synth);
     synth_provider = new SynthWaveProvider(synth, mseq);
     direct_out     = new DirectSoundOut(Properties.Settings.Default.Latency);
     direct_out.Init(synth_provider);
 }
        public SynthThread()
        {
            synth = new Synthesizer(Properties.Settings.Default.SampleRate, 2, Properties.Settings.Default.BufferSize, Properties.Settings.Default.BufferCount, Properties.Settings.Default.poly);
            mseq = new MidiFileSequencer(synth);
            synth_provider = new SynthWaveProvider(synth, mseq);

			if (Type.GetType ("Mono.Runtime") == null) { // if we are running on windows, use Microsoft DirectSound
				direct_out = new DirectSoundOutBroker (Properties.Settings.Default.Latency);
			} else { // if running on mono, then we should be on linux or mac. therefore, use OpenAL instead (actually, it should be better using OpenAL for everything
				direct_out = new OpenALSoundOut(Properties.Settings.Default.Latency);
			}

            direct_out.Init(synth_provider);
        }
 public void AddMessage(SynthWaveProvider.Message msg)
 {
     lctrl.addString(msg.ToString() + "\n");
     sthread.AddMessage(msg);
 }
 public void AddMessage(SynthWaveProvider.Message msg)
 {
     lock (synth_provider.lockObj)
     {
         synth_provider.msgQueue.Enqueue(msg);
     }
 }