MythTV  master
mythburn.h
Go to the documentation of this file.
1 #ifndef MYTHBURN_H_
2 #define MYTHBURN_H_
3 
4 #include <utility>
5 
6 // mythtv
7 #include <mythscreentype.h>
8 
9 // mytharchive
10 #include "archiveutil.h"
11 
12 class MythUIText;
13 class MythUIButton;
14 class MythUICheckBox;
15 class MythUIButtonList;
16 class MythUIProgressBar;
18 
20 {
21  Q_OBJECT
22 
23  public:
24  ProfileDialog(MythScreenStack *parent, ArchiveItem *archiveItem,
25  QList<EncoderProfile *> profileList)
26  : MythScreenType(parent, "functionpopup"),
27  m_archiveItem(archiveItem),
28  m_profileList(std::move(profileList)) {}
29  bool Create() override; // MythScreenType
30 
31  signals:
32  void haveResult(int profile);
33 
34  private slots:
35  void save(void);
37 
38  private:
40  QList<EncoderProfile *> m_profileList;
41 
46 
50 };
51 
52 class MythBurn : public MythScreenType
53 {
54 
55  Q_OBJECT
56 
57  public:
58  MythBurn(MythScreenStack *parent,
59  MythScreenType *destinationScreen, MythScreenType *themeScreen,
60  ArchiveDestination archiveDestination, const QString& name);
61 
62  ~MythBurn(void) override;
63 
64  bool Create(void) override; // MythScreenType
65  bool keyPressEvent(QKeyEvent *event) override; // MythScreenType
66 
67  void createConfigFile(const QString &filename);
68 
69  protected slots:
70  void handleNextPage(void);
71  void handlePrevPage(void);
72  void handleCancel(void);
73  void handleAddRecording(void);
74  void handleAddVideo(void);
75  void handleAddFile(void);
76 
77  void toggleUseCutlist(void);
78  void ShowMenu(void) override; // MythScreenType
79  void editDetails(void);
80  void editThumbnails(void);
81  void changeProfile(void);
82  void profileChanged(int profileNo);
83  void removeItem(void);
84  void selectorClosed(bool ok);
85  void editorClosed(bool ok, ArchiveItem *item);
87 
88  private:
89  void updateArchiveList(void);
90  void updateSizeBar();
91  void loadConfiguration(void);
92  void saveConfiguration(void);
93  EncoderProfile *getProfileFromName(const QString &profileName);
94  static QString loadFile(const QString &filename);
95  static bool isArchiveItemValid(const QString &type, const QString &filename);
96  void loadEncoderProfiles(void);
99  void runScript();
100 
104 
105  QList<ArchiveItem *> m_archiveList;
106  QList<EncoderProfile *> m_profileList;
107 
108  bool m_bCreateISO {false};
109  bool m_bDoBurn {false};
110  bool m_bEraseDvdRw {false};
111  QString m_saveFilename;
112  QString m_theme;
113 
114  bool m_moveMode {false};
115 
119 
125 
126  // size bar
132 };
133 
135 
136 class BurnMenu : public QObject
137 {
138  Q_OBJECT
139 
140  public:
141  BurnMenu(void);
142  ~BurnMenu(void) override = default;
143 
144  void start(void);
145 
146  private:
147  void customEvent(QEvent *event) override; // QObject
148  static void doBurn(int mode);
149 };
150 
151 #endif
152 
153 
MythUIText * m_oldSizeText
Definition: mythburn.h:44
QList< EncoderProfile * > m_profileList
Definition: mythburn.h:40
BurnMenu(void)
Definition: mythburn.cpp:1083
unsigned int slots[4]
Definition: element.c:38
MythScreenType * m_themeScreen
Definition: mythburn.h:102
QString m_saveFilename
Definition: mythburn.h:111
MythScreenType * m_destinationScreen
Definition: mythburn.h:101
All purpose text widget, displays a text string.
Definition: mythuitext.h:28
~BurnMenu(void) override=default
MythUIText * m_maxsizeText
Definition: mythburn.h:128
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
void haveResult(int profile)
QString m_theme
Definition: mythburn.h:112
MythUIButton * m_cancelButton
Definition: mythburn.h:118
void updateSizeBar()
Definition: mythburn.cpp:191
MythUIButton * m_okButton
Definition: mythburn.h:49
MythUICheckBox * m_enabledCheck
Definition: mythburn.h:48
void createConfigFile(const QString &filename)
Definition: mythburn.cpp:558
static QString loadFile(const QString &filename)
Definition: mythburn.cpp:361
void itemClicked(MythUIButtonListItem *item)
Definition: mythburn.cpp:998
MythUIText * m_minsizeText
Definition: mythburn.h:129
void profileChanged(MythUIButtonListItem *item)
Definition: mythburn.cpp:1054
MythUIButton * m_nextButton
Definition: mythburn.h:116
void save(void)
Definition: mythburn.cpp:1074
void editorClosed(bool ok, ArchiveItem *item)
Definition: mythburn.cpp:841
void handleCancel(void)
Definition: mythburn.cpp:354
EncoderProfile * getDefaultProfile(ArchiveItem *item)
Definition: mythburn.cpp:508
MythUIText * m_descriptionText
Definition: mythburn.h:43
MythUIText * m_currentsizeText
Definition: mythburn.h:131
void toggleUseCutlist(void)
Definition: mythburn.cpp:303
bool m_bDoBurn
Definition: mythburn.h:109
void runScript()
Definition: mythburn.cpp:897
ArchiveDestination m_archiveDestination
Definition: mythburn.h:103
ProfileDialog(MythScreenStack *parent, ArchiveItem *archiveItem, QList< EncoderProfile * > profileList)
Definition: mythburn.h:24
MythUIButton * m_prevButton
Definition: mythburn.h:117
void saveConfiguration(void)
Definition: mythburn.cpp:703
bool Create() override
Definition: mythburn.cpp:1010
void customEvent(QEvent *event) override
Definition: mythburn.cpp:1116
bool Create(void) override
Definition: mythburn.cpp:74
ArchiveItem * m_archiveItem
Definition: mythburn.h:39
void ShowMenu(void) override
Definition: mythburn.cpp:753
void handleAddFile(void)
Definition: mythburn.cpp:981
bool m_bEraseDvdRw
Definition: mythburn.h:110
MythUIButton * m_addvideoButton
Definition: mythburn.h:123
MythBurn(MythScreenStack *parent, MythScreenType *destinationScreen, MythScreenType *themeScreen, ArchiveDestination archiveDestination, const QString &name)
Definition: mythburn.cpp:45
QList< EncoderProfile * > m_profileList
Definition: mythburn.h:106
static void doBurn(int mode)
Definition: mythburn.cpp:1128
void editDetails(void)
Definition: mythburn.cpp:806
~MythBurn(void) override
Definition: mythburn.cpp:61
MythUIButtonList * m_profileBtnList
Definition: mythburn.h:47
MythUIButton * m_addfileButton
Definition: mythburn.h:124
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
QList< ArchiveItem * > m_archiveList
Definition: mythburn.h:105
MythUIText * m_newSizeText
Definition: mythburn.h:45
void loadConfiguration(void)
Definition: mythburn.cpp:643
MythUIText * m_captionText
Definition: mythburn.h:42
A single button widget.
Definition: mythuibutton.h:21
void selectorClosed(bool ok)
Definition: mythburn.cpp:951
void changeProfile(void)
Definition: mythburn.cpp:854
MythUIButtonList * m_archiveButtonList
Definition: mythburn.h:120
bool m_moveMode
Definition: mythburn.h:114
MythUIText * m_nofilesText
Definition: mythburn.h:121
void loadEncoderProfiles(void)
Definition: mythburn.cpp:228
void handleAddVideo(void)
Definition: mythburn.cpp:957
bool m_bCreateISO
Definition: mythburn.h:108
static bool isArchiveItemValid(const QString &type, const QString &filename)
Definition: mythburn.cpp:469
MythUIProgressBar * m_sizeBar
Definition: mythburn.h:127
void editThumbnails(void)
Definition: mythburn.cpp:825
void setProfile(EncoderProfile *profile, ArchiveItem *item)
void handleNextPage(void)
Definition: mythburn.cpp:338
void start(void)
Definition: mythburn.cpp:1089
MythUIText * m_currentsizeErrorText
Definition: mythburn.h:130
Screen in which all other widgets are contained and rendered.
Progress bar widget.
void updateArchiveList(void)
Definition: mythburn.cpp:386
void removeItem(void)
Definition: mythburn.cpp:793
void handleAddRecording(void)
Definition: mythburn.cpp:938
void handlePrevPage(void)
Definition: mythburn.cpp:349
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythburn.cpp:127
MythUIButton * m_addrecordingButton
Definition: mythburn.h:122
void profileChanged(int profileNo)
Definition: mythburn.cpp:874
EncoderProfile * getProfileFromName(const QString &profileName)
Definition: mythburn.cpp:694