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

Add quick subtitle toggle feature #490

Merged
merged 3 commits into from Jan 31, 2020

Conversation

SimonCapewell
Copy link
Contributor

@SimonCapewell SimonCapewell commented Jan 27, 2020

This change allows a long press of the subtitles button to toggle subtitles on and off. If there's more than one subtitle track, the first subtitle track is activated. A subtitle style message is shown onscreen when toggling the subtitle to indicate the new status of subtitles - on or off, or if no subtitles are available. The button used is configurable, and on my installation, I'm using a short press for toggle, a long press for the subtitles dialog.

@AbuBaniaz
Copy link
Contributor

This is causing an issue with the subtitle menu. Originally, you can access is by pressing subtitle, red button then would be selectable

subtitle_orig_1

subtitle_orig_2

@SimonCapewell
Copy link
Contributor Author

Weird. I've just swapped my short and long press and it's now broken just the same.

@AbuBaniaz
Copy link
Contributor

Also, press long subtitles to activate/deactivate. Ideally that should be end of it. However, you then get into menu. I hope that makes sense.

@SimonCapewell
Copy link
Contributor Author

Actually, I can't repro the red button problem. I just didn't realise that it's not available when subtitles are off.

The menu popping up when letting go of subtitle, I can reproduce though.

@AbuBaniaz
Copy link
Contributor

AbuBaniaz commented Jan 28, 2020

I just didn't realise that it's not available when subtitles are off.

Makes two of us. Makes sense as as you can't alter position/colour etc if no subtitles are showing.

Most skins do not have the menu button either.

@SimonCapewell
Copy link
Contributor Author

I think fixing the rogue popup on long button press is going to be a bit tricky. I can't see an obvious way to prevent the bounce event when you release the key.

@SimonCapewell
Copy link
Contributor Author

This should fix it. I had to introduce a global key watcher to do though. The e2 action map and keypress handler isn't really geared towards dealing with this long button press scenario.

@AbuBaniaz AbuBaniaz merged commit 2a406df into OpenViX:Dev Jan 31, 2020
@AbuBaniaz
Copy link
Contributor

Many thanks. Works very well.

@AbuBaniaz
Copy link
Contributor

@SimonCapewell
There is a bug in this. We can't disable the buttons presses when a message is showing.

Try doing the following:
Backup your lamedb first.
Remove all services and restart. (up next to OK, menu, highlight terrestrial services, menu, delete, restart.

You should come up with a service unavailable message. You can't get out of the screen.

We'll have to revert before next build unless fixed.

@AbuBaniaz
Copy link
Contributor

A release needs to be run. As we always merge dev to release, I have been asked to revert this.

AbuBaniaz added a commit that referenced this pull request Jan 31, 2020
@SimonCapewell
Copy link
Contributor Author

@AbuBaniaz I can't see any option to remove all services using the steps you listed. So, I've removed lamedb and bouquet files, but still no service unavailble popup on startup. Triggering the popup on e2 startup in code doesn't show any ill effect. Can you have another go testing it, but remove the eActionMap.getInstance().bindAction('', -maxint - 1, self.keypress) from SubtitleDisplay.py. I can't see at the moment how the new code can be causing this problem.

@AbuBaniaz
Copy link
Contributor

I'll try the new code, problem is I am stuck on PLi owing to the multiboot code they are changing. I'll send @TwolDE2 a PM to see if he can run it too.

Just for reference and in case it makes things clearer.
Press Up next to OK. Then Green
1

2

3

Alternatively, init 4, wait for 10 seconds, rename lamedb, init 3

@SimonCapewell
Copy link
Contributor Author

Thanks. Looks like I did the terminal steps, so there's probably some settings that are different

AbuBaniaz referenced this pull request in AbuBaniaz/enigma2_OpenViX Feb 4, 2020
@original-birdman
Copy link
Contributor

Abu asked me to test this.

I downloaded the code in this change (as a patch) then:

  • Installed patches and restarted GUI.
    Long-subtitle toggles OK.
    Short-subtitle brings up menu.

  • Removed terrestrial services by:
    Up next to OK
    Green (Extended - but I did get it to show Satellites once....)
    Highlight "Terrestrial Services"
    Menu
    Remove terrestrial services
    Restart GUI or reboot

  • Restarted GUI.
    Timer problem pop-up. Cancelled it.
    Service Unavailable. Cancelled it.
    Can bring up menus.

  • Rebooted box.
    Service Unavailable. Cancelled it.
    Can bring up menus.

So, for me, the code here seems to be OK as-is.

AbuBaniaz pushed a commit that referenced this pull request Feb 4, 2020
* Add quick subtitle toggle feature
* Add subtitle toggle UI
* Ignore keyup events whilst message is showing
@AbuBaniaz
Copy link
Contributor

I cannot reproduce the issue again. I have re-added this having consulted Stef. He will run a Dev build tonight.

@SimonCapewell
Copy link
Contributor Author

There's a bit of crappy code in there around removing the keybinding on close (or in fact not removing it) but this'd only be encountered when shutting down, and it won't matter then. I can submit a tidy up at a later date.

@AbuBaniaz
Copy link
Contributor

PLI have asked for a pull request to be submitted for this. So I'll wait for your modified code.

@SimonCapewell
Copy link
Contributor Author

#493

prl001 pushed a commit to prl001/enigma2 that referenced this pull request Jul 6, 2020
* Add quick subtitle toggle feature
* Add subtitle toggle UI
* Ignore keyup events whilst message is showing
prl001 pushed a commit to prl001/enigma2 that referenced this pull request Jul 6, 2020
prl001 pushed a commit to prl001/enigma2 that referenced this pull request Jul 6, 2020
* Add quick subtitle toggle feature
* Add subtitle toggle UI
* Ignore keyup events whilst message is showing
prl001 pushed a commit to prl001/enigma2 that referenced this pull request Jul 6, 2020
* Add quick subtitle toggle feature
* Add subtitle toggle UI
* Ignore keyup events whilst message is showing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants