Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MythPlayerInterface: Restructure inheritance
- this is how I should have implemented it in the first place... - add a MythPlayerUIBase class that inherits from MythPlayer and adds the main UI related objects that we need elsewhere - use a simple A->B->C inheritance structure for incorporating all of the interface subclasses into MythPlayerInterface This ensures:- - the full interface is still visible to the parent TV object - all base class members are visible in the derived classes - hence avoids duplication of member variables - critically - each class in the inheritance line can be a QObject
- Loading branch information
1 parent
4546495
commit 9a28281
Showing
10 changed files
with
94 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// MythTV | ||
#include "mythmainwindow.h" | ||
#include "mythplayeruibase.h" | ||
|
||
/*! \class MythPlayerUIBase | ||
* | ||
* This is the base class for all user facing MythPlayer classes. It contains | ||
* references to all of the major objects that will be needed for other UI player classes. | ||
*/ | ||
MythPlayerUIBase::MythPlayerUIBase(MythMainWindow* MainWindow, TV* Tv, PlayerContext* Context, PlayerFlags Flags) | ||
: MythPlayer(Context, Flags), | ||
m_mainWindow(MainWindow), | ||
m_tv(Tv), | ||
m_render(MainWindow->GetRenderDevice()), | ||
m_painter(MainWindow->GetPainter()), | ||
m_display(MainWindow->GetDisplay()) | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef MYTHPLAYERUIBASE_H | ||
#define MYTHPLAYERUIBASE_H | ||
|
||
// MythTV | ||
#include "mythplayer.h" | ||
|
||
class MythPlayerUIBase : public MythPlayer | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
MythPlayerUIBase(MythMainWindow* MainWindow, TV* Tv, PlayerContext* Context, PlayerFlags Flags); | ||
|
||
MythMainWindow* m_mainWindow { nullptr }; | ||
TV* m_tv { nullptr }; | ||
MythRender* m_render { nullptr }; | ||
MythPainter* m_painter { nullptr }; | ||
MythDisplay* m_display { nullptr }; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.