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

[PVR][guiinfo] Videofullscreen/Musicvisualisation: Direct channel number input #11434

Merged
merged 5 commits into from Jan 18, 2017

Conversation

ksooo
Copy link
Member

@ksooo ksooo commented Jan 12, 2017

Instead of opening the numeric input dialog when pressing 0 - 9 while in PVR fullscreen or PVR music visualisation, now only the entered number appears on screen, like this works for almost all other tv sets and settop boxes.

2 seconds (existing advancedsettings value!) after the last digit was entered, Kodi will automatically switch to the channel with the entered number.

Entering an invalid number will be ignored and nothing will happen.

Entering more than 4 digits results in left-shifting the previously entered digits, discarding the oldest digit, and appending the just entered number.

Largest supported channel number is 9999.

Entering 4 zeros in a row will immediately end direct channel number input.

This PR was tested on latest Kodi master on Linux and macOS.

screenshot000

@da-anda fyi

@phil65 already reviewed the skin change

@ronie: skins must be adjusted to use the new info label PVR.ChannelNumberInput. Otherwise the feature will also work, but nothing will be seen on the screen while entering the number.

@Jalle19 for review?

@ksooo ksooo added Type: Feature non-breaking change which adds functionality Component: PVR Component: Skin v18 Leia labels Jan 12, 2017
@ksooo ksooo added this to the L 18.0-alpha1 milestone Jan 12, 2017
@ksooo ksooo requested a review from Jalle19 January 12, 2017 21:36
@ronie
Copy link
Member

ronie commented Jan 12, 2017

thanx for the heads-up!

@@ -1411,7 +1411,7 @@
</setting>
<setting id="pvrplayback.confirmchannelswitch" type="boolean" label="19281" help="36231">
<level>1</level>
<default>false</default>
<default>true</default>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@Jalle19
Copy link
Member

Jalle19 commented Jan 13, 2017

Isn't there a button in the OSD during full screen playback which used to open the numpad? AFAIK it was only for users with limited remotes.

@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

Isn't there a button in the OSD during full screen playback which used to open the numpad? AFAIK it was only for users with limited remotes.

The button was "1" to "9", which does not help for remotes without these keys.

@Jalle19
Copy link
Member

Jalle19 commented Jan 13, 2017

@ksooo I mean a GUI button in the OSD.

@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

@ksooo I mean a GUI button in the OSD.

if there is such a GUI button i don't know it.

@@ -603,6 +604,12 @@ namespace PVR
*/
void PublishEvent(PVREvent state);

/*!
* @brief Get the nmeric channel input handler.

This comment was marked as spam.

This comment was marked as spam.


CSingleLock lock(m_critSection);

if (iDigit == 0 && m_digits.size() == 0)

This comment was marked as spam.

This comment was marked as spam.

if (m_digits.size() != m_iDigits || GetChannel() > 0)
{
for (int digit : m_digits)
m_strChannel.append(std::to_string(digit));

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

jenkins build this please

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from 8d5c1c4 to 35c5b15 Compare January 13, 2017 19:24
@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

@Jalle19 all changes you requested are in. good to go?

namespace PVR
{

CPVRNumericChannelInputHandler::CPVRNumericChannelInputHandler(int iDigits, int iSwitchDelay)

This comment was marked as spam.

This comment was marked as spam.

return iNumber;
}

std::string CPVRNumericChannelInputHandler::GetChannelAsString() const

This comment was marked as spam.

@xhaggi
Copy link
Member

xhaggi commented Jan 13, 2017

Looks good and makes sense because the numric input dialog can only be reached by the numpad of a remote and then you will never use the numeric controls of the dialog.

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from 35c5b15 to ab840a0 Compare January 13, 2017 22:53
@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

@xhaggi requested changes are in.

@ksooo
Copy link
Member Author

ksooo commented Jan 13, 2017

jenkins build this please

@xhaggi
Copy link
Member

xhaggi commented Jan 13, 2017

Thanks, that was fast :)

Copy link
Member

@Jalle19 Jalle19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from these +1, I don't really have an opinion on the setting default change

if (m_digits.size() != m_iDigits || GetChannelNumber() > 0)
{
for (int digit : m_digits)
m_strChannel.append(StringUtils::Format("%d", digit));

This comment was marked as spam.

{

CPVRChannelNumberInputHandler::CPVRChannelNumberInputHandler(int iDigits, int iSwitchDelay)
: m_iDigits(iDigits),

This comment was marked as spam.

@@ -162,7 +163,8 @@ CPVRManager::CPVRManager(void) :
m_bEpgsCreated(false),
m_progressHandle(NULL),
m_managerState(ManagerStateStopped),
m_isChannelPreview(false)
m_isChannelPreview(false),
m_channelNumberInputHandler(4 /* digits */, g_advancedSettings.m_iPVRNumericChannelSwitchTimeout)

