2012-03-16, 17:27
Hi everyone,
I started developing an xbmc add-on some days ago. The basic idea I have in mind for my add-on is:
1. After I start the Add-on a random movie from a specific folder of my hdd should start
1.1. This folder on my hdd should get the "playlist" for xbmc (so, after a movie ends another movie from the same folder should start)
2. By pressing a specific button on my remote control (not yet sure which button I want to use for this. Maybe the buttons), I want to change the folder/playlist
I have already written some code to implement the behavior of 1.) and 1.1.). Now I need to access the events coming from my remote control. Therefore I found this tutorial but I can't get it running. This is the code of my main.py
I can start the add-on from the video-add-on screen of my xbmc but all I get is a black screen with the "loading directory"-dialog saying "Retrieved 0 items". It seems the dialog will be displayed forever (I tried waiting 30 min). And if I press the cancel-button of this dialog I just get the black screen, two error messages in the log-file (see below), and the 'ESC'-key (ACTION_PREVIOUS_MENU-key) doesn't close this screen (neither does any other key).
So here are my questions:
1. How can I fix this?
2. Is there an other way to get access events? Maybe a better solution as the one I am trying
My setup:
I am using xbmc 10.1 on my gentoo server
For the development I also use a virtual maschine with ubuntu 10.10 and xbmc 11.0
Thanks for helping
I started developing an xbmc add-on some days ago. The basic idea I have in mind for my add-on is:
1. After I start the Add-on a random movie from a specific folder of my hdd should start
1.1. This folder on my hdd should get the "playlist" for xbmc (so, after a movie ends another movie from the same folder should start)
2. By pressing a specific button on my remote control (not yet sure which button I want to use for this. Maybe the buttons), I want to change the folder/playlist
I have already written some code to implement the behavior of 1.) and 1.1.). Now I need to access the events coming from my remote control. Therefore I found this tutorial but I can't get it running. This is the code of my main.py
Code:
import xbmc, xbmcgui
#get actioncodes from keymap.xml
ACTION_PREVIOUS_MENU = 10
class MyClass(xbmcgui.Window):
def onAction(self, action):
if action == ACTION_PREVIOUS_MENU:
self.close()
mydisplay = MyClass()
print "MY Class is created"
mydisplay .doModal()
del mydisplay
I can start the add-on from the video-add-on screen of my xbmc but all I get is a black screen with the "loading directory"-dialog saying "Retrieved 0 items". It seems the dialog will be displayed forever (I tried waiting 30 min). And if I press the cancel-button of this dialog I just get the black screen, two error messages in the log-file (see below), and the 'ESC'-key (ACTION_PREVIOUS_MENU-key) doesn't close this screen (neither does any other key).
Code:
NOTICE: MY Class is created
ERROR: GetDirectory - Error getting plugin://plugin.video.test/
ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.test/) failed
So here are my questions:
1. How can I fix this?
2. Is there an other way to get access events? Maybe a better solution as the one I am trying
My setup:
I am using xbmc 10.1 on my gentoo server
For the development I also use a virtual maschine with ubuntu 10.10 and xbmc 11.0
Thanks for helping