XBMC Plugin UPDATE

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
siggma
Posts: 4
Joined: Thu Feb 25, 2010 9:11 pm

XBMC Plugin UPDATE

Post by siggma » Thu Feb 25, 2010 9:37 pm

System Particulars:
EventGhost 0.3.7.r1436
Windows 7 build 7600
XBMC 9.11 r26017
Rosewill RRC-127 remote
Standard eHome driver (Topseed device)


There is apparently no pre-defined way to bring up the Player controls in the current XBMC plugin.
I've added and tested the following modification to the EventGhost/plugins/XBMC/__init__.py

See comment line below:

Code: Select all

ACTIONS = (   
    ("Up", "Up", "Moves up in the interface.", "Up"),        
    ("Down", "Down", "Moves down in the interface.", "Down"),        
    ("Left", "Left", "Moves left in the interface.", "Left"),        
    ("Right", "Right", "Moves right in the interface.", "Right"),        
    ("PageUp", "Page Up", "Moves up a page in the interface.", "PageUp"),
    ("PageDown", "Page Down", "Moves down a page in the interface.", "PageDown"),
    ("Select", "Select", "Selects the current element.", "Select"),
    ("PreviousMenu", "Previous Menu", "Previous menu.", "PreviousMenu"),
    ("ContextMenu", "Context Menu", "Context menu.", "ContextMenu"),
    ("Play", "Play", "Toggles play/pause of the current media.", "Play"),
    ("Pause", "Pause", "Pauses the current media.", "Pause"),
    ("Stop", "Stop", "Stops playback of the current media.", "Stop"),
    ("FastForward", "Fast Forward", "Fast-forwards the current media.", "FastForward"),
    ("Rewind", "Rewind", "Rewinds the current media.", "Rewind"),
    ("SkipNext", "Skip Next", "Skips to the next media item.", "SkipNext"),
    ("SkipPrevious", "Skip Previous", "Skips back to the previous media item.", "SkipPrevious"),
    ("Record", "Record", "Starts recording.", "Record"),
    ("BigSkipBackward", "Big Skip Backward", "Big skip backward.", "PlayerControl(BigSkipBackWard)"),
    ("BigSkipForward", "Big Skip Forward", "Big skip forward.", "PlayerControl(BigSkipForward)"),
    ("SmallSkipBackward", "Small Skip Backward", "Small skip backward.", "PlayerControl(SmallSkipBackward)"),
    ("SmallSkipForward", "Small Skip Forward", "Small skip forward.", "PlayerControl(SmallSkipForward)"),
    ("AspectRatio", "Aspect Ratio", "Display the aspect ratio of the current media.", "AspectRatio"),
    ("CodecInfo", "Codec Info", "Display the codec information of the current media.", "CodecInfo"),
    ("FullScreen", "Full Screen", "Display the current media in full screen mode.", "FullScreen"),
    ("Repeat", "Repeat", "Repeat.", "PlayerControl(Repeat)"),      
    ("ShowSubtitles", "Show Subtitles", "Toggle subtitles on or off.", "ShowSubtitles"),
#-----Player Controls---#
    ("Player", "Player Window", "Activate Player Window.", "ActivateWindow(PlayerControls)"),
    ("OSD", "Show OSD", "Shows the on-screen display.", "OSD"),
    ("ShowTime", "Show Time", "Show current play time.", "ShowTime"),
    ("VolumeUp", "Volume Up", "Raises the volume.", "VolumeUp"),       
    ("VolumeDown", "Volume Down", "Lowers the volume.", "VolumeDown"), 
    ("Mute", "Mute", "Simulate a press on the mute button.", "Mute"),
    ("ScrollUp", "Scroll Up", "Scroll up in list.", "ScrollUp"),
    ("ScrollDown", "Scroll Down", "Scroll down in list.", "ScrollDown"),
    ("Close", "Close", "Close and open dialog box.", "Close"),
    ("Number0", "Number 0", "Remote number 0.", "Number0"),
    ("Number1", "Number 1", "Remote number 1.", "Number1"),
    ("Number2", "Number 2", "Remote number 2.", "Number2"),
    ("Number3", "Number 3", "Remote number 3.", "Number3"),
    ("Number4", "Number 4", "Remote number 4.", "Number4"),
    ("Number5", "Number 5", "Remote number 5.", "Number5"),
    ("Number6", "Number 6", "Remote number 6.", "Number6"),
    ("Number7", "Number 7", "Remote number 7.", "Number7"),
    ("Number8", "Number 8", "Remote number 8.", "Number8"),
    ("Number9", "Number 9", "Remote number 9.", "Number9"),
    ("Playlist", "Playlist", "Shows the current playlist.", "Playlist"),
    ("Queue", "Queue", "Queue the current item.", "Queue"),
    ("MoveItemUp", "Move Item Up", "Move item up in playlist.", "MoveItemUp"),
    ("MoveItemDown", "Move Item Down", "Move item down in playlist.", "MoveItemDown"),
    ("Delete", "Delete", "Delete the current item.", "Delete"),
    ("Random", "Random", "Random.", "PlayerControl(Random)"),
    ("Repeat", "Repeat", "Repeat.", "PlayerControl(Repeat)"),
    ("PartyMode", "Party Mode", "Party mode.", "PlayerControl(PartyMode)"),
    ("ParentDir", "Parent Dir", "Parent directory.", "ParentDir"),
    ("Info", "Info", "Contextual information.", "Info"),
    ("TakeScreenShot", "Take Screen Shot", "Takes a screen shot.", "TakeScreenshot"),
    ("EjectTray", "Eject Tray", "Close or open the DVD tray.", "EjectTray"),
    ("PlayDVD", "Play DVD", "Plays the inserted CD or DVD media from the DVD-ROM Drive.", "PlayDVD"),
    ("Home", "Show Home Screen", "Show Home screen.", "ActivateWindow(Home)"),
    ("MyVideos", "Show Videos Screen", "Show Videos screen.", "ActivateWindow(MyVideos)"),
    ("MyMusic", "Show Music Screen", "Show Music screen.", "ActivateWindow(MyMusic)"),
    ("MyPictures", "Show Pictures Screen", "Show Pictures screen.", "ActivateWindow(MyPictures)"),
	("MyMovies", "Show Movies Screen", "Show Movies screen.", "ActivateWindow(MyVideoLibrary,movietitles,return)"),
	("MyTVShows", "Show TV Shows Screen", "Show TV Shows screen.", "ActivateWindow(MyVideoLibrary,tvshowtitles,return)"),   
    ("Weather", "Show Weather Screen", "Show Weather screen.", "ActivateWindow(Weather)"),
    ("Settings", "Show Settings Screen", "Show Settings screen.", "ActivateWindow(Settings)"),
    ("Favorites", "Show Favorites Screen", "Show Favorites screen.", "ActivateWindow(Favourites)"),
    ("SystemInfo", "Show System Info Screen", "Show System Info screen.", "ActivateWindow(SystemInfo)"),
    ("LastFMLove", "Last FM Love", "Add the current playing last.fm radio track to the last.fm loved tracks.", "LastFM.Love"),
    ("LastFMBan", "Last FM Ban", "Ban the current playing last.fm radio track.", "LastFM.Ban"),
    ("UpdateVideoLibrary", "Update Video Library", "Update the video library.", "UpdateLibrary(Video)"),
    ("UpdateMusicLibrary", "Update Music Library", "Update the music library.", "UpdateLibrary(Music)"),
    ("ShutdownMenu", "Show Shutdown Menu", "Show the shutdown Menu.", "ActivateWindow(ShutdownMenu)"),
    ("Quit", "Quit XBMC", "Quit XBMC.", "Quit"),
    ("Shutdown", "Shutdown Computer", "Trigger default shutdown behavior from settings.", "Shutdown"),
    ("Powerdown", "Powerdown Computer", "Powerdown the computer.", "Powerdown"),
    ("Suspend", "Suspend Computer", "Suspend the computer.", "Suspend"),
    ("Hibernate", "Hibernate Computer", "Hibernate the computer.", "Hibernate"),
    ("Reset", "Reset Computer", "Reset the computer.", "Reset"),
)    
This addition is really necessary so I can run XBMC on my HDTV and still use the computer for other things. Emulating any keystrokes won't work if the current context is the desktop, obviously.

