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