Пример #1
0
		public unsafe GstPlayer(int width, int height, PlayerUseType type) : base(IntPtr.Zero)
		{
			if(GetType() != typeof(GstPlayer)) {
				throw new InvalidOperationException("Can't override this constructor.");
			}
			IntPtr error = IntPtr.Zero;
			Raw = bacon_video_widget_new(width, height, (int) type, out error);
			if(error != IntPtr.Zero) throw new GLib.GException(error);
		}
Пример #2
0
        void Init(PlayerUseType type)
        {
            rate = 1;
            IntPtr error = IntPtr.Zero;

            Raw = lgm_video_player_new((int)type, out error);
            if (error != IntPtr.Zero)
            {
                throw new GLib.GException(error);
            }

            this.GlibError += (o, args) => {
                if (Error != null)
                {
                    Error(this, args.Message);
                }
            };

            this.GlibStateChange += (o, args) => {
                if (StateChange != null)
                {
                    StateChange(
                        new PlaybackStateChangedEvent {
                        Sender  = this,
                        Playing = args.Playing
                    }
                        );
                }
            };

            this.GlibReadyToSeek += (sender, e) => {
                if (ReadyToSeek != null)
                {
                    ReadyToSeek(this);
                }
            };

            this.GlibEos += (sender, e) => {
                if (Eos != null)
                {
                    Eos(this);
                }
            };
        }
Пример #3
0
 public unsafe GstPlayer(PlayerUseType type) : base(IntPtr.Zero)
 {
     Init(type);
 }
Пример #4
0
		void Init (PlayerUseType type)
		{
			rate = 1;
			IntPtr error = IntPtr.Zero;
			Raw = lgm_video_player_new ((int)type, out error);
			if (error != IntPtr.Zero)
				throw new GLib.GException (error);
			
			this.GlibError += (o, args) => {
				if (Error != null)
					Error (this, args.Message);
			};
			
			this.GlibStateChange += (o, args) => {
				if (StateChange != null)
					StateChange (this, args.Playing);
			};
			
			this.GlibReadyToSeek += (sender, e) => {
				if (ReadyToSeek != null)
					ReadyToSeek (this);
			};

			this.GlibEos += (sender, e) => {
				if (Eos != null)
					Eos (this);
			};
		}
Пример #5
0
		public unsafe GstPlayer (PlayerUseType type) : base (IntPtr.Zero)
		{
			Init (type);
		}