Keymap equivalent to Context - Play?
#1
I really think I'm missing something simple, but I've searched this forum & the wiki, honest!

I'm trying to find a way that, when I press "Play" (P on keyboard, for example) over an item, it's the same as if I opened the Context Menu and selected Play.

I've added <p>Play</p> to keyboard.xml and that didn't do it. That did nothing when selecting a playlist. I thought I could use PlayMedia(Selected) or some command like that, but I can't find it.

Is there a way to make the Play command play the currently selected item? The functionality is already in XBMC because selecting Play from the context menu is perfect.

Thanks!
Reply
#2
"Enter"
Reply
#3
I was hoping it would be something simple like that, but that didn't work. Let me clarify what I'm trying to do:

Action: In library mode, highlight a TV Show. Press Play.

Result for default "Play" behavior: Resume any paused show
Result for default "Select" behavior: Go to seasons view or episode list
Result for Context Menu / Play: Add the entire series to "Now playing" list, start playing selection
Result if "Enter" is mapped to a key: Nothing

My goal is to get a 1 key button to the "Context Menu / Play" result. Enter didn't work. Any other hints?
Reply
#4
Here's the code that's being called:

guiwindowvideobase.cpp:

Code:
// allow a folder to be ad-hoc queued and played by the default player
        if (item->m_bIsFolder || (item->IsPlayList() &&
           !g_advancedSettings.m_playlistAsFolders))
        {
          buttons.Add(CONTEXT_BUTTON_PLAY_ITEM, 208);
        }

That, in turn, calls PlayItem:
Code:
case CONTEXT_BUTTON_PLAY_ITEM:
    PlayItem(itemNumber);
    return true;

So.... PlayItem is allowed in the keymaps. I've seen that already. My question is now - is there a way to pass the selected item along with that? For example:
<p>PlayItem(Selected)</p> or something like that?

The command to get selected item is m_viewControl.GetSelectedItem(); - but that doesn't work in the keymap. Is there some trick getting that to work?
<p>PlayItem(m_viewControl.GetSelectedItem()Wink</p>
Reply
#5
Just Play should do what you want. If it doesn't, then it's unintentional.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#6
jmarshall Wrote:Just Play should do what you want. If it doesn't, then it's unintentional.

I thought that was the intended action, but in Library Mode on videos this seems to be borked. File Mode it works on videos and movies.

Currently - on Dharma Beta1 - pressing Play on a video folder (or genre) while in Library Mode does nothing if there's nothing playing, or will pause/resume a video that is playing.

I'll submit a bug for this.
Reply

Logout Mark Read Team Forum Stats Members Help
Keymap equivalent to Context - Play?0