MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Help on Development » General Development (no feature request here!)


General Development (no feature request here!) You were able to fix an issue, or improved a feature? Post it here.

Reply
 
Thread Tools Display Modes
Old 2005-12-08, 12:56   #1 (permalink)
Portal Member
 
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts


Default Idea: Eventing architecture

I think MP could benefit from implementing an eventing architecture where application events (not .NET framework events) can be propagated to enlisted subscribers.

MP would then fire events e.g. when:
- starting
- closing
- entering a module
- playing something
- changing channels
etc.

This way integration of plug-ins would be facilitated, I believe.

Combining this approach with a script plugin would allow for a simple but powerful solution to common automation problems (e.g. "Dim the lights to 25% when I start playing a movie/DVD and at the same time power on the surround receiver and set its volume level to X").

A GUI to show current event wire-up wouldn't hurt either!

Integrating, for instance, LCD-plugins should become a whole lot easier too!

What say ye?

/Nils
niekh is offline   Reply With Quote
Old 2005-12-12, 18:46   #2 (permalink)
Retired Team Member
 
Join Date: Jul 2005
Location: Ørsø, Dronninglund, Denmark
Age: 29
Posts: 449
Thanks: 1
Thanked 0 Times in 0 Posts

Country:


Send a message via MSN to LordMessi Send a message via Skype™ to LordMessi
Default Re: Idea: Eventing architecture

Quote:
Originally Posted by niekh
I think MP could benefit from implementing an eventing architecture where application events (not .NET framework events) can be propagated to enlisted subscribers.

MP would then fire events e.g. when:
- starting
- closing
- entering a module
- playing something
- changing channels
etc.

This way integration of plug-ins would be facilitated, I believe.

Combining this approach with a script plugin would allow for a simple but powerful solution to common automation problems (e.g. "Dim the lights to 25% when I start playing a movie/DVD and at the same time power on the surround receiver and set its volume level to X").

A GUI to show current event wire-up wouldn't hurt either!

Integrating, for instance, LCD-plugins should become a whole lot easier too!

What say ye?

/Nils
Well this sounds like a good idea - when do you start?
__________________
Sincerly / Med venlig hilsen,

Thomas Starup aka LordMessi
LordMessi is offline   Reply With Quote
Old 2005-12-14, 09:24   #3 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts


Default

You might want to start monitoring the event that's fired when a property in the property manager is changed. It will give you all this information and more - you just need to filter and respond to the appropriate ones.

Also, monitor the event that fires when ThreadMessages are fired - this will also give you a lot of information. Here's a list of all the messages that can be fired:

