Ejemplo n.º 1
0
        private VlcMedia(IntPtr pointer)
        {
            InstancePointer = pointer;
            EventManager    = new VlcEventManager(GetEventManagerFunction.Delegate(InstancePointer));

            onMetaChanged     = OnMetaChanged;
            onSubItemAdded    = OnSubItemAdded;
            onDurationChanged = OnDurationChanged;
            onParsedChanged   = OnParsedChanged;
            onFreed           = OnFreed;
            onStateChanged    = OnStateChanged;

            onMetaChangedHandle     = GCHandle.Alloc(onMetaChanged);
            onSubItemAddedHandle    = GCHandle.Alloc(onSubItemAdded);
            onDurationChangedHandle = GCHandle.Alloc(onDurationChanged);
            onParsedChangedHandle   = GCHandle.Alloc(onParsedChanged);
            onFreedHandle           = GCHandle.Alloc(onFreed);
            onStateChangedHandle    = GCHandle.Alloc(onStateChanged);

            HandleManager.Add(this);

            EventManager.Attach(Interop.Core.Events.EventTypes.MediaMetaChanged, onMetaChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaSubItemAdded, onSubItemAdded, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaDurationChanged, onDurationChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaParsedChanged, onParsedChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaFreed, onFreed, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaStateChanged, onStateChanged, IntPtr.Zero);
        }
Ejemplo n.º 2
0
        private VlcMedia(IntPtr pointer)
        {
            InstancePointer = pointer;
            EventManager = new VlcEventManager(GetEventManagerFunction.Delegate(InstancePointer));

            onMetaChanged = OnMetaChanged;
            onSubItemAdded = OnSubItemAdded;
            onDurationChanged = OnDurationChanged;
            onParsedChanged = OnParsedChanged;
            onFreed = OnFreed;
            onStateChanged = OnStateChanged;

            onMetaChangedHandle = GCHandle.Alloc(onMetaChanged);
            onSubItemAddedHandle = GCHandle.Alloc(onSubItemAdded);
            onDurationChangedHandle = GCHandle.Alloc(onDurationChanged);
            onParsedChangedHandle = GCHandle.Alloc(onParsedChanged);
            onFreedHandle = GCHandle.Alloc(onFreed);
            onStateChangedHandle = GCHandle.Alloc(onStateChanged);

            HandleManager.Add(this);

            EventManager.Attach(Interop.Core.Events.EventTypes.MediaMetaChanged, onMetaChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaSubItemAdded, onSubItemAdded, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaDurationChanged, onDurationChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaParsedChanged, onParsedChanged, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaFreed, onFreed, IntPtr.Zero);
            EventManager.Attach(Interop.Core.Events.EventTypes.MediaStateChanged, onStateChanged, IntPtr.Zero);
        }