Njb.SongFrame.SongFrame C# (CSharp) Method

SongFrame() public method

public SongFrame ( IntPtr framePtr ) : System
framePtr System.IntPtr
return System
        public SongFrame(IntPtr framePtr)
        {
            if(framePtr == IntPtr.Zero) {
                throw new ApplicationException("Could not create SongFrame");
            }

            label = Utility.PtrToUtf8String(NJB_Glue_Song_Frame_Get_Label(framePtr));
            handle = framePtr;

            switch(NJB_Glue_Song_Frame_Get_Type(framePtr)) {
                case 0x00:
                    frameType = SongFrameType.String;
                    data_str = Utility.PtrToUtf8String(NJB_Glue_Song_Frame_Get_Data_String(framePtr));
                    break;
                case 0x02:
                    frameType = SongFrameType.UInt16;
                    data_short = NJB_Glue_Song_Frame_Get_Data_UInt16(framePtr);
                    break;
                case 0x03:
                    frameType = SongFrameType.UInt32;
                    data_int = NJB_Glue_Song_Frame_Get_Data_UInt32(framePtr);
                    break;
                default:
                    throw new ApplicationException("Unknown frame type");
            }
        }