If I set the XBMC video to "use a fullscreen window rather than true fullscreen" under Settings->System->Video output I can still use the computer desktop since the remote output is isolated to XBMC. So far it works like a charm!

My mceremote.xml is attached. In my version of mceremote.xml the big green button opens the home screen and the channel +/- keys control the system volume separate from XBMC. The rest is pretty basic.

Thanks for all the hard work on this project. I hope this is helpful.
Attachments
mceremote.xml
XBMC mceremote.xml using the above modifications to __init__.py
(14.11 KiB) Downloaded 248 times

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: XBMC Plugin UPDATE

Post by jonib » Thu Feb 25, 2010 11:12 pm

Have you checked out my XBMC plugin XBMCRepeat?
It has a lot more options to control XBMC.

ActivateWindow(PlayerControls) looks useful so I will add it to my plugin.
Edit: so it was less useful then I thought but I'll add it anyway. :?

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: XBMC Plugin UPDATE

Post by jonib » Fri Feb 26, 2010 1:13 am

siggma wrote: This addition is really necessary so I can run XBMC on my HDTV and still use the computer for other things. Emulating any keystrokes won't work if the current context is the desktop, obviously.
After looking at what the command does I'm wondering why you need it? if your using a remote to control XBMC.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

UnknowNinjah
Posts: 1
Joined: Fri Feb 26, 2010 3:34 am

