MythTV  master
lyricsview.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <cstdlib>
3 #include <unistd.h>
4 
5 // qt
6 #include <QKeyEvent>
7 #include <QThread>
8 #include <QDomDocument>
9 
10 // myth
11 #include <mythcontext.h>
12 #include <mythversion.h>
13 #include <mythdbcon.h>
14 #include <mythmainwindow.h>
15 #include <mythuibuttonlist.h>
16 #include <mythuicheckbox.h>
17 #include <mythuitext.h>
18 #include <mythuibutton.h>
19 #include <mythuitextedit.h>
20 #include <mythuiutils.h>
21 #include <mythdialogbox.h>
22 #include <mythuistatetype.h>
23 #include <mythuiprogressbar.h>
24 #include <mythdownloadmanager.h>
25 #include <mythuihelper.h>
26 #include <mythdirs.h>
27 #include <audiooutput.h>
28 
29 
30 // mythmusic
31 #include "musiccommon.h"
32 #include "lyricsview.h"
33 #include "musicplayer.h"
34 
36 // LyricsView
37 
39  : MusicCommon(parent, parentScreen, "lyricsview")
40 {
42 
44 }
45 
47 {
48  if (m_lyricData)
49  {
50  m_lyricData->disconnect();
51  m_lyricData = nullptr;
52  }
53 
55 }
56 
58 {
59  QString windowName = gPlayer->getPlayMode() == MusicPlayer::PLAYMODE_RADIO ? "streamlyricsview" : "trackslyricsview";
60 
61  // Load the theme for this screen
62  bool err = LoadWindowFromXML("music-ui.xml", windowName, this);
63 
64  if (!err)
65  return false;
66 
67  // find common widgets available on any view
68  err = CreateCommon();
69 
70  // find widgets specific to this view
71  UIUtilE::Assign(this, m_lyricsList, "lyrics_list", &err);
72  UIUtilW::Assign(this, m_statusText, "status_text");
73  UIUtilW::Assign(this, m_loadingState, "loading_state");
74 
75  // for streams
76  UIUtilW::Assign(this, m_bufferStatus, "bufferstatus", &err);
77  UIUtilW::Assign(this, m_bufferProgress, "bufferprogress", &err);
78 
79  if (err)
80  {
81  LOG(VB_GENERAL, LOG_ERR, QString("Cannot load screen '%1'").arg(windowName));
82  return false;
83  }
84 
86 
88 
89  findLyrics();
90 
91  return true;
92 }
93 
94 void LyricsView::customEvent(QEvent *event)
95 {
96  bool handled = false;
97 
98  if ((event->type() == MusicPlayerEvent::TrackChangeEvent) ||
100  {
101  findLyrics();
102  }
103  else if (event->type() == OutputEvent::Info)
104  {
105  if (m_autoScroll)
106  {
107  auto *oe = dynamic_cast<OutputEvent *>(event);
109 
110  if (!oe || !curMeta)
111  return;
112 
113  std::chrono::milliseconds rs = 0ms;
114 
116  {
118  }
119  else
120  rs = oe->elapsedSeconds();
121 
122  int pos = 0;
123  for (int x = 0; x < m_lyricsList->GetCount(); x++)
124  {
126  auto *lyric = item->GetData().value<LyricsLine*>();
127  if (lyric)
128  {
129  if (lyric->m_time > 1s && rs >= lyric->m_time)
130  pos = x;
131  }
132  }
133 
135  }
136  }
137  else if (event->type() == DialogCompletionEvent::kEventType)
138  {
139  auto *dce = dynamic_cast<DialogCompletionEvent*>(event);
140 
141  // make sure the user didn't ESCAPE out of the menu
142  if ((dce == nullptr) || (dce->GetResult() < 0))
143  return;
144 
145  QString resultid = dce->GetId();
146  QString resulttext = dce->GetResultText();
147  if (resultid == "actionmenu")
148  {
149  if (resulttext == tr("Save Lyrics"))
150  {
151  saveLyrics();
152  }
153  else if ((resulttext == tr("Edit Lyrics")) ||
154  (resulttext == tr("Add Lyrics")))
155  {
156  editLyrics();
157  }
158  else if (resulttext == tr("Auto Scroll Lyrics"))
159  {
160  m_autoScroll = true;
161  }
162 
163  handled = true;
164  }
165  else if (resultid == "findlyricsmenu")
166  {
167  if (dce->GetResult() >= 0)
168  {
169  QString grabber = dce->GetData().toString();
170  m_lyricData->clear();
171  findLyrics(grabber);
172  }
173 
174  handled = true;
175  }
176  }
177  else if (event->type() == DecoderHandlerEvent::OperationStart)
178  {
179  auto *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
180  if (!dhe)
181  return;
182  if (dhe->getMessage() && m_bufferStatus)
183  {
184  m_bufferStatus->SetText(*dhe->getMessage());
185  }
186  }
187  else if (event->type() == DecoderHandlerEvent::BufferStatus)
188  {
189  auto *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
190  if (!dhe)
191  return;
192 
193  int available = 0;
194  int maxSize = 0;
195  dhe->getBufferStatus(&available, &maxSize);
196 
197  if (m_bufferStatus)
198  {
199  QString status = QString("%1%").arg((int)(100.0 / ((double)maxSize / (double)available)));
200  m_bufferStatus->SetText(status);
201  }
202 
203  if (m_bufferProgress)
204  {
205  m_bufferProgress->SetTotal(maxSize);
206  m_bufferProgress->SetUsed(available);
207  }
208  }
209  else if (event->type() == DecoderHandlerEvent::OperationStop)
210  {
211  if (m_bufferStatus)
213  }
214 
215  if (!handled)
217 }
218 
220 {
221  QString label = tr("Actions");
222 
223  auto *menu = new MythMenu(label, this, "actionmenu");
224 
225  if (m_lyricData)
226  {
227  menu->AddItem(tr("Find Lyrics"), nullptr, createFindLyricsMenu());
228 
230  {
231  if (!m_lyricData->lyrics()->isEmpty())
232  menu->AddItem(tr("Edit Lyrics"), nullptr, nullptr);
233  else
234  menu->AddItem(tr("Add Lyrics"), nullptr, nullptr);
235 
236  if (!m_lyricData->lyrics()->isEmpty() && m_lyricData->changed())
237  menu->AddItem(tr("Save Lyrics"), nullptr, nullptr);
238  }
239 
240  if (!m_autoScroll)
241  menu->AddItem(tr("Auto Scroll Lyrics"), nullptr, nullptr);
242  }
243 
244  menu->AddItem(tr("Other Options"), nullptr, createMainMenu());
245 
246  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
247 
248  auto *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");
249 
250  if (menuPopup->Create())
251  popupStack->AddScreen(menuPopup);
252  else
253  delete menuPopup;
254 }
255 
257 {
258  QString label = tr("Find Lyrics");
259 
260  auto *menu = new MythMenu(label, this, "findlyricsmenu");
261  menu->AddItemV(tr("Search All Grabbers"), QVariant::fromValue(QString("ALL")));
262 
263  QStringList strList("MUSIC_LYRICS_GETGRABBERS");
264  if (gCoreContext->SendReceiveStringList(strList))
265  {
266  for (int x = 1; x < strList.count(); x++)
267  menu->AddItemV(tr("Search %1").arg(strList.at(x)), QVariant::fromValue(strList.at(x)));
268  }
269 
270  return menu;
271 }
272 
273 bool LyricsView::keyPressEvent(QKeyEvent *event)
274 {
275  bool handled = false;
276  QStringList actions;
277 
278  if (GetFocusWidget() && GetFocusWidget()->keyPressEvent(event))
279  {
280  // if the lyrics list widget has focus and the UP/DOWN or PAGEUP/PAGEDOWN keys
281  // are pressed turn off auto scroll
282  if (GetFocusWidget() == m_lyricsList)
283  {
284  GetMythMainWindow()->TranslateKeyPress("Global", event, actions);
285  if (actions.contains("UP") || actions.contains("DOWN") ||
286  actions.contains("PAGEUP") || actions.contains("PAGEDOWN"))
287  m_autoScroll = false;
288  }
289 
290  return true;
291  }
292 
293  handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions);
294 
295  for (int i = 0; i < actions.size() && !handled; i++)
296  {
297  QString action = actions[i];
298  handled = true;
299 
300  if (action == "EDIT")
301  {
302  if (GetFocusWidget() == m_lyricsList)
303  {
305  editLyrics();
306  }
307  else
308  {
309  // pass the EDIT action on for normal tracks if not on the lyrics list
311  handled = false;
312  }
313  }
314  else if (GetFocusWidget() == m_lyricsList && (action == "MARK" || action == "SELECT"))
315  {
316  setLyricTime();
317  }
318  else
319  handled = false;
320  }
321 
322  if (!handled && MusicCommon::keyPressEvent(event))
323  handled = true;
324 
325  return handled;
326 }
327 
329 {
330  // change the time of the next lyric to the playback time
332  {
334 
336  if (item)
337  {
338  auto *lyric = item->GetData().value<LyricsLine*>();
339  if (lyric)
340  {
341  lyric->m_time = gPlayer->getOutput()->GetAudiotime() - 750ms;
342  m_lyricData->setChanged(true);
344  m_autoScroll = false;
345  }
346  }
347  }
348 }
349 
350 void LyricsView::findLyrics(const QString &grabber)
351 {
352  if (m_lyricData)
353  {
354  if (m_lyricData->changed())
355  m_lyricData->save();
356 
357  m_lyricData->disconnect();
358  m_lyricData = nullptr;
359  }
360 
361  MusicMetadata *mdata = nullptr;
362 
364  {
365  if (!gPlayer->getPlayedTracksList().isEmpty())
366  mdata = gPlayer->getPlayedTracksList().last();
367  }
368  else
369  mdata = gPlayer->getCurrentMetadata();
370 
371  if (!mdata)
372  return;
373 
374  m_lyricsList->Reset();
375 
376  if (m_loadingState)
378 
379  m_lyricData = mdata->getLyricsData();
380 
383 
384  m_lyricData->findLyrics(grabber);
385 }
386 
387 void LyricsView::lyricStatusChanged(LyricsData::Status status, const QString &message)
388 {
389  switch (status)
390  {
392  {
393  showMessage(message);
394  break;
395  }
396 
398  {
399  if (m_loadingState)
401 
402  showMessage(message);
403  break;
404  }
405 
407  {
408  showLyrics();
409  break;
410  }
411 
412  default:
413  if (m_loadingState)
415 
416  showMessage("");
417  break;
418  }
419 }
420 
421 void LyricsView::showMessage(const QString &message)
422 {
423  if (m_statusText)
424  {
425  if (message.isEmpty())
426  {
427  m_statusText->Reset();
428  m_statusText->Hide();
429  }
430  else
431  {
432  m_statusText->SetText(message);
433  m_statusText->Show();
434  }
435  }
436 }
437 
439 {
440  if (m_loadingState)
442 
443  showMessage("");
444 
445  m_lyricsList->Reset();
446 
447  QString syncronized = m_lyricData->syncronized() ? tr("Syncronized") : tr("Unsyncronized");
448  new MythUIButtonListItem(m_lyricsList, tr("** Lyrics from %1 (%2) **")
449  .arg(m_lyricData->grabber(), syncronized));
450 
451  for (auto * line : qAsConst(*m_lyricData->lyrics()))
452  {
453  if (line)
454  new MythUIButtonListItem(m_lyricsList, line->m_lyric, QVariant::fromValue(line));
455  }
456 
457  m_autoScroll = true;
458 }
459 
461 {
462  if (m_lyricData)
463  m_lyricData->save();
464 }
465 
467 {
469 
470  auto *editDialog = new EditLyricsDialog(mainStack, m_lyricData);
471 
472  if (!editDialog->Create())
473  {
474  delete editDialog;
475  return;
476  }
477  connect(editDialog, &EditLyricsDialog::haveResult, this, &LyricsView::editFinished);
478  mainStack->AddScreen(editDialog);
479 }
480 
481 void LyricsView::editFinished(bool result)
482 {
483  if (result)
484  showLyrics();
485 }
486 
488 // EditLyricsDialog
489 
491  MythScreenStack *parent, LyricsData *sourceData) :
492  MythScreenType(parent, "EditLyricsDialog"),
493  m_sourceData(sourceData)
494 {
495 }
496 
498 {
499  // Load the theme for this screen
500  bool foundtheme = LoadWindowFromXML("music-ui.xml", "editlyrics", this);
501  if (!foundtheme)
502  return false;
503 
504  bool err = false;
505  UIUtilE::Assign(this, m_grabberEdit, "grabberedit", &err);
506  UIUtilE::Assign(this, m_syncronizedCheck, "syncronizedcheck", &err);
507  UIUtilE::Assign(this, m_titleEdit, "titleedit", &err);
508  UIUtilE::Assign(this, m_artistEdit, "artistedit", &err);
509  UIUtilE::Assign(this, m_albumEdit, "albumedit", &err);
510  UIUtilE::Assign(this, m_lyricsEdit, "lyricsedit", &err);
511  UIUtilE::Assign(this, m_okButton, "okbutton", &err);
512  UIUtilE::Assign(this, m_cancelButton, "cancelbutton", &err);
513 
514  if (err)
515  {
516  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'editlyrics'");
517  return false;
518  }
519 
523 
529 
530  loadLyrics();
531 
532  BuildFocusList();
533 
534  return true;
535 }
536 
537 bool EditLyricsDialog::keyPressEvent(QKeyEvent *event)
538 {
539  bool handled = false;
540  QStringList actions;
541 
542  if (GetFocusWidget()->keyPressEvent(event))
543  return true;
544 
545  handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions);
546 
547  for (int i = 0; i < actions.size() && !handled; i++)
548  {
549  QString action = actions[i];
550 
551  if (action == "ESCAPE" && somethingChanged())
552  {
553  cancelPressed();
554  return true;
555  }
556  }
557 
558  return MythScreenType::keyPressEvent(event);
559 }
560 
562 {
563  QString lyrics;
564  LyricsLineMap::iterator i = m_sourceData->lyrics()->begin();
565  while (i != m_sourceData->lyrics()->end())
566  {
567  LyricsLine *line = (*i);
568  ++i;
569 
571 
572  if (i != m_sourceData->lyrics()->end())
573  lyrics += '\n';
574  }
575 
576  m_lyricsEdit->SetText(lyrics);
577 }
578 
580 {
581  (void) syncronized;
582 
583  loadLyrics();
584 }
585 
587 {
588  bool changed = false;
589 
590  changed |= m_sourceData->artist() != m_artistEdit->GetText();
591  changed |= m_sourceData->album() != m_albumEdit->GetText();
592  changed |= m_sourceData->title() != m_titleEdit->GetText();
593  changed |= m_sourceData->grabber() != m_grabberEdit->GetText();
595 
596  QStringList lines = m_lyricsEdit->GetText().split('\n');
597 
598  if (lines.count() != m_sourceData->lyrics()->count())
599  return true;
600 
601  int x = 0;
602  for (auto * line : qAsConst(*m_sourceData->lyrics()))
603  {
604  if (line->toString(m_sourceData->syncronized()) != lines.at(x))
605  changed = true;
606  ++x;
607  }
608 
609  return changed;
610 }
611 
613 {
614  if (!somethingChanged())
615  {
616  emit haveResult(false);
617  Close();
618  return;
619  }
620 
621  QStringList lyrics = m_lyricsEdit->GetText().split('\n');
622 
623  m_sourceData->setChanged(true);
629  m_sourceData->setLyrics(lyrics);
630  m_sourceData->save();
631  m_sourceData->setChanged(false);
632 
633  emit haveResult(true);
634  Close();
635 }
636 
638 {
639  if (!ok)
640  {
641  emit haveResult(false);
642  Close();
643  return;
644  }
645 
646  okPressed();
647 }
648 
650 {
651  if (somethingChanged())
652  {
653  ShowOkPopup(tr("Save changes?"), this, &EditLyricsDialog::saveEdits, true);
654  return;
655  }
656 
657  emit haveResult(false);
658  Close();
659 }
MythUIButton::Clicked
void Clicked()
MusicCommon::m_currentView
MusicView m_currentView
Definition: musiccommon.h:139
DecoderHandlerEvent::BufferStatus
static Type BufferStatus
Definition: decoderhandler.h:49
MythUIButtonList::GetItemAt
MythUIButtonListItem * GetItemAt(int pos) const
Definition: mythuibuttonlist.cpp:1676
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:314
MusicPlayer::getOutput
AudioOutput * getOutput(void)
Definition: musicplayer.h:125
EditLyricsDialog::m_sourceData
LyricsData * m_sourceData
Definition: lyricsview.h:84
gPlayer
MusicPlayer * gPlayer
Definition: musicplayer.cpp:35
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
DecoderHandlerEvent::OperationStart
static Type OperationStart
Definition: decoderhandler.h:50
LyricsView::LyricsView
LyricsView(MythScreenStack *parent, MythScreenType *parentScreen)
Definition: lyricsview.cpp:38
mythuitext.h
mythuiprogressbar.h
DialogCompletionEvent::GetId
QString GetId()
Definition: mythdialogbox.h:52
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:83
EditLyricsDialog::okPressed
void okPressed(void)
Definition: lyricsview.cpp:612
MythCoreContext::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Definition: mythcorecontext.cpp:1395
LyricsData::lyrics
LyricsLineMap * lyrics(void)
Definition: lyricsdata.h:78
OutputEvent
Definition: output.h:31
MusicCommon::CreateCommon
bool CreateCommon(void)
Definition: musiccommon.cpp:80
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
EditLyricsDialog::m_artistEdit
MythUITextEdit * m_artistEdit
Definition: lyricsview.h:89
EditLyricsDialog::m_okButton
MythUIButton * m_okButton
Definition: lyricsview.h:93
LyricsView::showMessage
void showMessage(const QString &message)
Definition: lyricsview.cpp:421
LyricsView::createFindLyricsMenu
MythMenu * createFindLyricsMenu(void)
Definition: lyricsview.cpp:256
MusicCommon::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: musiccommon.cpp:580
EditLyricsDialog::m_titleEdit
MythUITextEdit * m_titleEdit
Definition: lyricsview.h:88
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
LyricsLine::m_time
std::chrono::milliseconds m_time
Definition: lyricsdata.h:27
EditLyricsDialog::cancelPressed
void cancelPressed(void)
Definition: lyricsview.cpp:649
MythUICheckBox::GetBooleanCheckState
bool GetBooleanCheckState(void) const
Definition: mythuicheckbox.cpp:103
LyricsData::setArtist
void setArtist(const QString &artist)
Definition: lyricsdata.h:70
MythUIProgressBar::SetUsed
void SetUsed(int value)
Definition: mythuiprogressbar.cpp:59
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
mythdbcon.h
LyricsData::setAlbum
void setAlbum(const QString &album)
Definition: lyricsdata.h:73
LyricsView::findLyrics
void findLyrics(const QString &grabber="ALL")
Definition: lyricsview.cpp:350
MusicPlayer::isPlaying
bool isPlaying(void) const
Definition: musicplayer.h:110
EditLyricsDialog::syncronizedChanged
void syncronizedChanged(bool syncronized)
Definition: lyricsview.cpp:579
LyricsData::clear
void clear(void)
Definition: lyricsdata.cpp:30
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythuistatetype.h
MusicMetadata
Definition: musicmetadata.h:80
LyricsData::Status
Status
Definition: lyricsdata.h:87
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:47
mythdirs.h
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:53
mythuibuttonlist.h
EditLyricsDialog::Create
bool Create(void) override
Definition: lyricsview.cpp:497
MusicPlayer::getPlayMode
PlayMode getPlayMode(void)
Definition: musicplayer.h:78
MythUIButtonList::GetCount
int GetCount() const
Definition: mythuibuttonlist.cpp:1655
LyricsView::setLyricTime
void setLyricTime(void)
Definition: lyricsview.cpp:328
EditLyricsDialog
Definition: lyricsview.h:58
EditLyricsDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: lyricsview.cpp:537
LyricsData::setLyrics
void setLyrics(const QStringList &lyrics)
Definition: lyricsdata.cpp:302
LyricsView::m_lyricsList
MythUIButtonList * m_lyricsList
Definition: lyricsview.h:47
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
mythversion.h
MythUICheckBox::toggled
void toggled(bool)
LyricsData::STATUS_FOUND
@ STATUS_FOUND
Definition: lyricsdata.h:91
LyricsView::m_bufferStatus
MythUIText * m_bufferStatus
Definition: lyricsview.h:50
MythObservable::addListener
void addListener(QObject *listener)
Add a listener to the observable.
Definition: mythobservable.cpp:38
MusicPlayer::getCurrentMetadata
MusicMetadata * getCurrentMetadata(void)
get the metadata for the current track in the playlist
Definition: musicplayer.cpp:1158
LyricsData::STATUS_SEARCHING
@ STATUS_SEARCHING
Definition: lyricsdata.h:90
mythuiutils.h
MythUIButtonListItem
Definition: mythuibuttonlist.h:34
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:215
DecoderHandlerEvent
Events sent by the DecoderHandler and it's helper classes.
Definition: decoderhandler.h:26
MusicPlayerEvent::TrackChangeEvent
static Type TrackChangeEvent
Definition: musicplayer.h:40
MythUIProgressBar::SetTotal
void SetTotal(int value)
Definition: mythuiprogressbar.cpp:71
LyricsData::save
void save(void)
Definition: lyricsdata.cpp:120
MusicPlayerEvent::PlayedTracksChangedEvent
static Type PlayedTracksChangedEvent
Definition: musicplayer.h:51
MythUIType::Show
void Show(void)
Definition: mythuitype.cpp:1137
DecoderHandlerEvent::getBufferStatus
void getBufferStatus(int *available, int *maxSize) const
Definition: decoderhandler.cpp:62
LyricsView::lyricStatusChanged
void lyricStatusChanged(LyricsData::Status status, const QString &message)
Definition: lyricsview.cpp:387
LyricsData::statusChanged
void statusChanged(LyricsData::Status status, const QString &message)
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
MythMainWindow::TranslateKeyPress
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
Definition: mythmainwindow.cpp:1102
MusicMetadata::getLyricsData
LyricsData * getLyricsData(void)
Definition: musicmetadata.cpp:1378
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:224
LyricsView::customEvent
void customEvent(QEvent *event) override
Definition: lyricsview.cpp:94
LyricsLine
Definition: lyricsdata.h:20
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
LyricsData::STATUS_NOTFOUND
@ STATUS_NOTFOUND
Definition: lyricsdata.h:92
EditLyricsDialog::somethingChanged
bool somethingChanged(void)
Definition: lyricsview.cpp:586
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:205
LyricsData::setGrabber
void setGrabber(const QString &grabber)
Definition: lyricsdata.h:67
LyricsView::ShowMenu
void ShowMenu(void) override
Definition: lyricsview.cpp:219
EditLyricsDialog::haveResult
void haveResult(bool ok)
LyricsData::changed
bool changed(void) const
Definition: lyricsdata.h:84
LyricsView::m_lyricData
LyricsData * m_lyricData
Definition: lyricsview.h:53
LyricsData::setSyncronized
void setSyncronized(bool syncronized)
Definition: lyricsdata.h:82
EditLyricsDialog::EditLyricsDialog
EditLyricsDialog(MythScreenStack *parent, LyricsData *sourceData)
Definition: lyricsview.cpp:490
MV_LYRICS
@ MV_LYRICS
Definition: musiccommon.h:33
LyricsData
Definition: lyricsdata.h:49
EditLyricsDialog::loadLyrics
void loadLyrics(void)
Definition: lyricsview.cpp:561
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3648
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
LyricsData::syncronized
bool syncronized(void) const
Definition: lyricsdata.h:81
LyricsView::m_autoScroll
bool m_autoScroll
Definition: lyricsview.h:55
EditLyricsDialog::m_syncronizedCheck
MythUICheckBox * m_syncronizedCheck
Definition: lyricsview.h:87
AudioOutput::GetAudiotime
virtual std::chrono::milliseconds GetAudiotime(void)=0
LyricsData::setChanged
void setChanged(bool changed)
Definition: lyricsdata.h:85
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
MythUIType::Hide
void Hide(void)
Definition: mythuitype.cpp:1132
LyricsData::artist
QString artist(void)
Definition: lyricsdata.h:69
musiccommon.h
LyricsData::title
QString title(void)
Definition: lyricsdata.h:75
mythuihelper.h
MusicPlayer::getPlayedTracksList
QList< MusicMetadata * > & getPlayedTracksList(void)
Definition: musicplayer.h:138
LyricsView::editFinished
void editFinished(bool result)
Definition: lyricsview.cpp:481
MusicCommon::createMainMenu
MythMenu * createMainMenu(void)
Definition: musiccommon.cpp:2175
lyricsview.h
MythMenu
Definition: mythdialogbox.h:99
DecoderHandlerEvent::OperationStop
static Type OperationStop
Definition: decoderhandler.h:51
EditLyricsDialog::m_grabberEdit
MythUITextEdit * m_grabberEdit
Definition: lyricsview.h:86
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:397
LyricsView::showLyrics
void showLyrics(void)
Definition: lyricsview.cpp:438
mythuitextedit.h
MythUICheckBox::SetCheckState
void SetCheckState(MythUIStateType::StateType state)
Definition: mythuicheckbox.cpp:66
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
LyricsData::grabber
QString grabber(void)
Definition: lyricsdata.h:66
LyricsView::m_loadingState
MythUIStateType * m_loadingState
Definition: lyricsview.h:49
LyricsView::editLyrics
void editLyrics(void)
Definition: lyricsview.cpp:466
LyricsView::m_statusText
MythUIText * m_statusText
Definition: lyricsview.h:48
OutputEvent::Info
static Type Info
Definition: output.h:65
LyricsData::setTitle
void setTitle(const QString &title)
Definition: lyricsdata.h:76
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
audiooutput.h
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
mythcontext.h
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:114
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:101
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1557
build_compdb.action
action
Definition: build_compdb.py:9
MusicPlayer::PLAYMODE_RADIO
@ PLAYMODE_RADIO
Definition: musicplayer.h:74
EditLyricsDialog::saveEdits
void saveEdits(bool ok)
Definition: lyricsview.cpp:637
mythuibutton.h
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:319
LyricsLine::toString
QString toString(bool syncronized)
Definition: lyricsdata.h:30
LyricsData::findLyrics
void findLyrics(const QString &grabber)
Definition: lyricsdata.cpp:53
EditLyricsDialog::m_cancelButton
MythUIButton * m_cancelButton
Definition: lyricsview.h:92
MusicPlayer::getCurrentTrackTime
std::chrono::seconds getCurrentTrackTime(void) const
Definition: musicplayer.h:144
LyricsData::album
QString album(void)
Definition: lyricsdata.h:72
mythuicheckbox.h
mythdownloadmanager.h
LyricsView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: lyricsview.cpp:273
mythmainwindow.h
LyricsView::saveLyrics
void saveLyrics(void)
Definition: lyricsview.cpp:460
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:558
LyricsView::Create
bool Create(void) override
Definition: lyricsview.cpp:57
LyricsView::~LyricsView
~LyricsView(void) override
Definition: lyricsview.cpp:46
MusicCommon::customEvent
void customEvent(QEvent *event) override
Definition: musiccommon.cpp:1184
MythObservable::removeListener
void removeListener(QObject *listener)
Remove a listener to the observable.
Definition: mythobservable.cpp:55
EditLyricsDialog::m_lyricsEdit
MythUITextEdit * m_lyricsEdit
Definition: lyricsview.h:91
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
MusicCommon
Definition: musiccommon.h:47
musicplayer.h
LyricsView::m_bufferProgress
MythUIProgressBar * m_bufferProgress
Definition: lyricsview.h:51
EditLyricsDialog::m_albumEdit
MythUITextEdit * m_albumEdit
Definition: lyricsview.h:90