MythTV  master
musiccommon.cpp
Go to the documentation of this file.
1 // ANSI C includes
2 #include <cstdlib>
3 
4 // C++ includes
5 #include <iostream>
6 
7 // Qt includes
8 #include <QApplication>
9 #include <QLocale>
10 
11 // mythtv
12 #include <mythuitextedit.h>
13 #include <mythuistatetype.h>
14 #include <mythuiprogressbar.h>
15 #include <mythuibutton.h>
16 #include <mythuiimage.h>
17 #include <mythdialogbox.h>
18 #include <mythuibuttonlist.h>
19 #include <mythuibuttontree.h>
20 #include <mythuicheckbox.h>
21 #include <mythuivideo.h>
22 #include <mythuitext.h>
23 #include <audiooutput.h>
24 #include <compat.h>
25 #include <lcddevice.h>
26 #include <musicmetadata.h>
27 
28 // MythMusic includes
29 #include "musicdata.h"
30 #include "constants.h"
31 #include "decoder.h"
32 #include "mainvisual.h"
33 #include "smartplaylist.h"
34 #include "playlistcontainer.h"
35 #include "search.h"
36 #include "editmetadata.h"
37 #include "playlist.h"
38 
39 #include "musiccommon.h"
40 #include "playlistview.h"
41 #include "playlisteditorview.h"
42 #include "streamview.h"
43 #include "visualizerview.h"
44 #include "searchview.h"
45 #include "lyricsview.h"
46 
48  const QString &name)
49  : MythScreenType(parent, name),
50  m_parentScreen(parentScreen),
51  m_currentView()
52 {
53  m_cycleVisualizer = gCoreContext->GetBoolSetting("VisualCycleOnSongChange", false);
54 
55  if (LCD *lcd = LCD::Get())
56  {
57  lcd->switchToTime();
58  lcd->setFunctionLEDs(FUNC_MUSIC, true);
59  }
60 }
61 
63 {
64  gPlayer->removeListener(this);
65 
66  if (m_mainvisual)
67  {
69  delete m_mainvisual;
70  m_mainvisual = nullptr;
71  }
72 
73  if (LCD *lcd = LCD::Get())
74  {
75  lcd->switchToTime();
76  lcd->setFunctionLEDs(FUNC_MUSIC, false);
77  }
78 }
79 
81 {
82  bool err = false;
83  UIUtilW::Assign(this, m_timeText, "time", &err);
84  UIUtilW::Assign(this, m_infoText, "info", &err);
85  UIUtilW::Assign(this, m_visualText, "visualizername", &err);
86  UIUtilW::Assign(this, m_noTracksText, "notracks", &err);
87 
88  UIUtilW::Assign(this, m_shuffleState, "shufflestate", &err);
89  UIUtilW::Assign(this, m_repeatState, "repeatstate", &err);
90  UIUtilW::Assign(this, m_movingTracksState, "movingtracksstate", &err);
91 
92  UIUtilW::Assign(this, m_ratingState, "ratingstate", &err);
93 
94  UIUtilW::Assign(this, m_trackProgress, "progress", &err);
95  UIUtilW::Assign(this, m_trackProgressText, "trackprogress", &err);
96  UIUtilW::Assign(this, m_trackSpeedText, "trackspeed", &err);
97  UIUtilW::Assign(this, m_trackState, "trackstate", &err);
98 
99  UIUtilW::Assign(this, m_volumeText, "volume", &err);
100  UIUtilW::Assign(this, m_muteState, "mutestate", &err);
101 
102  UIUtilW::Assign(this, m_playlistProgress, "playlistprogress", &err);
103 
104  UIUtilW::Assign(this, m_prevButton, "prev", &err);
105  UIUtilW::Assign(this, m_rewButton, "rew", &err);
106  UIUtilW::Assign(this, m_pauseButton, "pause", &err);
107  UIUtilW::Assign(this, m_playButton, "play", &err);
108  UIUtilW::Assign(this, m_stopButton, "stop", &err);
109  UIUtilW::Assign(this, m_ffButton, "ff", &err);
110  UIUtilW::Assign(this, m_nextButton, "next", &err);
111 
112  UIUtilW::Assign(this, m_coverartImage, "coverart", &err);
113 
114  UIUtilW::Assign(this, m_currentPlaylist, "currentplaylist", &err);
115  UIUtilW::Assign(this, m_playedTracksList, "playedtrackslist", &err);
116 
117  UIUtilW::Assign(this, m_visualizerVideo, "visualizer", &err);
118 
119  if (m_prevButton)
121 
122  if (m_rewButton)
124 
125  if (m_pauseButton)
126  {
127  m_pauseButton->SetLockable(true);
129  }
130 
131  if (m_playButton)
132  {
133  m_playButton->SetLockable(true);
135  }
136 
137  if (m_stopButton)
138  {
139  m_stopButton->SetLockable(true);
141  }
142 
143  if (m_ffButton)
145 
146  if (m_nextButton)
148 
149  if (m_currentPlaylist)
150  {
155 
156  m_currentPlaylist->SetSearchFields("**search**");
157  }
158 
159  init();
160 
161  return err;
162 }
163 
165 {
166  gPlayer->addListener(this);
167 
168  if (startPlayback)
169  {
170  if (!gPlayer->isPlaying())
171  {
172  if (m_currentView == MV_RADIO)
176  else
178 
180  }
181  else
182  {
183  // if we are playing but we are switching to a view from a different playmode
184  // we need to restart playback in the new mode
186  {
187  // these views can be used in both play modes
188  }
190  {
191  gPlayer->stop(true);
192 
195  else
197 
199  }
201  {
202  gPlayer->stop(true);
205  }
206  }
207  }
208 
210 
212  if (curMeta)
213  updateTrackInfo(curMeta);
214 
216 
217  if (m_currentPlaylist)
219 
220  if (m_visualizerVideo)
221  {
223 
225 
226  m_fullscreenBlank = false;
227 
228  m_randomVisualizer = gCoreContext->GetBoolSetting("VisualRandomize", false);
229 
231 
232  // sanity check
233  if (m_currentVisual >= static_cast<uint>(m_visualModes.count()))
234  {
235  LOG(VB_GENERAL, LOG_ERR, QString("MusicCommon: Got a bad saved visualizer: %1").arg(m_currentVisual));
236  m_currentVisual = 0;
237  }
238 
240 
241  if (gPlayer->isPlaying())
242  startVisualizer();
243  }
244 
245  m_controlVolume = gCoreContext->GetBoolSetting("MythControlsVolume", false);
246  updateVolume();
247 
250 
251  if (m_stopButton)
253  if (m_playButton)
255  if (m_pauseButton)
257  if (m_trackState)
258  {
259  if (gPlayer->isPlaying())
260  m_trackState->DisplayState("playing");
261  else if (gPlayer->isPaused())
262  m_trackState->DisplayState("paused");
263  else
264  m_trackState->DisplayState("stopped");
265 
266  }
267 
270 
274 
275  if (m_playlistProgress)
276  {
279  }
280 
282 
284 }
285 
287 {
288  if (m_repeatState)
289  {
290  switch (gPlayer->getRepeatMode())
291  {
293  m_repeatState->DisplayState("off");
294  if (class LCD *lcd = LCD::Get())
295  lcd->setMusicRepeat (LCD::MUSIC_REPEAT_NONE);
296  break;
298  m_repeatState->DisplayState("track");
299  if (class LCD *lcd = LCD::Get())
300  lcd->setMusicRepeat (LCD::MUSIC_REPEAT_TRACK);
301  break;
303  m_repeatState->DisplayState("all");
304  if (class LCD *lcd = LCD::Get())
305  lcd->setMusicRepeat (LCD::MUSIC_REPEAT_ALL);
306  break;
307  default:
308  m_repeatState->DisplayState("off");
309  if (class LCD *lcd = LCD::Get())
310  lcd->setMusicRepeat (LCD::MUSIC_REPEAT_NONE);
311  break;
312  }
313  }
314 
315  // need this to update the next track info
317  if (curMeta)
318  updateTrackInfo(curMeta);
319 }
320 
321 void MusicCommon::updateShuffleMode(bool updateUIList)
322 {
323  if (m_shuffleState)
324  {
325  switch (gPlayer->getShuffleMode())
326  {
329  if (class LCD *lcd = LCD::Get())
330  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_NONE);
331  break;
333  m_shuffleState->DisplayState("random");
334  if (class LCD *lcd = LCD::Get())
335  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_RAND);
336  break;
338  m_shuffleState->DisplayState("intelligent");
339  if (class LCD *lcd = LCD::Get())
340  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_SMART);
341  break;
343  m_shuffleState->DisplayState("album");
344  if (class LCD *lcd = LCD::Get())
345  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_ALBUM);
346  break;
348  m_shuffleState->DisplayState("artist");
349  if (class LCD *lcd = LCD::Get())
350  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_ARTIST);
351  break;
352  default:
354  if (class LCD *lcd = LCD::Get())
355  lcd->setMusicShuffle(LCD::MUSIC_SHUFFLE_NONE);
356  break;
357  }
358  }
359 
360  if (updateUIList)
361  {
363 
368 
369  // need this to update the next track info
371  if (curMeta)
372  updateTrackInfo(curMeta);
373  }
374 }
375 
377 {
378  // can we switch to this view from the current view?
379  switch (m_currentView)
380  {
381  case MV_PLAYLIST:
382  {
383  if (view != MV_PLAYLISTEDITORTREE && view != MV_PLAYLISTEDITORGALLERY &&
384  view != MV_SEARCH && view != MV_VISUALIZER && view != MV_LYRICS)
385  return;
386  break;
387  }
388 
390  {
391  if (view != MV_PLAYLISTEDITORGALLERY && view != MV_SEARCH && view != MV_VISUALIZER && view != MV_LYRICS)
392  return;
393  break;
394  }
395 
397  {
398  if (view != MV_PLAYLISTEDITORTREE && view != MV_SEARCH && view != MV_VISUALIZER && view != MV_LYRICS)
399  return;
400  break;
401  }
402 
403  case MV_SEARCH:
404  {
405  if (view != MV_VISUALIZER && view != MV_LYRICS)
406  return;
407  break;
408  }
409 
410  case MV_VISUALIZER:
411  {
412  return;
413  }
414 
415  case MV_LYRICS:
416  {
417  if (view != MV_VISUALIZER && view != MV_SEARCH)
418  return;
419  break;
420  }
421 
422  case MV_RADIO:
423  {
424  if (view != MV_VISUALIZER && view != MV_LYRICS)
425  return;
426  break;
427  }
428 
429  default:
430  return;
431  }
432 
434 
435  stopVisualizer();
436 
437  if (m_mainvisual)
438  {
439  delete m_mainvisual;
440  m_mainvisual = nullptr;
441  }
442 
443  gPlayer->removeListener(this);
444  gPlayer->setAllowRestorePos(false);
445 
446  switch (view)
447  {
448  case MV_PLAYLIST:
449  {
450  auto *plview = new PlaylistView(mainStack, this);
451 
452  if (plview->Create())
453  {
454  mainStack->AddScreen(plview);
455  connect(plview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
456  }
457  else
458  delete plview;
459 
460  break;
461  }
462 
464  {
465  // if we are switching playlist editor views save and restore
466  // the current position in the tree
467  bool restorePos = (m_currentView == MV_PLAYLISTEDITORGALLERY);
468  auto *oldView = qobject_cast<PlaylistEditorView *>(this);
469  if (oldView)
470  oldView->saveTreePosition();
471 
472  MythScreenType *parentScreen = (oldView != nullptr ? m_parentScreen : this);
473 
474  auto *pleview = new PlaylistEditorView(mainStack, parentScreen, "tree", restorePos);
475 
476  if (pleview->Create())
477  {
478  mainStack->AddScreen(pleview);
479  connect(pleview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
480  }
481  else
482  delete pleview;
483 
484  if (oldView)
485  {
486  disconnect(this, &MythScreenType::Exiting, nullptr, nullptr);
487  Close();
488  }
489 
490  break;
491  }
492 
494  {
495  // if we are switching playlist editor views save and restore
496  // the current position in the tree
497  bool restorePos = (m_currentView == MV_PLAYLISTEDITORTREE);
498  auto *oldView = qobject_cast<PlaylistEditorView *>(this);
499  if (oldView)
500  oldView->saveTreePosition();
501 
502  MythScreenType *parentScreen = (oldView != nullptr ? m_parentScreen : this);
503 
504  auto *pleview = new PlaylistEditorView(mainStack, parentScreen, "gallery", restorePos);
505 
506  if (pleview->Create())
507  {
508  mainStack->AddScreen(pleview);
509  connect(pleview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
510  }
511  else
512  delete pleview;
513 
514  if (oldView)
515  {
516  disconnect(this, &MythScreenType::Exiting, nullptr, nullptr);
517  Close();
518  }
519 
520  break;
521  }
522 
523  case MV_SEARCH:
524  {
525  auto *sview = new SearchView(mainStack, this);
526 
527  if (sview->Create())
528  {
529  mainStack->AddScreen(sview);
530  connect(sview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
531  }
532  else
533  delete sview;
534 
535  break;
536  }
537 
538  case MV_VISUALIZER:
539  {
540  auto *vview = new VisualizerView(mainStack, this);
541 
542  if (vview->Create())
543  {
544  mainStack->AddScreen(vview);
545  connect(vview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
546  }
547  else
548  delete vview;
549 
550  break;
551  }
552 
553  case MV_LYRICS:
554  {
555  auto *lview = new LyricsView(mainStack, this);
556 
557  if (lview->Create())
558  {
559  mainStack->AddScreen(lview);
560  connect(lview, &MythScreenType::Exiting, this, &MusicCommon::viewExited);
561  }
562  else
563  delete lview;
564 
565  break;
566  }
567 
568  default:
569  break;
570  }
571 
573 }
574 
576 {
577  init(false);
578 }
579 
580 bool MusicCommon::keyPressEvent(QKeyEvent *e)
581 {
582  bool handled = false;
583 
584  // if there is a pending jump point pass the key press to the default handler
585  if (GetMythMainWindow()->IsExitingToMain())
586  {
588 
589  // do we need to stop playing?
590  if (gPlayer->isPlaying() && gCoreContext->GetSetting("MusicJumpPointAction", "stop") == "stop")
591  gPlayer->stop(true);
592 
594  }
595 
596  QStringList actions;
597  handled = GetMythMainWindow()->TranslateKeyPress("Music", e, actions, true);
598 
599  for (int i = 0; i < actions.size() && !handled; i++)
600  {
601  QString action = actions[i];
602  handled = true;
603 
604  // if we are currently moving an item,
605  // we only accept UP/DOWN/SELECT/ESCAPE
607  {
609  if (!item)
610  return false;
611 
612  if (action == "SELECT" || action == "ESCAPE")
613  {
614  m_movingTrack = false;
615  item->DisplayState("off", "movestate");
616  }
617  else if (action == "UP")
618  {
620  item->MoveUpDown(true);
627  }
628  else if (action == "DOWN")
629  {
631  item->MoveUpDown(false);
638  }
639 
640  return true;
641  }
642 
643  if (action == "ESCAPE")
644  {
645  // if we was started from another music view screen return to it
646  if (m_parentScreen)
647  {
648  handled = false;
649  }
650  else
651  {
652  // this is the top music view screen so prompt to continue playing
653  QString exit_action = gCoreContext->GetSetting("MusicExitAction", "prompt");
654 
655  if (!gPlayer->isPlaying())
656  {
658  stopAll();
659  Close();
660  }
661  else
662  {
663  if (exit_action == "stop")
664  {
666  stopAll();
667  Close();
668  }
669  else if (exit_action == "play")
670  Close();
671  else
672  showExitMenu();
673  }
674  }
675  }
676  else if (action == "THMBUP")
677  changeRating(true);
678  else if (action == "THMBDOWN")
679  changeRating(false);
680  else if (action == "NEXTTRACK")
681  {
682  if (m_nextButton)
683  m_nextButton->Push();
684  else
685  next();
686  }
687  else if (action == "PREVTRACK")
688  {
689  if (m_prevButton)
690  m_prevButton->Push();
691  else
692  previous();
693  }
694  else if (action == "FFWD")
695  {
697  {
698  if (m_ffButton)
699  m_ffButton->Push();
700  else
701  seekforward();
702  }
703  }
704  else if (action == "RWND")
705  {
707  {
708  if (m_rewButton)
709  m_rewButton->Push();
710  else
711  seekback();
712  }
713  }
714  else if (action == "PAUSE")
715  {
717  {
718  // ignore if we are already playing a radio stream
719  }
720  else if (gPlayer->isPlaying() || (gPlayer->getOutput() && gPlayer->getOutput()->IsPaused()))
721  {
722  // if we are playing or are paused PAUSE will toggle the pause state
723  if (m_pauseButton)
724  m_pauseButton->Push();
725  else
726  pause();
727  }
728  else
729  {
730  // not playing or paused so PAUSE acts the same as PLAY
731  if (m_playButton)
732  m_playButton->Push();
733  else
734  play();
735  }
736  }
737  else if (action == "PLAY")
738  {
739  if (m_playButton)
740  m_playButton->Push();
741  else
742  play();
743  }
744  else if (action == "STOP")
745  {
746  if (m_stopButton)
747  m_stopButton->Push();
748  else
749  stop();
750  m_currentTime = 0s;
751  }
752  else if (action == "CYCLEVIS")
753  cycleVisualizer();
754  else if (action == "BLANKSCR")
755  {
756  // change to the blank visualizer
757  if (m_mainvisual)
758  switchVisualizer("Blank");
759 
760  // switch to the full screen visualiser view
763  }
764  else if (action == "VOLUMEDOWN")
765  changeVolume(false);
766  else if (action == "VOLUMEUP")
767  changeVolume(true);
768  else if (action == "SPEEDDOWN")
769  changeSpeed(false);
770  else if (action == "SPEEDUP")
771  changeSpeed(true);
772  else if (action == "MUTE")
773  toggleMute();
774  else if (action == "TOGGLEUPMIX")
775  toggleUpmix();
776  else if (action == "INFO" || action == "EDIT")
777  {
779  {
781  {
782  auto *mdata = m_currentPlaylist->GetItemCurrent()->GetData().value<MusicMetadata*>();
783  if (mdata)
784  {
785  if (action == "INFO")
786  showTrackInfo(mdata);
787  else
788  editTrackInfo(mdata);
789  }
790  }
791  }
792  else
793  {
794  if (action == "INFO")
796  else
798  }
799  }
800  else if (action == "DELETE" && m_currentPlaylist && GetFocusWidget() == m_currentPlaylist)
801  {
803  if (item)
804  {
805  auto *mdata = item->GetData().value<MusicMetadata*>();
806  if (mdata)
807  gPlayer->removeTrack(mdata->ID());
808  }
809  }
810  else if (action == "MENU")
811  ShowMenu();
812  else if (action == "REFRESH")
813  {
814  if (m_currentPlaylist)
816  }
817  else if (action == "MARK")
818  {
819  if (!m_moveTrackMode)
820  {
821  m_moveTrackMode = true;
822  m_movingTrack = false;
823 
826  }
827  else
828  {
829  m_moveTrackMode = false;
830 
832  {
834  if (item)
835  item->DisplayState("off", "movestate");
836 
837  m_movingTrack = false;
838  }
839 
842  }
843  }
844  else if (action == "SWITCHTOPLAYLIST" && m_currentView != MV_PLAYLIST)
846  else if (action == "SWITCHTOPLAYLISTEDITORTREE" && m_currentView != MV_PLAYLISTEDITORTREE)
848  else if (action == "SWITCHTOPLAYLISTEDITORGALLERY" && m_currentView != MV_PLAYLISTEDITORGALLERY)
850  else if (action == "SWITCHTOSEARCH" && m_currentView != MV_SEARCH)
852  else if (action == "SWITCHTOVISUALISER" && m_currentView != MV_VISUALIZER)
854  else if (action == "SWITCHTORADIO" && m_currentView != MV_RADIO)
856  else if (action == "TOGGLESHUFFLE")
857  {
859  updateShuffleMode(true);
860  }
861  else if (action == "TOGGLEREPEAT")
862  {
865  }
866  else
867  handled = false;
868  }
869 
870  if (!handled && MythScreenType::keyPressEvent(e))
871  handled = true;
872  return handled;
873 }
874 
875 void MusicCommon::changeVolume(bool up) const
876 {
878  {
879  if (up)
880  gPlayer->incVolume();
881  else
882  gPlayer->decVolume();
883  showVolume();
884  }
885 }
886 
888 {
890  {
891  if (up)
892  gPlayer->incSpeed();
893  else
894  gPlayer->decSpeed();
895  showSpeed(true);
896  }
897 }
898 
900 {
901  if (m_controlVolume)
902  {
903  gPlayer->toggleMute();
904  showVolume();
905  }
906 }
907 
909 {
910  if (gPlayer->getOutput())
912 }
913 
915 {
916  if (!m_trackProgress)
917  return;
918 
920  {
921  // radio mode so show the buffer fill level since we don't know the track length
922  int available = 0;
923  int maxSize = 0;
924  gPlayer->getBufferStatus(&available, &maxSize);
925 
926  if (m_infoText)
927  {
928  QString status = QString("%1%").arg((int)(100.0 / ((double)maxSize / (double)available)));
929  m_infoText->SetText(status);
930  }
931 
932  if (m_trackProgress)
933  {
934  m_trackProgress->SetTotal(maxSize);
935  m_trackProgress->SetUsed(available);
936  }
937  }
938  else
939  {
940  // show the track played time
941  int percentplayed = 1;
942  if (m_maxTime > 0s)
943  percentplayed = m_currentTime * 100 / m_maxTime;
945  m_trackProgress->SetUsed(percentplayed);
946  }
947 }
948 
950 {
951  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
952 
953  auto *vol = new MythMusicVolumeDialog(popupStack, "volumepopup");
954 
955  if (!vol->Create())
956  {
957  delete vol;
958  return;
959  }
960 
961  popupStack->AddScreen(vol);
962 }
963 
965 {
966  (void) show;
967 }
968 
969 void MusicCommon::switchVisualizer(const QString &visual)
970 {
971  switchVisualizer(m_visualModes.indexOf(visual));
972 }
973 
975 {
976  if (!m_mainvisual)
977  return;
978 
979  if (visual < 0 || visual > m_visualModes.count() - 1)
980  visual = 0;
981 
982  m_currentVisual = visual;
983 
985 
986  if (m_visualText)
988 }
989 
991 {
992  if (!m_mainvisual)
993  return;
994 
995  // Only change the visualizer if there is more than 1 visualizer
996  // and the user currently has a visualizer active
997  if (m_visualModes.count() > 1)
998  {
999  if (m_randomVisualizer)
1000  {
1001  unsigned int next_visualizer = 0;
1002 
1003  //Find a visual thats not like the previous visual
1004  do
1005  next_visualizer = random() % m_visualModes.count();
1006  while (next_visualizer == m_currentVisual);
1007  m_currentVisual = next_visualizer;
1008  }
1009  else
1010  {
1011  //Change to the next selected visual
1012  m_currentVisual = (m_currentVisual + 1) % m_visualModes.count();
1013  }
1014 
1015  //Change to the new visualizer
1017  }
1018 }
1019 
1021 {
1023  return;
1024 
1026 }
1027 
1029 {
1031  return;
1032 
1034 }
1035 
1037 {
1038  LCD *lcd = LCD::Get();
1039  if (!lcd || !mdata)
1040  return;
1041 
1042  // Set the Artist and Tract on the LCD
1043  lcd->switchToMusic(mdata->Artist(),
1044  mdata->Album(),
1045  mdata->Title());
1046 }
1047 
1049 {
1050  if (LCD *lcd = LCD::Get())
1051  {
1052  lcd->switchToTime();
1053  }
1054 
1055  stopVisualizer();
1056 
1057  gPlayer->stop(true);
1058 }
1059 
1061 {
1062  gPlayer->play();
1063 }
1064 
1066 {
1067  gPlayer->pause();
1068 }
1069 
1071 {
1072  gPlayer->stop();
1073 
1074  QString time_string = getTimeString(m_maxTime, 0s);
1075 
1076  if (m_timeText)
1077  m_timeText->SetText(time_string);
1078  if (m_infoText)
1079  m_infoText->Reset();
1080 }
1081 
1083 {
1084  if (m_cycleVisualizer)
1085  cycleVisualizer();
1086 
1087 
1088  gPlayer->next();
1089 }
1090 
1092 {
1093  if (m_cycleVisualizer)
1094  cycleVisualizer();
1095 
1096  gPlayer->previous();
1097 }
1098 
1100 {
1101  std::chrono::seconds nextTime = m_currentTime + 5s;
1102  nextTime = std::clamp(nextTime, 0s, m_maxTime);
1103  seek(nextTime);
1104 }
1105 
1107 {
1108  std::chrono::seconds nextTime = m_currentTime - 5s;
1109  nextTime = std::clamp(nextTime, 0s, m_maxTime);
1110  seek(nextTime);
1111 }
1112 
1113 void MusicCommon::seek(std::chrono::seconds pos)
1114 {
1115  if (gPlayer->getOutput())
1116  {
1117  Decoder *decoder = gPlayer->getDecoder();
1118  if (decoder && decoder->isRunning())
1119  {
1120  decoder->lock();
1121  decoder->seek(pos.count());
1122 
1123  if (m_mainvisual)
1124  {
1125  m_mainvisual->mutex()->lock();
1126  m_mainvisual->prepare();
1127  m_mainvisual->mutex()->unlock();
1128  }
1129 
1130  decoder->unlock();
1131  }
1132 
1133  gPlayer->getOutput()->SetTimecode(pos);
1134 
1135  if (!gPlayer->isPlaying())
1136  {
1137  m_currentTime = pos;
1138  if (m_timeText)
1140 
1142 
1143  if (LCD *lcd = LCD::Get())
1144  {
1145  float percent_heard = m_maxTime <= 0s ? 0.0F : ((float)pos.count() /
1146  (float)m_maxTime.count());
1147 
1148  QString lcd_time_string = getTimeString(pos, m_maxTime);
1149 
1150  // if the string is longer than the LCD width, remove all spaces
1151  if (lcd_time_string.length() > (int)lcd->getLCDWidth())
1152  lcd_time_string.remove(' ');
1153 
1154  lcd->setMusicProgress(lcd_time_string, percent_heard);
1155  }
1156  }
1157  }
1158 }
1159 
1160 void MusicCommon::changeRating(bool increase)
1161 {
1163  return;
1164 
1165  // Rationale here is that if you can't get visual feedback on ratings
1166  // adjustments, you probably should not be changing them
1167  // TODO: should check if the rating is visible in the playlist buttontlist
1168  //if (!m_ratingState)
1169  // return;
1170 
1172  if (!curMeta)
1173  return;
1174 
1175 
1176  if (increase)
1177  curMeta->incRating();
1178  else
1179  curMeta->decRating();
1180 
1181  gPlayer->sendTrackStatsChangedEvent(curMeta->ID());
1182 }
1183 
1184 void MusicCommon::customEvent(QEvent *event)
1185 {
1186  QString statusString;
1187 
1188  if (event->type() == OutputEvent::Playing)
1189  {
1191  if (curMeta)
1192  updateTrackInfo(curMeta);
1193 
1194  statusString = tr("Playing stream.");
1195  if (gPlayer->isPlaying())
1196  {
1197  if (m_stopButton)
1198  m_stopButton->SetLocked(false);
1199  if (m_playButton)
1200  m_playButton->SetLocked(true);
1201  if (m_pauseButton)
1202  m_pauseButton->SetLocked(false);
1203  if (m_trackState)
1204  m_trackState->DisplayState("playing");
1205 
1206  if (m_currentPlaylist)
1207  {
1209  if (item)
1210  {
1211  item->SetFontState("running");
1212  item->DisplayState("playing", "playstate");
1213  }
1214  }
1215 
1216  startVisualizer();
1217 
1218  updateVolume();
1219  }
1220  }
1221  else if (event->type() == OutputEvent::Buffering)
1222  {
1223  statusString = tr("Buffering stream.");
1224  }
1225  else if (event->type() == OutputEvent::Paused)
1226  {
1227  statusString = tr("Stream paused.");
1228 
1229  if (m_stopButton)
1230  m_stopButton->SetLocked(false);
1231  if (m_playButton)
1232  m_playButton->SetLocked(false);
1233  if (m_pauseButton)
1234  m_pauseButton->SetLocked(true);
1235  if (m_trackState)
1236  m_trackState->DisplayState("paused");
1237 
1238  if (m_currentPlaylist)
1239  {
1241  if (item)
1242  {
1243  item->SetFontState("idle");
1244  item->DisplayState("paused", "playstate");
1245  }
1246  }
1247  }
1248  else if (event->type() == OutputEvent::Info)
1249  {
1250 
1251  auto *oe = dynamic_cast<OutputEvent *>(event);
1252 
1253  if (!oe)
1254  return;
1255 
1256  std::chrono::seconds rs = 0s;
1258 
1260  {
1261  if (curMeta)
1262  m_currentTime = rs = duration_cast<std::chrono::seconds>(curMeta->Length());
1263  else
1264  m_currentTime = 0s;
1265  }
1266  else
1267  m_currentTime = rs = oe->elapsedSeconds();
1268 
1269  QString time_string = getTimeString(rs, m_maxTime);
1270 
1272 
1273  if (curMeta)
1274  {
1275  if (LCD *lcd = LCD::Get())
1276  {
1277  float percent_heard = m_maxTime <= 0s ?
1278  0.0F:((float)rs.count() / (float)curMeta->Length().count()) * 1000.0F;
1279 
1280  QString lcd_time_string = time_string;
1281 
1282  // if the string is longer than the LCD width, remove all spaces
1283  if (time_string.length() > (int)lcd->getLCDWidth())
1284  lcd_time_string.remove(' ');
1285 
1286  lcd->setMusicProgress(lcd_time_string, percent_heard);
1287  }
1288  }
1289 
1290  QString info_string;
1291 
1292  // Hack around for cd bitrates
1293  if (oe->bitrate() < 2000)
1294  {
1295  info_string = QString("%1 "+tr("kbps")+ " %2 "+ tr("kHz")+ " %3 "+ tr("ch"))
1296  .arg(oe->bitrate())
1297  .arg(static_cast<double>(oe->frequency()) / 1000.0,0,'f',1,QChar('0'))
1298  .arg(oe->channels() > 1 ? "2" : "1");
1299  }
1300  else
1301  {
1302  info_string = QString("%1 "+ tr("kHz")+ " %2 "+ tr("ch"))
1303  .arg(static_cast<double>(oe->frequency()) / 1000.0,0,'f',1,QChar('0'))
1304  .arg(oe->channels() > 1 ? "2" : "1");
1305  }
1306 
1307  if (curMeta)
1308  {
1309  if (m_timeText)
1310  m_timeText->SetText(time_string);
1311  if (m_infoText)
1312  m_infoText->SetText(info_string);
1313  }
1314 
1315  // TODO only need to update the playlist times here
1317  }
1318  else if (event->type() == OutputEvent::Stopped)
1319  {
1320  statusString = tr("Stream stopped.");
1321  if (m_stopButton)
1322  m_stopButton->SetLocked(true);
1323  if (m_playButton)
1324  m_playButton->SetLocked(false);
1325  if (m_pauseButton)
1326  m_pauseButton->SetLocked(false);
1327  if (m_trackState)
1328  m_trackState->DisplayState("stopped");
1329 
1330  if (m_currentPlaylist)
1331  {
1333  if (item)
1334  {
1335  item->SetFontState("normal");
1336  item->DisplayState("stopped", "playstate");
1337  }
1338  }
1339 
1340  stopVisualizer();
1341  }
1342  else if (event->type() == DialogCompletionEvent::kEventType)
1343  {
1344  auto *dce = dynamic_cast<DialogCompletionEvent*>(event);
1345 
1346  // make sure the user didn't ESCAPE out of the menu
1347  if ((dce == nullptr) || (dce->GetResult() < 0))
1348  return;
1349 
1350  QString resultid = dce->GetId();
1351  QString resulttext = dce->GetResultText();
1352 
1353  if (resultid == "mainmenu")
1354  {
1355  if (resulttext == tr("Fullscreen Visualizer"))
1357  else if (resulttext == tr("Playlist Editor"))
1358  {
1359  if (gCoreContext->GetSetting("MusicPlaylistEditorView", "tree") == "tree")
1361  else
1363  }
1364  else if (resulttext == tr("Search for Music"))
1366  else if (resulttext == tr("Switch To Gallery View"))
1368  else if (resulttext == tr("Switch To Tree View"))
1370  else if (resulttext == tr("Lyrics"))
1372  }
1373  else if (resultid == "submenu")
1374  {
1375  if (resulttext == tr("Search List..."))
1376  searchButtonList();
1377  }
1378  else if (resultid == "playlistmenu")
1379  {
1380  if (resulttext == tr("Sync List With Current Track"))
1381  {
1383  }
1384  else if (resulttext == tr("Remove Selected Track"))
1385  {
1387  if (item)
1388  {
1389  auto *mdata = item->GetData().value<MusicMetadata*>();
1390  if (mdata)
1391  gPlayer->removeTrack(mdata->ID());
1392  }
1393  }
1394  else if (resulttext == tr("Remove All Tracks"))
1395  {
1396  if (gPlayer->getCurrentPlaylist())
1397  {
1399  gPlayer->activePlaylistChanged(-1, true);
1400  }
1401  }
1402  else if (resulttext == tr("Save To New Playlist"))
1403  {
1404  QString message = tr("Enter new playlist name");
1405 
1406  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1407 
1408  auto *inputdialog = new MythTextInputDialog(popupStack, message);
1409 
1410  if (inputdialog->Create())
1411  {
1412  inputdialog->SetReturnEvent(this, "addplaylist");
1413  popupStack->AddScreen(inputdialog);
1414  }
1415  else
1416  delete inputdialog;
1417  }
1418  else if (resulttext == tr("Save To Existing Playlist"))
1419  {
1420  QString message = tr("Select the playlist to save to");
1421  QStringList playlists = gMusicData->m_all_playlists->getPlaylistNames();
1422 
1423  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1424 
1425  auto *searchdialog = new MythUISearchDialog(popupStack, message, playlists);
1426 
1427  if (searchdialog->Create())
1428  {
1429  searchdialog->SetReturnEvent(this, "updateplaylist");
1430  popupStack->AddScreen(searchdialog);
1431  }
1432  }
1433  else if (resulttext == tr("Switch To Move Mode"))
1434  {
1435  m_moveTrackMode = true;
1436  m_movingTrack = false;
1437 
1438  if (m_movingTracksState)
1440  }
1441  else if (resulttext == tr("Switch To Select Mode"))
1442  {
1443  m_moveTrackMode = false;
1444 
1446  {
1448  if (item)
1449  item->DisplayState("off", "movestate");
1450 
1451  m_movingTrack = false;
1452  }
1453 
1454  if (m_movingTracksState)
1456  }
1457  }
1458  else if (resultid == "repeatmenu")
1459  {
1460  int mode = dce->GetData().toInt();
1462  updateRepeatMode();
1463  }
1464  else if (resultid == "shufflemenu")
1465  {
1466  int mode = dce->GetData().toInt();
1468  updateShuffleMode(true);
1469  }
1470  else if (resultid == "exitmenu")
1471  {
1472  if (resulttext == tr("No - Exit, Stop Playing"))
1473  {
1474  gPlayer->savePosition();
1475  stopAll();
1476  Close();
1477  }
1478  else if (resulttext == tr("Yes - Exit, Continue Playing"))
1479  {
1480  Close();
1481  }
1482  }
1483  else if (resultid == "playermenu")
1484  {
1485  if (resulttext == tr("Change Volume"))
1486  showVolume();
1487  else if (resulttext == tr("Mute"))
1488  toggleMute();
1489  else if (resulttext == tr("Previous Track"))
1490  previous();
1491  else if (resulttext == tr("Next Track"))
1492  next();
1493  else if (resulttext == tr("Jump Back"))
1494  seekback();
1495  else if (resulttext == tr("Jump Forward"))
1496  seekforward();
1497  else if (resulttext == tr("Play"))
1498  play();
1499  else if (resulttext == tr("Stop"))
1500  stop();
1501  else if (resulttext == tr("Pause"))
1502  pause();
1503  }
1504  else if (resultid == "quickplaylistmenu")
1505  {
1506  if (resulttext == tr("All Tracks"))
1507  allTracks();
1508  else if (resulttext == tr("From CD"))
1509  fromCD();
1510  else if (resulttext == tr("Tracks By Current Artist"))
1511  byArtist();
1512  else if (resulttext == tr("Tracks From Current Genre"))
1513  byGenre();
1514  else if (resulttext == tr("Tracks From Current Album"))
1515  byAlbum();
1516  else if (resulttext == tr("Tracks From Current Year"))
1517  byYear();
1518  else if (resulttext == tr("Tracks With Same Title"))
1519  byTitle();
1520  }
1521  else if (resultid == "playlistoptionsmenu")
1522  {
1523  if (resulttext == tr("Replace Tracks"))
1524  {
1526  doUpdatePlaylist();
1527  }
1528  else if (resulttext == tr("Add Tracks"))
1529  {
1531  doUpdatePlaylist();
1532  }
1533  }
1534  else if (resultid == "visualizermenu")
1535  {
1536  if (dce->GetResult() >= 0)
1537  {
1538  m_currentVisual = dce->GetData().toInt();
1539 
1540  //Change to the new visualizer
1542  }
1543  }
1544  else if (resultid == "addplaylist")
1545  {
1547  Playlist *playlist = gMusicData->m_all_playlists->getPlaylist(resulttext);
1548  gPlayer->playlistChanged(playlist->getID());
1549  }
1550  else if (resultid == "updateplaylist")
1551  {
1552  if (gPlayer->getCurrentPlaylist())
1553  {
1554  Playlist *playlist = gMusicData->m_all_playlists->getPlaylist(resulttext);
1555  QString songList = gPlayer->getCurrentPlaylist()->toRawSonglist();
1556  playlist->removeAllTracks();
1557  playlist->fillSongsFromSonglist(songList);
1558  playlist->changed();
1559  gPlayer->playlistChanged(playlist->getID());
1560  }
1561  }
1562  }
1563  else if (event->type() == MusicPlayerEvent::TrackChangeEvent)
1564  {
1565  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1566 
1567  if (!mpe)
1568  return;
1569 
1570  int trackNo = mpe->m_trackID;
1571 
1572  if (m_currentPlaylist)
1573  {
1574  if (m_currentTrack >= 0 && m_currentTrack < m_currentPlaylist->GetCount())
1575  {
1577  if (item)
1578  {
1579  item->SetFontState("normal");
1580  item->DisplayState("default", "playstate");
1581  }
1582  }
1583 
1584  if (trackNo >= 0 && trackNo < m_currentPlaylist->GetCount())
1585  {
1588 
1590  if (item)
1591  {
1592  item->SetFontState("running");
1593  item->DisplayState("playing", "playstate");
1594  }
1595  }
1596  }
1597 
1598  m_currentTrack = trackNo;
1599 
1600  if (gPlayer->getCurrentPlaylist())
1603  if (m_playlistProgress)
1604  {
1607  }
1608 
1611  }
1612  else if (event->type() == MusicPlayerEvent::VolumeChangeEvent)
1613  {
1614  updateVolume();
1615  }
1616  else if (event->type() == MusicPlayerEvent::TrackRemovedEvent)
1617  {
1618  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1619 
1620  if (!mpe)
1621  return;
1622 
1623  int trackID = mpe->m_trackID;
1624 
1625  if (m_currentPlaylist)
1626  {
1627  // find and remove the list item for the removed track
1628  for (int x = 0; x < m_currentPlaylist->GetCount(); x++)
1629  {
1631  auto *mdata = item->GetData().value<MusicMetadata*>();
1632  if (mdata && mdata->ID() == (MusicMetadata::IdType) trackID)
1633  {
1635  break;
1636  }
1637  }
1638  }
1639 
1641 
1642  // if we have just removed the playing track from the playlist
1643  // move to the next track
1644  if (gPlayer->getCurrentMetadata())
1645  {
1646  if (gPlayer->getCurrentMetadata()->ID() == (MusicMetadata::IdType) trackID)
1647  gPlayer->next();
1648  }
1649 
1650  if (gPlayer->getCurrentPlaylist())
1655 
1658  }
1659  else if (event->type() == MusicPlayerEvent::TrackAddedEvent)
1660  {
1661  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1662 
1663  if (!mpe)
1664  return;
1665 
1666  int trackID = mpe->m_trackID;
1667 
1668  if (m_currentPlaylist)
1669  {
1670  if (trackID == -1)
1671  {
1672  // more than one track has been added so easier to just reload the list
1673  updateUIPlaylist();
1674  }
1675  else
1676  {
1677  // just one track was added so just add that track to the end of the list
1678  MusicMetadata *mdata = gMusicData->m_all_music->getMetadata(trackID);
1679 
1680  if (mdata)
1681  {
1682  InfoMap metadataMap;
1683  mdata->toMap(metadataMap);
1684 
1685  auto *item = new MythUIButtonListItem(m_currentPlaylist, "",
1686  QVariant::fromValue(mdata));
1687 
1688  item->SetTextFromMap(metadataMap);
1689 
1691  mdata->ID() == gPlayer->getCurrentMetadata()->ID())
1692  {
1693  item->SetFontState("running");
1694  item->DisplayState("playing", "playstate");
1695  }
1696  else
1697  {
1698  item->SetFontState("normal");
1699  item->DisplayState("default", "playstate");
1700  }
1701 
1702  if (!gPlayer->getCurrentMetadata())
1704  }
1705 
1708  }
1709  }
1710 
1711  if (gPlayer->getCurrentPlaylist())
1714 
1717  }
1718  else if (event->type() == MusicPlayerEvent::AllTracksRemovedEvent)
1719  {
1720  updateUIPlaylist();
1722  updateTrackInfo(nullptr);
1723  }
1724  else if (event->type() == MusicPlayerEvent::MetadataChangedEvent ||
1726  {
1727  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1728 
1729  if (!mpe)
1730  return;
1731 
1732  uint trackID = mpe->m_trackID;
1733 
1734  if (m_currentPlaylist)
1735  {
1736  for (int x = 0; x < m_currentPlaylist->GetCount(); x++)
1737  {
1739  auto *mdata = item->GetData().value<MusicMetadata*>();
1740 
1741  if (mdata && mdata->ID() == trackID)
1742  {
1743  InfoMap metadataMap;
1744  mdata->toMap(metadataMap);
1745  item->SetTextFromMap(metadataMap);
1746 
1747  item->DisplayState(QString("%1").arg(mdata->Rating()), "ratingstate");
1748  }
1749  }
1750  }
1751 
1752  if (m_playedTracksList)
1753  {
1754  for (int x = 0; x < m_playedTracksList->GetCount(); x++)
1755  {
1757  auto *mdata = item->GetData().value<MusicMetadata*>();
1758 
1759  if (mdata && mdata->ID() == trackID)
1760  {
1761  InfoMap metadataMap;
1762  mdata->toMap(metadataMap);
1763  item->SetTextFromMap(metadataMap);
1764  }
1765  }
1766  }
1767 
1768  if (gPlayer->getCurrentMetadata() && trackID == gPlayer->getCurrentMetadata()->ID())
1770 
1771  // this will ensure the next track info gets updated
1772  if (gPlayer->getNextMetadata() && trackID == gPlayer->getNextMetadata()->ID())
1774  }
1775  else if (event->type() == MusicPlayerEvent::AlbumArtChangedEvent)
1776  {
1777  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1778 
1779  if (!mpe)
1780  return;
1781 
1782  uint trackID = mpe->m_trackID;
1783 
1784  if (m_currentPlaylist)
1785  {
1786  for (int x = 0; x < m_currentPlaylist->GetCount(); x++)
1787  {
1789  auto *mdata = item->GetData().value<MusicMetadata*>();
1790  if (mdata && mdata->ID() == trackID)
1791  {
1792  // reload the albumart image if one has already been loaded for this track
1793  if (!item->GetImageFilename().isEmpty())
1794  {
1795  QString artFile = mdata->getAlbumArtFile();
1796  if (artFile.isEmpty())
1797  {
1798  item->SetImage("");
1799  item->SetImage("", "coverart");
1800  }
1801  else
1802  {
1803  item->SetImage(mdata->getAlbumArtFile());
1804  item->SetImage(mdata->getAlbumArtFile(), "coverart");
1805  }
1806  }
1807  }
1808  }
1809  }
1810 
1811  if (gPlayer->getCurrentMetadata() && trackID == gPlayer->getCurrentMetadata()->ID())
1813  }
1814  else if (event->type() == MusicPlayerEvent::TrackUnavailableEvent)
1815  {
1816  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
1817 
1818  if (!mpe)
1819  return;
1820 
1821  uint trackID = mpe->m_trackID;
1822 
1823  if (m_currentPlaylist)
1824  {
1825  for (int x = 0; x < m_currentPlaylist->GetCount(); x++)
1826  {
1828  auto *mdata = item->GetData().value<MusicMetadata*>();
1829  if (mdata && mdata->ID() == trackID)
1830  {
1831  item->SetFontState("disabled");
1832  item->DisplayState("unavailable", "playstate");
1833  }
1834  }
1835  }
1836  }
1837 }
1838 
1840 {
1841  if (!m_controlVolume)
1842  {
1843  if (m_volumeText)
1844  m_volumeText->Hide();
1845 
1846  if (m_muteState)
1847  m_muteState->Hide();
1848 
1849  return;
1850  }
1851 
1852  if (m_volumeText)
1853  {
1854  InfoMap map;
1855  gPlayer->toMap(map);
1857  }
1858 
1859  if (m_muteState)
1860  {
1861  bool muted = gPlayer->isMuted();
1862  m_muteState->DisplayState(muted ? "on" : "off");
1863  }
1864 }
1865 
1867 {
1868  if (!mdata)
1869  return;
1870 
1872 
1873  auto *editDialog = new EditMetadataDialog(mainStack, mdata);
1874 
1875  if (!editDialog->Create())
1876  {
1877  delete editDialog;
1878  return;
1879  }
1880 
1881  mainStack->AddScreen(editDialog);
1882 }
1883 
1885 {
1886  if (!mdata)
1887  {
1888  InfoMap metadataMap;
1889  MusicMetadata metadata;
1890  metadata.toMap(metadataMap);
1891  metadata.toMap(metadataMap, "next");
1892  ResetMap(metadataMap);
1893 
1894  if (m_coverartImage)
1896  if (m_ratingState)
1898  if (m_timeText)
1899  m_timeText->Reset();
1900  if (m_infoText)
1901  m_infoText->Reset();
1902  if (m_trackProgress)
1904 
1905  if (m_mainvisual)
1907 
1908  return;
1909  }
1910 
1912  m_maxTime = 0s;
1913  else
1914  m_maxTime = duration_cast<std::chrono::seconds>(mdata->Length());
1915 
1916  // get map for current track
1917  InfoMap metadataMap;
1918  mdata->toMap(metadataMap);
1919 
1920  // add the map from the next track
1921  MusicMetadata *nextMetadata = gPlayer->getNextMetadata();
1922  if (nextMetadata)
1923  nextMetadata->toMap(metadataMap, "next");
1924 
1925  // now set text using the map
1926  SetTextFromMap(metadataMap);
1927 
1928  if (m_coverartImage)
1929  {
1930  QString filename = mdata->getAlbumArtFile();
1931  if (!filename.isEmpty())
1932  {
1934  m_coverartImage->Load();
1935  }
1936  else
1938  }
1939 
1940  if (m_ratingState)
1941  m_ratingState->DisplayState(QString("%1").arg(mdata->Rating()));
1942 
1943  setTrackOnLCD(mdata);
1944 }
1945 
1947 {
1948  if (!mdata)
1949  return;
1950 
1951  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
1952 
1953  auto *dlg = new TrackInfoDialog(popupStack, mdata, "trackinfopopup");
1954 
1955  if (!dlg->Create())
1956  {
1957  delete dlg;
1958  return;
1959  }
1960 
1961  popupStack->AddScreen(dlg);
1962 }
1963 
1965 {
1966  if (!item)
1967  return;
1968 
1969  if (m_moveTrackMode)
1970  {
1972 
1973  if (m_movingTrack)
1974  item->DisplayState("on", "movestate");
1975  else
1976  item->DisplayState("off", "movestate");
1977  }
1978  else
1980 
1981  if (m_cycleVisualizer)
1982  cycleVisualizer();
1983 }
1984 
1986 {
1987  if (!item)
1988  return;
1989 
1990  auto *mdata = item->GetData().value<MusicMetadata*>();
1991  if (mdata && item->GetText() == " ")
1992  {
1993  if (item->GetImageFilename().isEmpty())
1994  {
1995  QString artFile = mdata->getAlbumArtFile();
1996  if (artFile.isEmpty())
1997  {
1998  item->SetImage("");
1999  item->SetImage("", "coverart");
2000  }
2001  else
2002  {
2003  item->SetImage(mdata->getAlbumArtFile());
2004  item->SetImage(mdata->getAlbumArtFile(), "coverart");
2005  }
2006  }
2007 
2008  InfoMap metadataMap;
2009  mdata->toMap(metadataMap);
2010  item->SetText("");
2011  item->SetTextFromMap(metadataMap);
2012  item->DisplayState(QString("%1").arg(mdata->Rating()), "ratingstate");
2013  }
2014 }
2015 
2017 {
2020 
2021  if (!m_currentPlaylist)
2022  return;
2023 
2025 
2026  m_currentTrack = -1;
2027 
2028  Playlist *playlist = gPlayer->getCurrentPlaylist();
2029 
2030  if (!playlist)
2031  return;
2032 
2033  for (int x = 0; x < playlist->getTrackCount(); x++)
2034  {
2035  MusicMetadata *mdata = playlist->getSongAt(x);
2036  if (mdata)
2037  {
2038  auto *item = new MythUIButtonListItem(m_currentPlaylist, " ",
2039  QVariant::fromValue(mdata));
2040 
2041  item->SetText(mdata->Artist() + mdata->Album() + mdata->Title(), "**search**");
2042  item->SetFontState("normal");
2043  item->DisplayState("default", "playstate");
2044 
2045  // if this is the current track update its play state to match the player
2046  if (gPlayer->getCurrentMetadata() && mdata->ID() == gPlayer->getCurrentMetadata()->ID())
2047  {
2048  if (gPlayer->isPlaying())
2049  {
2050  item->SetFontState("running");
2051  item->DisplayState("playing", "playstate");
2052  }
2053  else if (gPlayer->isPaused())
2054  {
2055  item->SetFontState("idle");
2056  item->DisplayState("paused", "playstate");
2057  }
2058  else
2059  {
2060  item->SetFontState("normal");
2061  item->DisplayState("stopped", "playstate");
2062  }
2063 
2066  }
2067  }
2068  }
2069 }
2070 
2072 {
2073  if (!m_playedTracksList)
2074  return;
2075 
2077 
2078  QList<MusicMetadata*> playedList = gPlayer->getPlayedTracksList();
2079 
2080  for (int x = playedList.count(); x > 0; x--)
2081  {
2082  MusicMetadata *mdata = playedList[x-1];
2083  auto *item = new MythUIButtonListItem(m_playedTracksList, "",
2084  QVariant::fromValue(mdata));
2085 
2086  InfoMap metadataMap;
2087  mdata->toMap(metadataMap);
2088  item->SetTextFromMap(metadataMap);
2089 
2090  item->SetFontState("normal");
2091  item->DisplayState("default", "playstate");
2092 
2093  item->SetImage(mdata->getAlbumArtFile());
2094  }
2095 }
2096 
2098 {
2099  int trackCount = 0;
2100 
2101  if (gPlayer->getCurrentPlaylist())
2102  trackCount = gPlayer->getCurrentPlaylist()->getTrackCount();
2103 
2104  InfoMap map;
2105  if (gPlayer->isPlaying() && trackCount > 0)
2106  {
2107  QString playlistcurrent = QLocale::system().toString(m_currentTrack + 1);
2108  QString playlisttotal = QLocale::system().toString(trackCount);
2109 
2110  map["playlistposition"] = tr("%1 of %2").arg(playlistcurrent, playlisttotal);
2111  map["playlistcurrent"] = playlistcurrent;
2112  map["playlistcount"] = playlisttotal;
2114  map["playlistplayedtime"] = getTimeString(m_playlistPlayedTime + m_currentTime, 0s);
2115  map["playlisttotaltime"] = getTimeString(m_playlistMaxTime, 0s);
2116  QString playlistName = gPlayer->getCurrentPlaylist() ? gPlayer->getCurrentPlaylist()->getName() : "";
2117  if (playlistName == "default_playlist_storage")
2118  playlistName = tr("Default Playlist");
2119  else if (playlistName == "stream_playlist")
2120  playlistName = tr("Stream Playlist");
2121  map["playlistname"] = playlistName;
2122  }
2123  else
2124  {
2125  map["playlistposition"] = "";
2126  map["playlistcurrent"] = "";
2127  map["playlistcount"] = "";
2128  map["playlisttime"] = "";
2129  map["playlistplayedtime"] = "";
2130  map["playlisttotaltime"] = "";
2131  map["playlistname"] = "";
2132  }
2133 
2134  SetTextFromMap(map);
2135 
2136  if (m_playlistProgress)
2138 }
2139 
2140 QString MusicCommon::getTimeString(std::chrono::seconds exTime, std::chrono::seconds maxTime)
2141 {
2142  if (maxTime <= 0ms)
2143  return MythFormatTime(exTime,
2144  (exTime >= 1h) ? "H:mm:ss" : "mm:ss");
2145 
2146  QString fmt = (maxTime >= 1h) ? "H:mm:ss" : "mm:ss";
2147  return MythFormatTime(exTime, fmt) + " / " + MythFormatTime(maxTime, fmt);
2148 }
2149 
2151 {
2152  auto *buttonList = dynamic_cast<MythUIButtonList *>(GetFocusWidget());
2153  if (buttonList)
2154  buttonList->ShowSearchDialog();
2155 
2156  auto *buttonTree = dynamic_cast<MythUIButtonTree *>(GetFocusWidget());
2157  if (buttonTree)
2158  buttonTree->ShowSearchDialog();
2159 }
2160 
2162 {
2163  MythMenu *mainMenu = createMainMenu();
2164 
2165  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2166 
2167  auto *menuPopup = new MythDialogBox(mainMenu, popupStack, "actionmenu");
2168 
2169  if (menuPopup->Create())
2170  popupStack->AddScreen(menuPopup);
2171  else
2172  delete mainMenu;
2173 }
2174 
2176 {
2177  QString label = tr("View Actions");
2178 
2179  auto *menu = new MythMenu(label, this, "mainmenu");
2180 
2182  menu->AddItem(tr("Switch To Gallery View"));
2184  menu->AddItem(tr("Switch To Tree View"));
2185  else if (m_currentView == MV_PLAYLIST)
2186  menu->AddItem(MusicCommon::tr("Playlist Editor"));
2187 
2188  QStringList screenList;
2189  MythScreenType *screen = this;
2190  while (screen)
2191  {
2192  screenList.append(screen->objectName());
2193  screen = qobject_cast<MusicCommon*>(screen)->m_parentScreen;
2194  }
2195 
2196  if (!screenList.contains("searchview") && !screenList.contains("streamview"))
2197  menu->AddItem(tr("Search for Music"));
2198 
2199  if (!screenList.contains("visualizerview"))
2200  menu->AddItem(tr("Fullscreen Visualizer"));
2201 
2202  if (!screenList.contains("lyricsview"))
2203  menu->AddItem(tr("Lyrics"));
2204 
2205  menu->AddItem(tr("More Options"), nullptr, createSubMenu());
2206 
2207  return menu;
2208 }
2209 
2211 {
2212  QString label = tr("Actions");
2213 
2214  auto *menu = new MythMenu(label, this, "submenu");
2215 
2216  if (GetFocusWidget() && (GetFocusWidget()->inherits("MythUIButtonList") ||
2217  GetFocusWidget()->inherits("MythUIButtonTree")))
2218  menu->AddItem(tr("Search List..."));
2219 
2221  {
2222  menu->AddItem(tr("Playlist Options"), nullptr, createPlaylistMenu());
2223  menu->AddItem(tr("Set Shuffle Mode"), nullptr, createShuffleMenu());
2224  menu->AddItem(tr("Set Repeat Mode"), nullptr, createRepeatMenu());
2225  }
2226 
2227  menu->AddItem(tr("Player Options"), nullptr, createPlayerMenu());
2228 
2230  menu->AddItem(tr("Quick Playlists"), nullptr, createQuickPlaylistsMenu());
2231 
2232  if (m_visualizerVideo)
2233  menu->AddItem(tr("Change Visualizer"), nullptr, createVisualizerMenu());
2234 
2235  return menu;
2236 }
2237 
2239 {
2240  QString label = tr("Playlist Options");
2241 
2242  auto *menu = new MythMenu(label, this, "playlistmenu");
2243 
2244  if (m_currentPlaylist)
2245  {
2246  menu->AddItem(tr("Sync List With Current Track"));
2247  menu->AddItem(tr("Remove Selected Track"));
2248  }
2249 
2250  menu->AddItem(tr("Remove All Tracks"));
2251 
2252  if (m_currentPlaylist)
2253  {
2254  menu->AddItem(tr("Save To New Playlist"));
2255  menu->AddItem(tr("Save To Existing Playlist"));
2256 
2257  if (m_moveTrackMode)
2258  menu->AddItem(tr("Switch To Select Mode"));
2259  else
2260  menu->AddItem(tr("Switch To Move Mode"));
2261  }
2262 
2263  return menu;
2264 }
2265 
2267 {
2268  QString label = tr("Exiting Music Player.\n\n"
2269  "Do you want to continue playing in the background?");
2270 
2271  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2272 
2273  auto *menu = new MythDialogBox(label, popupStack, "exitmenu");
2274 
2275  if (!menu->Create())
2276  {
2277  delete menu;
2278  return;
2279  }
2280 
2281  menu->SetReturnEvent(this, "exitmenu");
2282 
2283  menu->AddButton(tr("No - Exit, Stop Playing"));
2284  menu->AddButton(tr("Yes - Exit, Continue Playing"));
2285  menu->AddButton(tr("Cancel"));
2286 
2287  popupStack->AddScreen(menu);
2288 }
2289 
2291 {
2292  QString label = tr("Player Actions");
2293 
2294  auto *menu = new MythMenu(label, this, "playermenu");
2295 
2296  menu->AddItem(tr("Change Volume"));
2297  menu->AddItem(tr("Mute"));
2298  menu->AddItem(tr("Previous Track"));
2299  menu->AddItem(tr("Next Track"));
2300 
2302  {
2303  menu->AddItem(tr("Jump Back"));
2304  menu->AddItem(tr("Jump Forward"));
2305  }
2306 
2307  menu->AddItem(tr("Play"));
2308  menu->AddItem(tr("Stop"));
2309 
2311  menu->AddItem(tr("Pause"));
2312 
2313  return menu;
2314 }
2315 
2317 {
2318  QString label = tr("Set Repeat Mode");
2319 
2320  auto *menu = new MythMenu(label, this, "repeatmenu");
2321 
2322  menu->AddItemV(tr("None"), QVariant::fromValue((int)MusicPlayer::REPEAT_OFF));
2323  menu->AddItemV(tr("Track"), QVariant::fromValue((int)MusicPlayer::REPEAT_TRACK));
2324  menu->AddItemV(tr("All"), QVariant::fromValue((int)MusicPlayer::REPEAT_ALL));
2325 
2326  menu->SetSelectedByData(static_cast<int>(gPlayer->getRepeatMode()));
2327 
2328  return menu;
2329 }
2330 
2332 {
2333  QString label = tr("Set Shuffle Mode");
2334 
2335  auto *menu = new MythMenu(label, this, "shufflemenu");
2336 
2337  menu->AddItemV(tr("None"), QVariant::fromValue((int)MusicPlayer::SHUFFLE_OFF));
2338  menu->AddItemV(tr("Random"), QVariant::fromValue((int)MusicPlayer::SHUFFLE_RANDOM));
2339  menu->AddItemV(tr("Smart"), QVariant::fromValue((int)MusicPlayer::SHUFFLE_INTELLIGENT));
2340  menu->AddItemV(tr("Album"), QVariant::fromValue((int)MusicPlayer::SHUFFLE_ALBUM));
2341  menu->AddItemV(tr("Artist"), QVariant::fromValue((int)MusicPlayer::SHUFFLE_ARTIST));
2342 
2343  menu->SetSelectedByData(static_cast<int>(gPlayer->getShuffleMode()));
2344 
2345  return menu;
2346 }
2347 
2349 {
2350  QString label = tr("Quick Playlists");
2351 
2352  auto *menu = new MythMenu(label, this, "quickplaylistmenu");
2353 
2354  menu->AddItem(tr("All Tracks"));
2355 
2357  menu->AddItem(tr("From CD"));
2358 
2359  if (gPlayer->getCurrentMetadata())
2360  {
2361  menu->AddItem(tr("Tracks By Current Artist"));
2362  menu->AddItem(tr("Tracks From Current Album"));
2363  menu->AddItem(tr("Tracks From Current Genre"));
2364  menu->AddItem(tr("Tracks From Current Year"));
2365  menu->AddItem(tr("Tracks With Same Title"));
2366  }
2367 
2368  return menu;
2369 }
2370 
2372 {
2373  QString label = tr("Choose Visualizer");
2374 
2375  auto *menu = new MythMenu(label, this, "visualizermenu");
2376 
2377  for (uint x = 0; x < static_cast<uint>(m_visualModes.count()); x++)
2378  menu->AddItemV(m_visualModes.at(x), QVariant::fromValue(x));
2379 
2380  menu->SetSelectedByData(m_currentVisual);
2381 
2382  return menu;
2383 }
2384 
2386 {
2387  QString label = tr("Add to Playlist Options");
2388 
2389  auto *menu = new MythMenu(label, this, "playlistoptionsmenu");
2390 
2391  menu->AddItem(tr("Replace Tracks"));
2392  menu->AddItem(tr("Add Tracks"));
2393 
2394  return menu;
2395 }
2396 
2398 {
2399  m_whereClause = "ORDER BY music_artists.artist_name, album_name, disc_number, track";
2401 }
2402 
2404 {
2405  m_whereClause = "";
2406  m_songList.clear();
2407 
2408  // get the list of cd tracks
2409  for (int x = 1; x <= gMusicData->m_all_music->getCDTrackCount(); x++)
2410  {
2412  if (mdata)
2413  {
2414  m_songList.append((mdata)->ID());
2415  }
2416  }
2417 
2419 }
2420 
2422 {
2424  if (!mdata)
2425  return;
2426 
2427  QString value = formattedFieldValue(mdata->Artist().toUtf8().constData());
2428  m_whereClause = "WHERE music_artists.artist_name = " + value +
2429  " ORDER BY album_name, disc_number, track";
2430 
2432 }
2433 
2435 {
2437  if (!mdata)
2438  return;
2439 
2440  QString value = formattedFieldValue(mdata->Album().toUtf8().constData());
2441  m_whereClause = "WHERE album_name = " + value +
2442  " ORDER BY disc_number, track";
2443 
2445 }
2446 
2448 {
2450  if (!mdata)
2451  return;
2452 
2453  QString value = formattedFieldValue(mdata->Genre().toUtf8().constData());
2454  m_whereClause = "WHERE genre = " + value +
2455  " ORDER BY music_artists.artist_name, album_name, disc_number, track";
2456 
2458 }
2459 
2461 {
2463  if (!mdata)
2464  return;
2465 
2466  QString value = formattedFieldValue(mdata->Year());
2467  m_whereClause = "WHERE music_songs.year = " + value +
2468  " ORDER BY music_artists.artist_name, album_name, disc_number, track";
2469 
2471 }
2472 
2474 {
2476  if (!mdata)
2477  return;
2478 
2479  QString value = formattedFieldValue(mdata->Title().toUtf8().constData());
2480  m_whereClause = "WHERE music_songs.name = " + value +
2481  " ORDER BY music_artists.artist_name, album_name, disc_number, track";
2482 
2484 }
2485 
2487 {
2488  if (!gPlayer->getCurrentPlaylist())
2489  return;
2490 
2492 
2493  // Don't bother showing the dialog if the current playlist is empty
2494  if (gPlayer->getCurrentPlaylist()->getTrackCount() == 0)
2495  {
2497  doUpdatePlaylist();
2498  return;
2499  }
2500 
2502 
2503  if (addMainMenu)
2504  menu->AddItem(tr("More Options"), nullptr, createMainMenu());
2505 
2506  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
2507 
2508  auto *menuPopup = new MythDialogBox(menu, popupStack, "playlistoptionsmenu");
2509 
2510  if (menuPopup->Create())
2511  popupStack->AddScreen(menuPopup);
2512  else
2513  delete menu;
2514 }
2515 
2517 {
2518  int curTrackID = -1;
2519  int trackCount = 0;
2520  int curPos = gPlayer->getCurrentTrackPos();
2521 
2522  if (gPlayer->getCurrentPlaylist())
2523  trackCount = gPlayer->getCurrentPlaylist()->getTrackCount();
2524 
2525  // store id of current track
2526  if (gPlayer->getCurrentMetadata())
2527  curTrackID = gPlayer->getCurrentMetadata()->ID();
2528 
2529  if (!m_whereClause.isEmpty())
2530  {
2531  // update playlist from quick playlist
2533  m_whereClause, true,
2534  m_playlistOptions.insertPLOption, curTrackID);
2535  m_whereClause.clear();
2536  }
2537  else if (!m_songList.isEmpty())
2538  {
2539  // update playlist from song list (from the playlist editor)
2541  m_songList, true,
2542  m_playlistOptions.insertPLOption, curTrackID);
2543 
2544  m_songList.clear();
2545  }
2546 
2548 
2549  updateUIPlaylist();
2550 
2551  if (m_currentTrack == -1)
2552  playFirstTrack();
2553  else
2554  {
2556  {
2557  case PL_CURRENT:
2558  {
2559  if (!restorePosition(curTrackID))
2560  playFirstTrack();
2561 
2562  break;
2563  }
2564 
2565  case PL_FIRST:
2566  playFirstTrack();
2567  break;
2568 
2569  case PL_FIRSTNEW:
2570  {
2572  {
2573  case PL_REPLACE:
2574  playFirstTrack();
2575  break;
2576 
2577  case PL_INSERTATEND:
2578  {
2579  pause();
2580  if (!gPlayer->setCurrentTrackPos(trackCount))
2581  playFirstTrack();
2582  break;
2583  }
2584 
2585  case PL_INSERTAFTERCURRENT:
2586  if (!gPlayer->setCurrentTrackPos(curPos + 1))
2587  playFirstTrack();
2588  break;
2589 
2590  default:
2591  playFirstTrack();
2592  }
2593 
2594  break;
2595  }
2596  }
2597  }
2598 
2599  if (gPlayer->getCurrentPlaylist())
2604 }
2605 
2607 {
2608  // try to move to the current track
2609  bool foundTrack = false;
2610 
2611  if (trackID != -1 && gPlayer->getCurrentPlaylist())
2612  {
2613  for (int x = 0; x < gPlayer->getCurrentPlaylist()->getTrackCount(); x++)
2614  {
2616  if (mdata && mdata->ID() == (MusicMetadata::IdType) trackID)
2617  {
2618  m_currentTrack = x;
2619  if (m_currentPlaylist)
2620  {
2623  if (item)
2624  {
2625  item->SetFontState("running");
2626  item->DisplayState("playing", "playstate");
2627  }
2628  }
2629 
2630  foundTrack = true;
2631 
2632  break;
2633  }
2634  }
2635  }
2636 
2637  return foundTrack;
2638 }
2639 
2641 {
2643 }
2644 
2645 //---------------------------------------------------------
2646 // MythMusicVolumeDialog
2647 //---------------------------------------------------------
2648 static constexpr std::chrono::milliseconds MUSICVOLUMEPOPUPTIME { 4s };
2649 
2651 {
2652  if (m_displayTimer)
2653  {
2654  m_displayTimer->stop();
2655  delete m_displayTimer;
2656  m_displayTimer = nullptr;
2657  }
2658 }
2659 
2661 {
2662  if (!LoadWindowFromXML("music-ui.xml", "volume_popup", this))
2663  return false;
2664 
2665  UIUtilW::Assign(this, m_volText, "volume");
2666  UIUtilW::Assign(this, m_volProgress, "volumeprogress");
2667  UIUtilW::Assign(this, m_muteState, "mutestate");
2668 
2669  if (m_volProgress)
2670  m_volProgress->SetTotal(100);
2671 
2672  updateDisplay();
2673 
2674  m_displayTimer = new QTimer(this);
2676  m_displayTimer->setSingleShot(true);
2678 
2679  return true;
2680 }
2681 
2683 {
2684  QStringList actions;
2685  bool handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions, false);
2686 
2687  for (int i = 0; i < actions.size() && !handled; i++)
2688  {
2689  QString action = actions[i];
2690  handled = true;
2691 
2692  if (action == "UP" || action == "VOLUMEUP")
2693  increaseVolume();
2694  else if (action == "DOWN" || action == "VOLUMEDOWN")
2695  decreaseVolume();
2696  else if (action == "MUTE" || action == "SELECT")
2697  toggleMute();
2698  else
2699  handled = false;
2700  }
2701 
2702  if (!handled && MythScreenType::keyPressEvent(event))
2703  handled = true;
2704 
2705  // Restart the display timer only if we handled this keypress, if nothing
2706  // has changed there's no need to keep the volume on-screen
2707  if (handled)
2709 
2710  return handled;
2711 }
2712 
2714 {
2715  gPlayer->incVolume();
2716  updateDisplay();
2717 }
2718 
2720 {
2721  gPlayer->decVolume();
2722  updateDisplay();
2723 }
2724 
2726 {
2727  gPlayer->toggleMute();
2728  updateDisplay();
2729 }
2730 
2732 {
2733  if (m_muteState)
2734  m_muteState->DisplayState(gPlayer->isMuted() ? "on" : "off");
2735 
2736  if (m_volProgress)
2738 
2739  if (m_volText)
2740  {
2741  InfoMap map;
2742  gPlayer->toMap(map);
2743  m_volText->SetTextFromMap(map);
2744  }
2745 }
2746 
2747 //---------------------------------------------------------
2748 // TrackInfoDialog
2749 //---------------------------------------------------------
2751 {
2752  if (!LoadWindowFromXML("music-ui.xml", "trackdetail_popup", this))
2753  return false;
2754 
2755  InfoMap metadataMap;
2756  m_metadata->toMap(metadataMap);
2757  SetTextFromMap(metadataMap);
2758 
2759  MythUIStateType *ratingState = dynamic_cast<MythUIStateType *>(GetChild("rating_state"));
2760  if (ratingState)
2761  ratingState->DisplayState(QString("%1").arg(m_metadata->Rating()));
2762 
2763  MythUIImage *albumImage = dynamic_cast<MythUIImage *>(GetChild("coverart"));
2764  if (albumImage)
2765  {
2766  if (!m_metadata->getAlbumArtFile().isEmpty())
2767  {
2768  albumImage->SetFilename(m_metadata->getAlbumArtFile());
2769  albumImage->Load();
2770  }
2771  }
2772 
2773  // hide the song ID by default
2774  MythUIText *songID = dynamic_cast<MythUIText *>(GetChild("songid"));
2775  if (songID)
2776  songID->Hide();
2777 
2778  return true;
2779 }
2780 
2781 bool TrackInfoDialog::keyPressEvent(QKeyEvent *event)
2782 {
2783  QStringList actions;
2784  bool handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions, false);
2785 
2786  for (int i = 0; i < actions.size() && !handled; i++)
2787  {
2788  QString action = actions[i];
2789  handled = true;
2790 
2791  if (action == "INFO")
2792  Close();
2793  if (action == "0")
2794  {
2795  // if it's available show the song ID
2796  MythUIText *songID = dynamic_cast<MythUIText *>(GetChild("songid"));
2797  if (songID)
2798  songID->Show();
2799  }
2800  else
2801  handled = false;
2802  }
2803 
2804  if (!handled && MythScreenType::keyPressEvent(event))
2805  handled = true;
2806 
2807  return handled;
2808 }
LCD::MUSIC_SHUFFLE_ALBUM
@ MUSIC_SHUFFLE_ALBUM
Definition: lcddevice.h:198
MusicPlayer::addVisual
void addVisual(MainVisual *visual)
Definition: musicplayer.cpp:175
FUNC_MUSIC
@ FUNC_MUSIC
Definition: lcddevice.h:164
MythMusicVolumeDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: musiccommon.cpp:2682
MythUIButton::Clicked
void Clicked()
MusicCommon::m_currentView
MusicView m_currentView
Definition: musiccommon.h:139
MusicCommon::stopAll
void stopAll(void)
Definition: musiccommon.cpp:1048
MusicPlayer::PLAYMODE_TRACKSEDITOR
@ PLAYMODE_TRACKSEDITOR
Definition: musicplayer.h:73
MythUIButtonList::GetItemAt
MythUIButtonListItem * GetItemAt(int pos) const
Definition: mythuibuttonlist.cpp:1676
MusicPlayer::toggleMute
void toggleMute(void)
Definition: musicplayer.cpp:1399
MusicCommon::m_movingTracksState
MythUIStateType * m_movingTracksState
Definition: musiccommon.h:179
mythuibuttontree.h
MusicPlayer::SHUFFLE_INTELLIGENT
@ SHUFFLE_INTELLIGENT
Definition: musicplayer.h:174
MusicPlayer::getDecoder
Decoder * getDecoder(void)
Definition: musicplayer.h:123
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:317
MusicCommon::init
void init(bool startPlayback=true)
Definition: musiccommon.cpp:164
MusicCommon::editTrackInfo
static void editTrackInfo(MusicMetadata *mdata)
Definition: musiccommon.cpp:1866
playlistcontainer.h
MusicCommon::m_trackProgressText
MythUIText * m_trackProgressText
Definition: musiccommon.h:184
MusicPlayer::getOutput
AudioOutput * getOutput(void)
Definition: musicplayer.h:125
MythUISearchDialog
Provide a dialog to quickly find an entry in a list.
Definition: mythdialogbox.h:398
PL_REPLACE
@ PL_REPLACE
Definition: playlist.h:24
MusicMetadata::Title
QString Title() const
Definition: musicmetadata.h:162
MythUIButton::SetLocked
void SetLocked(bool locked)
Definition: mythuibutton.cpp:204
gPlayer
MusicPlayer * gPlayer
Definition: musicplayer.cpp:35
MV_MINIPLAYER
@ MV_MINIPLAYER
Definition: musiccommon.h:42
MusicCommon::m_currentTrack
int m_currentTrack
Definition: musiccommon.h:155
Playlist::getSongAt
MusicMetadata * getSongAt(int pos) const
Definition: playlist.cpp:1087
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
formattedFieldValue
QString formattedFieldValue(const QVariant &value)
Definition: smartplaylist.cpp:104
MusicPlayer::setCurrentTrackPos
bool setCurrentTrackPos(int pos)
Definition: musicplayer.cpp:1035
mythuitext.h
MusicPlayer::getRepeatMode
RepeatMode getRepeatMode(void)
Definition: musicplayer.h:188
mythuiprogressbar.h
MythMusicVolumeDialog
Definition: musiccommon.h:209
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
OutputEvent::Buffering
static Type Buffering
Definition: output.h:64
MythMusicVolumeDialog::m_volText
MythUIText * m_volText
Definition: musiccommon.h:229
MusicCommon::m_repeatState
MythUIStateType * m_repeatState
Definition: musiccommon.h:177
DialogCompletionEvent::GetId
QString GetId()
Definition: mythdialogbox.h:52
MusicMetadata::Genre
QString Genre() const
Definition: musicmetadata.h:175
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
editmetadata.h
MusicCommon::setTrackOnLCD
static void setTrackOnLCD(MusicMetadata *mdata)
Definition: musiccommon.cpp:1036
MusicCommon::m_playButton
MythUIButton * m_playButton
Definition: musiccommon.h:196
MusicPlayer::toMap
void toMap(InfoMap &infoMap) const
Definition: musicplayer.cpp:1415
MusicCommon::m_whereClause
QString m_whereClause
Definition: musiccommon.h:165
mythuivideo.h
MusicCommon::m_trackSpeedText
MythUIText * m_trackSpeedText
Definition: musiccommon.h:185
MusicCommon::seekforward
void seekforward(void)
Definition: musiccommon.cpp:1099
MusicCommon::m_ffButton
MythUIButton * m_ffButton
Definition: musiccommon.h:198
MythMusicVolumeDialog::increaseVolume
void increaseVolume(void)
Definition: musiccommon.cpp:2713
MythUIButtonListItem::DisplayState
void DisplayState(const QString &state, const QString &name)
Definition: mythuibuttonlist.cpp:3506
MusicCommon::switchView
void switchView(MusicView view)
Definition: musiccommon.cpp:376
MythUIComposite::ResetMap
virtual void ResetMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:28
OutputEvent
Definition: output.h:31
MusicCommon::CreateCommon
bool CreateCommon(void)
Definition: musiccommon.cpp:80
MusicPlayerEvent
Definition: musicplayer.h:21
MusicCommon::createPlaylistOptionsMenu
MythMenu * createPlaylistOptionsMenu(void)
Definition: musiccommon.cpp:2385
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:385
PlaylistEditorView
Definition: playlisteditorview.h:64
OutputEvent::Stopped
static Type Stopped
Definition: output.h:67
MusicCommon::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: musiccommon.cpp:580
TrackInfoDialog::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: musiccommon.cpp:2781
MV_PLAYLISTEDITORTREE
@ MV_PLAYLISTEDITORTREE
Definition: musiccommon.h:34
MythUIType::GetChild
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
Definition: mythuitype.cpp:131
MusicCommon::showPlaylistOptionsMenu
void showPlaylistOptionsMenu(bool addMainMenu=false)
Definition: musiccommon.cpp:2486
MusicCommon::playlistItemClicked
void playlistItemClicked(MythUIButtonListItem *item)
Definition: musiccommon.cpp:1964
MythUIButtonList::RemoveItem
void RemoveItem(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1488
MusicCommon::createVisualizerMenu
MythMenu * createVisualizerMenu(void)
Definition: musiccommon.cpp:2371
MusicCommon::m_songList
QList< int > m_songList
Definition: musiccommon.h:168
MusicCommon::m_fullscreenBlank
bool m_fullscreenBlank
Definition: musiccommon.h:143
MusicCommon::m_muteState
MythUIStateType * m_muteState
Definition: musiccommon.h:188
MythUIImage::Load
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
Definition: mythuiimage.cpp:968
MusicPlayer::decVolume
void decVolume(void)
Definition: musicplayer.cpp:1374
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
MusicCommon::previous
void previous(void)
Definition: musiccommon.cpp:1091
MusicCommon::createSubMenu
MythMenu * createSubMenu(void)
Definition: musiccommon.cpp:2210
PlaylistOptions::insertPLOption
InsertPLOption insertPLOption
Definition: playlist.h:39
Playlist
Definition: playlist.h:45
Playlist::getName
QString getName(void)
Definition: playlist.h:106
MusicCommon::toggleMute
void toggleMute(void) const
Definition: musiccommon.cpp:899
LCD::MUSIC_REPEAT_ALL
@ MUSIC_REPEAT_ALL
Definition: lcddevice.h:191
TrackInfoDialog
Definition: musiccommon.h:234
MusicCommon::updatePlaylistStats
void updatePlaylistStats(void)
Definition: musiccommon.cpp:2097
MusicCommon::seekback
void seekback(void)
Definition: musiccommon.cpp:1106
MythUIProgressBar::SetUsed
void SetUsed(int value)
Definition: mythuiprogressbar.cpp:59
MUSICVOLUMEPOPUPTIME
static constexpr std::chrono::milliseconds MUSICVOLUMEPOPUPTIME
Definition: musiccommon.cpp:2648
mythdialogbox.h
MythScreenStack
Definition: mythscreenstack.h:16
MusicPlayerEvent::TrackStatsChangedEvent
static Type TrackStatsChangedEvent
Definition: musicplayer.h:47
MusicCommon::byTitle
void byTitle(void)
Definition: musiccommon.cpp:2473
MusicPlayer::setShuffleMode
void setShuffleMode(ShuffleMode mode)
Definition: musicplayer.cpp:1241
MusicMetadata::ID
IdType ID() const
Definition: musicmetadata.h:219
MusicCommon::next
void next(void)
Definition: musiccommon.cpp:1082
MusicCommon::doUpdatePlaylist
void doUpdatePlaylist(void)
Definition: musiccommon.cpp:2516
MV_PLAYLIST
@ MV_PLAYLIST
Definition: musiccommon.h:32
MusicCommon::~MusicCommon
~MusicCommon(void) override
Definition: musiccommon.cpp:62
MusicCommon::playFirstTrack
static void playFirstTrack()
Definition: musiccommon.cpp:2640
MusicPlayer::getCurrentTrackPos
int getCurrentTrackPos(void) const
Definition: musicplayer.h:140
MusicPlayerEvent::TrackAddedEvent
static Type TrackAddedEvent
Definition: musicplayer.h:42
MusicPlayer::isPlaying
bool isPlaying(void) const
Definition: musicplayer.h:110
MusicCommon::m_ratingState
MythUIStateType * m_ratingState
Definition: musiccommon.h:181
MusicCommon::m_rewButton
MythUIButton * m_rewButton
Definition: musiccommon.h:194
PlaylistContainer::copyNewPlaylist
void copyNewPlaylist(const QString &name)
Definition: playlistcontainer.cpp:192
MusicCommon::showTrackInfo
static void showTrackInfo(MusicMetadata *mdata)
Definition: musiccommon.cpp:1946
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MusicCommon::m_pauseButton
MythUIButton * m_pauseButton
Definition: musiccommon.h:195
MythUIButton::SetLockable
void SetLockable(bool lockable)
Definition: mythuibutton.h:39
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
mythuistatetype.h
show
static void show(uint8_t *buf, int length)
Definition: ringbuffer.cpp:339
MusicCommon::fromCD
void fromCD(void)
Definition: musiccommon.cpp:2403
playlisteditorview.h
MusicMetadata
Definition: musicmetadata.h:80
MusicCommon::createPlaylistMenu
MythMenu * createPlaylistMenu(void)
Definition: musiccommon.cpp:2238
MusicPlayerEvent::MetadataChangedEvent
static Type MetadataChangedEvent
Definition: musicplayer.h:46
MusicCommon::switchVisualizer
void switchVisualizer(const QString &visual)
Definition: musiccommon.cpp:969
PlaylistContainer::getPlaylistNames
QStringList getPlaylistNames(void)
Definition: playlistcontainer.cpp:285
MusicMetadata::Length
std::chrono::milliseconds Length() const
Definition: musicmetadata.h:205
MusicPlayer::getCurrentPlaylist
Playlist * getCurrentPlaylist(void)
Definition: musicplayer.cpp:1599
MythUIButtonList::SetSearchFields
void SetSearchFields(const QString &fields)
Definition: mythuibuttonlist.h:214
playlistview.h
MythUIImage::Reset
void Reset(void) override
Reset the image back to the default defined in the theme.
Definition: mythuiimage.cpp:645
MusicPlayer::removeListener
void removeListener(QObject *listener)
Definition: musicplayer.cpp:159
MusicMetadata::Artist
QString Artist() const
Definition: musicmetadata.h:126
MainVisual::prepare
void prepare(void) override
Definition: mainvisual.cpp:138
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:53
MusicPlayer::setPlayMode
void setPlayMode(PlayMode mode)
Definition: musicplayer.cpp:952
MusicPlayer::pause
void pause(void)
Definition: musicplayer.cpp:286
mythuibuttonlist.h
PlaylistView
Definition: playlistview.h:17
LCD::Get
static LCD * Get(void)
Definition: lcddevice.cpp:69
MusicPlayer::getPlayMode
PlayMode getPlayMode(void)
Definition: musicplayer.h:78
mythuiimage.h
MythUIButtonList::GetCount
int GetCount() const
Definition: mythuibuttonlist.cpp:1655
Playlist::toRawSonglist
QString toRawSonglist(bool shuffled=false, bool tracksOnly=false)
Definition: playlist.cpp:854
MV_RADIO
@ MV_RADIO
Definition: musiccommon.h:41
PL_FIRSTNEW
@ PL_FIRSTNEW
Definition: playlist.h:33
MythMusicVolumeDialog::Create
bool Create(void) override
Definition: musiccommon.cpp:2660
MusicPlayer::isStopped
bool isStopped(void)
Definition: musicplayer.h:112
MusicCommon::play
static void play(void)
Definition: musiccommon.cpp:1060
MusicCommon::changeSpeed
static void changeSpeed(bool up)
Definition: musiccommon.cpp:887
MythMusicVolumeDialog::m_displayTimer
QTimer * m_displayTimer
Definition: musiccommon.h:227
VisualizerView
Definition: visualizerview.h:16
MusicPlayer::changeCurrentTrack
void changeCurrentTrack(int trackNo)
change the current track to the given track
Definition: musicplayer.cpp:1136
AllMusic::getCDMetadata
MusicMetadata * getCDMetadata(int m_the_track)
Definition: musicmetadata.cpp:1702
MusicCommon::byArtist
void byArtist(void)
Definition: musiccommon.cpp:2421
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
MainVisual::setVisual
void setVisual(const QString &name)
Definition: mainvisual.cpp:80
PlaylistContainer::getActive
Playlist * getActive(void)
Definition: playlistcontainer.h:47
MusicCommon::m_visualModes
QStringList m_visualModes
Definition: musiccommon.h:147
MusicCommon::m_playlistOptions
PlaylistOptions m_playlistOptions
Definition: musiccommon.h:164
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythUIButtonListItem::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythuibuttonlist.cpp:3271
MusicPlayer::sendTrackStatsChangedEvent
void sendTrackStatsChangedEvent(int trackID)
Definition: musicplayer.cpp:1341
MusicPlayer::getCurrentMetadata
MusicMetadata * getCurrentMetadata(void)
get the metadata for the current track in the playlist
Definition: musicplayer.cpp:1158
LCD::MUSIC_REPEAT_NONE
@ MUSIC_REPEAT_NONE
Definition: lcddevice.h:189
MusicCommon::showVolume
static void showVolume(void)
Definition: musiccommon.cpp:949
MusicCommon::m_currentTime
std::chrono::seconds m_currentTime
Definition: musiccommon.h:156
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
MusicCommon::m_moveTrackMode
bool m_moveTrackMode
Definition: musiccommon.h:150
MusicPlayer::SHUFFLE_OFF
@ SHUFFLE_OFF
Definition: musicplayer.h:172
MusicCommon::getTimeString
static QString getTimeString(std::chrono::seconds exTime, std::chrono::seconds maxTime)
Definition: musiccommon.cpp:2140
MusicPlayer::toggleRepeatMode
RepeatMode toggleRepeatMode(void)
Definition: musicplayer.cpp:1195
Decoder
Definition: decoder.h:70
MusicCommon::m_currentVisual
unsigned int m_currentVisual
Definition: musiccommon.h:148
MusicPlayerEvent::TrackChangeEvent
static Type TrackChangeEvent
Definition: musicplayer.h:40
Playlist::fillSonglistFromQuery
void fillSonglistFromQuery(const QString &whereClause, bool removeDuplicates=false, InsertPLOption insertOption=PL_REPLACE, int currentTrackID=0)
Definition: playlist.cpp:681
MythUIProgressBar::SetTotal
void SetTotal(int value)
Definition: mythuiprogressbar.cpp:71
MusicPlayer::removeVisual
void removeVisual(MainVisual *visual)
Definition: musicplayer.cpp:189
MusicCommon::m_maxTime
std::chrono::seconds m_maxTime
Definition: musiccommon.h:157
OutputEvent::Playing
static Type Playing
Definition: output.h:63
MythUIType::Show
void Show(void)
Definition: mythuitype.cpp:1125
MusicPlayer::incVolume
void incVolume(void)
Definition: musicplayer.cpp:1365
MusicCommon::byYear
void byYear(void)
Definition: musiccommon.cpp:2460
MusicCommon::m_cycleVisualizer
bool m_cycleVisualizer
Definition: musiccommon.h:144
Decoder::unlock
virtual void unlock(void)
Definition: decoder.h:86
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
Playlist::changed
void changed(void)
Definition: playlist.cpp:985
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:198
MusicCommon::m_playlistTrackCount
uint m_playlistTrackCount
Definition: musiccommon.h:159
MusicMetadata::toMap
void toMap(InfoMap &metadataMap, const QString &prefix="")
Definition: musicmetadata.cpp:1091
MV_VISUALIZER
@ MV_VISUALIZER
Definition: musiccommon.h:36
MusicPlayer::toggleShuffleMode
ShuffleMode toggleShuffleMode(void)
Definition: musicplayer.cpp:1214
MusicCommon::m_playlistProgress
MythUIProgressBar * m_playlistProgress
Definition: musiccommon.h:191
MusicCommon::playlistItemVisible
static void playlistItemVisible(MythUIButtonListItem *item)
Definition: musiccommon.cpp:1985
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:166
LCD::MUSIC_SHUFFLE_RAND
@ MUSIC_SHUFFLE_RAND
Definition: lcddevice.h:196
compat.h
MusicMetadata::getAlbumArtFile
QString getAlbumArtFile(void)
Definition: musicmetadata.cpp:1261
MusicCommon::byGenre
void byGenre(void)
Definition: musiccommon.cpp:2447
MythTV::Visual::mutex
QMutex * mutex()
Definition: visual.h:26
searchview.h
MusicCommon::m_prevButton
MythUIButton * m_prevButton
Definition: musiccommon.h:193
MusicCommon::createQuickPlaylistsMenu
MythMenu * createQuickPlaylistsMenu(void)
Definition: musiccommon.cpp:2348
MusicCommon::m_playlistMaxTime
std::chrono::seconds m_playlistMaxTime
Definition: musiccommon.h:161
clamp
float clamp(float val, float minimum, float maximum)
Definition: mythmiscutil.h:56
Playlist::getTrackCount
int getTrackCount(void)
Definition: playlist.h:82
MusicPlayer::REPEAT_TRACK
@ REPEAT_TRACK
Definition: musicplayer.h:167
EditMetadataDialog
Definition: editvideometadata.h:19
MythUIComposite::SetTextFromMap
virtual void SetTextFromMap(const InfoMap &infoMap)
Definition: mythuicomposite.cpp:9
PlaylistContainer::getPlaylist
Playlist * getPlaylist(int id)
Definition: playlistcontainer.cpp:133
MythUIButton::Push
void Push(bool lock=false)
Definition: mythuibutton.cpp:173
MusicCommon::m_currentPlaylist
MythUIButtonList * m_currentPlaylist
Definition: musiccommon.h:203
MV_PLAYLISTEDITORGALLERY
@ MV_PLAYLISTEDITORGALLERY
Definition: musiccommon.h:35
MusicPlayer::incSpeed
void incSpeed()
Definition: musicplayer.cpp:1317
MythUIButtonTree
A tree widget for displaying and navigating a MythGenericTree()
Definition: mythuibuttontree.h:16
MusicCommon::updateProgressBar
void updateProgressBar(void)
Definition: musiccommon.cpp:914
MusicCommon::stopVisualizer
void stopVisualizer(void)
Definition: musiccommon.cpp:1028
AllMusic::getCDTrackCount
int getCDTrackCount(void) const
Definition: musicmetadata.h:443
MusicCommon::m_mainvisual
MainVisual * m_mainvisual
Definition: musiccommon.h:142
MythMusicVolumeDialog::m_muteState
MythUIStateType * m_muteState
Definition: musiccommon.h:230
MusicCommon::createRepeatMenu
MythMenu * createRepeatMenu(void)
Definition: musiccommon.cpp:2316
MusicPlayer::getShuffleMode
ShuffleMode getShuffleMode(void)
Definition: musicplayer.h:192
MusicPlayer::SHUFFLE_ARTIST
@ SHUFFLE_ARTIST
Definition: musicplayer.h:176
MusicPlayerEvent::m_trackID
int m_trackID
Definition: musicplayer.h:34
MusicPlayer::savePosition
void savePosition(void)
Definition: musicplayer.cpp:1050
MV_LYRICS
@ MV_LYRICS
Definition: musiccommon.h:33
MusicCommon::viewExited
void viewExited(void)
Definition: musiccommon.cpp:575
LCD::MUSIC_SHUFFLE_NONE
@ MUSIC_SHUFFLE_NONE
Definition: lcddevice.h:195
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3587
LCD::MUSIC_SHUFFLE_ARTIST
@ MUSIC_SHUFFLE_ARTIST
Definition: lcddevice.h:199
MusicPlayer::playlistChanged
void playlistChanged(int playlistID)
Definition: musicplayer.cpp:1487
AllMusic::getMetadata
MusicMetadata * getMetadata(int an_id)
Definition: musicmetadata.cpp:1632
uint
unsigned int uint
Definition: compat.h:140
MusicPlayer::removeTrack
void removeTrack(int trackID)
Definition: musicplayer.cpp:1581
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:60
MusicData::m_all_playlists
PlaylistContainer * m_all_playlists
Definition: musicdata.h:54
MythFormatTime
QString MythFormatTime(std::chrono::milliseconds msecs, const QString &fmt)
Format a milliseconds time value.
Definition: mythmiscutil.cpp:1235
MusicPlayer::next
void next(void)
Definition: musicplayer.cpp:418
MusicPlayer::isPaused
bool isPaused(void)
Definition: musicplayer.h:111
MusicCommon::updateUIPlayedList
void updateUIPlayedList(void)
Definition: musiccommon.cpp:2071
smartplaylist.h
MusicCommon::updateRepeatMode
void updateRepeatMode(void)
Definition: musiccommon.cpp:286
MusicPlayerEvent::AllTracksRemovedEvent
static Type AllTracksRemovedEvent
Definition: musicplayer.h:45
MusicCommon::m_trackState
MythUIStateType * m_trackState
Definition: musiccommon.h:186
MusicCommon::createShuffleMenu
MythMenu * createShuffleMenu(void)
Definition: musiccommon.cpp:2331
MusicCommon::m_coverartImage
MythUIImage * m_coverartImage
Definition: musiccommon.h:201
LyricsView
Definition: lyricsview.h:17
MythUIButtonList::itemVisible
void itemVisible(MythUIButtonListItem *item)
MusicCommon::m_infoText
MythUIText * m_infoText
Definition: musiccommon.h:172
musicdata.h
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
TrackInfoDialog::m_metadata
MusicMetadata * m_metadata
Definition: musiccommon.h:247
MythUIType::Hide
void Hide(void)
Definition: mythuitype.cpp:1120
MythMusicVolumeDialog::toggleMute
void toggleMute(void)
Definition: musiccommon.cpp:2725
MythUIButtonListItem::SetTextFromMap
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
Definition: mythuibuttonlist.cpp:3288
MusicPlayer::SHUFFLE_RANDOM
@ SHUFFLE_RANDOM
Definition: musicplayer.h:173
musiccommon.h
MusicCommon::m_visualizerVideo
MythUIVideo * m_visualizerVideo
Definition: musiccommon.h:206
MusicMetadata::Album
QString Album() const
Definition: musicmetadata.h:150
MusicCommon::createPlayerMenu
MythMenu * createPlayerMenu(void)
Definition: musiccommon.cpp:2290
gMusicData
MusicData * gMusicData
Definition: musicdata.cpp:20
streamview.h
MythCoreContext::GetBoolSetting
bool GetBoolSetting(const QString &key, bool defaultval=false)
Definition: mythcorecontext.cpp:930
MusicCommon::changeRating
static void changeRating(bool increase)
Definition: musiccommon.cpp:1160
MythUIButtonListItem::GetText
QString GetText(const QString &name="") const
Definition: mythuibuttonlist.cpp:3312
MusicCommon::m_stopButton
MythUIButton * m_stopButton
Definition: musiccommon.h:197
MusicMetadata::IdType
uint32_t IdType
Definition: musicmetadata.h:86
MusicPlayer::PLAYMODE_TRACKSPLAYLIST
@ PLAYMODE_TRACKSPLAYLIST
Definition: musicplayer.h:72
MusicPlayer::getNextMetadata
MusicMetadata * getNextMetadata(void)
get the metadata for the next track in the playlist
Definition: musicplayer.cpp:1170
LCD::MUSIC_SHUFFLE_SMART
@ MUSIC_SHUFFLE_SMART
Definition: lcddevice.h:197
MusicCommon::m_timeText
MythUIText * m_timeText
Definition: musiccommon.h:171
OutputEvent::Paused
static Type Paused
Definition: output.h:66
MainVisual::getVisualizations
QStringList getVisualizations(void)
Definition: mainvisual.h:56
PL_INSERTATEND
@ PL_INSERTATEND
Definition: playlist.h:26
MainVisual::getCurrentVisual
int getCurrentVisual(void) const
Definition: mainvisual.h:58
MusicCommon::updateVolume
void updateVolume(void)
Definition: musiccommon.cpp:1839
MusicCommon::updateTrackInfo
void updateTrackInfo(MusicMetadata *mdata)
Definition: musiccommon.cpp:1884
MainVisual
Definition: mainvisual.h:32
MusicPlayer::getPlayedTracksList
QList< MusicMetadata * > & getPlayedTracksList(void)
Definition: musicplayer.h:138
MusicCommon::m_trackProgress
MythUIProgressBar * m_trackProgress
Definition: musiccommon.h:183
MusicCommon::createMainMenu
MythMenu * createMainMenu(void)
Definition: musiccommon.cpp:2175
MythUIButtonListItem::SetFontState
void SetFontState(const QString &state, const QString &name="")
Definition: mythuibuttonlist.cpp:3390
MusicPlayer::previous
void previous(void)
Definition: musicplayer.cpp:455
lyricsview.h
MythMenu
Definition: mythdialogbox.h:99
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
MusicCommon::updateShuffleMode
void updateShuffleMode(bool updateUIList=false)
Definition: musiccommon.cpp:321
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:397
MusicPlayer::decSpeed
void decSpeed()
Definition: musicplayer.cpp:1323
MusicPlayerEvent::TrackUnavailableEvent
static Type TrackUnavailableEvent
Definition: musicplayer.h:44
MusicCommon::showExitMenu
void showExitMenu(void)
Definition: musiccommon.cpp:2266
MusicPlayer::activePlaylistChanged
void activePlaylistChanged(int trackID, bool deleted)
Definition: musicplayer.cpp:1424
MythMusicVolumeDialog::~MythMusicVolumeDialog
~MythMusicVolumeDialog(void) override
Definition: musiccommon.cpp:2650
MusicPlayer::setRepeatMode
void setRepeatMode(RepeatMode mode)
Definition: musicplayer.h:189
MusicMetadata::decRating
void decRating()
Definition: musicmetadata.cpp:1167
MusicPlayer::REPEAT_OFF
@ REPEAT_OFF
Definition: musicplayer.h:166
MythMusicVolumeDialog::updateDisplay
void updateDisplay(void)
Definition: musiccommon.cpp:2731
mythuitextedit.h
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
MythUIButtonListItem::SetImage
void SetImage(MythImage *image, const QString &name="")
Sets an image directly, should only be used in special circumstances since it bypasses the cache.
Definition: mythuibuttonlist.cpp:3405
MusicCommon::searchButtonList
void searchButtonList(void)
Definition: musiccommon.cpp:2150
MusicPlayer::RepeatMode
RepeatMode
Definition: musicplayer.h:165
random
static long int random(void)
Definition: compat.h:149
PL_INSERTAFTERCURRENT
@ PL_INSERTAFTERCURRENT
Definition: playlist.h:27
MusicPlayer::SHUFFLE_ALBUM
@ SHUFFLE_ALBUM
Definition: musicplayer.h:175
MusicCommon::cycleVisualizer
void cycleVisualizer(void)
Definition: musiccommon.cpp:990
constants.h
OutputEvent::Info
static Type Info
Definition: output.h:65
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
audiooutput.h
MusicPlayerEvent::VolumeChangeEvent
static Type VolumeChangeEvent
Definition: musicplayer.h:41
MusicCommon::showSpeed
static void showSpeed(bool show)
Definition: musiccommon.cpp:964
MythUIText::SetTextFromMap
void SetTextFromMap(const InfoMap &map)
Definition: mythuitext.cpp:156
MusicPlayerEvent::TrackRemovedEvent
static Type TrackRemovedEvent
Definition: musicplayer.h:43
MusicView
MusicView
Definition: musiccommon.h:30
Playlist::getStats
void getStats(uint *trackCount, std::chrono::seconds *totalLength, uint currentTrack=0, std::chrono::seconds *playedLength=nullptr) const
Definition: playlist.cpp:492
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:133
MusicPlayer::isMuted
bool isMuted(void) const
Definition: musicplayer.h:90
MythUIType::SetVisible
virtual void SetVisible(bool visible)
Definition: mythuitype.cpp:1086
startPlayback
static void startPlayback(void)
Definition: mythtv/programs/mythfrontend/main.cpp:552
MusicCommon::m_movingTrack
bool m_movingTrack
Definition: musiccommon.h:151
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
MusicCommon::changeVolume
void changeVolume(bool up) const
Definition: musiccommon.cpp:875
MusicCommon::startVisualizer
void startVisualizer(void)
Definition: musiccommon.cpp:1020
mainvisual.h
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:104
MusicCommon::m_playlistPlayedTime
std::chrono::seconds m_playlistPlayedTime
Definition: musiccommon.h:160
MThread::isRunning
bool isRunning(void) const
Definition: mthread.cpp:266
visualizerview.h
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1557
MusicPlayer::setAllowRestorePos
void setAllowRestorePos(bool allow)
Definition: musicplayer.h:151
build_compdb.action
action
Definition: build_compdb.py:9
MusicCommon::m_playedTracksList
MythUIButtonList * m_playedTracksList
Definition: musiccommon.h:204
MusicPlayer::PLAYMODE_RADIO
@ PLAYMODE_RADIO
Definition: musicplayer.h:74
MusicCommon::pause
static void pause(void)
Definition: musiccommon.cpp:1065
MusicCommon::stop
void stop(void)
Definition: musiccommon.cpp:1070
MusicPlayer::play
void play(void)
Definition: musicplayer.cpp:305
MythScreenType::Exiting
void Exiting()
LCD::switchToMusic
void switchToMusic(const QString &artist, const QString &album, const QString &track)
Definition: lcddevice.cpp:569
mythuibutton.h
PlaylistOptions::playPLOption
PlayPLOption playPLOption
Definition: playlist.h:40
MusicPlayer::restorePosition
void restorePosition(void)
Definition: musicplayer.cpp:1067
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &Stackname)
Definition: mythmainwindow.cpp:322
MV_SEARCH
@ MV_SEARCH
Definition: musiccommon.h:37
MusicData::m_all_music
AllMusic * m_all_music
Definition: musicdata.h:55
MusicCommon::byAlbum
void byAlbum(void)
Definition: musiccommon.cpp:2434
MusicCommon::MusicCommon
MusicCommon(MythScreenStack *parent, MythScreenType *parentScreen, const QString &name)
Definition: musiccommon.cpp:47
MusicMetadata::Rating
int Rating() const
Definition: musicmetadata.h:240
LCD::MUSIC_REPEAT_TRACK
@ MUSIC_REPEAT_TRACK
Definition: lcddevice.h:190
MythUIButtonTree::ShowSearchDialog
void ShowSearchDialog(void)
Definition: mythuibuttontree.cpp:357
MusicCommon::updateUIPlaylist
void updateUIPlaylist(void)
Definition: musiccommon.cpp:2016
MythThemedMenuState::Create
bool Create(void) override
Definition: myththemedmenu.cpp:36
Playlist::fillSongsFromSonglist
void fillSongsFromSonglist(const QString &songList)
Definition: playlist.cpp:632
MusicMetadata::incRating
void incRating()
Definition: musicmetadata.cpp:1176
MythUIButtonListItem::GetImageFilename
QString GetImageFilename(const QString &name="") const
Definition: mythuibuttonlist.cpp:3493
Decoder::lock
virtual void lock(void)
Definition: decoder.h:85
Playlist::removeAllTracks
void removeAllTracks(void)
Definition: playlist.cpp:84
PL_FIRST
@ PL_FIRST
Definition: playlist.h:32
MusicPlayer::stop
void stop(bool stopAll=false)
Definition: musicplayer.cpp:237
Playlist::getID
int getID(void) const
Definition: playlist.h:111
MusicCommon::m_volumeText
MythUIText * m_volumeText
Definition: musiccommon.h:189
playlist.h
Playlist::fillSonglistFromList
void fillSonglistFromList(const QList< int > &songList, bool removeDuplicates, InsertPLOption insertOption, int currentTrackID)
Definition: playlist.cpp:781
MythTextInputDialog
Dialog prompting the user to enter a text string.
Definition: mythdialogbox.h:313
lcddevice.h
mythuicheckbox.h
PL_CURRENT
@ PL_CURRENT
Definition: playlist.h:34
MusicPlayer::getBufferStatus
void getBufferStatus(int *bufferAvailable, int *bufferSize) const
Definition: musicplayer.cpp:946
MythUIImage::SetFilename
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
Definition: mythuiimage.cpp:676
MythUIButtonList::ShowSearchDialog
void ShowSearchDialog(void)
Definition: mythuibuttonlist.cpp:3103
MusicCommon::m_shuffleState
MythUIStateType * m_shuffleState
Definition: musiccommon.h:176
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
MusicPlayerEvent::AlbumArtChangedEvent
static Type AlbumArtChangedEvent
Definition: musicplayer.h:48
MusicCommon::m_visualText
MythUIText * m_visualText
Definition: musiccommon.h:173
build_compdb.filename
filename
Definition: build_compdb.py:21
Decoder::seek
virtual void seek(double)=0
MusicCommon::m_noTracksText
MythUIText * m_noTracksText
Definition: musiccommon.h:174
MusicPlayer::getVolume
uint getVolume(void) const
Definition: musicplayer.cpp:1392
MusicCommon::m_parentScreen
MythScreenType * m_parentScreen
Definition: musiccommon.h:138
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:50
MythUIButtonListItem::MoveUpDown
bool MoveUpDown(bool flag)
Definition: mythuibuttonlist.cpp:3592
MusicCommon::seek
void seek(std::chrono::seconds pos)
Definition: musiccommon.cpp:1113
MusicCommon::restorePosition
bool restorePosition(int trackID)
Definition: musiccommon.cpp:2606
MusicCommon::m_randomVisualizer
bool m_randomVisualizer
Definition: musiccommon.h:145
SearchView
Definition: searchview.h:18
AudioOutput::ToggleUpmix
virtual bool ToggleUpmix(void)
Definition: audiooutput.h:160
MusicCommon::customEvent
void customEvent(QEvent *event) override
Definition: musiccommon.cpp:1184
musicmetadata.h
MusicCommon::m_controlVolume
bool m_controlVolume
Definition: musiccommon.h:153
TrackInfoDialog::Create
bool Create(void) override
Definition: musiccommon.cpp:2750
MusicCommon::m_nextButton
MythUIButton * m_nextButton
Definition: musiccommon.h:199
LCD
Definition: lcddevice.h:173
MusicMetadata::Year
int Year() const
Definition: musicmetadata.h:196
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called....
Definition: mythuistatetype.h:22
AudioOutput::IsPaused
virtual bool IsPaused(void) const =0
MythMusicVolumeDialog::decreaseVolume
void decreaseVolume(void)
Definition: musiccommon.cpp:2719
MusicPlayer::addListener
void addListener(QObject *listener)
Definition: musicplayer.cpp:143
MusicCommon::toggleUpmix
static void toggleUpmix(void)
Definition: musiccommon.cpp:908
MythUIStateType::DisplayState
bool DisplayState(const QString &name)
Definition: mythuistatetype.cpp:84
decoder.h
MusicCommon::ShowMenu
void ShowMenu(void) override
Definition: musiccommon.cpp:2161
MusicPlayer::ShuffleMode
ShuffleMode
Definition: musicplayer.h:171
AudioOutput::SetTimecode
virtual void SetTimecode(std::chrono::milliseconds timecode)=0
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:922
MythMusicVolumeDialog::m_volProgress
MythUIProgressBar * m_volProgress
Definition: musiccommon.h:231
MusicCommon::allTracks
void allTracks(void)
Definition: musiccommon.cpp:2397
MusicPlayer::REPEAT_ALL
@ REPEAT_ALL
Definition: musicplayer.h:168
MusicPlayer::moveTrackUpDown
void moveTrackUpDown(bool moveUp, int whichTrack)
Definition: musicplayer.cpp:1017