Basic MythTV plugin configuration: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Plugin support in MythTV is | Plugin support in MythTV is great, but a little rough around the edges to set up. Here is a quick setup HOWTO. | ||
# | # In the mythplugins project, select an existing plugin to clone, and copy the directory. | ||
#: In my case, I added the following block to [mythtv/programs/mythfrontend/library.xml]: | # In the mythplugins project, update the configuration file to build your new plugin. | ||
# In your plugin's main.cpp, update setupKeys(), replacing REG_JUMP actions with new ones. | |||
# In the mythtv project, add a button to the XML ui to access your plugin via your new REG_JUMP action. | |||
# Bang away on your new plugin! | |||
== Details == | |||
<ol> | |||
<li>I chose to clone mythmusic. | |||
<pre> | |||
cd mythplugins | |||
cp -r mythmusic mythdj | |||
cd mythdj | |||
mv mythmusic.pro mythdj.pro | |||
emacs mythdj.pro (s&r as needed) | |||
mv mythmusic mythdj | |||
cd mythdj | |||
mv mythmusic.pro mythdj.pro | |||
emacs mythdj.pro (s&r as needed) | |||
</pre> | |||
Then I search-and-replaced all instances of [mythmusic] with [mythdj], and [MythMusic] with [MythDJ], in the entire mythdj plugin folder. | |||
</li> | |||
<li>Here's what I needed to add to [mythplugins/configure]: | |||
<pre> | |||
dj="yes" | |||
--- | |||
MythDJ related options: | |||
--enable-mythdj MDM build the mythdj plugin [$dj] | |||
--- | |||
--enable-mythdj) dj="yes" | |||
;; | |||
--disable-mythdj) dj="no" | |||
;; | |||
--- | |||
if test "$dj" = "yes" ; then | |||
echo " MythDJ plugin will be built" | |||
echo "SUBDIRS += mythdj" >> ./config.pro | |||
else | |||
echo " MythDJ plugin will not be built" | |||
fi | |||
--- | |||
########################################################### | |||
# # | |||
# MythDJ related configuration options # | |||
# (similar to MythMusic) # | |||
# # | |||
########################################################### | |||
(basically a copy of MythMusic with s&r of 'music' with 'dj') | |||
</pre> | |||
</li> | |||
<li>In my case, I removed all REG_JUMP, REG_JUMPEX, REG_KEY and REG_MEDIA_HANDLER macros from setupKeys(), and replaced them with one new REG_JUMP action "Start DJ". | |||
</li> | |||
<li>In my case, I added the following block to [mythtv/programs/mythfrontend/library.xml]: | |||
<pre> | |||
<button> | |||
<type>DJ_PLAY</type> | |||
<text>Start DJ</text> | |||
<action>JUMP Start DJ</action> | |||
<depends>mythmusic</depends> | |||
<depends>mythdj</depends> | |||
</button> | |||
</pre> | |||
</li> | |||
<li>I'm doing it now! | |||
</li> | |||
</ol> |
Latest revision as of 21:37, 26 November 2008
Plugin support in MythTV is great, but a little rough around the edges to set up. Here is a quick setup HOWTO.
- In the mythplugins project, select an existing plugin to clone, and copy the directory.
- In the mythplugins project, update the configuration file to build your new plugin.
- In your plugin's main.cpp, update setupKeys(), replacing REG_JUMP actions with new ones.
- In the mythtv project, add a button to the XML ui to access your plugin via your new REG_JUMP action.
- Bang away on your new plugin!
Details
- I chose to clone mythmusic.
cd mythplugins cp -r mythmusic mythdj cd mythdj mv mythmusic.pro mythdj.pro emacs mythdj.pro (s&r as needed) mv mythmusic mythdj cd mythdj mv mythmusic.pro mythdj.pro emacs mythdj.pro (s&r as needed)
Then I search-and-replaced all instances of [mythmusic] with [mythdj], and [MythMusic] with [MythDJ], in the entire mythdj plugin folder.
- Here's what I needed to add to [mythplugins/configure]:
dj="yes" --- MythDJ related options: --enable-mythdj MDM build the mythdj plugin [$dj] --- --enable-mythdj) dj="yes" ;; --disable-mythdj) dj="no" ;; --- if test "$dj" = "yes" ; then echo " MythDJ plugin will be built" echo "SUBDIRS += mythdj" >> ./config.pro else echo " MythDJ plugin will not be built" fi --- ########################################################### # # # MythDJ related configuration options # # (similar to MythMusic) # # # ########################################################### (basically a copy of MythMusic with s&r of 'music' with 'dj')
- In my case, I removed all REG_JUMP, REG_JUMPEX, REG_KEY and REG_MEDIA_HANDLER macros from setupKeys(), and replaced them with one new REG_JUMP action "Start DJ".
- In my case, I added the following block to [mythtv/programs/mythfrontend/library.xml]:
<button> <type>DJ_PLAY</type> <text>Start DJ</text> <action>JUMP Start DJ</action> <depends>mythmusic</depends> <depends>mythdj</depends> </button>
- I'm doing it now!