Ejemplo n.º 1
0
        void CatchPeakOverloadEvent(object sender, VuMeter.PeakOverloadEventArgs EventOb)
        {
            //Obi.Events.Audio.VuMeter.PeakOverloadEventArgs EventOb = e as Obi.Events.Audio.VuMeter.PeakOverloadEventArgs;
            if (EventOb.Channel == 1)
            {
                //m_StrLeftOverloadIndicator = "OL ";
                m_StrLeftOverloadIndicator = Localizer.Message("TextVuMeter_OverloadIndicator");
            }
            else
            {
                //m_StrRightOverloadIndicator = "OL ";
                m_StrRightOverloadIndicator = Localizer.Message("TextVuMeter_OverloadIndicator");
            }

            //UpdateControls ();
            AudioLib.VuMeter ob_VuMeter = sender as AudioLib.VuMeter;


            // beep enabled false means this is first peak overload after text timer tick, so play beep
            if (m_OverLoadBeepEnabled == false)
            {
                PlayBeep();
                m_OverLoadBeepEnabled = true;
            }
        }
Ejemplo n.º 2
0
        // function to catch the update event from VuMeter class to update graph cordinates
        public void CatchPeakMeterUpdateEvent(object sender, AudioLib.VuMeter.PeakMeterUpdateEventArgs e)
        {
            VuMeter ob_VuMeterArg = sender as VuMeter;

            mVuMeter = ob_VuMeterArg;

            double channelValueLeft  = 0;
            double channelValueRight = 0;

            if (e.PeakDb != null && e.PeakDb.Length > 0)
            {
                channelValueLeft = e.PeakDb[0];

                if (e.PeakDb.Length > 1)
                {
                    channelValueRight = e.PeakDb[1];
                }
                else
                {
                    channelValueRight = channelValueLeft;
                }

                //if (channelValueLeft == Double.PositiveInfinity
                //    && e.PeakDb.Length > 1
                //    && channelValueRight == Double.PositiveInfinity)
                //{
                //    CatchResetEvent();
                //    return;
                //}
            }

            // Update erase left and erase right cordinates
            int ThresholdFactor = 12500 / (210 - 15);
            int DisplayAmpLeft  = (int)((channelValueLeft * ThresholdFactor) / 100.0);
            int DisplayAmpRight = (int)((channelValueRight * ThresholdFactor) / 100.0);
            int Offset          = 65 - ((15 * ThresholdFactor) / 100);


            DisplayAmpLeft  = DisplayAmpLeft + Offset;
            DisplayAmpRight = DisplayAmpRight + Offset;

            EraserLeft  = Convert.ToInt32(LowBottom - (ScaleFactor * DisplayAmpLeft));
            EraserRight = Convert.ToInt32(LowBottom - (ScaleFactor * DisplayAmpRight));
            //EraserLeft = 100+  mVuMeter.m_MeanValueLeft;

            tmRefresh.Start();
            //MessageBox.Show(EraserLeft.ToString());
        }