Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for interactive controls #8

Closed
denis-stepanov opened this issue Aug 8, 2022 · 2 comments · Fixed by #71
Closed

Support for interactive controls #8

denis-stepanov opened this issue Aug 8, 2022 · 2 comments · Fixed by #71
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@denis-stepanov
Copy link
Owner

denis-stepanov commented Aug 8, 2022

When running from command line, it would be useful to listen to user keystrokes in order to react on the following input:

  • (space) mute or unmute - useful when the tool goes into a wrong mode;
  • m - explicitly mute, or do nothing if muted;
  • M (shift-m) - explicitly unmute, or do nothing if unmuted;
  • q - gracefully exit - because currently exiting is hard.
@denis-stepanov denis-stepanov added the enhancement New feature or request label Aug 8, 2022
@denis-stepanov denis-stepanov added this to the v1.6.0 milestone Mar 30, 2024
@denis-stepanov
Copy link
Owner Author

denis-stepanov commented Mar 30, 2024

Also:

  • c- decrease confidence threshold by 1%
  • C (shift-c) - increase confidence threshold by 1%

@denis-stepanov denis-stepanov self-assigned this Mar 31, 2024
@denis-stepanov denis-stepanov linked a pull request Apr 12, 2024 that will close this issue
@denis-stepanov
Copy link
Owner Author

As frequently happens, many more things had to be done. It turned out that Python has no-builtin capability to read un-buffered input. After experimentation a new dependency sshkeyboard has been added. The final list of commands:

h     - help
t     - emulate a hit
a     - toggle TV 'in action' status
space - toggle mute
m / M - mute / unmute
v / V - volume lower / raise
i / I - interval decrease / increase
c / C - confidence decrease / increase
q     - quit

n / N (changing thread number on the fly) was too laborious to implement in scope of this ticket; it was forked into a separate issue #68.

Other notable changes on the way:

  • introduced new option -A which would allow starting TV "in action" (useful when TV happens to be muted upon AdVent start-up);
  • added concept of uni-/bi-directional TV controls;
  • refactored TV control API. The change is functionally compatible (i.e., represents extension of functionality), but signatures of methods of TVControl class have changed; so all TV controls had to be adapted;
  • volume input parameter for PulseAudio was constrained to percentage of volume. Previously nearly any valid parameter accepted by pactl was possible, but it was hard to maintain that functionality in line with other controllers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant