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) **").arg(m_lyricData->grabber()).arg(syncronized));
449 
450  for (auto * line : qAsConst(*m_lyricData->lyrics()))
451  {
452  if (line)
453  new MythUIButtonListItem(m_lyricsList, line->m_lyric, QVariant::fromValue(line));
454  }
455 
456  m_autoScroll = true;
457 }
458 
460 {
461  if (m_lyricData)
462  m_lyricData->save();
463 }
464 
466 {
468 
469  auto *editDialog = new EditLyricsDialog(mainStack, m_lyricData);
470 
471  if (!editDialog->Create())
472  {
473  delete editDialog;
474  return;
475  }
476  connect(editDialog, &EditLyricsDialog::haveResult, this, &LyricsView::editFinished);
477  mainStack->AddScreen(editDialog);
478 }
479 
480 void LyricsView::editFinished(bool result)
481 {
482  if (result)
483  showLyrics();
484 }
485 
487 // EditLyricsDialog
488 
490  MythScreenStack *parent, LyricsData *sourceData) :
491  MythScreenType(parent, "EditLyricsDialog"),
492  m_sourceData(sourceData)
493 {
494 }
495 
497 {
498  // Load the theme for this screen
499  bool foundtheme = LoadWindowFromXML("music-ui.xml", "editlyrics", this);
500  if (!foundtheme)
501  return false;
502 
503  bool err = false;
504  UIUtilE::Assign(this, m_grabberEdit, "grabberedit", &err);
505  UIUtilE::Assign(this, m_syncronizedCheck, "syncronizedcheck", &err);
506  UIUtilE::Assign(this, m_titleEdit, "titleedit", &err);
507  UIUtilE::Assign(this, m_artistEdit, "artistedit", &err);
508  UIUtilE::Assign(this, m_albumEdit, "albumedit", &err);
509  UIUtilE::Assign(this, m_lyricsEdit, "lyricsedit", &err);
510  UIUtilE::Assign(this, m_okButton, "okbutton", &err);
511  UIUtilE::Assign(this, m_cancelButton, "cancelbutton", &err);
512 
513  if (err)
514  {
515  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'editlyrics'");
516  return false;
517  }
518 
522 
528 
529  loadLyrics();
530 
531  BuildFocusList();
532 
533  return true;
534 }
535 
536 bool EditLyricsDialog::keyPressEvent(QKeyEvent *event)
537 {
538  bool handled = false;
539  QStringList actions;
540 
541  if (GetFocusWidget()->keyPressEvent(event))
542  return true;
543 
544  handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions);
545 
546  for (int i = 0; i < actions.size() && !handled; i++)
547  {
548  QString action = actions[i];
549 
550  if (action == "ESCAPE" && somethingChanged())
551  {
552  cancelPressed();
553  return true;
554  }
555  }
556 
557  return MythScreenType::keyPressEvent(event);
558 }
559 
561 {
562  QString lyrics;
563  LyricsLineMap::iterator i = m_sourceData->lyrics()->begin();
564  while (i != m_sourceData->lyrics()->end())
565  {
566  LyricsLine *line = (*i);
567  ++i;
568 
570 
571  if (i != m_sourceData->lyrics()->end())
572  lyrics += '\n';
573  }
574 
575  m_lyricsEdit->SetText(lyrics);
576 }
577 
579 {
580  (void) syncronized;
581 
582  loadLyrics();
583 }
584 
586 {
587  bool changed = false;
588 
589  changed |= m_sourceData->artist() != m_artistEdit->GetText();
590  changed |= m_sourceData->album() != m_albumEdit->GetText();
591  changed |= m_sourceData->title() != m_titleEdit->GetText();
592  changed |= m_sourceData->grabber() != m_grabberEdit->GetText();
594 
595  QStringList lines = m_lyricsEdit->GetText().split('\n');
596 
597  if (lines.count() != m_sourceData->lyrics()->count())
598  return true;
599 
600  int x = 0;
601  for (auto * line : qAsConst(*m_sourceData->lyrics()))
602  {
603  if (line->toString(m_sourceData->syncronized()) != lines.at(x))
604  changed = true;
605  ++x;
606  }
607 
608  return changed;
609 }
610 
612 {
613  if (!somethingChanged())
614  {
615  emit haveResult(false);
616  Close();
617  return;
618  }
619 
620  QStringList lyrics = m_lyricsEdit->GetText().split('\n');
621 
622  m_sourceData->setChanged(true);
628  m_sourceData->setLyrics(lyrics);
629  m_sourceData->save();
630  m_sourceData->setChanged(false);
631 
632  emit haveResult(true);
633  Close();
634 }
635 
637 {
638  if (!ok)
639  {
640  emit haveResult(false);
641  Close();
642  return;
643  }
644 
645  okPressed();
646 }
647 
649 {
650  if (somethingChanged())
651  {
652  ShowOkPopup(tr("Save changes?"), this, &EditLyricsDialog::saveEdits, true);
653  return;
654  }
655 
656  emit haveResult(false);
657  Close();
658 }
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:317
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:611
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:1384
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:648
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:578
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:496
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:536
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:27
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:1125
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:1116
MusicMetadata::getLyricsData
LyricsData * getLyricsData(void)
Definition: musicmetadata.cpp:1378
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:198
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:585
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:489
MV_LYRICS
@ MV_LYRICS
Definition: musiccommon.h:33
LyricsData
Definition: lyricsdata.h:49
EditLyricsDialog::loadLyrics
void loadLyrics(void)
Definition: lyricsview.cpp:560
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3582
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:1120
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:480
MusicCommon::createMainMenu
MythMenu * createMainMenu(void)
Definition: musiccommon.cpp:2176
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:465
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:104
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:636
mythuibutton.h
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
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:459
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