Exemple #1
0
 private void OnVlcEvent(ref libvlc_event_t type, IntPtr userdata)
 {
     switch (type.type)
     {
         case libvlc_event_e.MediaMetaChanged:
             EventsHelper.RaiseEvent(MetaChanged, this, new VlcEventArgs<MetaTypes>((MetaTypes) type.media_meta_changed.meta_type));
             break;
         case libvlc_event_e.MediaSubItemAdded:
             //TODO
             //EventsHelper.RaiseEvent(SubItemAdded, this, new VlcEventArgs<MetaData>((MetaData)type.media_subitem_added.new_child));
             break;
         case libvlc_event_e.MediaDurationChanged:
             EventsHelper.RaiseEvent(DurationChanged, this, new VlcEventArgs<long>(type.media_duration_changed.new_duration));
             break;
         case libvlc_event_e.MediaParsedChanged:
             EventsHelper.RaiseEvent(ParsedChanged, this, new VlcEventArgs<int>(type.media_parsed_changed.new_status));
             break;
         case libvlc_event_e.MediaFreed:
             //TODO
             //EventsHelper.RaiseEvent(Freed, this, new VlcEventArgs<MediaBase>(type.media_freed.md));
             break;
         case libvlc_event_e.MediaStateChanged:
             EventsHelper.RaiseEvent(StateChanged, this, new VlcEventArgs<MediaStates>((MediaStates) type.media_state_changed.new_state));
             break;
     }
 }
Exemple #2
0
 public static extern IntPtr libvlc_event_type_name(libvlc_event_t eventType);
Exemple #3
0
        private void OnVlcEvent(ref libvlc_event_t eventData, IntPtr userData)
        {
            switch (eventData.type)
            {
                case libvlc_event_e.MediaPlayerBackward:
                    EventsHelper.RaiseEvent(Backward, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerBuffering:
                    EventsHelper.RaiseEvent(Buffering, this, new VlcEventArgs<float>(eventData.media_player_buffering.new_cache));
                    break;
                case libvlc_event_e.MediaPlayerEncounteredError:
                    EventsHelper.RaiseEvent(EncounteredError, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerEndReached:
                    EventsHelper.RaiseEvent(EndReached, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerForward:
                    EventsHelper.RaiseEvent(Forward, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerLengthChanged:
                    EventsHelper.RaiseEvent(LengthChanged, this, new VlcEventArgs<long>(eventData.media_player_length_changed.new_length));
                    break;
                case libvlc_event_e.MediaPlayerMediaChanged:
                    //TODO
                    //EventsHelper.RaiseEvent(MediaChanged, this, new VlcEventArgs<MediaBase>(eventData.media_player_media_changed.new_media));
                    break;
                case libvlc_event_e.MediaPlayerNothingSpecial:

                    break;
                case libvlc_event_e.MediaPlayerOpening:
                    break;
                case libvlc_event_e.MediaPlayerPausableChanged:
                    EventsHelper.RaiseEvent(PausableChanged, this, new VlcEventArgs<int>(eventData.media_player_pausable_changed.new_pausable));
                    break;
                case libvlc_event_e.MediaPlayerPaused:
                    EventsHelper.RaiseEvent(Paused, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerPositionChanged:
                    EventsHelper.RaiseEvent(PositionChanged, this, new VlcEventArgs<float>(eventData.media_player_position_changed.new_position));
                    break;
                case libvlc_event_e.MediaPlayerSeekableChanged:
                    EventsHelper.RaiseEvent(SeekableChanged, this, new VlcEventArgs<int>(eventData.media_player_seekable_changed.new_seekable));
                    break;
                case libvlc_event_e.MediaPlayerSnapshotTaken:
                    EventsHelper.RaiseEvent(SnapshotTaken, this, new VlcEventArgs<string>(IntPtrExtensions.ToStringAnsi(eventData.media_player_snapshot_taken.psz_filename)));
                    break;
                case libvlc_event_e.MediaPlayerStopped:
                    EventsHelper.RaiseEvent(Stopped, this, new VlcEventArgs<EventArgs>(EventArgs.Empty));
                    break;
                case libvlc_event_e.MediaPlayerTimeChanged:
                    EventsHelper.RaiseEvent(TimeChanged, this, new VlcEventArgs<long>(eventData.media_player_time_changed.new_time));
                    break;
                case libvlc_event_e.MediaPlayerTitleChanged:
                    EventsHelper.RaiseEvent(TitleChanged, this, new VlcEventArgs<long>(eventData.media_player_title_changed.new_title));
                    break;
            }
        }
Exemple #4
0
 public static extern IntPtr libvlc_event_type_name(libvlc_event_t eventType);