Exemple #1
0
        public PlayHarpNoteClass CreateTakt(Control parent, AirSlotAttributesClass txt, HarpClass hc)
        {
            harpClass             = hc;
            slot                  = new PlayNoteButton();
            slot.Enabled          = true;
            slot.Parent           = parent;
            slot.BackColor        = Color.Bisque;
            slot.Font             = new Font("Consolas", 10, FontStyle.Bold);
            slot.TextAlign        = ContentAlignment.BottomLeft;
            slot.ToolTipActive    = false;
            slot.ToolTipText      = string.Empty;
            slot.Image            = null;
            slot.ImageHover       = null;
            slot.ImageAlign       = ContentAlignment.MiddleRight;
            slot.Width            = Statics.TabButtonWitdh;
            slot.Height           = Statics.PlayButtonHeight;
            slot.Text             = string.Empty;
            slot.BackColor        = Color.Gray;
            slot.BackColorHover   = slot.BackColor;
            slot.BorderColorHover = Color.Blue;
            slot.HoverStyle       = SeControlsLib.frameStyle.thickRectangle;
            slot.FlatStyle        = FlatStyle.Flat;
            slot.Tag              = txt;

            return(this);
        }
Exemple #2
0
        public void CreatePause(Control parent, HarpClass hc, AirSlotAttributesClass slot, string noteatt)
        {
            Image             img   = GetNoteImage(noteatt, slot.UnitLength);
            PlayHarpNoteClass aslot = new PlayHarpNoteClass().CreatePause(parent, slot, img, hc);

            Notes.Add(aslot.slot);
        }
Exemple #3
0
        public PlayHarpNoteClass CreatePause(Control parent, AirSlotAttributesClass txt, Image img, HarpClass hc)
        {
            harpClass             = hc;
            slot                  = new PlayNoteButton();
            slot.Enabled          = true;
            slot.Parent           = parent;
            slot.BackColor        = Color.Bisque;
            slot.Font             = new Font("Consolas", 10, FontStyle.Bold);
            slot.TextAlign        = ContentAlignment.BottomLeft;
            slot.ToolTipActive    = true;
            slot.ToolTipText      = $@"Note:{txt.NoteStr} ({txt.DelayStr}){Environment.NewLine}Slot:{txt.Slot}";
            slot.Width            = Statics.PlayButtonWitdh;
            slot.Height           = Statics.PlayButtonHeight;
            slot.Text             = txt.Slot.ToString();
            slot.Image            = img;
            slot.ImageHover       = img;
            slot.BackColor        = Color.LightGray;
            slot.Text             = "P";
            slot.BackColorHover   = slot.BackColor;
            slot.BorderColorHover = Color.Blue;
            slot.HoverStyle       = SeControlsLib.frameStyle.thickRectangle;
            slot.FlatStyle        = FlatStyle.Flat;
            slot.Tag              = txt;

            return(this);
        }
Exemple #4
0
        public void CreateTakt(Control parent, HarpClass hc, AirSlotAttributesClass slot, string noteatt)
        {
            Image             img   = null;
            var               hnc   = new PlayHarpNoteClass();
            PlayHarpNoteClass aslot = hnc.CreateTakt(parent, slot, hc);

            Notes.Add(aslot.slot);
        }
Exemple #5
0
        public void SetData(int slt)
        {
            List <AirSlotAttributesClass> slots = sq.GetSlotID(slt);

            if (slots.Count == 1)
            {
                slot = slots[0];
            }
        }