This comment was marked as spam.

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from ab840a0 to ccaf719 Compare January 14, 2017 11:30
@ksooo
Copy link
Member Author

ksooo commented Jan 14, 2017

@Jalle19 all of the changes you requested are now in. thanks for the review.

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from ccaf719 to 9e15960 Compare January 14, 2017 11:35
@ksooo
Copy link
Member Author

ksooo commented Jan 14, 2017

jenkins build this please

@da-anda
Copy link
Member

da-anda commented Jan 14, 2017

ok, I tested this PR a bit with latest Milhouse build and found some issues.

  • the number input didn't seem to work when playing a radio channel. All I could enter was 1, all other keys where ignored
  • when in any PVR window (like the channels list) pressing a number still trigger the numpad OSD. We probably should get rid of it and instead jump to the related channel in the list

Then I was wondering about if we could probably use the channel switch delay setting for the delay of the numeric input instead of an advanced setting. IIRC this setting is currently only used when pressing up/down in the OSD and not for channelUp/channelDown actions. Just a thought.

@ksooo
Copy link
Member Author

ksooo commented Jan 14, 2017

Confirming the radio channel bug. Will have look.

The other pvr windows suggestion is for another PR. This is simply not part of this iteration.

Using the official setting instead of the advanced setting (that we were also using here before for whatever reason, btw) makes sense.

EDIT: On second thought, using the official channel switch delay setting makes no sense at it serves a different purpose, imo. The advanced setting is for adjusting the time between the last key press and the actual switch. This generally will usually never be more than 3 seconds, i guess. Compared to this, the official setting is for delay between up/down press followed by immediate display of next/prev channel epg data and the delayed actual switch. Thus, the value depends on how fast people can read the epg data, which could be easily more than 3 seconds, for slower people. So, I guess people might want really different values for the twi use case and think it is fine as it is now.

EDIT2: Radio channel input (other numbers than 1) works fine on my Mac, but not on my custom LibreELEC build. How I hate platform dependent issues!

@da-anda
Copy link
Member

da-anda commented Jan 14, 2017

btw, thanks sooooo much for this PR. I think I owe you a brewery by now ;)

@ksooo
Copy link
Member Author

ksooo commented Jan 14, 2017

ok, I tested this PR a bit with latest Milhouse build and found some issues.
the number input didn't seem to work when playing a radio channel. All I could enter was 1, all other keys where ignored

Radio channel input (other numbers than 1) works fine on my Mac, but not on my custom LibreELEC build.

Seems to be a remote vs. keyboard config issue problem. When using a keyboard, numbers other than 0 and 1 also work on LibreELEC.

Strange.

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from 9e15960 to efabcb3 Compare January 15, 2017 10:59
@da-anda
Copy link
Member

da-anda commented Jan 15, 2017

thought about this feature some more. I think it might be good if the "back" action could also abort the number input process. What do you think?

edit: as for the numeric input. I just saw your fix by also listening to JUMPSMS. The correct fix IMO would be to adjust the remote.xml keymap so that the keys send NUMBER[X] instead of JUMPSMS[X] action, because this mapping seems to be missing for PVR windows from a quick look at the keymap file

edit2: I think the mapping has to be added to the visualisation window (to which FullscreenRadio falls back)

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from efabcb3 to c0d8714 Compare January 15, 2017 12:43
@ksooo
Copy link
Member Author

