Exemplo n.º 1
0
        public MmKeys(IPlayer player) : base(IntPtr.Zero)
        {
            base.Raw = mmkeys_new();

            this.player = player;

            toggle_play_cb = new SignalUtils.SignalDelegate(OnTogglePlay);
            prev_cb        = new SignalUtils.SignalDelegate(OnPrev);
            next_cb        = new SignalUtils.SignalDelegate(OnNext);
            stop_cb        = new SignalUtils.SignalDelegate(OnStop);

            SignalUtils.SignalConnect(base.Raw, "mm_playpause", toggle_play_cb);
            SignalUtils.SignalConnect(base.Raw, "mm_prev", prev_cb);
            SignalUtils.SignalConnect(base.Raw, "mm_next", next_cb);
            SignalUtils.SignalConnect(base.Raw, "mm_stop", stop_cb);
        }
Exemplo n.º 2
0
        public Player() : base(IntPtr.Zero)
        {
            IntPtr error_ptr;

            Raw = player_new(out error_ptr);

            if (error_ptr != IntPtr.Zero)
            {
                throw new PlayerException(error_ptr);
            }

            tick_cb  = new SignalUtils.SignalDelegateInt(OnTick);
            eos_cb   = new SignalUtils.SignalDelegate(OnEndOfStream);
            error_cb = new SignalUtils.SignalDelegateStr(OnError);

            SignalUtils.SignalConnect(Raw, "tick", tick_cb);
            SignalUtils.SignalConnect(Raw, "end_of_stream", eos_cb);
            SignalUtils.SignalConnect(Raw, "error", error_cb);

            playing = false;
            song    = null;
        }