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