Re: XBMC Plugin UPDATE

Post by UnknowNinjah » Fri Feb 26, 2010 3:39 am

Sorry if this is not the place to post this, but i have been searching the forums for a while now...

I have that same remote your talking about the Rosewill RRC-127, Just downloaded XBMC & EventGhost, but im having trouble on how to add the remote to eventghost... any help would be appreciated...

User avatar
Livin
Experienced User
Posts: 792
Joined: Wed Oct 08, 2008 4:56 am

Re: XBMC Plugin UPDATE

Post by Livin » Fri Feb 26, 2010 6:15 am

@UnknowNinjah
you're right, you should start your own and give a lot more info. though it looks like you need to do more reading as there are many how-to's here and on the XBMC forum and setup is really simple.


@siggma
I don't understand the purpose. Do you mean that you are using a dual screen with XBMC on one and still using the PC (via KB & mouse) on another?
setup... XBMC, W7MC for DVR & Live OTA TV, JRMC for multi-zone audio, EG, MiCasaVerde Vera3, USB-UIRT IR receiver, Harmony remote, 5.2 home theater system

siggma
Posts: 4
Joined: Thu Feb 25, 2010 9:11 pm

Re: XBMC Plugin UPDATE

Post by siggma » Sat Feb 27, 2010 3:43 am

jonib wrote:
siggma wrote: This addition is really necessary so I can run XBMC on my HDTV and still use the computer for other things. Emulating any keystrokes won't work if the current context is the desktop, obviously.
After looking at what the command does I'm wondering why you need it? if your using a remote to control XBMC.

jonib
You're right, less than useful. Yes I'm using a remote but there does not seem to be an action that I can bind to a remote key to bring up the music player controls while in full screen (visualization only). On my remote I bind the "aspect" key to "full screen" so I can see the visualization full screen with a music playlist. When music is playing it clears the menu and displays just the visualization. At that point I need a way to bring up the player control without using the keyboard and I can't seem to find one in either the original XBMC or XBMC.REPEAT plugins. Am I missing something?

On the XBOX (PM3-HD skin) the "x" key (??) brings up that little 3D X with player and visualization controls. I'm struggling to get the remote to activate the player and context menus without having to send an actual keyboard stroke via EventGhost. I can't find an XBMC plugin action that works. If I create a custom macro and send an "{m}" it works fine unless the context is the desktop in which case the "m" key ends up in Firefox, or Thunderbird or "dings" at the desktop while the remote toting numskul across the room keep pushing the button... The goal is to isolate XBMC from the keyboard and mouse so it will work even if the foreground window is not XBMC on the HDTV.

I upgraded to the latest svn (XBMC PRE-10.5 r28078 Compiled FEB 23 2010) from HERE and noticed that annoying "Parent Directory" vs "Backspace" vs "Previous Menu" thing works correctly so that's good.

Any suggestions?

siggma
Posts: 4
Joined: Thu Feb 25, 2010 9:11 pm

Re: XBMC Plugin UPDATE

Post by siggma » Sat Feb 27, 2010 3:49 am

Livin wrote: @siggma
I don't understand the purpose. Do you mean that you are using a dual screen with XBMC on one and still using the PC (via KB & mouse) on another?
Yes. By checking "Settings->Appearance->Video->"use fullscreen window rather than true fullscreen" I can have XBMC on the HDTV and still use the desktop for other things. I suspect this works correctly because EventGhost sends remote output via python calls rather than poking stuff into the keyboard buffer. See previous reply.

Tom

jonib
Plugin Developer
Posts: 1344
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: XBMC Plugin UPDATE

Post by jonib » Sat Feb 27, 2010 4:21 am

siggma wrote: You're right, less than useful. Yes I'm using a remote but there does not seem to be an action that I can bind to a remote key to bring up the music player controls while in full screen (visualization only). On my remote I bind the "aspect" key to "full screen" so I can see the visualization full screen with a music playlist. When music is playing it clears the menu and displays just the visualization. At that point I need a way to bring up the player control without using the keyboard and I can't seem to find one in either the original XBMC or XBMC.REPEAT plugins. Am I missing something?
Unless I'm totally misunderstanding you I get that menu by pressing Buttons\Remote\Menu in my XBMCRepeat plugin, I get the same pressing the Menu button on my XBOX also.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image

siggma
Posts: 4
Joined: Thu Feb 25, 2010 9:11 pm

Re: XBMC Plugin UPDATE

Post by siggma » Sat Feb 27, 2010 4:38 am

jonib wrote:
siggma wrote: Unless I'm totally misunderstanding you I get that menu by pressing Buttons\Remote\Menu in my XBMCRepeat plugin, I get the same pressing the Menu button on my XBOX also.

jonib
I'll try it, thanks.

Post Reply