예제 #1
0
            public override bool ButtonPressed(Location location, ButtonEvent buttonEvent)
            {
                if (buttonEvent == ButtonEvent.Down && location.X == 0 && location.Y == 0)
                {
                    _audioSelectLayout._mediaDeviceService.SetMute(!_device.Mute, _device);
                    _audioSelectLayout.SetSessionMuted();
                    return(true);
                }

                return(false);
            }
예제 #2
0
파일: MacroElement.cs 프로젝트: tihilv/Vkm
            public override bool ButtonPressed(Location location, ButtonEvent buttonEvent)
            {
                if (location.X == 0 && location.Y == 0)
                {
                    if (buttonEvent == ButtonEvent.Up)
                    {
                        foreach (var pair in _macroData.Devices.ToArray())
                        {
                            _audioSelectLayout._mediaDeviceService.SetMute(pair.Value, pair.Key);
                        }
                        foreach (var pair in _macroData.Sessions.ToArray())
                        {
                            _audioSelectLayout._mediaDeviceService.SetMuteSession(pair.Value, pair.Key);
                        }

                        _audioSelectLayout.SetSessionMuted();
                        return(true);
                    }
                    else if (buttonEvent == ButtonEvent.LongPress)
                    {
                        _macroData.Devices.Clear();
                        _macroData.Sessions.Clear();
                        var sessions = _audioSelectLayout._mediaDeviceService.GetSessions();
                        foreach (var session in sessions)
                        {
                            _macroData.Sessions[session] = session.Mute;
                        }
                        var devices = _audioSelectLayout._mediaDeviceService.GetDevices(false);
                        foreach (var device in devices)
                        {
                            _macroData.Devices[device] = device.Mute;
                        }
                    }
                }

                return(false);
            }