[Solved] Plugin development under mythtv 30

Post Reply
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

[Solved] Plugin development under mythtv 30

Post by tobiz »

I've tried to build the mythhello plugin as per the official mythhello wiki https://www.mythtv.org/wiki/Talk:Buildi ... :HelloMyth without success. I'm building under mythtv 0.30 and have a running system but the example plugin as described fails to build. Has anyone successfully built mythhello under version 0.30, if so how?
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

Re: Plugin development under mythtv 30

Post by tobiz »

Not being able to get mythhello example plugin to build under mythtv-30 I moved on to mythnotes plugin example, which I still can't get this to build either. Having created all the folders and files for mythnotes and runninng: qmake; make, the best I can get is:

Code: Select all

notesUI.cpp:28:50:   required from here /usr/local/include/mythtv/libmythui/mythuiutils.h:39:16: error: cannot dynamic_cast ‘container->NotesUI::<anonymous>.MythScreenType::<anonymous>.MythUIComposite::<anonymous>.MythUIType::GetChild((* & name))’ (of type ‘class MythUIType*’) to type ‘class MythUIText*’ (target is not pointer or reference to complete type)
         item = dynamic_cast<UIType *>(container->GetChild(name));
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:296: recipe for target 'obj/notesUI.o' failed
make[1]: *** [obj/notesUI.o] Error 1
make[1]: Leaving directory '/home/pjr/Development/mythtv-30/build/mythtv/mythplugins/mythnotes/mythnotes'
Makefile:41: recipe for target 'sub-mythnotes-make_default' failed
make: *** [sub-mythnotes-make_default] Error 2

 
notesUI.cpp is:

Code: Select all

/*
 * Source file for UIs
 *
 * Copyright (C) 2010 Lukas Doktor <ldoktor@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License
 * as published by the Free Software Foundation.
 *
 */

#include "notesUI.h"

NotesUI::NotesUI(MythScreenStack *parent, QString name)
		: MythScreenType(parent, name), m_title(NULL)
{
}

bool NotesUI::Create()
{
	if (!LoadWindowFromXML("notes-ui.xml", "notesui", this))
		return false;

	bool err = false;



	UIUtilE::Assign(this, m_title, "title", &err);
	if (err)
		return false;

	return true;
}
And line 28 is:

Code: Select all

UIUtilE::Assign(this, m_titleText, "title", &err);
notesUI.h is:

Code: Select all

/*
 * Header file for UI
 *
 * Copyright (C) 2010 Lukas Doktor <ldoktor@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License
 * as published by the Free Software Foundation.
 *
 */

#ifndef NOTESUI_H_
#define NOTESUI_H_

#include "notesUI.h"


#include <mythscreentype.h>
#include <mythmainwindow.h>
#include <mythdb.h>
#include <mythdialogbox.h>

class NotesUI : public MythScreenType
{
	Q_OBJECT

  public:
	NotesUI(MythScreenStack *parentStack, QString name = "MythNotes");

	bool Create();

  private:
	MythUIText		*m_title;
};

#endif /* NOTESUI_H_ */
I cannot resolve, "error: cannot dynamic_cast...". It suggests there's something incorrect with the mythnotes files since all the other plugins build without error.
Any ideas as to what's the problem would be most helpful.
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

Re: Plugin development under mythtv 30

Post by tobiz »

Building Plugins:MythNotes02 fails to build:
notesUI.h:23:10: fatal error: mythverbose.h: No such file or directory

How does this get solved? This file does not exist in mythtv/30 source.
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Plugin development under mythtv 30

Post by paulh »

I've updated the MythHello wiki page to be hopefully more relevant to the current builds of MythTV. I compile tested a build of the plugin using current fixes/31 and it built OK. Haven't tried to install or run it though since I use master.

If you have time try the MythHello instructions again and let me know how you get on.

I can do the same for the MythNotes example as well but it's quite time consuming and you need a lot of patience correcting the wiki which is something I don't have :roll:
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

Re: Plugin development under mythtv 30

Post by tobiz »

Thanks for the update, I'll try it. If it works on mythtv/31 I'll try it against mythtv/30 just to see what happens. I'll examine (working) MythHello and look at applying any 'differences' to MythNotes and see how that works out. If this works I wouldn't mind contributing something to the project by updating the MythNotes wiki to a working build (which as far as I can tell at the moment it isn't).
User avatar
paulh
Developer
Posts: 909
Joined: Thu Feb 06, 2014 6:09 pm
Great Britain

Re: Plugin development under mythtv 30

Post by paulh »

I've fixed the MythNotes sources up to https://www.mythtv.org/wiki/Building_Pl ... ythNotes02 - it's a start at least :)
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

Re: Plugin development under mythtv 30

Post by tobiz »

Hi paulh, now have mythtv/30 working with your Hellomyth example mythplugin from the Mythtv wiki as of 10th May 2020 on ubuntu 18.04. Thanks for your help updating the website.
I can now make progress developing my Marantz amp controller plugin
tobiz
Junior
Posts: 21
Joined: Mon Dec 02, 2019 9:53 pm
Great Britain

Re: Plugin development under mythtv 30

Post by tobiz »

Just built and run Hellomyth for mythtv/31 without issue on ubuntu 18.04 as per your instructions.
Post Reply