Пример #1
0
        public string PeekXbox(uint offset, PeekType type)
        {
            switch (type)
            {
            case PeekType.String:
                return(ReadString(offset));

            case PeekType.Float:
                return(GetMemory(offset, 10).ToString());

            case PeekType.Double:
                return(ReadDouble(offset).ToString("X"));

            case PeekType.Short:
                return(ReadInt16(offset).ToString("X"));

            case PeekType.Byte:
                return(ReadByte(offset).ToString("X"));

            case PeekType.Long:
                return(ReadInt32(offset).ToString("X"));

            case PeekType.Quad:
                return(ReadInt64(offset).ToString("X"));

            default:
                return(null);
            }
        }
Пример #2
0
        /// <summary>
        /// Retrieves a symbol that meats specific requirements and is relative to specific symbol.
        /// </summary>
        /// <typeparam name="TSymbol">Type of symbol</typeparam>
        /// <param name="relativeTo"></param>
        /// <param name="peekType"></param>
        /// <returns></returns>
        public TSymbol Peek <TSymbol>(MusicalSymbol relativeTo, PeekType peekType) where TSymbol : MusicalSymbol
        {
            PeekStrategy <TSymbol> strategy;

            switch (peekType)
            {
            case PeekType.BeginningOfMeasure:
                strategy = new BeginningOfMeasurePeekStrategy <TSymbol>(this);
                break;

            case PeekType.BeginningOfTuplet:
                strategy = new BeginningOfTupletPeekStrategy <TSymbol>(this);
                break;

            case PeekType.EndOfTuplet:
                strategy = new EndOfTupletPeekStrategy <TSymbol>(this);
                break;

            case PeekType.NextElement:
                strategy = new NextElementPeekStrategy <TSymbol>(this);
                break;

            case PeekType.PreviousElement:
                strategy = new PreviousElementPeekStrategy <TSymbol>(this);
                break;

            case PeekType.HighestNoteInChord:
                strategy = new HighestNoteInChordPeekStrategy <TSymbol>(this);
                break;

            default:
                throw new NotImplementedException("Peek type not implemented.");
            }
            return(strategy.Peek(relativeTo));
        }
Пример #3
0
		// NOTE: This is an implementation specific function. The library wrapper will implement
		//       the interface required by the standard.
		public char PeekChar(TextReader stream, PeekType peekType = PeekType.Normal, char targetChar = '\x00')
		{
			if (peekType == PeekType.SkipWhiteSpace)
				SkipWhile(stream, Char.IsWhiteSpace);
			else if (peekType == PeekType.TargetChar)
				SkipWhile(stream, c => c != targetChar);

			return (char) stream.Peek();
		}
Пример #4
0
        // NOTE: This is an implementation specific function. The library wrapper will implement
        //       the interface required by the standard.
        public char PeekChar(TextReader stream, PeekType peekType = PeekType.Normal, char targetChar = '\x00')
        {
            if (peekType == PeekType.SkipWhiteSpace)
            {
                SkipWhile(stream, Char.IsWhiteSpace);
            }
            else if (peekType == PeekType.TargetChar)
            {
                SkipWhile(stream, c => c != targetChar);
            }

            return((char)stream.Peek());
        }
Пример #5
0
 private static extern int navigator_card_peek(PeekType peek_type);
Пример #6
0
 public static bool RequestCardPeek(PeekType type)
 {
     if (!type.IsValidValue())
     {
         throw new ArgumentException("not a valid peek type.", "type");
     }
     Util.GetBPSOrException();
     return navigator_card_peek(type) == BPS.BPS_SUCCESS;
 }