Esempio n. 1
1
        private void inputStream_Sample(object sender, SampleEventArgs e)
        {
            sampleAggregator.Add(e.Left * 2.0f, e.Right * 2.0f);

            // I know, I know, magic numbers are bad, mmkay.

            if (ActiveStream != null)
            {
                if (sampleReset + 42000 < ActiveStream.Position)
                {
                    sampleReset = ActiveStream.Position;
                    sampleAggregator.Clear();
                }
            }
        }
Esempio n. 2
0
 void inputStream_Sample(object sender, SampleEventArgs e)
 {
     if (OnSample != null)
     {
         OnSample(this, e);
     }
 }
Esempio n. 3
0
 void waveStream_Sample(object sender, SampleEventArgs e)
 {
     waveformAggregator.Add(e.Left, e.Right);
 }
Esempio n. 4
0
 private void inputStream_Sample(object sender, SampleEventArgs e)
 {
     sampleAggregator.Add(e.Left, e.Right);
     long repeatStartPosition = (long)((SelectionBegin.TotalSeconds / ActiveStream.TotalTime.TotalSeconds) * ActiveStream.Length);
     long repeatStopPosition = (long)((SelectionEnd.TotalSeconds / ActiveStream.TotalTime.TotalSeconds) * ActiveStream.Length);
     if (((SelectionEnd - SelectionBegin) >= TimeSpan.FromMilliseconds(repeatThreshold)) && ActiveStream.Position >= repeatStopPosition)
     {
         sampleAggregator.Clear();
         ActiveStream.Position = repeatStartPosition;
     }
 }
Esempio n. 5
0
 /// <summary>
 /// This callback is called everytime a sample is player. This method handles current time and current position updates,
 /// the stop of the playing at the end of the track and the buffering state.
 /// </summary>
 /// <param name="sender">Unused params</param>
 /// <param name="e">Unused params</param>
 private void wc_Sample(object sender, SampleEventArgs e)
 {
     if (wc == null) return;
     if (wc.CurrentTime.TotalSeconds != currentTime)
     {
         currentTime = wc.CurrentTime.TotalSeconds;
         NotifyPropertyChanged("CurrentTime");
         NotifyPropertyChanged("BufferPortion");
         pos = lmem.Position;
         NotifyPropertyChanged("Position");
     }
     if (lmem.Position == lmem.Length) { this.stop(); return; }
     long myBufferSize = 20480;
     if ((!BufferingState) && (localstream.Position != rsc.Tag.FileSize) && ((localstream.Position - lmem.Position) < myBufferSize))
     {
         Console.WriteLine("Paused ... waiting!");
         BufferingState = true;
         this.pause();
         localstream.WaitForMore();
     }
 }
 void _notify_Sample(object sender, SampleEventArgs e)
 {
     if (SampleReceived != null)
         SampleReceived.Invoke(this, e);
 }
Esempio n. 7
0
 void OnSample(object sender, SampleEventArgs e)
 {
     aggregator.Add(e.Left);
 }
Esempio n. 8
0
		/// <summary>
		/// Event when player plays another sample
		/// </summary>
		private void SampleCounter(object sender, SampleEventArgs e) {
			m_SampleCount++;
		}
 private void Sound0_Sample(object sender, SampleEventArgs e)
 {
     max = Math.Max(max, e.Left);
     min = Math.Min(min, e.Left);
 }
Esempio n. 10
0
 void eq_Sample(object sender, SampleEventArgs e)
 {
     inputStream_Sample(sender, e);
 }
Esempio n. 11
0
 private void channel_Sample(object sender, SampleEventArgs e)
 {
     InputSampler.Add(e.Left, e.Right);
 }
Esempio n. 12
0
 static void _waveChannel_Sample(object sender, SampleEventArgs e)
 {
     InputSampler.Add(e.Left, e.Right);
 }
Esempio n. 13
0
 private void SampleEvent(object sender, SampleEventArgs e)
 {
     nextval = Math.Abs(e.Left + e.Right / 2);
 }
Esempio n. 14
0
 private void inputStream_Sample(object sender, SampleEventArgs e)
 {
     sampleAggregator.Add(e.Left, e.Right);
 }