Ejemplo n.º 1
0
 /// <summary>Initializes a new instance of the <see cref="Notification"/> class.</summary>
 /// <param name="rawNotification">The raw notification.</param>
 internal unsafe Notification(RawNotification* rawNotification)
 {
     Type = rawNotification->Type;
     TimeStamp= rawNotification->TimeStamp;
 }
Ejemplo n.º 2
0
        private static unsafe void NotificationCallbackDelegateImpl(RawNotification* rawNotification)
        {
            if (rawNotification == (void*)0 || rawNotification->ContextPointer == IntPtr.Zero)
                return;

            var callback = (ManagedNotificationCallback)Marshal.GetDelegateForFunctionPointer(rawNotification->ContextPointer, typeof(ManagedNotificationCallback));

            switch (rawNotification->Type)
            {
                case NotificationType.CueDestroyed:
                case NotificationType.CuePlay:
                case NotificationType.CuePrepared:
                case NotificationType.CueStop:
                    callback(new CueNotification(rawNotification));
                    break;
                case NotificationType.WaveBankDestroyed:
                case NotificationType.WaveBankPrepared:
                case NotificationType.WaveBankStreamingInvalidContent:
                    callback(new WaveBankNotification(rawNotification));
                    break;
                case NotificationType.WaveDestroyed:
                case NotificationType.WaveLooped:
                case NotificationType.WavePlay:
                case NotificationType.WavePrepared:
                case NotificationType.WaveStop:
                    callback(new WaveNotification(rawNotification));
                    break;
                case NotificationType.Marker:
                    callback(new MarkerNotification(rawNotification));
                    break;
                case NotificationType.GuiConnected:
                case NotificationType.GuiDisconnected:
                    callback(new GuiNotification(rawNotification));
                    break;
                case NotificationType.GlobalVariableChanged:
                case NotificationType.LocalVariableChanged:
                    callback(new VariableNotification(rawNotification));
                    break;
                case NotificationType.SoundBankDestroyed:
                    callback(new SoundBankNotification(rawNotification));
                    break;
            }
        }