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