protected override void MediaPlayerEventOccured(ref LibvlcEventT libvlcEvent, IntPtr userData) { switch (libvlcEvent.type) { case LibvlcEventE.LibvlcMediaListItemAdded: if (MItemAdded != null) { var media = new BasicMedia(libvlcEvent.MediaDescriptor.media_list_item_added.item, ReferenceCountAction.AddRef); MItemAdded(MEventProvider, new MediaListItemAdded(media, libvlcEvent.MediaDescriptor.media_list_item_added.index)); media.Release(); } break; case LibvlcEventE.LibvlcMediaListWillAddItem: if (MWillAddItem != null) { var media2 = new BasicMedia(libvlcEvent.MediaDescriptor.media_list_will_add_item.item, ReferenceCountAction.AddRef); MWillAddItem(MEventProvider, new MediaListWillAddItem(media2, libvlcEvent.MediaDescriptor.media_list_will_add_item.index)); media2.Release(); } break; case LibvlcEventE.LibvlcMediaListItemDeleted: if (MItemDeleted != null) { var media3 = new BasicMedia(libvlcEvent.MediaDescriptor.media_list_item_deleted.item, ReferenceCountAction.AddRef); MItemDeleted(MEventProvider, new MediaListItemDeleted(media3, libvlcEvent.MediaDescriptor.media_list_item_deleted.index)); media3.Release(); } break; case LibvlcEventE.LibvlcMediaListWillDeleteItem: if (MWillDeleteItem != null) { var media4 = new BasicMedia(libvlcEvent.MediaDescriptor.media_list_will_delete_item.item, ReferenceCountAction.AddRef); MWillDeleteItem(MEventProvider, new MediaListWillDeleteItem(media4, libvlcEvent.MediaDescriptor.media_list_will_delete_item.index)); media4.Release(); } break; } }
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 LibvlcEventT libvlcEvent, IntPtr userData) { switch (libvlcEvent.type) { case LibvlcEventE.LibvlcMediaMetaChanged: if (metaDataChanged != null) { metaDataChanged(MEventProvider, new MediaMetaDataChange((MetaDataType)libvlcEvent.MediaDescriptor.media_meta_changed.meta_type)); } break; case LibvlcEventE.LibvlcMediaSubItemAdded: if (subItemAdded != null) { var media = new BasicMedia(libvlcEvent.MediaDescriptor.media_subitem_added.new_child, ReferenceCountAction.AddRef); subItemAdded(MEventProvider, new MediaNewSubItem(media)); media.Release(); } break; case LibvlcEventE.LibvlcMediaDurationChanged: if (durationChanged != null) { durationChanged(MEventProvider, new MediaDurationChange(libvlcEvent.MediaDescriptor.media_duration_changed.new_duration)); } break; case LibvlcEventE.LibvlcMediaParsedChanged: if (parsedChanged != null) { parsedChanged(MEventProvider, new MediaParseChange(Convert.ToBoolean(libvlcEvent.MediaDescriptor.media_parsed_changed.new_status))); } break; case LibvlcEventE.LibvlcMediaFreed: if (mediaFreed != null) { mediaFreed(MEventProvider, new MediaFree(libvlcEvent.MediaDescriptor.media_freed.md)); } break; case LibvlcEventE.LibvlcMediaStateChanged: if (stateChanged != null) { stateChanged(MEventProvider, new MediaStateChange((MediaState)libvlcEvent.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.media_list_item_added.item, ReferenceCountAction.AddRef); m_itemAdded(m_eventProvider, new MediaListItemAdded(media, libvlc_event.media_list_item_added.index)); media.Release(); } break; case libvlc_event_e.libvlc_MediaListWillAddItem: if (m_willAddItem != null) { BasicMedia media2 = new BasicMedia(libvlc_event.media_list_will_add_item.item, ReferenceCountAction.AddRef); m_willAddItem(m_eventProvider, new MediaListWillAddItem(media2, libvlc_event.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.media_list_item_deleted.item, ReferenceCountAction.AddRef); m_itemDeleted(m_eventProvider, new MediaListItemDeleted(media3, libvlc_event.media_list_item_deleted.index)); media3.Release(); } break; case libvlc_event_e.libvlc_MediaListWillDeleteItem: if (m_willDeleteItem != null) { BasicMedia media4 = new BasicMedia(libvlc_event.media_list_will_delete_item.item, ReferenceCountAction.AddRef); m_willDeleteItem(m_eventProvider, new MediaListWillDeleteItem(media4, libvlc_event.media_list_will_delete_item.index)); media4.Release(); } break; } }