Exemple #1
0
        public static ToneEnum GetBaseToneFromMidiIndex(int aMidiIdx)
        {
            while (aMidiIdx > 11)
            {
                aMidiIdx -= 12;
            }
            ToneEnum result = ToneEnum.A;

            switch (aMidiIdx)
            {
            case 0:
                result = ToneEnum.C;
                break;

            case 1:
                result = ToneEnum.CSharpDFlat;
                break;

            case 2:
                result = ToneEnum.D;
                break;

            case 3:
                result = ToneEnum.DSharpEFlat;
                break;

            case 4:
                result = ToneEnum.E;
                break;

            case 5:
                result = ToneEnum.F;
                break;

            case 6:
                result = ToneEnum.FSharpGFlat;
                break;

            case 7:
                result = ToneEnum.G;
                break;

            case 8:
                result = ToneEnum.GSharpAFlat;
                break;

            case 9:
                result = ToneEnum.A;
                break;

            case 10:
                result = ToneEnum.ASharpBFlat;
                break;

            case 11:
                result = ToneEnum.B;
                break;
            }
            return(result);
        }
Exemple #2
0
        public static Color GetToneColor(ToneEnum aTone)
        {
            Color result = Color.black;

            switch (aTone)
            {
            case ToneEnum.A:
                result = HexToRGB(74, 1, 200);
                break;

            case ToneEnum.ASharpBFlat:
                result = HexToRGB(49, 49, 236);
                break;

            case ToneEnum.B:
                result = HexToRGB(3, 146, 206);
                break;

            case ToneEnum.C:
                result = HexToRGB(74, 176, 2);
                break;

            case ToneEnum.CSharpDFlat:
                result = HexToRGB(188, 217, 2);
                break;

            case ToneEnum.D:
                result = HexToRGB(247, 233, 0);
                break;

            case ToneEnum.DSharpEFlat:
                result = HexToRGB(242, 185, 12);
                break;

            case ToneEnum.E:
                result = HexToRGB(251, 153, 2);
                break;

            case ToneEnum.F:
                result = HexToRGB(253, 91, 19);
                break;

            case ToneEnum.FSharpGFlat:
                result = HexToRGB(238, 0, 0);
                break;

            case ToneEnum.G:
                result = HexToRGB(202, 0, 69);
                break;

            case ToneEnum.GSharpAFlat:
                result = HexToRGB(141, 29, 175);
                break;
            }
            return(result);
        }
Exemple #3
0
 public string GetValue(ToneEnum k)
 {
     foreach (KeyValuePair <ToneEnum, string> d in this.TONES)
     {
         if (d.Key == k)
         {
             return(d.Value);
         }
     }
     return(null);
 }
Exemple #4
0
 public string GetValue(ToneEnum k)
 {
     foreach (KeyValuePair<ToneEnum, string> d in this.TONES)
     {
         if (d.Key == k)
         {
             return d.Value;
         }
     }
     return null;
 }
Exemple #5
0
 public bool UISetValue(PropertyValueChangedEventArgs e)
 {
     bool r = false;
     if (this.mItemUseGlobal != null && e.ChangedItem.Label.Equals(this.mItemUseGlobal.Name))
     {
         this.UseGlobal = (bool)e.ChangedItem.Value;
     }
     else if (e.ChangedItem.Label.Equals(mItemTone.Name))
     {
         if (mToolStripButtonTestAudio != null)
         {
             mToolStripButtonTestAudio.Checked = false;
         }
         this.Tone = (ToneEnum)mItemTone.SelectedValue;
         r = true;
     }
     else if (e.ChangedItem.Label.Equals(mItemMp3.Name))
     {
         if (mToolStripButtonTestAudio != null)
         {
             mToolStripButtonTestAudio.Checked = false;
         }
         this.MP3 = (string)e.ChangedItem.Value;
         r = true;
     }
     return r;
 }
Exemple #6
0
 public void LoadConfig(IConfigSetting section)
 {
     IConfigSetting i = section[this.ID];
     this.UseGlobal = i["useglobal"].boolValue;
     if (this.UseGlobal == true)
     {
         return;
     }
     this.Tone = (ToneEnum)i["tone"].intValue;
     this.MP3 = i["mp3"].Value;
     this.mMute = i["mute"].boolValue;
 }
Exemple #7
0
 public TonePlayer()
 {
     mStop = false;
     mTone = ToneEnum.NONE;
 }
Exemple #8
0
 public TonePlayer()
 {
     mStop = false;
     mTone = ToneEnum.NONE;
 }