[mythtv] Guide to write a plugin?

Josh Lefler joshlefler at leflerinc.com
Thu Oct 12 20:02:57 UTC 2006


I've started doing just that at

http://www.mythtv.org/wiki/index.php/MythPlugin_Architecture

but it is still an early work in progress.

Josh Lefler
Lefler, Inc.
Website: www.leflerinc.com



Steven Adeff wrote:
> On 10/12/06, Josh Lefler <joshlefler at leflerinc.com> wrote:
>   
>>  <snip>
>>  Josh Lefler wrote:
>>
>>
>>  Henrik,
>>
>> I recently wrote my first plugin for myth (Ticket #2482) and had much
>> the same dilemma as you when I got started. Here are a few bits of
>> information that made the process easier for me:
>>
>>
>>  <snip>
>>  Thank you very much for your reply. A few more questions:
>>
>> How do I go about compiling the thing? I should end up with what? A .so
>> file? And where do I place this? With what filename?
>>
>>  Yes, you should end up with a .so file. Look at the (pluginname).pro file
>> for one of the plugins or my patch. You'll see that each plugin actually has
>> several .pro files. One in the parent directory, and one in each
>> subdirectory. The one in the parent directory simply points to the ones in
>> the subdirectories so you can keep different binaries for you plugin (if it
>> has more than one binary) organized but still make them all with one
>> command. Your best bet is just to copy these pro files from another plugin
>> then tweak them to your needs by changing the lines specific to your plugin.
>> Look through the files and you'll get a better idea of what I mean.
>>
>>  Then, you run qmake to generate a Makefile based upon the .pro files and
>> then make as normal. If you setup your plugin like an existing official
>> plugin (like I did mine), then you'll have an easier time with installation
>> etc. as the mythplugins directory itself helps find the proper install
>> location etc. Look through configure for mythplugins to see what I mean.
>>
>>
>>
>>  Regarding the UI xml file, does it need to have a specific name, or do I
>> reference it from within my code?
>>
>>
>>  You pass in a portion of the filename. Specifically, anything before the
>> "ui.xml". I do this on line 46 of main.cpp in my plugin.
>>
>>
>>
>>  Do you know anything about the i18n folder, containing translations? Is
>> that for internal use only, or does mythtv choose the translation etc
>> somehow?
>>
>>
>>  The i18n folder is for translations - but I haven't implemented it yet so
>> can't help ya much there.
>>
>>  Sorry if I'm asking dumb questions, I haven't yet figured out how things
>> play together.
>>
>>
>>  I asked a lot of dumb questions when I was getting started, and Anduin,
>> Isaac (chutt), xris, etc. were very helpful.. just happy to be able to
>> return the favor in an indirect sort of way.
>>
>>  / Henrik
>>
>>
>>  Henrik Gammelmark wrote:
>>
>>
>>  I have looked around on mythtv.org, but I cannot seem to find any
>> documentation / howtos / turorials / faqs on how to build a simple
>> plugin for MythTV.
>>
>> Does anyone know of any such guide or at least some sort of
>> documentation to use? For starters I wish to create simple Hello World
>> plugin that appears in the main menu, and responds to a keystroke (or
>> lirc key) by doing something useless.
>>
>> In #mythtv @ Freenode, I was told that there is no such guide or sample
>> plugin, and the best way to go about it, is study an existing plugin. So
>> I started taking apart mythweather, but I quickly got stuck.
>>
>> Any pointers would be helpful - what is the bare minimum of code
>> required to accomplish the above task, and also, what is the build
>> procedure? I never used qmake before, and I'm not sure I understand what
>> it does.
>>
>> Thank you very much in advance
>>     
>
> you guys should put this information on the Wiki.
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20061012/5bd6cac1/attachment.htm 


More information about the mythtv-dev mailing list