protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch (libvlc_event.type) { case libvlc_event_e.libvlc_MediaListPlayerPlayed: if (m_mediaListPlayerPlayed != null) { m_mediaListPlayerPlayed(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaListPlayerNextItemSet: if (m_mediaListPlayerNextItemSet != null) { BasicMedia media = new BasicMedia(libvlc_event.media_list_player_next_item_set.item, ReferenceCountAction.AddRef); m_mediaListPlayerNextItemSet(m_eventProvider, new MediaListPlayerNextItemSet(media)); //media.Release(); } break; case libvlc_event_e.libvlc_MediaListPlayerStopped: if(m_mediaListPlayerStopped != null) { m_mediaListPlayerStopped(m_eventProvider, EventArgs.Empty); } break; } }
protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch (libvlc_event.type) { case libvlc_event_e.libvlc_MediaPlayerTimeChanged: RaiseTimeChanged(libvlc_event.MediaDescriptor.media_player_time_changed.new_time); break; case libvlc_event_e.libvlc_MediaPlayerEndReached: RaiseMediaEnded(); break; case libvlc_event_e.libvlc_MediaPlayerMediaChanged: if (m_mediaChanged != null) { BasicMedia media = new BasicMedia(libvlc_event.MediaDescriptor.media_player_media_changed.new_media, ReferenceCountAction.AddRef); m_mediaChanged(m_eventProvider, new MediaPlayerMediaChanged(media)); //media.Release(); } break; case libvlc_event_e.libvlc_MediaPlayerNothingSpecial: if (m_nothingSpecial != null) { m_nothingSpecial(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerOpening: if (m_playerOpening != null) { m_playerOpening(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerBuffering: if (m_playerBuffering != null) { m_playerBuffering(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerPlaying: if (m_playerPlaying != null) { m_playerPlaying(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerPaused: if (m_playerPaused != null) { m_playerPaused(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerStopped: if (m_playerStopped != null) { m_playerStopped(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerForward: if (m_playerForward != null) { m_playerForward(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerBackward: if (m_playerPaused != null) { m_playerPaused(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerEncounteredError: if (m_playerEncounteredError != null) { m_playerEncounteredError(m_eventProvider, EventArgs.Empty); } break; case libvlc_event_e.libvlc_MediaPlayerPositionChanged: if (m_playerPositionChanged != null) { m_playerPositionChanged(m_eventProvider, new MediaPlayerPositionChanged(libvlc_event.MediaDescriptor.media_player_position_changed.new_position)); } break; case libvlc_event_e.libvlc_MediaPlayerSeekableChanged: if (m_playerSeekableChanged != null) { m_playerSeekableChanged(m_eventProvider, new MediaPlayerSeekableChanged(libvlc_event.MediaDescriptor.media_player_seekable_changed.new_seekable)); } break; case libvlc_event_e.libvlc_MediaPlayerPausableChanged: if (m_playerPausableChanged != null) { m_playerPausableChanged(m_eventProvider, new MediaPlayerPausableChanged(libvlc_event.MediaDescriptor.media_player_pausable_changed.new_pausable)); } break; case libvlc_event_e.libvlc_MediaPlayerTitleChanged: if (m_playerTitleChanged != null) { m_playerTitleChanged(m_eventProvider, new MediaPlayerTitleChanged(libvlc_event.MediaDescriptor.media_player_title_changed.new_title)); } break; case libvlc_event_e.libvlc_MediaPlayerSnapshotTaken: if (m_playerSnapshotTaken != null) { m_playerSnapshotTaken(m_eventProvider, new MediaPlayerSnapshotTaken(Marshal.PtrToStringAuto(libvlc_event.MediaDescriptor.media_player_snapshot_taken.psz_filename))); } break; case libvlc_event_e.libvlc_MediaPlayerLengthChanged: if (m_playerLengthChanged != null) { m_playerLengthChanged(m_eventProvider, new MediaPlayerLengthChanged(libvlc_event.MediaDescriptor.media_player_length_changed.new_length)); } break; } }
protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch(libvlc_event.type) { case libvlc_event_e.libvlc_MediaDiscovererStarted: break; case libvlc_event_e.libvlc_MediaDiscovererEnded: break; } }
protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch (libvlc_event.type) { case libvlc_event_e.libvlc_VlmMediaAdded: if (m_MediaAdded != null) { m_MediaAdded(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaRemoved: if (m_MediaRemoved != null) { m_MediaRemoved(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaChanged: if (m_MediaChanged != null) { m_MediaChanged(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStarted: if (m_MediaInstanceStarted != null) { m_MediaInstanceStarted(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStopped: if (m_MediaInstanceStopped != null) { m_MediaInstanceStopped(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusInit: if (m_MediaInstanceInit != null) { m_MediaInstanceInit(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusOpening: if (m_MediaInstanceOpening != null) { m_MediaInstanceOpening(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusPlaying: if (m_MediaInstancePlaying != null) { m_MediaInstancePlaying(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusPause: if (m_MediaInstancePause != null) { m_MediaInstancePause(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusEnd: if (m_MediaInstanceEnd != null) { m_MediaInstanceEnd(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; case libvlc_event_e.libvlc_VlmMediaInstanceStatusError: if (m_MediaInstanceError != null) { m_MediaInstanceError(m_eventProvider, new VlmEvent(Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_instance_name), Marshal.PtrToStringAuto(libvlc_event.vlm_media_event.psz_media_name))); } break; default: break; } }
protected abstract void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData);
private void VlcEventHandler(ref libvlc_event_t libvlc_event, IntPtr userData) { }
protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch (libvlc_event.type) { case libvlc_event_e.libvlc_MediaMetaChanged: if (metaDataChanged != null) { metaDataChanged(m_eventProvider, new MediaMetaDataChange((MetaDataType)libvlc_event.MediaDescriptor.media_meta_changed.meta_type)); } break; case libvlc_event_e.libvlc_MediaSubItemAdded: if (subItemAdded != null) { BasicMedia media = new BasicMedia(libvlc_event.MediaDescriptor.media_subitem_added.new_child, ReferenceCountAction.AddRef); subItemAdded(m_eventProvider, new MediaNewSubItem(media)); media.Release(); } break; case libvlc_event_e.libvlc_MediaDurationChanged: if (durationChanged != null) { durationChanged(m_eventProvider, new MediaDurationChange(libvlc_event.MediaDescriptor.media_duration_changed.new_duration)); } break; case libvlc_event_e.libvlc_MediaParsedChanged: if (parsedChanged != null) { parsedChanged(m_eventProvider, new MediaParseChange(Convert.ToBoolean(libvlc_event.MediaDescriptor.media_parsed_changed.new_status))); } break; case libvlc_event_e.libvlc_MediaFreed: if (mediaFreed != null) { mediaFreed(m_eventProvider, new MediaFree(libvlc_event.MediaDescriptor.media_freed.md)); } break; case libvlc_event_e.libvlc_MediaStateChanged: if (stateChanged != null) { stateChanged(m_eventProvider, new MediaStateChange((MediaState)libvlc_event.MediaDescriptor.media_state_changed.new_state)); } break; default: break; } }
protected override void MediaPlayerEventOccured(ref libvlc_event_t libvlc_event, IntPtr userData) { switch (libvlc_event.type) { case libvlc_event_e.libvlc_MediaListItemAdded: if (m_itemAdded != null) { BasicMedia media = new BasicMedia(libvlc_event.MediaDescriptor.media_list_item_added.item, ReferenceCountAction.AddRef); m_itemAdded(m_eventProvider, new MediaListItemAdded(media, libvlc_event.MediaDescriptor.media_list_item_added.index)); media.Release(); } break; case libvlc_event_e.libvlc_MediaListWillAddItem: if (m_willAddItem != null) { BasicMedia media2 = new BasicMedia(libvlc_event.MediaDescriptor.media_list_will_add_item.item, ReferenceCountAction.AddRef); m_willAddItem(m_eventProvider, new MediaListWillAddItem(media2, libvlc_event.MediaDescriptor.media_list_will_add_item.index)); media2.Release(); } break; case libvlc_event_e.libvlc_MediaListItemDeleted: if (m_itemDeleted != null) { BasicMedia media3 = new BasicMedia(libvlc_event.MediaDescriptor.media_list_item_deleted.item, ReferenceCountAction.AddRef); m_itemDeleted(m_eventProvider, new MediaListItemDeleted(media3, libvlc_event.MediaDescriptor.media_list_item_deleted.index)); media3.Release(); } break; case libvlc_event_e.libvlc_MediaListWillDeleteItem: if (m_willDeleteItem != null) { BasicMedia media4 = new BasicMedia(libvlc_event.MediaDescriptor.media_list_will_delete_item.item, ReferenceCountAction.AddRef); m_willDeleteItem(m_eventProvider, new MediaListWillDeleteItem(media4, libvlc_event.MediaDescriptor.media_list_will_delete_item.index)); media4.Release(); } break; } }
private void VlcEventHandler(ref libvlc_event_t libvlc_event, IntPtr userData) { Log(LogType.Debug, "======== VLC SENT A " + libvlc_event.ToString() + " SIGNAL ======"); evaluateEventWaitHandle.Set(); }