ksooo commented Jan 15, 2017

thought about this feature some more. I think it might be good if the "back" action could also abort the number input process. What do you think?

maybe later.

edit: as for the numeric input. I just saw your fix by also listening to JUMPSMS. The correct fix IMO would be to adjust the remote.xml keymap

both is needed, to be on the "save" side.

@ksooo
Copy link
Member Author

ksooo commented Jan 15, 2017

jenkins build this please

…, no longer for direct channel number input. the latter will always auto switch after the value of 'channel switch delay'.
@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch from c0d8714 to 43e86a0 Compare January 16, 2017 21:11
@ksooo
Copy link
Member Author

ksooo commented Jan 16, 2017

Well, reworked everything and now it is also possible to use direct input in channel and guide window, @da-anda

@Jalle19 could you please re-review?

Copy link
Member

@Jalle19 Jalle19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More complicated than the previous implementation, but hey, if it works...

@@ -45,6 +44,7 @@ using namespace EPG;

CGUIWindowPVRGuide::CGUIWindowPVRGuide(bool bRadio) :
CGUIWindowPVRBase(bRadio, bRadio ? WINDOW_RADIO_GUIDE : WINDOW_TV_GUIDE, "MyPVRGuide.xml"),
CPVRChannelNumberInputHandler(1000),

This comment was marked as spam.

@da-anda
Copy link
Member

da-anda commented Jan 17, 2017

I think we should drop the JumpSMS stuff now that we found the root cause of it not working on radio channels.
Besides of that, thanks so much again.

@@ -1,11 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<window>
<visible>[[Player.Seeking | Player.DisplayAfterSeek | [Player.Paused + !Player.Caching] | Player.Forwarding | Player.Rewinding | Player.ShowInfo | Window.IsActive(fullscreeninfo) | Window.IsActive(videoosd) | Window.IsActive(playerprocessinfo)] + Window.IsActive(fullscreenvideo)] | Window.IsActive(visualisation) | !String.IsEmpty(Player.SeekNumeric)</visible>
<visible>[[Player.Seeking | Player.DisplayAfterSeek | [Player.Paused + !Player.Caching] | Player.Forwarding | Player.Rewinding | Player.ShowInfo | Window.IsActive(fullscreeninfo) | Window.IsActive(videoosd) | Window.IsActive(playerprocessinfo)] + Window.IsActive(fullscreenvideo)] | Window.IsActive(visualisation) | !String.IsEmpty(Player.SeekNumeric) | !String.IsEmpty(PVR.ChannelNumberInput)</visible>

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@ksooo
Copy link
Member Author

ksooo commented Jan 17, 2017

I think we should drop the JumpSMS stuff now that we found the root cause of it not working on radio channels.

Nope. Currently not needed, but correct nevertheless.

@ksooo
Copy link
Member Author

ksooo commented Jan 17, 2017

More complicated than the previous implementation,

Not really; just factored out a base class of what we had before to reuse the code for three different use cases (before it was only one).

@da-anda
Copy link
Member

da-anda commented Jan 17, 2017

I think we should drop the JumpSMS stuff now that we found the root cause of it not working on radio channels.

Nope. Currently not needed, but correct nevertheless.

it's two different things, isn't it? JumpSMS is about jumping by name while numeric input is jumping by number. But up to you.

@ksooo ksooo force-pushed the pvr-channel-switch-with-okay-cleanup branch 2 times, most recently from e872535 to 3288734 Compare January 17, 2017 22:05
@ksooo
Copy link
Member Author

ksooo commented Jan 17, 2017

jenkins build this please

@ksooo
Copy link
Member Author

ksooo commented Jan 17, 2017

jenkins error is unrelated

@ksooo ksooo merged commit c255597 into xbmc:master Jan 18, 2017
@ksooo ksooo deleted the pvr-channel-switch-with-okay-cleanup branch January 18, 2017 06:49
@da-anda
Copy link
Member

da-anda commented Jan 18, 2017

thanks a lot, huge improvement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: PVR Component: Skin Type: Feature non-breaking change which adds functionality v18 Leia
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants