예제 #1
0
 public static void Remove(IVlcObject vlcObject)
 {
     if (HandleDic.ContainsKey(vlcObject.InstancePointer))
     {
         HandleDic.Remove(vlcObject.InstancePointer);
     }
 }
예제 #2
0
 public static void Remove(IVlcObject vlcObject)
 {
     if (HandleDic.ContainsKey(vlcObject.InstancePointer))
     {
         HandleDic.Remove(vlcObject.InstancePointer);
     }
 }
예제 #3
0
 public static void Add(IVlcObject vlcObject)
 {
     if (!HandleDic.ContainsKey(vlcObject.InstancePointer))
     {
         HandleDic.Add(vlcObject.InstancePointer, vlcObject);
     }
 }
예제 #4
0
        private VlcMedia(IVlcObject parentVlcObject, IntPtr pointer)
        {
            VlcInstance     = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            EventManager    = new VlcEventManager(this, _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(EventTypes.MediaMetaChanged, _onMetaChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaSubItemAdded, _onSubItemAdded, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaDurationChanged, _onDurationChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaParsedChanged, _onParsedChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaFreed, _onFreed, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaStateChanged, _onStateChanged, IntPtr.Zero);
        }
예제 #5
0
 public static void Add(IVlcObject vlcObject)
 {
     if (!HandleDic.ContainsKey(vlcObject.InstancePointer))
     {
         HandleDic.Add(vlcObject.InstancePointer, vlcObject);
     }
 }
예제 #6
0
        public static void Remove(IVlcObject vlcObject)
        {
            var pointer = new IntPtr(vlcObject.InstancePointer);

            if (HandleDic.ContainsKey(pointer))
            {
                HandleDic.Remove(pointer);
            }
        }
예제 #7
0
        public static void Add(IVlcObject vlcObject)
        {
            var pointer = new IntPtr(vlcObject.InstancePointer);

            if (!HandleDic.ContainsKey(pointer))
            {
                HandleDic.Add(pointer, vlcObject);
            }
        }
예제 #8
0
        /// <summary>
        ///     Create a event manager with parent Vlc object and pointer of event manager.
        /// </summary>
        /// <param name="parentVlcObject"></param>
        /// <param name="pointer"></param>
        public VlcEventManager(IVlcObject parentVlcObject, void *pointer)
        {
            VlcInstance     = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            VlcObjectManager.Add(this);

            _onVlcEventFired       = OnVlcEventFired;
            _onVlcEventFiredHandle = GCHandle.Alloc(_onVlcEventFired);
        }
예제 #9
0
        private VlcMedia(IVlcObject parentVlcObject, void *pointer)
        {
            VlcInstance     = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            VlcObjectManager.Add(this);

            EventManager = new VlcEventManager(this,
                                               LibVlcManager.GetFunctionDelegate <libvlc_media_event_manager>().Invoke(InstancePointer));

            EventManager.Attach(EventType.MediaMetaChanged);
            EventManager.Attach(EventType.MediaSubItemAdded);
            EventManager.Attach(EventType.MediaDurationChanged);
            EventManager.Attach(EventType.MediaParsedChanged);
            EventManager.Attach(EventType.MediaFreed);
            EventManager.Attach(EventType.MediaStateChanged);
            EventManager.Attach(EventType.MediaSubItemTreeAdded);

            EventManager.VlcEventFired += OnVlcEventFired;
        }
예제 #10
0
        private VlcMediaPlayer(IVlcObject parentVlcObject, void* pointer)
        {
            VlcInstance = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            VlcObjectManager.Add(this);

            EventManager = new VlcEventManager(this,
                LibVlcManager.GetFunctionDelegate<libvlc_media_player_event_manager>().Invoke(InstancePointer));

            EventManager.Attach(EventType.MediaPlayerPlaying);
            EventManager.Attach(EventType.MediaPlayerPaused);
            EventManager.Attach(EventType.MediaPlayerOpening);
            EventManager.Attach(EventType.MediaPlayerBuffering);
            EventManager.Attach(EventType.MediaPlayerStopped);
            EventManager.Attach(EventType.MediaPlayerForward);
            EventManager.Attach(EventType.MediaPlayerBackward);
            EventManager.Attach(EventType.MediaPlayerEndReached);
            EventManager.Attach(EventType.MediaPlayerMediaChanged);
            EventManager.Attach(EventType.MediaPlayerNothingSpecial);
            EventManager.Attach(EventType.MediaPlayerPausableChanged);
            EventManager.Attach(EventType.MediaPlayerPositionChanged);
            EventManager.Attach(EventType.MediaPlayerSeekableChanged);
            EventManager.Attach(EventType.MediaPlayerSnapshotTaken);
            EventManager.Attach(EventType.MediaPlayerTimeChanged);
            EventManager.Attach(EventType.MediaPlayerTitleChanged);
            EventManager.Attach(EventType.MediaPlayerLengthChanged);
            EventManager.Attach(EventType.MediaPlayerEncounteredError);
            EventManager.Attach(EventType.MediaPlayerVout);
            EventManager.Attach(EventType.MediaPlayerScrambledChanged);
            EventManager.Attach(EventType.MediaPlayerESAdded);
            EventManager.Attach(EventType.MediaPlayerESDeleted);
            EventManager.Attach(EventType.MediaPlayerESSelected);
            EventManager.Attach(EventType.MediaPlayerCorked);
            EventManager.Attach(EventType.MediaPlayerUncorked);
            EventManager.Attach(EventType.MediaPlayerMuted);
            EventManager.Attach(EventType.MediaPlayerUnmuted);
            EventManager.Attach(EventType.MediaPlayerAudioVolume);
            EventManager.Attach(EventType.MediaPlayerAudioDevice);
            EventManager.Attach(EventType.MediaPlayerChapterChanged);

            EventManager.VlcEventFired += OnVlcEventFired;
        }
예제 #11
0
 /// <summary>
 ///     Create a event manager with parent Vlc object and pointer of event manager.
 /// </summary>
 /// <param name="parentVlcObject"></param>
 /// <param name="pointer"></param>
 public VlcEventManager(IVlcObject parentVlcObject, IntPtr pointer)
 {
     VlcInstance = parentVlcObject.VlcInstance;
     InstancePointer = pointer;
     HandleManager.Add(this);
 }
예제 #12
0
 /// <summary>
 ///     Create a event manager with parent Vlc object and pointer of event manager.
 /// </summary>
 /// <param name="parentVlcObject"></param>
 /// <param name="pointer"></param>
 public VlcEventManager(IVlcObject parentVlcObject, IntPtr pointer)
 {
     VlcInstance     = parentVlcObject.VlcInstance;
     InstancePointer = pointer;
     HandleManager.Add(this);
 }
예제 #13
0
        private VlcMediaPlayer(IVlcObject parentVlcObject, IntPtr pointer)
        {
            VlcInstance = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            EventManager = new VlcEventManager(this, _getEventManagerFunction.Delegate(InstancePointer));

            HandleManager.Add(this);

            _onPlaying = OnPlaying;
            _onPaused = OnPaused;
            _onOpening = OnOpening;
            _onBuffering = OnBuffering;
            _onStoped = OnStoped;
            _onForward = OnForward;
            _onBackward = OnBackward;
            _onEndReached = OnEndReached;
            _onMediaChanged = OnMediaChanged;
            _onNothingSpecial = OnNothingSpecial;
            _onPausableChanged = OnPausableChanged;
            _onPositionChanged = OnPositionChanged;
            _onSeekableChanged = OnSeekableChanged;
            _onSnapshotTaken = OnSnapshotTaken;
            _onTimeChanged = OnTimeChanged;
            _onTitleChanged = OnTitleChanged;
            _onVideoOutChanged = OnVideoOutChanged;
            _onLengthChanged = OnLengthChanged;
            _onEncounteredError = OnEncounteredError;

            _onPlayingHandle = GCHandle.Alloc(_onPlaying);
            _onPausedHandle = GCHandle.Alloc(_onPaused);
            _onOpeningHandle = GCHandle.Alloc(_onOpening);
            _onBufferingHandle = GCHandle.Alloc(_onBuffering);
            _onStopedHandle = GCHandle.Alloc(_onStoped);
            _onForwardHandle = GCHandle.Alloc(_onForward);
            _onBackwardHandle = GCHandle.Alloc(_onBackward);
            _onEndReachedHandle = GCHandle.Alloc(_onEndReached);
            _onMediaChangedHandle = GCHandle.Alloc(_onMediaChanged);
            _onNothingSpecialHandle = GCHandle.Alloc(_onNothingSpecial);
            _onPausableChangedHandle = GCHandle.Alloc(_onPausableChanged);
            _onPositionChangedHandle = GCHandle.Alloc(_onPositionChanged);
            _onSeekableChangedHandle = GCHandle.Alloc(_onSeekableChanged);
            _onSnapshotTakenHandle = GCHandle.Alloc(_onSnapshotTaken);
            _onTimeChangedHandle = GCHandle.Alloc(_onTimeChanged);
            _onTitleChangedHandle = GCHandle.Alloc(_onTitleChanged);
            _onVideoOutChangedHandle = GCHandle.Alloc(_onVideoOutChanged);
            _onLengthChangedHandle = GCHandle.Alloc(_onLengthChanged);
            _onEncounteredErrorHandle = GCHandle.Alloc(_onEncounteredError);

            EventManager.Attach(EventTypes.MediaPlayerPlaying, _onPlaying, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPaused, _onPaused, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerOpening, _onOpening, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerBuffering, _onBuffering, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerStopped, _onStoped, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerForward, _onForward, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerBackward, _onBackward, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerEndReached, _onEndReached, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerMediaChanged, _onMediaChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerNothingSpecial, _onNothingSpecial, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPausableChanged, _onPausableChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPositionChanged, _onPositionChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerSeekableChanged, _onSeekableChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerSnapshotTaken, _onSnapshotTaken, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerTimeChanged, _onTimeChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerTitleChanged, _onTitleChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerVideoOutChanged, _onVideoOutChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerLengthChanged, _onLengthChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerEncounteredError, _onEncounteredError, IntPtr.Zero);
        }
예제 #14
0
        private VlcMediaPlayer(IVlcObject parentVlcObject, IntPtr pointer)
        {
            VlcInstance     = parentVlcObject.VlcInstance;
            InstancePointer = pointer;
            EventManager    = new VlcEventManager(this, _getEventManagerFunction.Delegate(InstancePointer));

            HandleManager.Add(this);

            _onPlaying          = OnPlaying;
            _onPaused           = OnPaused;
            _onOpening          = OnOpening;
            _onBuffering        = OnBuffering;
            _onStoped           = OnStoped;
            _onForward          = OnForward;
            _onBackward         = OnBackward;
            _onEndReached       = OnEndReached;
            _onMediaChanged     = OnMediaChanged;
            _onNothingSpecial   = OnNothingSpecial;
            _onPausableChanged  = OnPausableChanged;
            _onPositionChanged  = OnPositionChanged;
            _onSeekableChanged  = OnSeekableChanged;
            _onSnapshotTaken    = OnSnapshotTaken;
            _onTimeChanged      = OnTimeChanged;
            _onTitleChanged     = OnTitleChanged;
            _onVideoOutChanged  = OnVideoOutChanged;
            _onLengthChanged    = OnLengthChanged;
            _onEncounteredError = OnEncounteredError;

            _onPlayingHandle          = GCHandle.Alloc(_onPlaying);
            _onPausedHandle           = GCHandle.Alloc(_onPaused);
            _onOpeningHandle          = GCHandle.Alloc(_onOpening);
            _onBufferingHandle        = GCHandle.Alloc(_onBuffering);
            _onStopedHandle           = GCHandle.Alloc(_onStoped);
            _onForwardHandle          = GCHandle.Alloc(_onForward);
            _onBackwardHandle         = GCHandle.Alloc(_onBackward);
            _onEndReachedHandle       = GCHandle.Alloc(_onEndReached);
            _onMediaChangedHandle     = GCHandle.Alloc(_onMediaChanged);
            _onNothingSpecialHandle   = GCHandle.Alloc(_onNothingSpecial);
            _onPausableChangedHandle  = GCHandle.Alloc(_onPausableChanged);
            _onPositionChangedHandle  = GCHandle.Alloc(_onPositionChanged);
            _onSeekableChangedHandle  = GCHandle.Alloc(_onSeekableChanged);
            _onSnapshotTakenHandle    = GCHandle.Alloc(_onSnapshotTaken);
            _onTimeChangedHandle      = GCHandle.Alloc(_onTimeChanged);
            _onTitleChangedHandle     = GCHandle.Alloc(_onTitleChanged);
            _onVideoOutChangedHandle  = GCHandle.Alloc(_onVideoOutChanged);
            _onLengthChangedHandle    = GCHandle.Alloc(_onLengthChanged);
            _onEncounteredErrorHandle = GCHandle.Alloc(_onEncounteredError);

            EventManager.Attach(EventTypes.MediaPlayerPlaying, _onPlaying, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPaused, _onPaused, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerOpening, _onOpening, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerBuffering, _onBuffering, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerStopped, _onStoped, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerForward, _onForward, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerBackward, _onBackward, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerEndReached, _onEndReached, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerMediaChanged, _onMediaChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerNothingSpecial, _onNothingSpecial, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPausableChanged, _onPausableChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerPositionChanged, _onPositionChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerSeekableChanged, _onSeekableChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerSnapshotTaken, _onSnapshotTaken, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerTimeChanged, _onTimeChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerTitleChanged, _onTitleChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerVideoOutChanged, _onVideoOutChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerLengthChanged, _onLengthChanged, IntPtr.Zero);
            EventManager.Attach(EventTypes.MediaPlayerEncounteredError, _onEncounteredError, IntPtr.Zero);
        }