public SndListResource(IntPtr pSLR) : this() { if (pSLR == IntPtr.Zero) return; format = Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); numModifiers = Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); modifierPart = new QuickTimeAPI.ModRef[numModifiers]; for (int nModifierIndx = 0; numModifiers > nModifierIndx; nModifierIndx++) { modifierPart[nModifierIndx].modNumber = (ushort)Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); modifierPart[nModifierIndx].modInit = Marshal.ReadInt32(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 4); } numCommands = Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); commandPart = new SndCommand[numCommands]; for (int nCommandIndx = 0; numCommands > nCommandIndx; nCommandIndx++) { commandPart[nCommandIndx].cmd = (ushort)Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); commandPart[nCommandIndx].param1 = Marshal.ReadInt16(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 2); commandPart[nCommandIndx].param2 = Marshal.ReadInt32(pSLR); pSLR = (IntPtr)(pSLR.ToInt32() + 4); } enSoundHeaderType = SoundHeader.GetHeaderEncode(pSLR); switch(enSoundHeaderType) { case SoundHeaderType.Std: dataPart = new SoundHeader(pSLR); break; case SoundHeaderType.Cmp: dataPart = new CmpSoundHeader(pSLR); break; case SoundHeaderType.Ext: dataPart = new ExtSoundHeader(pSLR); break; } }
public SndListResource() { format = 0; numModifiers = 0; modifierPart = null; numCommands = 0; commandPart = null; enSoundHeaderType = SoundHeaderType.Std; dataPart = null; }