Ejemplo n.º 1
0
        /// <summary>
        /// Fremde Notify Routinen werden der zentralen HarpNoties zugeordnet.
        /// </summary>
        /// <param name="notify"></param>

        /*
         * public void RegisterFormsInfoNotify(RaiseNotifyHandler notify)
         * {
         *  List<string> lst = HarpNotifies.Notify.GetInfoTargedList();
         *  if (lst.Contains(notify.Target.ToString())) return;
         *  HarpNotifies.Notify.OnRaiseInfoHandler -= notify;
         *  HarpNotifies.Notify.OnRaiseInfoHandler += notify;
         * }
         * public void RegisterFormsErrorNotify(RaiseNotifyHandler notify)
         * {
         *  List<string> lst = HarpNotifies.Notify.GetErrorTargedList();
         *  if (lst.Contains(notify.Target.ToString())) return;
         *  HarpNotifies.Notify.OnRaiseErrorHandler -= notify;
         *  HarpNotifies.Notify.OnRaiseErrorHandler += notify;
         *
         * }
         */
        public void SelectHarpByName(string name)
        {
            Harp harp = hc.Harps.Find(X => X.Name == name);

            hc.ActualHarpInstrument = HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(harp);
            soundAttributeForm.SetHarp(harp);
        }
Ejemplo n.º 2
0
        public void SetIntrument(SimpleApi saa, Instrument instrument, Harp harp)
        {
            harpIntrument = HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(harp);

            if (harpIntrument.InstrumentNotesDefinition.Count <= 0)
            {
                return;
            }

            var inn = harpIntrument.InstrumentNotesDefinition.Keys.Select(m => m).Where(kvp => kvp.BreathDirection == eBreathDirection.blow).Select(k => k.Slot).ToList();
        }
Ejemplo n.º 3
0
        private void LoadDatas(string fileName)
        {
            sq = new SQLDataClass(fileName);
            List <Harp> lst = sq.GetAll();

            dgvDATA.DataSource = lst;

            SetAirSlots(lst[0]);
            FormInstances.Instance().hc.AddHarps(lst);
            HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(lst[0]);
        }
Ejemplo n.º 4
0
        public void SaveInitialHarps(string fileName)
        {
            if (File.Exists(FormInstances.Instance().DatabaseFile))
            {
                File.Delete(FormInstances.Instance().DatabaseFile);
            }
            HarpInstrumentClass hi = HarpInstrumentFactory.SeydelDeLuxeSteelOrchestra(eKey.C_DUR);

            Harp ins = new Harp();
            List <AirSlotAttributesClass> airSlots = new List <AirSlotAttributesClass>();

            airSlots.AddRange(hi.InstrumentNotesDefinition.Keys);
            ins.AirSlots    = airSlots;
            ins.Name        = hi.Name;
            ins.Description = hi.Name;
            ins.Stamp       = DateTime.Now;
            ins.Key         = hi.Key;
            var sq = new SQLDataClass(fileName);

            sq.InsertDatas(ins);


            hi       = HarpInstrumentFactory.HohnerUnsereLieblinge(eKey.C_DUR);
            ins      = new Harp();
            airSlots = new List <AirSlotAttributesClass>();
            airSlots.AddRange(hi.InstrumentNotesDefinition.Keys);
            ins.AirSlots    = airSlots;
            ins.Name        = hi.Name;
            ins.Description = hi.Name;
            ins.Stamp       = DateTime.Now;
            ins.Key         = hi.Key;

            sq.InsertDatas(ins);

            hi       = HarpInstrumentFactory.ChroamticStandard(eKey.C_DUR);
            ins      = new Harp();
            airSlots = new List <AirSlotAttributesClass>();
            airSlots.AddRange(hi.InstrumentNotesDefinition.Keys);
            ins.AirSlots    = airSlots;
            ins.Name        = hi.Name;
            ins.Description = hi.Name;
            ins.Stamp       = DateTime.Now;
            ins.Key         = hi.Key;

            sq.InsertDatas(ins);
        }
Ejemplo n.º 5
0
        public int Create(Control parent, Control songTextControl, SimpleApi saa, Instrument instrument, Harp harp)
        {
            FormInstances.Instance().hc.ActualHarpInstrument = HarpInstrumentFactory.HarpDatabaeObject2HarpInstrument(harp);

            if (FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition.Count <= 0)
            {
                return(0);
            }

            var inn = FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition.Keys.Select(m => m).Where(kvp => kvp.BreathDirection == eBreathDirection.blow).Select(k => k.Slot).ToList();

            gb         = new GroupBox();
            gb.Parent  = parent;
            gb.Width   = (inn.Count + 1) * (Statics.SlotButtonWitdh + 2) + 16;
            gb.Height  = 500;
            gb.Left    = 8;
            gb.Top     = 16;
            gb.Text    = string.Empty; //harp.Name;
            gb.Dock    = DockStyle.Left;
            gb.Visible = true;
            //Für alle im Instrument definierten HarpSlotn wird die UI angelegt
            int witdh = 0;

            foreach (KeyValuePair <AirSlotAttributesClass, InstrumentsNotesClass> inf in FormInstances.Instance().hc.ActualHarpInstrument.InstrumentNotesDefinition)
            {
                if (inf.Key.BreathDirection == eBreathDirection.blow)
                {
                    witdh += 1;
                }
                AirSlotClass aslot = new AirSlotClass(gb, songTextControl, inf, FormInstances.Instance().sa);

                Slots.Add(aslot);
            }

            return((witdh * (Statics.SlotButtonWitdh + 2)) + 86);
        }