Code:
	GUI_MSG_WINDOW_INIT,
				GUI_MSG_WINDOW_DEINIT,
				GUI_MSG_SETFOCUS,
				GUI_MSG_LOSTFOCUS,
				GUI_MSG_CLICKED,
				GUI_MSG_VISIBLE,
				GUI_MSG_HIDDEN,
				GUI_MSG_ENABLED,
				GUI_MSG_DISABLED,
				GUI_MSG_SELECTED,
				GUI_MSG_DESELECTED,
				GUI_MSG_LABEL_ADD,
				GUI_MSG_LABEL_SET,
				GUI_MSG_LABEL_RESET,
				GUI_MSG_ITEM_SELECTED,
				GUI_MSG_ITEM_SELECT,
        GUI_MSG_ITEM_FOCUS,
				GUI_MSG_LABEL2_SET,
				GUI_MSG_SHOWRANGE,
        GUI_MSG_GET_ITEM,
        GUI_MSG_START_SLIDESHOW,
        GUI_MSG_ITEMS,
        GUI_MSG_GET_SELECTED_ITEM,
        GUI_MSG_PLAYBACK_STOPPED,
        GUI_MSG_PLAYLIST_CHANGED,
        GUI_MSG_PLAYBACK_ENDED,
        GUI_MSG_PLAYBACK_STARTED,
        GUI_MSG_PERCENTAGE_CHANGED,
        GUI_MSG_PLAY_FILE,
        GUI_MSG_STOP_FILE,
        GUI_MSG_SEEK_FILE_PERCENTAGE,
				GUI_MSG_RECORDER_ALLOC_CARD,
        GUI_MSG_RECORDER_FREE_CARD,
        GUI_MSG_RECORDER_STOP_TIMESHIFT,
        GUI_MSG_TUNE_EXTERNAL_CHANNEL,
        GUI_MSG_GET_STRING,
        GUI_MSG_GET_PASSWORD,
        GUI_MSG_SWITCH_FULL_WINDOWED,
        GUI_MSG_PLAY_AUDIO_CD,
        GUI_MSG_CD_REMOVED,
        GUI_MSG_CD_INSERTED,
        GUI_MSG_PLAYING_10SEC,//file is playing 10 sec
        GUI_MSG_PLAY_RADIO_STATION,
        GUI_MSG_SHOW_WARNING,
        GUI_MSG_RESUME_TV,
        GUI_MSG_SEEK_FILE_END,
        GUI_MSG_REFRESH,
        GUI_MSG_ASKYESNO,
        GUI_MSG_NEW_LINE_ENTERED,
        GUI_MSG_FILE_DOWNLOADED,
        GUI_MSG_FILE_DOWNLOADING,
        GUI_MSG_USER,
        GUI_MSG_MSN_MESSAGE,
        GUI_MSG_MSN_STATUS_MESSAGE,
        GUI_MSG_MSN_CLOSECONVERSATION,
        GUI_MSG_ITEM_FOCUS_CHANGED,
				GUI_MSG_PLAY_ITEM,
				GUI_MSG_RECORDER_VIEW_CHANNEL,
				GUI_MSG_RECORDER_STOP_VIEWING,
				GUI_MSG_GOTO_WINDOW,
				GUI_MSG_RECORDER_TUNE_RADIO,
				GUI_MSG_RECORDER_STOP_RADIO,
				GUI_MSG_VOLUME_INSERTED,
				GUI_MSG_VOLUME_REMOVED,
				GUI_MSG_AUTOPLAY_VOLUME,
				GUI_MSG_SHOW_DIRECTORY,
				GUI_MSG_SHOW_MESSAGE,
				GUI_MSG_HIDE_MESSAGE,
				GUI_MSG_NOTIFY,
				GUI_MSG_RECORDER_STOP_TV,
				GUI_MSG_CLICKED_UP,
				GUI_MSG_CLICKED_DOWN,
				GUI_MSG_RECORDER_ABOUT_TO_START_RECORDING,
				GUI_MSG_NOTIFY_TV_PROGRAM,
				GUI_MSG_RESTART_REMOTE_CONTROLS,
				GetList,
				GUI_MSG_SEEK_POSITION,
				GUI_MSG_PLAYER_POSITION_CHANGED,
        GUI_MSG_RECORD
Also, the player component also fires events when an item starts playing (song, video, tv etc.), when it stops, when the next item is played in the playlist etc.

So I think more the point is that some one needs to go in and make sure all these messages are fired at the appropriate moment, rather than creating a new event manager.

EDIT: Hang on - what do you mean by 'application events (not .NET framework events)'?

Sam
samuel337 is offline   Reply With Quote
Old 2005-12-14, 11:19   #4 (permalink)
Portal Member
 
Join Date: Oct 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts


Default

Quote:
Originally Posted by samuel337
EDIT: Hang on - what do you mean by 'application events (not .NET framework events)'?
Just a statement to raise the abstraction level a bit!

What I mean is that the events we are interested in are the ones where MP's state changes in such a way as in the examples I presented rather than events like "Widget X was clicked".

That's why I said "(not .NET framework events)" although I fully understand that .NET events can be used when implementing an eventing architecture.

I have just started studying MP's sources (and it's a daunting task!) so I can't say for sure that support for feature X is missing or not but I do believe that plugin authors and MP as a whole could benefit from a unified way of receiving and raising application events (if it's already there, great!). That in combination with my lack of knowledge of MP's internals is why I made the proposition hoping that some of the more seasoned MP devs would consider it and comment upon it.
niekh is offline   Reply With Quote
Old 2005-12-14, 11:24   #5 (permalink)
Portal Member
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 773
Thanks: 0
Thanked 0 Times in 0 Posts


Default

In that case, I think the examples I gave pretty much answer your question.

Sam
samuel337 is offline   Reply With Quote
Reply

Bookmarks

Tags
architecture, eventing, idea

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuration idea for EPG in MP (make it simple but still powerful) Lyxalig Improvement Suggestions 5 2006-11-10 17:10
Photo Skin - A new idea Visard Skins 23 2005-11-01 19:33
An idea about interoperability and scripting... Clodo General Development (no feature request here!) 5 2005-09-26 12:19
A nice little simple idea Anonymous Improvement Suggestions 3 2004-11-14 23:07


All times are GMT +1. The time now is 21:21.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden