Exemplo n.º 1
0
 void OnEndKey()
 {
     lock (this) {
         if (_state == BeatState.Running)
         {
             StopCapture(true);
             _state = BeatState.Idle;
         }
     }
 }
Exemplo n.º 2
0
        public BeatState[] GetLoopState()
        {
            BeatState[] ret = new BeatState[this.BeatCount];

            for (int i = 0; i < this.BeatCount; i++)
            {
                ret[i] = Beats[i].State;
            }

            return(ret);
        }
Exemplo n.º 3
0
 void OnBeatKey()
 {
     lock (this) {
         if (_state == BeatState.Idle) {
             StartCapture();
             _state = BeatState.FirstBeat;
         }
         if (_state == BeatState.FirstBeat) {
             _state = BeatState.Running;
         }
         _tickList.Add(_tracker.CurrentTime);
     }
 }
Exemplo n.º 4
0
 void OnBeatKey()
 {
     lock (this) {
         if (_state == BeatState.Idle)
         {
             StartCapture();
             _state = BeatState.FirstBeat;
         }
         if (_state == BeatState.FirstBeat)
         {
             _state = BeatState.Running;
         }
         _tickList.Add(_tracker.CurrentTime);
     }
 }
Exemplo n.º 5
0
 void PeriodicCancelThread()
 {
     while (true)
     {
         lock (this) {
             if (_state == BeatState.Running &&
                 (_tracker.CurrentTime - _tickList.Last()) > 2000 * 10000
                 )
             {
                 StopCapture(false);
                 _state = BeatState.Idle;
             }
         }
         Thread.Sleep(1000);
     }
 }
        /// <summary>
        /// Sets the selection state of the beat.
        /// </summary>
        /// <param name="state">State to set the beat as</param>
        private void SetBeatState(BeatState state)
        {
            switch (state)
            {
            case BeatState.None:
                hovered = hovered == this ? null : hovered;
                outerRectangle.Opacity = 0.3;
                break;

            case BeatState.Hovering:
                hovered = this;
                outerRectangle.Opacity = 0.5;
                break;

            case BeatState.Grab:
                outerRectangle.Opacity = 0.6;
                break;
            }
        }
Exemplo n.º 7
0
        private void Track_BeatCountChanged(object sender, EventArgs e)
        {
            BeatState[] states = this.beatLoop.GetLoopState();

            BeatState[] newstates = new BeatState[this.BeatCount];
            if (states.Length <= newstates.Length)
            {
                Array.Copy(states, 0, newstates, 0, states.Length);
                for (int i = states.Length; i < newstates.Length; ++i)
                {
                    newstates[i] = BeatState.Off;
                }
            }
            else
            {
                Array.Copy(states, 0, newstates, 0, newstates.Length);
            }

            this.beatLoop.BeatCount = this.BeatCount;
            this.beatLoop.SetLoopState(newstates);
            this.SetupSliders();
        }
Exemplo n.º 8
0
 void PeriodicCancelThread()
 {
     while (true) {
         lock (this) {
             if (_state == BeatState.Running &&
                 (_tracker.CurrentTime - _tickList.Last()) > 2000 * 10000
             ) {
                 StopCapture(false);
                 _state = BeatState.Idle;
             }
         }
         Thread.Sleep(1000);
     }
 }
Exemplo n.º 9
0
 void OnEndKey()
 {
     lock(this) {
         if (_state == BeatState.Running) {
             StopCapture(true);
             _state = BeatState.Idle;
         }
     }
 }
Exemplo n.º 10
0
 private void InitializeObjectBasedOnBeat(Beat BeatObjReference)
 {
     SpawnPosition     = BeatObjReference.transform.position;
     CurrentBeatStatus = BeatObjReference.Status;
 }