Ejemplo n.º 1
0
        public void VerifyWithCallback(Session session, FingerPosition position)
        {
            WinBiometric.Verified -= Verified;
            WinBiometric.Verified += Verified;

            WinBiometric.VerifyWithCallback(session, position);
        }
Ejemplo n.º 2
0
        public bool AdvanceFrets(int nFrets)
        {
            if (!FingerPosition.AdvanceFrets(nFrets))
            {
                return(false);
            }

            if (nFrets > 0)
            {
                if (FingerPosition.Fret + FingerPosition.SameNoteFretDifferenceOnString(FingerPosition.String, FingerPosition.String + 1) >= 0)
                {
                    if (!FingerPosition.NextString())
                    {
                        return(FingerPosition.PreviousOctave());
                    }
                }
            }
            else
            {
                if (FingerPosition.Fret % FingerPosition.SameNoteFretDifferenceOnString(FingerPosition.String, FingerPosition.String - 1) == 0)
                {
                    // Can fail.
                    FingerPosition.PreviousString();
                }
            }

            int nCurrNote   = (int)Note;
            int nNumOfNotes = (int)ENotes.NumberOfNotes;

            // Advance notes
            Note = ((nNumOfNotes + ((nCurrNote + nFrets) % nNumOfNotes)) % nNumOfNotes);

            return(true);
        }
 internal UnclaimedIdentifyEvent(uint unidId, FingerPosition fingerPosition, BiometricIdentity identity, RejectDetail rejectDetail)
 {
     this.UnidId         = unidId;
     this.FingerPosition = fingerPosition;
     this.Identity       = identity;
     this.RejectDetail   = rejectDetail;
 }
Ejemplo n.º 4
0
 public void GetProperty(Session session,
                         PropertyType propertyType,
                         PropertyId propertyId,
                         uint unitId,
                         BiometricIdentity identity,
                         FingerPosition position,
                         out byte[] propertyBuffer)
 {
     WinBiometric.GetProperty(session, propertyType, propertyId, unitId, identity, position, out propertyBuffer);
 }
        /// <summary>
        /// Initialize new instance of <see cref="FingerprintEnrollmentData"/> with pecific finger index <see cref="FingerPosition"/> and <see cref="BiometricSample"/>.
        /// </summary>
        /// <param name="position">Finger index.</param>
        /// <param name="samples">Collection of <see cref="BiometricSample"/> for specific finger.</param>
        public FingerprintEnrollmentData(FingerPosition position, IEnumerable <BiometricSample> samples)
            : this(position)
        {
            if (samples == null)
            {
                throw new ArgumentNullException("samples");
            }

            Samples = samples.ToArray();
        }
Ejemplo n.º 6
0
    public GameObject GetFingerPosition(int id)
    {
        int length = m_fingerObject.Count;

        for (int i = 0; i < length; i++)
        {
            FingerPosition script   = m_fingerObject[i].GetComponent <FingerPosition>();
            int            fingerId = script.GetFingerId();
            if (fingerId == id)
            {
                return(m_fingerObject[i]);
            }
        }
        return(null);
    }
Ejemplo n.º 7
0
        public static Fingering CreateFingeringFor(this FingerboardInstrument instrument, Melody piece, ISelectValue randomness)
        {
            var notes = piece.Notes;

            var fingering = new Fingering();

            foreach (Note p in notes)
            {
                var possibleAlternatives = instrument.PositionsFor(p);

                int            randomIndex = randomness.BetweenZeroAnd(possibleAlternatives.Count - 1);
                FingerPosition selected    = possibleAlternatives[randomIndex];

                fingering.Add(new FingerPosition(selected.Fret, selected.String));
            }

            return(fingering);
        }
Ejemplo n.º 8
0
        private void FingerprintOkButton_Click(object sender, RoutedEventArgs e)
        {
            if (fingerprintImage == null)
            {
                return;
            }

            FingerPosition position = FingerPosition.Unknown;

            if (FingerprintPosition.SelectedIndex >= 0)
            {
                position = (FingerPosition)(FingerprintPosition.SelectedIndex + 1);
            }
            credential = Credential.Create(new FingerprintEnrollmentData(position, fingerprintEnrollmentData));

            DialogResult = true;
            Close();
        }
