myGadgets plugin (in Development) (1 Viewer)

magnuje2

Portal Member
May 11, 2006
23
0
I am trying to develop a gadgets plugin that is to be used in my new kitchen. That is, a plugin that shows a summary on one screen from many parts of the MP system which is simple enough to be navigated by a touch screen. It will be some kind of a basic MP setup with all the essential information on one screen. This should be fully configurable to the user which should be able to add, remove and order these "gadgets" (which is small code blocks that retreaves spesific information from the system/plugins). It will also have shortcuts to the plugins shown. For example, if you click the current weather picture the wather plgin should be loaded.

My vision is a kitchen screen that shows today´s agenda from Google Calendar (open API), displays any new emails (myMail plugin?), upcoming TV-sows (bublic methods in mp-core), today´s recordings (should be ok to retreave) and the current wather. Also it would be neat with a scrolling rss feed on the lower end of the screen displaying today´s news and the "Now playing" thing from basic home. Also, more "gadgets" should be easily added.

I am new to C# so i need some help getting started. So I have some questions I hope someone will take time to answer since I think this could be a cool feature which enables MP to be used in other settings than the living room:


1. Is this plugin possible? I have not yet started developing the information retreaval parts which i think is the most complex ones.

2. There are quite a few public metods which can be used to harvest information from the TV-database class, such as "get today´s recordings" and "get the next /current 10 tv-shows". But these return booleans rather than arrays/objects which I find logical. Do any1 know of some code examples describing this sort of information retreaval.

3. The plugins are giving me a headache as these contain no public methods. Take myWeather for example. What is the best way of just extracting the current weather image (the sun/rain/cloudy one) and the temperature without duplicating the code in my plugin? The same with the rss plugin.

4. How do I define scrolling text in the xml file? Need this for the scrolling rss feed

5. I have planned to make a Java config program that just modifies the xml file. This will lead to little extra information retreavlel since the "gadgets" will all run but the user decides who will be visible on the screen. Is there any better way of doing this?

6. Other inputs? How this should be done or what this plugin shold be able to do?


If anyone else with C# experience wants to join my development you are herby invited!
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
1. Yes its possible. I don't believe there's a common way to grab data from the web, so just use the in-built .NET WebRequest and WebService methods. For website scraping, James has written some code that you can reuse. See https://forum.team-mediaportal.com/showthread.php?t=12576&highlight=webepg+web

2. Download the MP code, and check out the Databases project.

3. Try see if the weather plugin writes the data to the PropertyManager class. Plugins should do this, but they don't all comply. Otherwise you can get the weather settings from the MediaPortal.xml file using the MP config methods.

4. not sure.

5. I suggest you implement the ISetupForm interface in C# and write it in that. That way it appears in the MP Configuration dialog. If you can write the plugin in C#, you can write the setup form in C#.

6. I'd be interested in how you allow the user to layout the gadgets on the screen...

Sam
 

magnuje2

Portal Member
May 11, 2006
23
0
Thanks for your help, ill look into it now

6. I'd be interested in how you allow the user to layout the gadgets on the screen...
Sam

I just started looking at xml files a few days ago. But I think it should be possible to have a user custom layout on the screen since every object (button etc) is defined by a ID. So lets say the program guide summary uses objects with ID 1-10, then its just to move those around or not show them at all, giving the user an impression that the plugin is not running.

Then its just to write a program which constructs/alters the xml code someway after the user´s requests. The program needs to know which ID range is assigned to which "gadget".

should work?

If this user config is not possible ill just go for a kitchen plugin with a fixed summary and interface from the MP system. This will be weather, next TV shows, news, today´s recordings, now playing, new mails, radio shortcut, my music shortcut. Agenda from Google calendar and stuff like that which needs information from the web will not be in the first version
 

magnuje2

Portal Member
May 11, 2006
23
0
1
3. Try see if the weather plugin writes the data to the PropertyManager class. Plugins should do this, but they don't all comply. Otherwise you can get the weather settings from the MediaPortal.xml file using the MP config methods.
Sam

On os X system so cant look into the property manager class right now. But according to it´s name I am assuming this class holds plugin properties and not the current weather information I am interensted in? I would like to avoid doing the same web calls as the plugins itself since this information allready exists in the system.
 

samuel337

Portal Pro
August 25, 2004
772
0
Melbourne, Australia
For the layout question - maybe taking a look at the on/off MP skin editor code is an option. Its in MP's SVN repository.

For the propertyManager question - nope. This class was designed to hold bits of information that various plugins get so that other plugins can use it too. For example, it holds information about the currently playing song, the next TV recording, the currently selected item on screen etc.

Sam
 

Users who are viewing this thread

Top Bottom