Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface IVLCObject : IDisposable
- {
- IntPtr ObjectHandle { get; }
- bool IsInvalid { get; }
- }
- public interface IVLCMedia : IVLCObject
- {
- Uri Location { get; }
- void AddOption(string mediaOption);
- long Duration { get; }
- ...
- }
- public interface IVLCMediaPlayer : IVLCObject
- {
- IVLCMedia Media { get; set; }
- bool Play();
- void Pause();
- void Stop();
- ...
- }
- internal class VLCMediaPlayer
- : VLCObject<VLCMediaPlayer.libvlc_media_player_release_t>, IVLCMediaPlayer
- {
- public VLCMediaPlayer(IVLCObject vlcObject)
- : base(libvlc_media_player_new(vlcObject,
- vlcObject.GetType().GetInterface("IVLCMedia") != null), libvlc_media_player_release)
- {
- }
- ....
- private static IntPtr libvlc_media_player_new(IVLCObject vlcObject, bool fromMedia = false)
- {
- return Environment.Is64BitProcess
- ? fromMedia
- ? libvlc_media_player_new_from_media64(vlcObject.ObjectHandle)
- : libvlc_media_player_new64(vlcObject.ObjectHandle)
- : fromMedia
- ? libvlc_media_player_new_from_media32(vlcObject.ObjectHandle)
- : libvlc_media_player_new32(vlcObject.ObjectHandle);
- }
- }
Add Comment
Please, Sign In to add comment