Ejemplo n.º 9
0
 public void DesktopInput()
 {
     if (Input.GetMouseButtonDown(0))
     {
         Vector3    mousePositionOnNearPlane = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_fieldPositionZ));
         GameObject newObject = (GameObject)Instantiate(m_fingerPosition, mousePositionOnNearPlane, Quaternion.identity);
         m_fingerObject.Add(newObject);
     }
     else if (Input.GetMouseButton(0))
     {
         Vector3        mousePositionOnNearPlane = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, m_fieldPositionZ));
         GameObject     oldObject = m_fingerObject[0];
         FingerPosition script    = oldObject.GetComponent <FingerPosition>();
         script.SetPosition(mousePositionOnNearPlane);
     }
     else if (Input.GetMouseButtonUp(0))
     {
         Destroy(m_fingerObject[0]);
         m_fingerObject.RemoveAt(0);
     }
 }
Ejemplo n.º 10
0
        public override int UnpackReceivedMessage()
        {
            int index = 0;

            UnpackDuties(ref index);                                                                   // Message Type

            int fingerAmount = Convert.ToInt32(MobileControlPackHelper.UnpackByte(_bytes, ref index)); // Amount of fingers on the touch display

            fingerPositions = new List <FingerPosition>(fingerAmount);
            for (int ii = 0; ii < fingerAmount; ++ii)
            {
                FingerPosition fingerPos = new FingerPosition();
                fingerPos.fingerID = Convert.ToInt32(MobileControlPackHelper.UnpackByte(_bytes, ref index)); // Current Finger ID
                fingerPos.xPos     = MobileControlPackHelper.UnpackFloat(_bytes, ref index);                 // Current Finger xPos
                fingerPos.yPos     = MobileControlPackHelper.UnpackFloat(_bytes, ref index);                 // Current Finger yPos

                fingerPositions.Add(fingerPos);
            }

            return(index);
        }
Ejemplo n.º 11
0
    public void MobileInput()
    {
        int length = Input.touchCount;

        for (int i = 0; i < length && i < m_fingerNumber; i++)
        {
            int     id = Input.touches[i].fingerId;
            Vector3 mousePositionOnNearPlane = Camera.main.ScreenToWorldPoint(new Vector3(Input.touches[i].position.x, Input.touches[i].position.y, m_fieldPositionZ));

            //開始觸碰
            if (Input.touches[i].phase == TouchPhase.Began)
            {
                GameObject     newObject = (GameObject)Instantiate(m_fingerPosition, mousePositionOnNearPlane, Quaternion.identity);
                FingerPosition script    = newObject.GetComponent <FingerPosition>();
                script.SetFingerId(Input.touches[i].fingerId);
                m_fingerObject.Add(newObject);
            }
            else if (Input.touches[i].phase == TouchPhase.Moved)
            {
                GameObject oldObject = GetFingerPosition(id);
                if (oldObject != null)
                {
                    FingerPosition script = oldObject.GetComponent <FingerPosition>();
                    script.SetPosition(mousePositionOnNearPlane);
                }
            }

            //手指離開螢幕
            if (Input.touches[i].phase == TouchPhase.Ended || Input.touches[i].phase == TouchPhase.Canceled)
            {
                GameObject oldObject = GetFingerPosition(id);
                if (oldObject != null)
                {
                    Destroy(oldObject);
                    m_fingerObject.Remove(oldObject);
                }
            }
        }
        Debug.Log(m_fingerObject.Count);
    }
Ejemplo n.º 12
0
 public void BeginEnroll(Session session, FingerPosition position, uint unitId)
 {
     WinBiometric.BeginEnroll(session, position, unitId);
 }
 internal FingerprintEnrollmentData(FingerPosition position)
 {
     Position = position;
 }
Ejemplo n.º 14
0
 public VerifyResult Verify(Session session, FingerPosition position)
 {
     return(WinBiometric.Verify(session, position));
 }
Ejemplo n.º 15
0
        public void DeleteTemplate(Session session, uint unitId, BiometricIdentity identity, FingerPosition position)
        {
            if (identity == null)
            {
                throw new ArgumentNullException(nameof(identity));
            }

            WinBiometric.DeleteTemplate(session, unitId, identity, position);
        }
Ejemplo n.º 16
0
 public bool NextString()
 {
     return(FingerPosition.NextString());
 }
Ejemplo n.º 17
0
 internal IdentifyResult(uint unitId, HRESULT operationStatus, BiometricIdentity identity, FingerPosition fingerPosition, RejectDetail rejectDetail)
 {
     this.UnitId          = unitId;
     this.OperationStatus = operationStatus;
     this.Identity        = identity;
     this.FingerPosition  = fingerPosition;
     this.RejectDetail    = rejectDetail;
 }
Ejemplo n.º 18
0
 public bool PreviousString()
 {
     return(FingerPosition.PreviousString());
 }