18#include <libmythbase/mythversion.h>
82 LOG(VB_GENERAL, LOG_ERR, QString(
"Cannot load screen '%1'").arg(windowName));
114 std::chrono::milliseconds rs = 0ms;
122 rs = oe->elapsedSeconds();
132 if (lyric->m_time > 1s && rs >= lyric->m_time)
145 if ((dce ==
nullptr) || (dce->GetResult() < 0))
148 QString resultid = dce->
GetId();
149 QString resulttext = dce->GetResultText();
150 if (resultid ==
"actionmenu")
152 if (resulttext == tr(
"Save Lyrics"))
156 else if ((resulttext == tr(
"Edit Lyrics")) ||
157 (resulttext == tr(
"Add Lyrics")))
161 else if (resulttext == tr(
"Auto Scroll Lyrics"))
168 else if (resultid ==
"findlyricsmenu")
170 if (dce->GetResult() >= 0)
172 QString grabber = dce->GetData().toString();
202 QString status = QString(
"%1%").arg((
int)(100.0 / ((
double)maxSize / (
double)available)));
224 QString label = tr(
"Actions");
235 menu->AddItem(tr(
"Edit Lyrics"),
nullptr,
nullptr);
237 menu->AddItem(tr(
"Add Lyrics"),
nullptr,
nullptr);
240 menu->AddItem(tr(
"Save Lyrics"),
nullptr,
nullptr);
244 menu->AddItem(tr(
"Auto Scroll Lyrics"),
nullptr,
nullptr);
253 if (menuPopup->Create())
261 QString label = tr(
"Find Lyrics");
263 auto *
menu =
new MythMenu(label,
this,
"findlyricsmenu");
264 menu->AddItemV(tr(
"Search All Grabbers"), QVariant::fromValue(QString(
"ALL")));
266 QStringList strList(
"MUSIC_LYRICS_GETGRABBERS");
269 for (
int x = 1; x < strList.count(); x++)
270 menu->AddItemV(tr(
"Search %1").arg(strList.at(x)), QVariant::fromValue(strList.at(x)));
278 bool handled =
false;
288 if (actions.contains(
"UP") || actions.contains(
"DOWN") ||
289 actions.contains(
"PAGEUP") || actions.contains(
"PAGEDOWN"))
298 for (
int i = 0; i < actions.size() && !handled; i++)
300 const QString&
action = actions[i];
432 if (message.isEmpty())
479 if (!editDialog->Create())
500 m_sourceData(sourceData)
523 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'editlyrics'");
546 bool handled =
false;
554 for (
int i = 0; i < actions.size() && !handled; i++)
556 const QString&
action = actions[i];
593 bool changed =
false;
virtual std::chrono::milliseconds GetAudiotime(void)=0
Events sent by the DecoderHandler and it's helper classes.
static const Type kBufferStatus
static const Type kOperationStart
void getBufferStatus(int *available, int *maxSize) const
static const Type kOperationStop
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
static const Type kEventType
MythUIButton * m_cancelButton
void syncronizedChanged(bool syncronized)
MythUITextEdit * m_grabberEdit
EditLyricsDialog(MythScreenStack *parent, LyricsData *sourceData)
bool Create(void) override
MythUITextEdit * m_albumEdit
MythUITextEdit * m_lyricsEdit
MythUITextEdit * m_artistEdit
MythUIButton * m_okButton
MythUITextEdit * m_titleEdit
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
MythUICheckBox * m_syncronizedCheck
bool somethingChanged(void)
LyricsData * m_sourceData
void setGrabber(const QString &grabber)
void findLyrics(const QString &grabber)
LyricsLineMap * lyrics(void)
void setSyncronized(bool syncronized)
void setTitle(const QString &title)
void setLyrics(const QStringList &lyrics)
void statusChanged(LyricsData::Status status, const QString &message)
bool syncronized(void) const
void setArtist(const QString &artist)
void setChanged(bool changed)
void setAlbum(const QString &album)
QString toString(bool syncronized)
std::chrono::milliseconds m_time
void lyricStatusChanged(LyricsData::Status status, const QString &message)
MythUIButtonList * m_lyricsList
MythUIText * m_statusText
void showMessage(const QString &message)
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUIText * m_bufferStatus
bool Create(void) override
void ShowMenu(void) override
MythMenu * createFindLyricsMenu(void)
void editFinished(bool result)
void customEvent(QEvent *event) override
void findLyrics(const QString &grabber="ALL")
MythUIProgressBar * m_bufferProgress
LyricsView(MythScreenStack *parent, MythScreenType *parentScreen)
~LyricsView(void) override
MythUIStateType * m_loadingState
MythMenu * createMainMenu(void)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
void customEvent(QEvent *event) override
static const Type kPlayedTracksChangedEvent
static const Type kTrackChangeEvent
MusicMetadata * getCurrentMetadata(void)
get the metadata for the current track in the playlist
PlayMode getPlayMode(void)
std::chrono::seconds getCurrentTrackTime(void) const
QList< MusicMetadata * > & getPlayedTracksList(void)
bool isPlaying(void) const
AudioOutput * getOutput(void)
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Basic menu dialog, message and a list of options.
MythScreenStack * GetMainStack()
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
MythScreenStack * GetStack(const QString &Stackname)
void addListener(QObject *listener)
Add a listener to the observable.
void removeListener(QObject *listener)
Remove a listener to the observable.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
MythUIType * GetFocusWidget(void) const
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void SetCheckState(MythUIStateType::StateType state)
bool GetBooleanCheckState(void) const
bool DisplayState(const QString &name)
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
static MythThemedMenu * menu
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)