コード例 #1
0
 internal void CalcAxis(PianoProperties pprops, RollConfigures rconf)
 {
     if (_me.Y <= rconf.Const_TitleHeight && _me.Y >= 0)
     {
         _area = AreaType.Title;
     }
     else if (_me.X <= rconf.Const_RollWidth && _me.X >= 0)
     {
         _area = AreaType.Roll;
     }
     else
     {
         _area = AreaType.Track;
     }
     if (_area != AreaType.Title)
     {
         double drawed_noteSpt  = (double)(_me.Y - rconf.Const_TitleHeight) / rconf.Const_RollNoteHeight;
         uint   _noteNumber     = pprops.PianoTopNote - (uint)drawed_noteSpt;
         double cent            = 0.5 - drawed_noteSpt + (uint)drawed_noteSpt;
         int    _notePitchWheel = (int)Math.Round(cent * 0x2000, 0);
         _pitchvp            = new PitchAtomObject(_noteNumber, _notePitchWheel);
         _pitchvp.OctaveType = pprops.OctaveType;
     }
     if (_area != AreaType.Roll)
     {
         long drawed_pixel = _me.X - rconf.Const_RollWidth;
         _tick = (long)Math.Round((pprops.PianoStartTick + pprops.dertPixel2dertTick(drawed_pixel)), 0);
     }
 }
コード例 #2
0
 internal void CalcAxis(PianoProperties pprops, RollConfigures rconf, PianoMouseEventArgs cache)
 {
     if (cache != null && cache.MouseEventArgs.X == _me.X && cache.MouseEventArgs.Y == _me.Y)
     {
         _tick    = cache.Tick;
         _pitchvp = cache.PitchValue;
         _area    = cache.Area;
     }
     else
     {
         CalcAxis(pprops, rconf);
     }
 }
コード例 #3
0
 internal void CalcAxis(PianoProperties pprops, RollConfigures rconf, long windowheight)
 {
     if (_me.X <= rconf.Const_RollWidth && _me.X >= 0)
     {
         _area = AreaType.Btns;
     }
     else
     {
         _area = AreaType.Area;
     }
     if (_area != AreaType.Btns)
     {
         long drawed_pixel = _me.X - rconf.Const_RollWidth;
         _tick = (long)Math.Round((pprops.PianoStartTick + pprops.dertPixel2dertTick(drawed_pixel)), 0);
     }
     _tallPercent = CalcPercent(_me.Y, windowheight);
 }
コード例 #4
0
 internal void CalcAxis(PianoProperties pprops, RollConfigures rconf, ParamMouseEventArgs cache, long windowheight)
 {
     if (cache != null && cache.MouseEventArgs.X == _me.X && cache.MouseEventArgs.Y == _me.Y)
     {
         _tick = cache.Tick;
         _area = cache.Area;
         if (windowheight == cache.windowheight)
         {
             _tallPercent = cache._tallPercent;
         }
         else
         {
             _tallPercent       = CalcPercent(_me.Y, windowheight);
             cache._tallPercent = _tallPercent;
             cache.windowheight = windowheight;
         }
     }
     else
     {
         CalcAxis(pprops, rconf, windowheight);
     }
 }
コード例 #5
0
 internal PianoProperties(RollConfigures rconf)
 {
     BeatsCountPerSummery = 4;
     BeatType             = NoteType.Crotchet;
     this.rconf           = rconf;
 }