Beispiel #1
0
 private void LoadSettings()
 {
     this.EQSettings = XMLUTILS.LoadEqualizerSettings();
     this.SetUseEqualizer();
     this.SetUseStyle();
     this.SetUseSmoothEQ();
     this.SetDelayStart();
     this.SetShowTitle();
 }
 private void LoadSettings()
 {
   this.EQSettings = XMLUTILS.LoadEqualizerSettings();
   this.SetUseEqualizer();
   this.SetUseStyle();
   this.SetUseSmoothEQ();
   this.SetDelayStart();
   this.SetShowTitle();
 }
Beispiel #3
0
 public void DrawVerticalBarGraph(ref EQControl EQSettings, ref byte[] EqDataArray)
 {
   if (!((!this._isOpen | !this.commPort.IsOpen) | this._IsDisplayOff))
   {
     int num = (this.dSettings.Columns - EQSettings.Render_BANDS) / 2;
     if ((num > 0) & EQSettings.UseStereoEq)
     {
       num--;
     }
     if (EQSettings.UseStereoEq)
     {
       num = 1;
     }
     byte[] setLine = this._CommandSet.SetLine;
     byte[] packet = this._CommandSet.SetLine;
     byte[] buffer3 = this._CommandSet.SetLine;
     byte[] buffer4 = this._CommandSet.SetLine;
     int index = 2;
     if (this.dSettings.PacketFormat)
     {
       index = 3;
     }
     if (this.dSettings.Rows == 2)
     {
       setLine[index] = 1;
       packet[index] = 0;
     }
     else
     {
       setLine[index] = 3;
       packet[index] = 2;
       buffer3[index] = 1;
       buffer4[index] = 0;
     }
     index = 3;
     if (this.dSettings.PacketFormat)
     {
       index = 4;
     }
     for (int i = 0; i < 0x10; i++)
     {
       bool flag = true;
       if (EQSettings.UseStereoEq)
       {
         if ((i == 7) & (EQSettings.Render_BANDS == this.dSettings.Columns))
         {
           flag = false;
         }
         else if ((i == 15) & (EQSettings.Render_BANDS == this.dSettings.Columns))
         {
           flag = false;
         }
       }
       if (flag && (EqDataArray[1 + i] > 0))
       {
         if (this.dSettings.Rows == 2)
         {
           if (EqDataArray[1 + i] > 8)
           {
             packet[index + i] = (byte)(EqDataArray[1 + i] - 9);
           }
           else
           {
             packet[index + i] = 0x20;
             setLine[index + i] = (byte)(EqDataArray[1 + i] - 1);
           }
         }
         else if (EqDataArray[1 + i] > 0x18)
         {
           buffer4[index + i] = (byte)(EqDataArray[1 + i] - 0x19);
         }
         else if (EqDataArray[1 + i] > 0x10)
         {
           buffer4[index + i] = 0x20;
           buffer3[index + i] = (byte)(EqDataArray[1 + i] - 0x11);
         }
         else if (EqDataArray[1 + i] > 8)
         {
           buffer4[index + i] = 0x20;
           buffer3[index + i] = 0x20;
           packet[index + i] = (byte)(EqDataArray[1 + i] - 9);
         }
         else
         {
           buffer4[index + i] = 0x20;
           buffer3[index + i] = 0x20;
           packet[index + i] = 0x20;
           setLine[index + i] = (byte)(EqDataArray[1 + i] - 1);
         }
       }
     }
     if (this.dSettings.Rows == 4)
     {
       if (this.dSettings.PacketFormat)
       {
         this.Calc_CRC(ref buffer4, buffer4.Length);
         this.Calc_CRC(ref buffer3, buffer3.Length);
       }
       this.commPort.Write(buffer4, 0, buffer4.Length);
       this.commPort.Write(buffer3, 0, buffer3.Length);
     }
     if (this.dSettings.PacketFormat)
     {
       this.Calc_CRC(ref packet, packet.Length);
       this.Calc_CRC(ref setLine, setLine.Length);
     }
     this.commPort.Write(packet, 0, packet.Length);
     this.commPort.Write(setLine, 0, setLine.Length);
   }
 }