Beispiel #1
0
        private void ShowBullsEyes(Graphics xgr, SizeF size)
        {
            //EmergingBoolChord = new bool[12];
            //* show bullseye countdown using nudLookAhead
            //int lookahead = (int)nudLookAhead.Value;
            if (LookAhead == 0)
            {
                return;
            }
            clsMTime.clsBBT bbt = P.F.CurrentBBT.Copy();
            //int qi = bbt.Ticks / P.F.TicksPerQI;
            //bool[] currentchord = P.F.CF.NoteMap[qi];
            bool[] currentchord = ActiveBoolChordCF;

            for (int i = 0; i < LookAhead; i++)
            {
                bbt.NextBeat();
                if (bbt.Ticks >= P.F.MaxBBT.Ticks)
                {
                    break;
                }
                int qi = bbt.Ticks / P.F.TicksPerQI;
                //bool[] newchord = P.F.CF.NoteMap[qi];
                bool[] newchord = P.F.CF.NoteMap.GetBoolChord(qi, eKBTrans.Add);
                if (newchord.SequenceEqual(currentchord))
                {
                    continue;
                }

                if (!picPC_indMouseDown)
                {
                    int innerradius = (i == 0) ?
                                      Radius : ((2 * LookAhead - 1 - i) * Radius) / (2 * LookAhead);
                    int   innerdiameter = 2 * innerradius;
                    SizeF innersize     = new SizeF(innerdiameter, innerdiameter);
                    for (int y = 0; y < XYPC.Count; y++)
                    {
                        for (int x = 0; x < XYPC[y].Count; x++)
                        {
                            clsXYPC xypc = XYPC[y][x];
                            //* compare without kbtrans applied
                            //int pc = (xypc.PC - P.frmSC.Play.TransposeKB).Mod12();
                            PointF     innerloc   = new PointF(xypc.XPos - innerradius, xypc.YPos - innerradius);
                            RectangleF innerrectf = new RectangleF(innerloc, innersize);
                            if (currentchord[xypc.PC] && !newchord[xypc.PC]) //pc only in current chord
                            {
                                xgr.FillEllipse(P.ColorsTonnetz["Old Active Node"].Br, innerrectf);
                            }
                            else if (!currentchord[xypc.PC] && newchord[xypc.PC]) //pc only in new chord
                            {
                                xgr.FillEllipse(P.ColorsTonnetz["New Active Node"].Br, innerrectf);
                            }
                        }
                    }
                    break;
                }
            }
        }
Beispiel #2
0
 private void GetActiveNotes()
 {
     //* called from ShowNode()
     Active = new bool[Depth][];
     if (P.F.CF == null)
     {
         return;
     }
     clsMTime.clsBBT bbt = P.F.CurrentBBT.Copy();
     //for (int i = 0; i < (int)nudLookAhead.Value; i++) bbt.NextBeat();
     for (int d = 0; d < Depth; d++)
     {
         int qi = bbt.Ticks / P.F.TicksPerQI;
         Active[d] = P.F.CF.NoteMap[qi];
         bbt.NextBeat();
         if (bbt.Ticks >= P.F.MaxTicks)
         {
             break;
         }
     }
 }
Beispiel #3
0
        private void ShowBullsEyes(Graphics xgr, SizeF size)
        {
            //* show bullseye countdown using nudLookAhead
            clsMTime.clsBBT bbt = P.F.CurrentBBT.Copy();
            int             qi  = bbt.Ticks / P.F.TicksPerQI;

            bool[] currentchord = P.F.CF.NoteMap[qi];
            int    lookahead    = (int)nudLookAhead.Value;

            for (int i = 0; i < lookahead; i++)
            {
                bbt.NextBeat();
                if (bbt.Ticks >= P.F.MaxTicks)
                {
                    break;
                }
                qi = bbt.Ticks / P.F.TicksPerQI;
                bool[] chord = P.F.CF.NoteMap[qi];
                if (chord.SequenceEqual(currentchord))
                {
                    continue;
                }
                if (chord.SequenceEqual(NullBoolChord))
                {
                    continue;
                }

                //* draw bullseyes
                int outerradius   = Radius + lookahead * (int)nudBeatWidth.Value;
                int outerdiameter = 2 * outerradius;
                for (int y = 0; y < XYPC.Count; y++)
                {
                    for (int x = 0; x < XYPC[y].Count; x++)
                    {
                        clsXYPC xypc = XYPC[y][x];
                        if (!chord[xypc.PC])
                        {
                            continue;       //only show if in new chord
                        }
                        int innerradius   = Radius + i * (int)nudBeatWidth.Value;
                        int innerdiameter = innerradius * 2;

                        PointF     outerloc   = new PointF(xypc.XPos - outerradius, xypc.YPos - outerradius);
                        SizeF      outersize  = new SizeF(outerdiameter, outerdiameter);
                        RectangleF outerrectf = new RectangleF(outerloc, outersize);

                        PointF     innerloc   = new PointF(xypc.XPos - innerradius, xypc.YPos - innerradius);
                        SizeF      innersize  = new SizeF(innerdiameter, innerdiameter);
                        RectangleF innerrectf = new RectangleF(innerloc, innersize);

                        GraphicsPath path = new GraphicsPath();
                        path.AddEllipse(innerrectf);
                        Region region = new Region(path);
                        xgr.ExcludeClip(region);
                        xgr.FillEllipse(BullsEyeBrush, outerrectf);
                        xgr.ResetClip();
                    }
                }
                break;
            }
        }