Exemple #6
0
 public bool UpdateSlotDatas(AirSlotAttributesClass datas)
 {
     try
     {
         //BsonMapper.Global.Entity<IdentityServer4.Models.IdentityResources.OpenId>().Id(oid => oid.Name);
         using (var db = new LiteDatabase(DatabaseName))
         {
             var dataobject = db.GetCollection <AirSlotAttributesClass>("datas");
             dataobject.EnsureIndex(x => x.Slot);
             dataobject.Update(datas);
             return(true);
         }
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemple #7
0
        public PlayHarpNoteClass CreateNote(Control parent, AirSlotAttributesClass txt, Image img, HarpClass hc)
        {
            harpClass          = hc;
            slot               = new PlayNoteButton();
            slot.Enabled       = true;
            slot.Parent        = parent;
            slot.BackColor     = Color.Bisque;
            slot.Font          = new Font("Consolas", 10, FontStyle.Bold);
            slot.TextAlign     = ContentAlignment.BottomLeft;
            slot.ToolTipActive = true;
            slot.ToolTipText   = $@"Note:{txt.NoteStr} ({txt.DelayStr}){Environment.NewLine}Slot:{txt.Slot}{Environment.NewLine}Delay:{txt.Delay}{Environment.NewLine}RefDelay:{txt.RefDelay}";
            slot.Width         = Statics.PlayButtonWitdh;
            slot.Height        = Statics.PlayButtonHeight;
            slot.Text          = txt.Slot.ToString();
            slot.Image         = img;
            slot.ImageHover    = img;

            if (txt.BreathDirection == eBreathDirection.blow)
            {
                slot.BackColor = Color.LightGreen;
            }
            else if (txt.BreathDirection == eBreathDirection.draw)
            {
                slot.BackColor = Color.LightSalmon;
            }
            else if (txt.BreathDirection == eBreathDirection.blowPushed)
            {
                slot.BackColor = Color.LightGreen;
                slot.ForeColor = Color.Yellow;
            }
            else if (txt.BreathDirection == eBreathDirection.drawPushed)
            {
                slot.BackColor = Color.LightSalmon;
                slot.ForeColor = Color.Yellow;
            }
            slot.BackColorHover   = slot.BackColor;
            slot.BorderColorHover = Color.Blue;
            slot.HoverStyle       = SeControlsLib.frameStyle.thickRectangle;
            slot.FlatStyle        = FlatStyle.Flat;
            slot.Tag        = txt;
            slot.MouseDown += Slot_MouseDown;
            slot.MouseUp   += Slot_MouseUp;
            return(this);
        }
Exemple #8
0
        /*
         * public void PlayOff(AirSlotAttributesClass HarpSlot, SimpleApi sa, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
         *  KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *  foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *  {
         *      if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot - notediff))
         *      {
         *          instrument = ins;
         *          break;
         *      }
         *  }
         *
         *  if (instrument.Value != null)
         *  {
         *      //sa.SetTranspose(transpose);
         *      byte playByte = instrument.Value.GetNoteByte();
         *
         *      sa.NoteOff(playByte);
         *  }
         * }
         */
        public void PlayOff(AirSlotAttributesClass HarpSlot, SimpleApi sa)
        {
            KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass>();

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
            {
                if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
                {
                    instrument = ins;
                    break;
                }
            }

            if (instrument.Value != null)
            {
                //sa.SetTranspose(transpose);
                byte playByte = instrument.Value.GetNoteByte();

                sa.NoteOff(playByte);
            }
        }
Exemple #9
0
        /*
         * public int GetHarpSlotnDiff(AirSlotAttributesClass HarpSlot, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = 0;
         *  if (this.Name != refHarpInstrument.Name)
         *  {
         *      //Referenzinstument ist diffeernt, es muß die R0wDiff errechnet werden
         *
         *      KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *      KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrumentRef = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *
         *      foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *      {
         *          if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
         *          {
         *              instrument = ins;
         *              break;
         *          }
         *      }
         *
         *      foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in refHarpInstrument.InstrumentNotesDefinition)
         *      {
         *          if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
         *          {
         *              instrumentRef = ins;
         *              break;
         *          }
         *      }
         *
         *      if (instrumentRef.Value != null && instrument.Value != null)
         *      {
         *          notediff = instrument.Value.NoteDiff - instrumentRef.Value.NoteDiff;
         *      }
         *  }
         *  return notediff;
         * }
         */
        /*
         * public byte Play(AirSlotAttributesClass HarpSlot, SimpleApi sa, HarpInstrumentClass refHarpInstrument)
         * {
         *  int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
         *  KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass>();
         *
         *  foreach (KeyValuePair<AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
         *  {
         *      if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot - notediff))
         *      {
         *          instrument = ins;
         *          break;
         *      }
         *  }
         *  byte playByte = 0;
         *
         *  if (instrument.Value != null)
         *  {
         *
         *      playByte = instrument.Value.GetNoteByte();
         *      //sa.SetTranspose(transpose);
         *      sa.NoteOn(playByte);
         *  }
         *  return playByte;
         * }
         */
        public byte Play(AirSlotAttributesClass HarpSlot, SimpleApi sa)
        {
            //int notediff = GetHarpSlotnDiff(HarpSlot, refHarpInstrument);
            KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> instrument = new KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass>();

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> ins in InstrumentNotesDefinition)
            {
                if ((ins.Key.BreathDirection == HarpSlot.BreathDirection) && (ins.Key.Slot == HarpSlot.Slot))
                {
                    instrument = ins;
                    break;
                }
            }
            byte playByte = 0;

            if (instrument.Value != null)
            {
                playByte = instrument.Value.GetNoteByte();
                //sa.SetTranspose(transpose);
                sa.NoteOn(playByte);
            }
            return(playByte);
        }
Exemple #10
0
        private void Slot_MouseDown(object sender, MouseEventArgs e)
        {
            AirSlotAttributesClass note = (AirSlotAttributesClass)this.slot.Tag;

            harpClass.Play(Math.Abs(note.Slot), note.BreathDirection, 1000);
        }