[mythtv] Guide to write a plugin?
Henrik Gammelmark
mythtv at geemark.com
Fri Oct 13 13:14:39 UTC 2006
Josh Lefler 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.
Thanks, it was pretty straight-forward, given your explanation. I now
have a .so file, and added a menu item for it, able to display a blank
screen.
>> 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.
I am trying to make a single gui in a XML file, and got it to load
without errors. However, the screen is entirely blank.
I have a few <font>'s, and a single <container> with an <image> and a
<textarea> in it, but neither are displayed.
How do I use these containers etc, and how do they relate? One container
per page? Are they hidden by default?
What do I need to do in the code to make it work? Do I need to do
anything? ;)
Any pointers to how this gui thing is organized would be helpful.
>> 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'm skipping that one for now, then
> 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
>>>>
>>>> / Henrik
>>>> _______________________________________________
More information about the mythtv-dev
mailing list