home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Products
TV-Server
TV Engine 3 Plugins
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="hurley" data-source="post: 1163072" data-attributes="member: 151395"><p>You could put your third party library in the TVServer Plugins folder but the TVService will <strong><em>try</em></strong> to load it as a plugin, which should fail without error.</p><p>Don't know if that's a good idea or not. Refer to: <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TvService/Service1.cs#L772" target="_blank"><span style="color: #0000b3">TvService.TvServiceThread.StartPlugins()</span></a> and <a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TvService/PluginLoader.cs" target="_blank"><span style="color: #0000b3">TvService.PluginLoader.Load()</span></a></p><p><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TvService/PluginLoader.cs" target="_blank"><span style="color: #0000b3"></span></a></p><p><strong>Edit:</strong> Re mm's link: <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx" target="_blank">Dynamic-Link Library Search Order</a></p><p><em>"Application loaded from directory"</em> and <em>"Current Directory"</em> will both be <em>C:\Program Files\Team MediaPortal\MediaPortal TV Server</em> at plugin load. So above may be a moot point. <span style="font-size: 10px">(Sorry, last post edit I swear)</span> :|</p><p></p><p>Some tips from what I've learned:</p><p>The IController sent to your plugin through it's <span style="color: #0000b3">Start(IController controller)</span> method is an interface to the <em>TVService.TVController</em> instance. This has many useful functions for a TV Server plugin.</p><p></p><p>Other particularly useful classes for the areas you're looking at:</p><p style="margin-left: 20px"><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/TvBusinessLayer/BusinessLayer.cs" target="_blank"><span style="color: #0000b3">TvDatabase.TvBusinessLayer</span></a></p> <p style="margin-left: 20px"><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Program.cs" target="_blank"><span style="color: #0000b3">TvDatabase.Program</span></a></p> <p style="margin-left: 20px"><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Schedule.cs" target="_blank"><span style="color: #0000b3">TvDatabase.Schedule</span></a></p> <p style="margin-left: 20px"><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Recording.cs" target="_blank"><span style="color: #0000b3">TvDatabase.Recording</span></a></p> <p style="margin-left: 20px"><a href="https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Channel.cs" target="_blank"><span style="color: #0000b3">TvDatabase.Channel</span></a></p><p></p><p>Of course as mentioned the TvServerEvents will be useful and as mm said referring to the built in plugins helped me a lot too.</p><p>Subscribe to TvServerEvents in your plugin's Start method and unsubscribe in Close</p><p>[CODE]public void Start(IController controller)</p><p>{</p><p> //...</p><p></p><p> ITvServerEvent events = GlobalServiceProvider.Instance.Get<ITvServerEvent>();</p><p> events.OnTvServerEvent += new TvServerEventHandler(events_OnTvServerEvent);</p><p>}</p><p></p><p>public void Stop()</p><p>{</p><p> //...</p><p></p><p> if (GlobalServiceProvider.Instance.IsRegistered<ITvServerEvent>())</p><p> {</p><p> GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= events_OnTvServerEvent;</p><p> }</p><p>}[/CODE]</p><p></p><p>Ah, just found my link to Version Compatibility info, knew it was in the wiki somewhere: <a href="http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/6_Plugins/Version_Compatibility" target="_blank">Version Compatibility</a></p><p>Also just stumbled on <a href="https://forum.team-mediaportal.com/threads/ledcontroller-control-your-leds-htpcmonitor-keep-an-eye-on-your-pc.44948/" target="_blank">LEDController</a> amongst my MePo archives. Unfortunately the original post has been deleted and there was no source code, but this looks like it did exactly what was requested in <a href="https://forum.team-mediaportal.com/threads/visual-indicator-when-recording.132598/#post-1162925" target="_blank">Visual indicator when recording.</a></p><p></p><p>[ATTACH]172468[/ATTACH]</p><p><span style="font-size: 10px">Edit: Fixed link to Version Compatibility. Added git links to source references.</span></p></blockquote><p></p>
[QUOTE="hurley, post: 1163072, member: 151395"] You could put your third party library in the TVServer Plugins folder but the TVService will [B][I]try[/I][/B] to load it as a plugin, which should fail without error. Don't know if that's a good idea or not. Refer to: [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TvService/Service1.cs#L772'][COLOR=#0000b3]TvService.TvServiceThread.StartPlugins()[/COLOR][/URL] and [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TvService/PluginLoader.cs'][COLOR=#0000b3]TvService.PluginLoader.Load() [/COLOR][/URL] [B]Edit:[/B] Re mm's link: [URL='https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx']Dynamic-Link Library Search Order[/URL] [I]"Application loaded from directory"[/I] and [I]"Current Directory"[/I] will both be [I]C:\Program Files\Team MediaPortal\MediaPortal TV Server[/I] at plugin load. So above may be a moot point. [SIZE=2](Sorry, last post edit I swear)[/SIZE] :| Some tips from what I've learned: The IController sent to your plugin through it's [COLOR=#0000b3]Start(IController controller)[/COLOR] method is an interface to the [I]TVService.TVController[/I] instance. This has many useful functions for a TV Server plugin. Other particularly useful classes for the areas you're looking at: [INDENT][URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/TvBusinessLayer/BusinessLayer.cs'][COLOR=#0000b3]TvDatabase.TvBusinessLayer[/COLOR][/URL] [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Program.cs'][COLOR=#0000b3]TvDatabase.Program[/COLOR][/URL] [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Schedule.cs'][COLOR=#0000b3]TvDatabase.Schedule[/COLOR][/URL] [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Recording.cs'][COLOR=#0000b3]TvDatabase.Recording[/COLOR][/URL] [URL='https://github.com/MediaPortal/MediaPortal-1/blob/master/TvEngine3/TVLibrary/TVDatabase/Channel.cs'][COLOR=#0000b3]TvDatabase.Channel[/COLOR][/URL][/INDENT] Of course as mentioned the TvServerEvents will be useful and as mm said referring to the built in plugins helped me a lot too. Subscribe to TvServerEvents in your plugin's Start method and unsubscribe in Close [CODE]public void Start(IController controller) { //... ITvServerEvent events = GlobalServiceProvider.Instance.Get<ITvServerEvent>(); events.OnTvServerEvent += new TvServerEventHandler(events_OnTvServerEvent); } public void Stop() { //... if (GlobalServiceProvider.Instance.IsRegistered<ITvServerEvent>()) { GlobalServiceProvider.Instance.Get<ITvServerEvent>().OnTvServerEvent -= events_OnTvServerEvent; } }[/CODE] Ah, just found my link to Version Compatibility info, knew it was in the wiki somewhere: [URL='http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/18_Contribute/6_Plugins/Version_Compatibility']Version Compatibility[/URL] Also just stumbled on [URL='https://forum.team-mediaportal.com/threads/ledcontroller-control-your-leds-htpcmonitor-keep-an-eye-on-your-pc.44948/']LEDController[/URL] amongst my MePo archives. Unfortunately the original post has been deleted and there was no source code, but this looks like it did exactly what was requested in [URL='https://forum.team-mediaportal.com/threads/visual-indicator-when-recording.132598/#post-1162925']Visual indicator when recording.[/URL] [ATTACH]172468[/ATTACH] [SIZE=2]Edit: Fixed link to Version Compatibility. Added git links to source references.[/SIZE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Products
TV-Server
TV Engine 3 Plugins
Contact us
RSS
Top
Bottom