⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmoscope.pas

📁 一套及时通讯的原码
💻 PAS
📖 第 1 页 / 共 5 页
字号:
                  else if (Y1 > FEffectBottom) then
                  begin
                     DIB_SetColor(rEffectClr);
                     DIB_VLine(i, Y1, Y1-5);
                  end;
               end;
               inc(i,FSteps);
            end;
         end
         else if (FEffect = efSplit) then
         begin
            DIB_HLine(0, FMarkBegin, FMiddle);
            DIB_HLine(0, FMarkBegin, FMiddle-1);
            DIB_SetColor(rForeClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle);
            DIB_SetColor(rEffectClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle-1);
            DIB_SetColor(rInactClr);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle-1);
            aColor := rInactClr;
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := FHeight-(Long(Value * FGain div 8 + FCenter)* FHeight div FRange)-1;
               if (Y1 < -1) then GainOverflow;

               if i > FMarkEnd then aColor := rInactClr
               else if i >= FMarkBegin then aColor := rForeClr;

               if (aColor = rForeClr) and (Y1 < FEffectBottom) then
                  DIB_SetColor(rEffectClr)
               else
                  DIB_SetColor(aColor);

               DIB_VLine(i, FMiddle, Y1);

               inc(i,FSteps);
            end;
         end;
      end;
   end;
end;

{-- TMMOscope ------------------------------------------------------------}
Procedure TMMOscope.DrawAsMirLines;
Var
   i: integer;
   Y1,Y2: integer;
   aColor: Long;
   rForeClr: Long;
   rInactClr: Long;
   rEffectClr: Long;
   Value: Longint;

begin
   with DIBCanvas do
   begin
      rForeClr := DIB_ColorToIndex(FForeColor);
      rInactClr := DIB_ColorToIndex(FInactColor);
      rEffectClr := DIB_ColorToIndex(FEffectColor);
      i := 0;
      if FScroll then
      begin
         DIB_SetTColor(Color);
         DIB_VLine(Fx1,0,FHeight);
         DIB_SetColor(rForeClr);
         if (FEffect = efNone) then
         begin
            Value := FData^[i];
            if abs(FData^[i+1]) > abs(Value) then Value := FData^[i+1];
            if Value >= 32767 then PcmOverflow;
            Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
            if (Y1 > FHeight) then GainOverflow;

            DIB_VLine(Fx1, FHeight-Y1-1, Y1);
         end
         else if (FEffect = efPeak) then
         begin
            Value := FData^[i];
            if abs(FData^[i+1]) > abs(Value) then Value := FData^[i+1];
            if Value >= 32767 then PcmOverflow;
            Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
            if (Y1 > FHeight) then GainOverflow;

            Y2 := FHeight-Y1-1;
            DIB_VLine(Fx1, Y2, Y1);

            if (Y1 < FEffectTop) then
            begin
               DIB_SetColor(rEffectClr);
               DIB_VLine(Fx1,Y1,Y1+5);
               DIB_VLine(Fx1,Y2,Y2-5);
            end
            else if (Y1 > FEffectBottom) then
            begin
               DIB_SetColor(rEffectClr);
               DIB_VLine(Fx1,Y1,Y1-5);
               DIB_VLine(Fx1,Y2,Y2+5);
            end;
         end
         else if (FEffect = efSplit) then
         begin
            Value := FData^[i];
            if abs(FData^[i+1]) > abs(Value) then Value := FData^[i+1];
            if Value >= 32767 then PcmOverflow;
            Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
            if (Y1 > FHeight) then GainOverflow;

            if (Y1 < FEffectBottom) then
            begin
               DIB_SetColor(rEffectClr);
               DIB_VLine(Fx1, FMiddle, Y1);
               DIB_SetColor(rForeClr);
               DIB_VLine(Fx1, FMiddle, FHeight-Y1-1);
            end
            else
            begin
               DIB_SetColor(rForeClr);
               DIB_VLine(Fx1, FMiddle, Y1);
               DIB_SetColor(rEffectClr);
               DIB_VLine(Fx1, FMiddle, FHeight-Y1-1);
            end;
         end;
      end
      else
      begin
         DIB_SetColor(rInactClr);
         if (FEffect = efNone) then
         begin
            DIB_HLine(0, FMarkBegin, FMiddle);
            DIB_HLine(0, FMarkBegin, FMiddle-1);
            DIB_SetColor(rForeClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle-1);
            DIB_SetColor(rInactClr);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle-1);
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
               if (Y1 > FHeight) then GainOverflow;

               if i > FMarkEnd then DIB_SetColor(rInactClr)
               else if i >= FMarkBegin then DIB_SetColor(rForeClr);

               DIB_VLine(i, FHeight-Y1-1, Y1);
               inc(i,FSteps);
            end;
         end
         else if (FEffect = efPeak) then
         begin
            DIB_HLine(0, FMarkBegin, FMiddle);
            DIB_HLine(0, FMarkBegin, FMiddle-1);
            DIB_SetColor(rForeClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle-1);
            DIB_SetColor(rInactClr);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle-1);
            aColor := rInactClr;
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
               if (Y1 > FHeight) then GainOverflow;

               if i > FMarkEnd then aColor := rInactClr
               else if i >= FMarkBegin then aColor := rForeClr;

               Y2 := FHeight-Y1-1;
               DIB_SetColor(aColor);
               DIB_VLine(i, Y2, Y1);

               if (aColor = rForeClr) then
               begin
                  if (Y1 < FEffectTop) then
                  begin
                     DIB_SetColor(rEffectClr);
                     DIB_VLine(i,Y1,Y1+5);
                     DIB_VLine(i,Y2,Y2-5);
                  end
                  else if (Y1 > FEffectBottom) then
                  begin
                     DIB_SetColor(rEffectClr);
                     DIB_VLine(i,Y1,Y1-5);
                     DIB_VLine(i,Y2,Y2+5);
                  end;
               end;
               inc(i,FSteps);
            end;
         end
         else if (FEffect = efSplit) then
         begin
            DIB_HLine(0, FMarkBegin, FMiddle);
            DIB_HLine(0, FMarkBegin, FMiddle-1);
            DIB_SetColor(rForeClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle);
            DIB_SetColor(rEffectClr);
            DIB_HLine(FMarkBegin, FMarkEnd+1, FMiddle-1);
            DIB_SetColor(rInactClr);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle);
            DIB_HLine(FMarkEnd+1, FWidth, FMiddle-1);
            aColor := rInactClr;
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := Long(Value * FGain div 8 + FCenter)* FHeight div FRange;
               if (Y1 > FHeight) then GainOverflow;

               if i > FMarkEnd then aColor := rInactClr
               else if i >= FMarkBegin then aColor := rForeClr;

               if (aColor = rForeClr) then
               begin
                  if (Y1 < FEffectBottom) then
                  begin
                     DIB_SetColor(rEffectClr);
                     DIB_VLine(i, FMiddle, Y1);
                     DIB_SetColor(aColor);
                     DIB_VLine(i, FMiddle, FHeight-Y1-1);
                  end
                  else
                  begin
                     DIB_SetColor(aColor);
                     DIB_VLine(i, FMiddle, Y1);
                     DIB_SetColor(rEffectClr);
                     DIB_VLine(i, FMiddle, FHeight-Y1-1);
                  end;
               end
               else
               begin
                  DIB_SetColor(aColor);
                  DIB_VLine(i, FMiddle, Y1);
                  DIB_VLine(i, FMiddle, FHeight-Y1-1);
               end;
               inc(i,FSteps);
            end;
         end;
      end;
   end;
end;

{-- TMMOscope ------------------------------------------------------------}
Procedure TMMOscope.DrawAsSpikes;
Var
   i,Y1: integer;
   aColor: Long;
   rForeClr: Long;
   rInactClr: Long;
   rEffectClr: Long;
   Value: Longint;

begin
   with DIBCanvas do
   begin
      rForeClr := DIB_ColorToIndex(FForeColor);
      rInactClr := DIB_ColorToIndex(FInactColor);
      rEffectClr := DIB_ColorToIndex(FEffectColor);
      i := 0;
      if FScroll then
      begin
         DIB_SetTColor(Color);
         DIB_VLine(Fx1,0,FHeight);
         DIB_SetColor(rForeClr);
         if (FEffect = efNone) then
         begin
            Value := abs(FData^[i]);
            if abs(FData^[i+1]) > Value then Value := abs(FData^[i+1]);
            if Value >= 32767 then PcmOverflow;

            Y1 := FHeight-(Long(Word(Value)* Long(FGain) div 8 + FCenter)* FHeight div FRange)-1;
            if (Y1 < -1) then GainOverflow;

            DIB_VLine(Fx1, FHeight, Y1);
         end
         else if(FEffect = efPeak) then
         begin
            Value := abs(FData^[i]);
            if abs(FData^[i+1]) > Value then Value := abs(FData^[i+1]);
            if Value >= 32767 then PcmOverflow;
            Y1 := FHeight-(Long(Word(Value)* Long(FGain) div 8 + FCenter)* FHeight div FRange)-1;
            if (Y1 < -1) then GainOverflow;

            DIB_VLine(Fx1, FHeight, Y1);

            if (Y1 < FEffectTop shl 1) then
            begin
               DIB_SetColor(rEffectClr);
               DIB_VLine(Fx1, Y1, Y1+5);
            end;
         end
         else
         begin
            for i := 0 to 1 do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := Long(Word(ABS(Value))* Long(FGain) div 8 + FCenter)* FHeight div FRange;
               if (Y1 > FHeight) then GainOverflow;

               if (Y1 > FEffectBottom) then
               begin
                  DIB_SetColor(rEffectClr);
                  DIB_VLine(Fx1, FMiddle, FHeight-Y1-1);
                  DIB_SetColor(rForeClr);
                  DIB_VLine(Fx1, FHeight, FMiddle);
               end
               else DIB_VLine(Fx1, FHeight, FHeight-Y1-1);
            end;
         end;
      end
      else
      begin
         DIB_SetColor(rInactClr);
         if (FEffect = efNone) then
         begin
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := FHeight-(Long(Word(ABS(Value))* Long(FGain) div 8 + FCenter)* FHeight div FRange)-1;
               if (Y1 < -1) then GainOverflow;

               if i > FMarkEnd then DIB_SetColor(rInactClr)
               else if i >= FMarkBegin then DIB_SetColor(rForeClr);

               DIB_VLine(i, FHeight, Y1);
               inc(i,FSteps);
            end;
         end
         else if(FEffect = efPeak) then
         begin
            aColor := rInactClr;
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := FHeight-(Long(Word(ABS(Value))* Long(FGain) div 8 + FCenter)* FHeight div FRange)-1;
               if (Y1 < -1) then GainOverflow;

               if i > FMarkEnd then aColor := rInactClr
               else if i >= FMarkBegin then aColor := rForeClr;

               DIB_SetColor(aColor);
               DIB_VLine(i, FHeight, Y1);

               if (aColor = rForeClr) and (Y1 < FEffectTop shl 1) then
               begin
                  DIB_SetColor(rEffectClr);
                  DIB_VLine(i, Y1, Y1+5);
               end;
               inc(i,FSteps);
            end;
         end
         else
         begin
            aColor := rInactClr;
            while i < FWidth do
            begin               { display lines by plotting samples in FData.}
               Value := FData^[i];
               if Value >= 32767 then PcmOverflow;
               Y1 := Long(Word(ABS(Value))* Long(FGain) div 8 + FCenter)* FHeight div FRange;
               if (Y1 > FHeight) then GainOverflow;

               if i > FMarkEnd then aColor := rInactClr
               else if i >= FMarkBegin then aColor := rForeClr;

               if (aColor = rForeClr) and (Y1 > FEffectBottom) then
               begin
                  DIB_SetColor(rEffectClr);
                  DIB_VLine(i, FMiddle, FHeight-Y1-1);
                  DIB_SetColor

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -