MythTV  master
streamview.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include <cstdlib>
3 
4 // qt
5 #include <QKeyEvent>
6 #include <QRegExp>
7 #include <QThread>
8 #include <QDomDocument>
9 
10 // myth
11 #include <mythcontext.h>
12 #include <mythdbcon.h>
13 #include <mythmainwindow.h>
14 #include <mythuibuttonlist.h>
15 #include <mythuibutton.h>
16 #include <mythuitext.h>
17 #include <mythuiprogressbar.h>
18 #include <mythuiutils.h>
19 #include <mythdialogbox.h>
20 #include <mythuihelper.h>
21 #include <mythdownloadmanager.h>
22 #include <mythdirs.h>
23 #include <musicutils.h>
24 #include <mythcoreutil.h>
25 
26 // mythmusic
27 #include "musicdata.h"
28 #include "musiccommon.h"
29 #include "streamview.h"
30 #include "musicplayer.h"
31 
32 using namespace std;
33 
34 
36  : MusicCommon(parent, parentScreen, "streamview")
37 {
39 }
40 
42 {
43  // Load the theme for this screen
44  bool err = LoadWindowFromXML("stream-ui.xml", "streamview", this);
45 
46  if (!err)
47  return false;
48 
49  // find common widgets available on any view
50  err = CreateCommon();
51 
52  // find widgets specific to this view
53  UIUtilE::Assign(this, m_streamList, "streamlist", &err);
54  UIUtilW::Assign(this, m_bufferStatus, "bufferstatus", &err);
55  UIUtilW::Assign(this, m_bufferProgress, "bufferprogress", &err);
56  UIUtilW::Assign(this, m_noStreams, "nostreams", &err);
57 
58  if (err)
59  {
60  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'streamview'");
61  return false;
62  }
63 
64  connect(m_streamList, SIGNAL(itemClicked(MythUIButtonListItem*)),
66  connect(m_streamList, SIGNAL(itemVisible(MythUIButtonListItem*)),
68 
70 
73 
75 
76  return true;
77 }
78 
80 {
81  auto *menu = new MythMenu(tr("Stream Actions"), this, "mainmenu");
82  menu->AddItem(tr("Add Stream"));
83 
85  {
86  menu->AddItem(tr("Edit Stream"));
87  menu->AddItem(tr("Remove Stream"));
88  }
89 
90  menu->AddItem(MusicCommon::tr("Fullscreen Visualizer"), QVariant::fromValue((int)MV_VISUALIZER));
91  menu->AddItem(MusicCommon::tr("Lyrics"), QVariant::fromValue((int)MV_LYRICS));
92 
93  menu->AddItem(tr("More Options"), nullptr, createSubMenu());
94 
95  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
96 
97  auto *menuPopup = new MythDialogBox(menu, popupStack, "actionmenu");
98 
99  if (menuPopup->Create())
100  popupStack->AddScreen(menuPopup);
101  else
102  delete menu;
103 }
104 
105 void StreamView::customEvent(QEvent *event)
106 {
107  bool handled = true;
108 
109  if (event->type() == MusicPlayerEvent::PlayedTracksChangedEvent)
110  {
111  if (gPlayer->getPlayedTracksList().count())
113 
114  // add the new track to the list
116  {
117  MusicMetadata *mdata = gPlayer->getPlayedTracksList().last();
118 
119  auto *item = new MythUIButtonListItem(m_playedTracksList, "",
120  QVariant::fromValue(mdata), 0);
121 
122  InfoMap metadataMap;
123  mdata->toMap(metadataMap);
124  item->SetTextFromMap(metadataMap);
125  item->SetFontState("normal");
126  item->DisplayState("default", "playstate");
127  item->SetImage(mdata->getAlbumArtFile());
128 
130  }
131  }
132  else if (event->type() == MusicPlayerEvent::TrackChangeEvent)
133  {
134  auto *mpe = dynamic_cast<MusicPlayerEvent *>(event);
135 
136  if (!mpe)
137  return;
138 
139  if (m_streamList)
140  {
141  MythUIButtonListItem *item = m_streamList->GetItemByData(QVariant::fromValue(m_currStream));
142  if (item)
143  {
144  item->SetFontState("normal");
145  item->DisplayState("default", "playstate");
146  }
147 
149  {
152  }
153 
154  item = m_streamList->GetItemByData(QVariant::fromValue(m_currStream));
155  if (item)
156  {
157  if (gPlayer->isPlaying())
158  {
159  item->SetFontState("running");
160  item->DisplayState("playing", "playstate");
161  }
162  else if (gPlayer->isPaused())
163  {
164  item->SetFontState("idle");
165  item->DisplayState("paused", "playstate");
166  }
167  else
168  {
169  item->SetFontState("normal");
170  item->DisplayState("stopped", "playstate");
171  }
172  }
173  }
174 
176  }
177  else if (event->type() == OutputEvent::Playing)
178  {
179  if (gPlayer->isPlaying())
180  {
181  if (m_streamList)
182  {
183  MythUIButtonListItem *item = m_streamList->GetItemByData(QVariant::fromValue(m_currStream));
184  if (item)
185  {
186  item->SetFontState("running");
187  item->DisplayState("playing", "playstate");
188  }
189  }
190  }
191 
192  // pass it on to the default handler in MusicCommon
193  handled = false;
194  }
195  else if (event->type() == OutputEvent::Stopped)
196  {
197  if (m_streamList)
198  {
199  MythUIButtonListItem *item = m_streamList->GetItemByData(QVariant::fromValue(m_currStream));
200  if (item)
201  {
202  item->SetFontState("normal");
203  item->DisplayState("stopped", "playstate");
204  }
205  }
206 
207  // pass it on to the default handler in MusicCommon
208  handled = false;
209  }
210  else if (event->type() == OutputEvent::Buffering)
211  {
212  }
213  else if (event->type() == MythEvent::MythEventMessage)
214  {
215  auto *me = dynamic_cast<MythEvent *>(event);
216  if (me == nullptr)
217  return;
218 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
219  QStringList tokens = me->Message().split(" ", QString::SkipEmptyParts);
220 #else
221  QStringList tokens = me->Message().split(" ", Qt::SkipEmptyParts);
222 #endif
223 
224  if (tokens.isEmpty())
225  return;
226 
227  if (tokens[0] == "DOWNLOAD_FILE")
228  {
229  QStringList args = me->ExtraDataList();
230 
231  if (tokens[1] == "UPDATE")
232  {
233  }
234  else if (tokens[1] == "FINISHED")
235  {
236  QString url = args[0];
237  int fileSize = args[2].toInt();
238  int errorCode = args[4].toInt();
239  QString filename = args[1];
240 
241  if ((errorCode != 0) || (fileSize == 0))
242  LOG(VB_GENERAL, LOG_ERR, QString("StreamView: failed to download radio icon from '%1'").arg(url));
243  else
244  {
245  for (int x = 0; x < m_streamList->GetCount(); x++)
246  {
248  auto *mdata = item->GetData().value<MusicMetadata *>();
249  if (mdata && mdata->LogoUrl() == url)
250  item->SetImage(filename);
251  }
252  }
253  }
254  }
255  }
256  else if (event->type() == DecoderHandlerEvent::OperationStart)
257  {
258  auto *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
259  if (!dhe)
260  return;
261  if (dhe->getMessage() && m_bufferStatus)
262  {
263  m_bufferStatus->SetText(*dhe->getMessage());
264  }
265  }
266  else if (event->type() == DecoderHandlerEvent::BufferStatus)
267  {
268  auto *dhe = dynamic_cast<DecoderHandlerEvent*>(event);
269  if (!dhe)
270  return;
271 
272  int available = 0;
273  int maxSize = 0;
274  dhe->getBufferStatus(&available, &maxSize);
275 
276  if (m_bufferStatus)
277  {
278  QString status = QString("%1%").arg((int)(100.0 / ((double)maxSize / (double)available)));
279  m_bufferStatus->SetText(status);
280  }
281 
282  if (m_bufferProgress)
283  {
284  m_bufferProgress->SetTotal(maxSize);
285  m_bufferProgress->SetUsed(available);
286  }
287  }
288  else if (event->type() == DecoderHandlerEvent::OperationStop)
289  {
290  if (m_bufferStatus)
292  }
293  else if (event->type() == DialogCompletionEvent::kEventType)
294  {
295  auto *dce = dynamic_cast<DialogCompletionEvent*>(event);
296 
297  // make sure the user didn't ESCAPE out of the menu
298  if ((dce == nullptr) || (dce->GetResult() < 0))
299  return;
300 
301  QString resultid = dce->GetId();
302  QString resulttext = dce->GetResultText();
303 
304  if (resultid == "mainmenu")
305  {
306  if (resulttext == tr("Add Stream"))
307  {
309  MythScreenType *screen = new EditStreamMetadata(mainStack, this, nullptr);
310 
311  if (screen->Create())
312  mainStack->AddScreen(screen);
313  else
314  delete screen;
315  }
316  else if (resulttext == tr("Remove Stream"))
317  {
318  removeStream();
319  }
320  else if (resulttext == tr("Edit Stream"))
321  {
322  editStream();
323  }
324  else
325  handled = false;
326  }
327  else
328  handled = false;
329  }
330  else
331  handled = false;
332 
333 
334  if (!handled)
336 }
337 
338 bool StreamView::keyPressEvent(QKeyEvent *event)
339 {
340  if (GetFocusWidget() && GetFocusWidget()->keyPressEvent(event))
341  return true;
342 
343  QStringList actions;
344  bool handled = GetMythMainWindow()->TranslateKeyPress("Music", event, actions);
345 
346  for (int i = 0; i < actions.size() && !handled; i++)
347  {
348  QString action = actions[i];
349  handled = true;
350 
351  if (action == "EDIT")
352  {
353  editStream();
354  }
355  else if (action == "DELETE")
356  {
357  removeStream();
358  }
359  else if (action == "TOGGLELAST")
360  {
362  {
363  m_streamList->SetValueByData(QVariant::fromValue(m_lastStream));
364 
366  if (item)
367  streamItemClicked(item);
368  }
369  }
370  else
371  handled = false;
372  }
373 
374  if (!handled && MusicCommon::keyPressEvent(event))
375  handled = true;
376 
377  return handled;
378 }
379 
381 {
383  if (item)
384  {
385  auto *mdata = item->GetData().value<MusicMetadata *>();
387  MythScreenType *screen = new EditStreamMetadata(mainStack, this, mdata);
388 
389  if (screen->Create())
390  mainStack->AddScreen(screen);
391  else
392  delete screen;
393  }
394 }
395 
397 {
399  if (item)
400  {
401  auto *mdata = item->GetData().value<MusicMetadata *>();
402 
403  if (mdata)
404  {
405  ShowOkPopup(tr("Are you sure you want to delete this Stream?\n"
406  "Broadcaster: %1 - Channel: %2")
407  .arg(mdata->Broadcaster()).arg(mdata->Channel()),
408  this, SLOT(doRemoveStream(bool)), true);
409  }
410  }
411 }
412 
414 {
415  if (!ok)
416  return;
417 
419  if (item)
420  {
421  auto *mdata = item->GetData().value<MusicMetadata *>();
422 
423  if (mdata)
424  deleteStream(mdata);
425  }
426 }
427 
429 {
430  if (!gPlayer->getCurrentPlaylist())
431  return;
432 
433  m_streamList->Reset();
434 
435  bool foundActiveStream = false;
436 
437  for (int x = 0; x < gPlayer->getCurrentPlaylist()->getTrackCount(); x++)
438  {
440  auto *item = new MythUIButtonListItem(m_streamList, "",
441  QVariant::fromValue(mdata));
442  InfoMap metadataMap;
443  if (mdata)
444  mdata->toMap(metadataMap);
445  item->SetTextFromMap(metadataMap);
446  item->SetText("", "imageloaded");
447  item->SetFontState("normal");
448  item->DisplayState("default", "playstate");
449 
450  // if this is the current radio stream update its play state to match the player
451  if (gPlayer->getCurrentMetadata() && mdata &&
452  mdata->ID() == gPlayer->getCurrentMetadata()->ID())
453  {
454  if (gPlayer->isPlaying())
455  {
456  item->SetFontState("running");
457  item->DisplayState("playing", "playstate");
458  }
459  else if (gPlayer->isPaused())
460  {
461  item->SetFontState("idle");
462  item->DisplayState("paused", "playstate");
463  }
464  else
465  {
466  item->SetFontState("normal");
467  item->DisplayState("stopped", "playstate");
468  }
469 
471 
473 
474  foundActiveStream = true;
475  }
476  }
477 
478  if (m_streamList->GetCount() > 0 && !foundActiveStream)
479  {
481  gPlayer->stop(true);
482  }
483 
484  if (m_noStreams)
486 
487  if (m_streamList->GetCount() == 0)
488  LOG(VB_GENERAL, LOG_ERR, "StreamView hasn't found any streams!");
489 }
490 
492 {
493  if (!item)
494  return;
495 
497 }
498 
500 {
501  if (!item)
502  return;
503 
504  if (!item->GetText("imageloaded").isEmpty())
505  return;
506 
507  auto *mdata = item->GetData().value<MusicMetadata *>();
508  if (mdata)
509  {
510  if (!mdata->LogoUrl().isEmpty())
511  item->SetImage(mdata->getAlbumArtFile());
512  else
513  item->SetImage("");
514  }
515 
516  item->SetText(" ", "imageloaded");
517 }
518 
520 {
521  // sanity check this is a radio stream
522  int repo = ID_TO_REPO(mdata->ID());
523  if (repo != RT_Radio)
524  {
525  LOG(VB_GENERAL, LOG_ERR, "StreamView asked to add a stream but it isn't a radio stream!");
526  return;
527  }
528 
529  QString url = mdata->Url();
530 
532 
534 
536 
537  // find the new stream and make it the active item
538  for (int x = 0; x < m_streamList->GetCount(); x++)
539  {
541  auto *itemsdata = item->GetData().value<MusicMetadata *>();
542  if (itemsdata)
543  {
544  if (url == itemsdata->Url())
545  {
547  break;
548  }
549  }
550  }
551 }
552 
554 {
555  // sanity check this is a radio stream
556  int repo = ID_TO_REPO(mdata->ID());
557  if (repo != RT_Radio)
558  {
559  LOG(VB_GENERAL, LOG_ERR, "StreamView asked to update a stream but it isn't a radio stream!");
560  return;
561  }
562 
563  MusicMetadata::IdType id = mdata->ID();
564 
566 
568 
569  // update mdata to point to the new item
570  mdata = gMusicData->m_all_streams->getMetadata(id);
571 
572  if (!mdata)
573  return;
574 
575  // force the icon to reload incase it changed
576  QFile::remove(mdata->getAlbumArtFile());
577  mdata->reloadAlbumArtImages();
578 
580 
581  // if we just edited the currently playing stream update the current metadata to match
582  MusicMetadata *currentMetadata = gPlayer->getCurrentMetadata();
583  if (id == currentMetadata->ID())
584  {
585  currentMetadata->setBroadcaster(mdata->Broadcaster());
586  currentMetadata->setChannel(mdata->Channel());
587  }
588 
589  // update the played tracks list to match the new metadata
590  if (m_playedTracksList)
591  {
592  for (int x = 0; x < m_playedTracksList->GetCount(); x++)
593  {
595  auto *playedmdata = item->GetData().value<MusicMetadata *>();
596 
597  if (playedmdata && playedmdata->ID() == id)
598  {
599  playedmdata->setBroadcaster(mdata->Broadcaster());
600  playedmdata->setChannel(mdata->Channel());
601 
602  InfoMap metadataMap;
603  playedmdata->toMap(metadataMap);
604  item->SetTextFromMap(metadataMap);
605  }
606  }
607  }
608 
609  // find the stream and make it the active item
610  for (int x = 0; x < m_streamList->GetCount(); x++)
611  {
613  auto *itemsdata = item->GetData().value<MusicMetadata *>();
614  if (itemsdata)
615  {
616  if (mdata->ID() == itemsdata->ID())
617  {
619  break;
620  }
621  }
622  }
623 }
624 
626 {
627  // sanity check this is a radio stream
628  int repo = ID_TO_REPO(mdata->ID());
629  if (repo != RT_Radio)
630  {
631  LOG(VB_GENERAL, LOG_ERR, "StreamView asked to delete a stream but it isn't a radio stream!");
632  return;
633  }
634 
635  int currPos = m_streamList->GetCurrentPos();
636  int topPos = m_streamList->GetTopItemPos();
637 
638  // if we are playing this radio stream stop playing
639  if (gPlayer->getCurrentMetadata() == mdata)
640  gPlayer->stop(true);
641 
643 
645 
647 
648  m_streamList->SetItemCurrent(currPos, topPos);
649 }
650 
652 
654 {
655  if (!LoadWindowFromXML("stream-ui.xml", "editstreammetadata", this))
656  return false;
657 
658  bool err = false;
659  UIUtilE::Assign(this, m_broadcasterEdit, "broadcasteredit", &err);
660  UIUtilE::Assign(this, m_channelEdit, "channeledit", &err);
661  UIUtilE::Assign(this, m_descEdit, "descriptionedit", &err);
662  UIUtilE::Assign(this, m_url1Edit, "url1edit", &err);
663  UIUtilE::Assign(this, m_url2Edit, "url2edit", &err);
664  UIUtilE::Assign(this, m_url3Edit, "url3edit", &err);
665  UIUtilE::Assign(this, m_url4Edit, "url4edit", &err);
666  UIUtilE::Assign(this, m_url5Edit, "url5edit", &err);
667  UIUtilE::Assign(this, m_logourlEdit, "logourledit" , &err);
668  UIUtilE::Assign(this, m_genreEdit, "genreedit", &err);
669  UIUtilE::Assign(this, m_languageEdit, "languageedit", &err);
670  UIUtilE::Assign(this, m_countryEdit, "countryedit", &err);
671  UIUtilE::Assign(this, m_formatEdit, "formatedit", &err);
672  UIUtilE::Assign(this, m_saveButton, "savebutton", &err);
673  UIUtilE::Assign(this, m_cancelButton, "cancelbutton", &err);
674  UIUtilE::Assign(this, m_searchButton, "searchbutton", &err);
675 
676  if (err)
677  {
678  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'editstreampopup'");
679  return false;
680  }
681 
682  if (m_streamMeta)
683  {
697  }
698  else
699  m_formatEdit->SetText("%a - %t");
700 
701  connect(m_searchButton, SIGNAL(Clicked()), this, SLOT(searchClicked()));
702  connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(Close()));
703  connect(m_saveButton, SIGNAL(Clicked()), this, SLOT(saveClicked()));
704 
705  BuildFocusList();
706 
707  return true;
708 }
709 
711 {
713  MythScreenType *screen = new SearchStream(mainStack, this);
714 
715  if (screen->Create())
716  mainStack->AddScreen(screen);
717  else
718  delete screen;
719 
720 }
721 
723 {
724  bool doUpdate = true;
725 
726  if (!m_streamMeta)
727  {
730  doUpdate = false;
731  }
732 
740  m_streamMeta->setFormat("cast");
747 
748  if (doUpdate)
750  else
752 
753  Close();
754 }
755 
757 {
758  if (mdata)
759  {
761  m_channelEdit->SetText(mdata->Channel());
762  m_url1Edit->SetText(mdata->Url(0));
763  m_url2Edit->SetText(mdata->Url(1));
764  m_url3Edit->SetText(mdata->Url(2));
765  m_url4Edit->SetText(mdata->Url(3));
766  m_url5Edit->SetText(mdata->Url(4));
767  m_logourlEdit->SetText(mdata->LogoUrl());
768  m_genreEdit->SetText(mdata->Genre());
770  m_descEdit->SetText(mdata->Description());
771  m_countryEdit->SetText(mdata->Country());
772  m_languageEdit->SetText(mdata->Language());
773  }
774 }
775 
777 
779 {
780  if (!LoadWindowFromXML("stream-ui.xml", "searchstream", this))
781  return false;
782 
783  bool err = false;
784  UIUtilE::Assign(this, m_broadcasterList, "broadcasterlist", &err);
785  UIUtilE::Assign(this, m_genreList, "genrelist", &err);
786  UIUtilW::Assign(this, m_languageList, "languagelist", &err);
787  UIUtilW::Assign(this, m_countryList, "countrylist", &err);
788  UIUtilE::Assign(this, m_streamList, "streamlist", &err);
789  UIUtilE::Assign(this, m_channelEdit, "channeledit", &err);
790  UIUtilE::Assign(this, m_matchesText, "matchestext", &err);
791 
792  if (err)
793  {
794  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'searchstream'");
795  return false;
796  }
797 
800  m_matchesText->SetText("");
801 
802  connect(m_streamList, SIGNAL(itemClicked(MythUIButtonListItem*)),
803  this, SLOT(streamClicked(MythUIButtonListItem*)));
804  connect(m_streamList, SIGNAL(itemVisible(MythUIButtonListItem*)),
805  this, SLOT(streamVisible(MythUIButtonListItem*)));
806  connect(m_broadcasterList, SIGNAL(itemSelected(MythUIButtonListItem*)),
807  this, SLOT(updateStreams()));
808  connect(m_genreList, SIGNAL(itemSelected(MythUIButtonListItem*)),
809  this, SLOT(updateStreams()));
810  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
811  this, SLOT(updateStreams()));
812 
813 
814  if (m_countryList)
815  {
817  connect(m_languageList, SIGNAL(itemSelected(MythUIButtonListItem*)),
818  this, SLOT(updateStreams()));
819  }
820 
821  if (m_languageList)
822  {
824  connect(m_channelEdit, SIGNAL(valueChanged()),
825  this, SLOT(updateStreams()));
826  }
827 
828  connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(doUpdateStreams()));
829 
830  LoadInBackground("Loading Streams...");
831 
832  BuildFocusList();
833 
834  return true;
835 }
836 
838 {
839  loadStreams();
840  QTimer::singleShot(0, this, SLOT(doneLoading(void)));
841 }
842 
844 {
846  updateGenres();
847  updateLanguages();
848  updateCountries();
849  doUpdateStreams();
850 }
851 
853 {
854  if (!item)
855  return;
856 
857  auto mdata = item->GetData().value<MusicMetadata>();
859 
860  Close();
861 }
862 
864 {
865  if (!item)
866  return;
867 
868  auto mdata = item->GetData().value<MusicMetadata>();
869  if (!mdata.LogoUrl().isEmpty() && mdata.LogoUrl() != "-")
870  {
871  if (item->GetText("dummy") == " ")
872  {
873  item->SetImage(mdata.LogoUrl());
874  item->SetText("", "dummy");
875  }
876  }
877 }
878 
880 {
882 }
883 
885 {
887 
888  new MythUIButtonListItem(m_broadcasterList, tr("<All Broadcasters>"));
889 
891 
892  query.prepare("SELECT DISTINCT broadcaster FROM music_streams ORDER BY broadcaster;");
893 
894  if (!query.exec() || !query.isActive())
895  {
896  MythDB::DBError("get broadcaster", query);
897  return;
898  }
899 
900  while (query.next())
901  {
903  }
904 
905  m_broadcasterList->SetValue(tr("<All Broadcasters>"));
906 }
907 
909 {
910  m_genreList->Reset();
911 
912  new MythUIButtonListItem(m_genreList, tr("<All Genres>"));
913 
915 
916  query.prepare("SELECT DISTINCT genre FROM music_streams ORDER BY genre;");
917 
918  if (!query.exec() || !query.isActive())
919  {
920  MythDB::DBError("get genres", query);
921  return;
922  }
923 
924  while (query.next())
925  {
926  new MythUIButtonListItem(m_genreList, query.value(0).toString());
927  }
928 
929  m_genreList->SetValue(tr("<All Genres>"));
930 }
931 
933 {
934  if (m_countryList)
935  {
936  m_countryList->Reset();
937 
938  new MythUIButtonListItem(m_countryList, tr("<All Countries>"));
939 
941 
942  query.prepare("SELECT DISTINCT country FROM music_streams ORDER BY country;");
943 
944  if (!query.exec() || !query.isActive())
945  {
946  MythDB::DBError("get countries", query);
947  return;
948  }
949 
950  while (query.next())
951  {
952  new MythUIButtonListItem(m_countryList, query.value(0).toString());
953  }
954 
955  m_countryList->SetValue(tr("<All Countries>"));
956  }
957 }
958 
960 {
961  if (m_languageList)
962  {
964 
965  new MythUIButtonListItem(m_languageList, tr("<All Languages>"));
966 
968 
969  query.prepare("SELECT DISTINCT language FROM music_streams ORDER BY language;");
970 
971  if (!query.exec() || !query.isActive())
972  {
973  MythDB::DBError("get languages", query);
974  return;
975  }
976 
977  while (query.next())
978  {
979  new MythUIButtonListItem(m_languageList, query.value(0).toString());
980  }
981 
982  m_languageList->SetValue(tr("<All Languages>"));
983  }
984 }
985 
987 {
988  if (m_updateTimer.isActive())
989  m_updateTimer.stop();
990 
991  m_updateTimer.start(500);
992 }
993 
995 {
996  if (m_updating)
997  return;
998 
999  QString broadcaster = m_broadcasterList->GetValue();
1000  QString genre = m_genreList->GetValue();
1001  QString language = m_languageList ? m_languageList->GetValue() : tr("<All Languages>");
1002  QString country = m_countryList ? m_countryList->GetValue() : tr("<All Countries>");
1003  QString channel = m_channelEdit->GetText();
1004 
1005  // only update the buttonlist if something changed
1006  if (m_oldBroadcaster == broadcaster && m_oldGenre == genre && m_oldChannel == channel &&
1007  m_oldLanguage == language && m_oldCountry == country)
1008  return;
1009 
1010  m_oldBroadcaster = broadcaster;
1011  m_oldGenre = genre;
1013  m_oldLanguage = language;
1014  m_oldCountry = country;
1015 
1016  bool searchBroadcaster = (broadcaster != tr("<All Broadcasters>"));
1017  bool searchGenre = (genre != tr("<All Genres>"));
1018  bool searchLanguage = (language != tr("<All Languages>"));
1019  bool searchCountry = (country != tr("<All Countries>"));
1020  bool searchChannel = !channel.isEmpty();
1021 
1022  m_streams.clear();
1023  m_streamList->Reset();
1024 
1026 
1027  QString sql = "SELECT broadcaster, channel, description, genre, url1, url2, url3, url4, url5, "
1028  "logourl, metaformat, country, language "
1029  "FROM music_streams ";
1030  bool doneWhere = false;
1031 
1032  if (searchBroadcaster)
1033  {
1034  sql += "WHERE broadcaster = :BROADCASTER ";
1035  doneWhere = true;
1036  }
1037 
1038  if (searchGenre)
1039  {
1040  if (!doneWhere)
1041  {
1042  sql += "WHERE genre = :GENRE ";
1043  doneWhere = true;
1044  }
1045  else
1046  sql += "AND genre = :GENRE ";
1047  }
1048 
1049  if (searchLanguage)
1050  {
1051  if (!doneWhere)
1052  {
1053  sql += "WHERE language = :LANGUAGE ";
1054  doneWhere = true;
1055  }
1056  else
1057  sql += "AND language = :LANGUAGE ";
1058  }
1059 
1060  if (searchCountry)
1061  {
1062  if (!doneWhere)
1063  {
1064  sql += "WHERE country = :COUNTRY ";
1065  doneWhere = true;
1066  }
1067  else
1068  sql += "AND country = :COUNTRY ";
1069  }
1070 
1071  if (searchChannel)
1072  {
1073  if (!doneWhere)
1074  {
1075  sql += "WHERE channel LIKE " + QString("'%%1%'").arg(channel);
1076  // doneWhere = true;
1077  }
1078  else
1079  sql += "AND channel LIKE " + QString("'%%1%' ").arg(channel);
1080  }
1081 
1082  sql += "ORDER BY broadcaster, channel;";
1083 
1084  query.prepare(sql);
1085 
1086  if (searchBroadcaster)
1087  query.bindValue(":BROADCASTER", broadcaster);
1088 
1089  if (searchGenre)
1090  query.bindValue(":GENRE", genre);
1091 
1092  if (searchLanguage)
1093  query.bindValue(":LANGUAGE", language);
1094 
1095  if (searchCountry)
1096  query.bindValue(":COUNTRY", country);
1097 
1098  if (!query.exec() || !query.isActive())
1099  {
1100  MythDB::DBError("search streams", query);
1101  return;
1102  }
1103 
1104  if (query.size() > 500)
1105  {
1106  QString message = tr("Updating stream list. Please Wait ...");
1107  OpenBusyPopup(message);
1108  }
1109 
1110  int count = 0;
1111  while (query.next())
1112  {
1113  MusicMetadata mdata;
1114  mdata.setBroadcaster(query.value(0).toString());
1115  mdata.setChannel(query.value(1).toString());
1116  mdata.setDescription(query.value(2).toString());
1117  mdata.setGenre(query.value(3).toString());
1118 
1119  for (int x = 0; x < STREAMURLCOUNT; x++)
1120  mdata.setUrl(query.value(4 + x).toString(), x);
1121 
1122  mdata.setLogoUrl(query.value(9).toString());
1123  mdata.setMetadataFormat(query.value(10).toString());
1124  mdata.setCountry(query.value(11).toString());
1125  mdata.setLanguage(query.value(12).toString());
1126 
1127  auto *item = new MythUIButtonListItem(m_streamList, "",
1128  QVariant::fromValue(mdata));
1129  InfoMap metadataMap;
1130  mdata.toMap(metadataMap);
1131 
1132  item->SetTextFromMap(metadataMap);
1133 
1134  item->SetText(" ", "dummy");
1135  count++;
1136 
1137  if ((count % 500) == 0)
1138  {
1139  qApp->processEvents();
1140  }
1141  }
1142 
1143  m_matchesText->SetText(QString("%1").arg(m_streamList->GetCount()));
1144 
1145  if (query.size() > 500)
1146  CloseBusyPopup();
1147 
1148  m_updating = false;
1149 }
MusicCommon::m_currentView
MusicView m_currentView
Definition: musiccommon.h:139
StreamView::streamItemClicked
void streamItemClicked(MythUIButtonListItem *item)
Definition: streamview.cpp:491
DecoderHandlerEvent::BufferStatus
static Type BufferStatus
Definition: decoderhandler.h:49
MythUIButtonList::GetItemAt
MythUIButtonListItem * GetItemAt(int pos) const
Definition: mythuibuttonlist.cpp:1676
MSqlQuery::isActive
bool isActive(void) const
Definition: mythdbcon.h:204
MythScreenType::LoadInBackground
void LoadInBackground(const QString &message="")
Definition: mythscreentype.cpp:302
MSqlQuery::next
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
Definition: mythdbcon.cpp:783
MSqlQuery
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
build_compdb.args
args
Definition: build_compdb.py:11
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:304
SearchStream::m_oldLanguage
QString m_oldLanguage
Definition: streamview.h:132
MythUIButtonList::GetTopItemPos
int GetTopItemPos(void) const
Definition: mythuibuttonlist.h:192
channel
QDomElement channel
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:498
STREAMURLCOUNT
#define STREAMURLCOUNT
Definition: musicmetadata.h:76
StreamView::updateStreamList
void updateStreamList(void)
Definition: streamview.cpp:428
StreamView::m_bufferStatus
MythUIText * m_bufferStatus
Definition: streamview.h:50
gPlayer
MusicPlayer * gPlayer
Definition: musicplayer.cpp:35
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:203
Playlist::getSongAt
MusicMetadata * getSongAt(int pos) const
Definition: playlist.cpp:1090
MythEvent::MythEventMessage
static Type MythEventMessage
Definition: mythevent.h:73
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
DecoderHandlerEvent::OperationStart
static Type OperationStart
Definition: decoderhandler.h:50
hardwareprofile.smolt.timeout
float timeout
Definition: smolt.py:103
AllStream::updateStream
void updateStream(MusicMetadata *mdata)
Definition: musicmetadata.cpp:1870
MythUIButtonList::SetValueByData
void SetValueByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1542
MusicPlayer::setCurrentTrackPos
bool setCurrentTrackPos(int pos)
Definition: musicplayer.cpp:1033
mythuitext.h
mythuiprogressbar.h
EditStreamMetadata::m_searchButton
MythUIButton * m_searchButton
Definition: streamview.h:93
MusicMetadata::LogoUrl
QString LogoUrl(void)
Definition: musicmetadata.h:274
SearchStream::doneLoading
void doneLoading(void)
Definition: streamview.cpp:843
OutputEvent::Buffering
static Type Buffering
Definition: output.h:64
EditStreamMetadata::searchClicked
void searchClicked(void)
Definition: streamview.cpp:710
DialogCompletionEvent::GetId
QString GetId()
Definition: mythdialogbox.h:52
MusicMetadata::Genre
QString Genre() const
Definition: musicmetadata.h:175
AllStream::addStream
void addStream(MusicMetadata *mdata)
Definition: musicmetadata.cpp:1817
MythUIText::Reset
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitext.cpp:83
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:550
StreamView::Create
bool Create(void) override
Definition: streamview.cpp:41
MusicMetadata::setDescription
void setDescription(const QString &description)
Definition: musicmetadata.h:267
MusicMetadata::setBroadcaster
void setBroadcaster(const QString &broadcaster)
Definition: musicmetadata.h:261
MythUIButtonListItem::DisplayState
void DisplayState(const QString &state, const QString &name)
Definition: mythuibuttonlist.cpp:3507
MusicCommon::CreateCommon
bool CreateCommon(void)
Definition: musiccommon.cpp:81
MusicPlayerEvent
Definition: musicplayer.h:21
MusicMetadata::MetadataFormat
QString MetadataFormat(void)
Definition: musicmetadata.h:277
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
MusicPlayer::loadStreamPlaylist
void loadStreamPlaylist(void)
Definition: musicplayer.cpp:994
SearchStream::m_oldCountry
QString m_oldCountry
Definition: streamview.h:131
OutputEvent::Stopped
static Type Stopped
Definition: output.h:67
MusicCommon::keyPressEvent
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
Definition: musiccommon.cpp:581
StreamView::ShowMenu
void ShowMenu(void) override
Definition: streamview.cpp:79
SearchStream::doUpdateStreams
void doUpdateStreams(void)
Definition: streamview.cpp:994
SearchStream
Definition: streamview.h:98
SearchStream::m_genreList
MythUIButtonList * m_genreList
Definition: streamview.h:135
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:1106
SearchStream::m_oldBroadcaster
QString m_oldBroadcaster
Definition: streamview.h:128
EditStreamMetadata::m_url3Edit
MythUITextEdit * m_url3Edit
Definition: streamview.h:84
DialogCompletionEvent::kEventType
static Type kEventType
Definition: mythdialogbox.h:57
AllStream::getMetadata
MusicMetadata * getMetadata(MusicMetadata::IdType an_id)
Definition: musicmetadata.cpp:1757
MusicCommon::createSubMenu
MythMenu * createSubMenu(void)
Definition: musiccommon.cpp:2213
MythEvent
This class is used as a container for messages.
Definition: mythevent.h:16
mythcoreutil.h
SearchStream::updateLanguages
void updateLanguages(void)
Definition: streamview.cpp:959
MythUIProgressBar::SetUsed
void SetUsed(int value)
Definition: mythuiprogressbar.cpp:59
mythdialogbox.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
MythScreenStack
Definition: mythscreenstack.h:15
MythScreenType::Create
virtual bool Create(void)
Definition: mythscreentype.cpp:282
arg
arg(title).arg(filename).arg(doDelete))
mythdbcon.h
MusicMetadata::setChannel
void setChannel(const QString &channel)
Definition: musicmetadata.h:264
MusicMetadata::ID
IdType ID() const
Definition: musicmetadata.h:217
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
StreamView::doRemoveStream
void doRemoveStream(bool ok)
Definition: streamview.cpp:413
MusicPlayer::isPlaying
bool isPlaying(void) const
Definition: musicplayer.h:102
MythScreenType::OpenBusyPopup
void OpenBusyPopup(const QString &message="")
Definition: mythscreentype.cpp:336
EditStreamMetadata::m_logourlEdit
MythUITextEdit * m_logourlEdit
Definition: streamview.h:87
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
SearchStream::m_updating
bool m_updating
Definition: streamview.h:143
StreamView::m_bufferProgress
MythUIProgressBar * m_bufferProgress
Definition: streamview.h:51
MusicMetadata
Definition: musicmetadata.h:80
EditStreamMetadata::m_url5Edit
MythUITextEdit * m_url5Edit
Definition: streamview.h:86
SearchStream::updateGenres
void updateGenres(void)
Definition: streamview.cpp:908
MythUITextEdit::GetText
QString GetText(void) const
Definition: mythuitextedit.h:47
MusicPlayer::getCurrentPlaylist
Playlist * getCurrentPlaylist(void)
Definition: musicplayer.cpp:1595
SearchStream::streamClicked
void streamClicked(MythUIButtonListItem *item)
Definition: streamview.cpp:852
mythdirs.h
StreamView::updateStream
void updateStream(MusicMetadata *mdata)
Definition: streamview.cpp:553
EditStreamMetadata::Create
bool Create() override
Definition: streamview.cpp:653
menu
static MythThemedMenu * menu
Definition: mythtv/programs/mythtv-setup/main.cpp:55
MusicPlayer::setPlayMode
void setPlayMode(PlayMode mode)
Definition: musicplayer.cpp:950
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:309
mythuibuttonlist.h
MythUIButtonList::GetCount
int GetCount() const
Definition: mythuibuttonlist.cpp:1655
MV_RADIO
@ MV_RADIO
Definition: musiccommon.h:41
SearchStream::updateCountries
void updateCountries(void)
Definition: streamview.cpp:932
musicutils.h
MythEvent::Message
const QString & Message() const
Definition: mythevent.h:65
MythUIButtonList::GetItemByData
MythUIButtonListItem * GetItemByData(const QVariant &data)
Definition: mythuibuttonlist.cpp:1684
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
MythUIButtonListItem::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythuibuttonlist.cpp:3272
EditStreamMetadata::saveClicked
void saveClicked(void)
Definition: streamview.cpp:722
MusicPlayer::getCurrentMetadata
MusicMetadata * getCurrentMetadata(void)
get the metadata for the current track in the playlist
Definition: musicplayer.cpp:1155
mythuiutils.h
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
SearchStream::m_countryList
MythUIButtonList * m_countryList
Definition: streamview.h:136
MythUITextEdit::SetText
void SetText(const QString &text, bool moveCursor=true)
Definition: mythuitextedit.cpp:216
MusicMetadata::Url
QString Url(uint index=0)
Definition: musicmetadata.cpp:670
MusicMetadata::Channel
QString Channel(void)
Definition: musicmetadata.h:265
DecoderHandlerEvent
Events sent by the DecoderHandler and it's helper classes.
Definition: decoderhandler.h:26
MusicPlayerEvent::TrackChangeEvent
static Type TrackChangeEvent
Definition: musicplayer.h:40
MythUIProgressBar::SetTotal
void SetTotal(int value)
Definition: mythuiprogressbar.cpp:71
MusicPlayerEvent::PlayedTracksChangedEvent
static Type PlayedTracksChangedEvent
Definition: musicplayer.h:51
SearchStream::Create
bool Create() override
Definition: streamview.cpp:778
OutputEvent::Playing
static Type Playing
Definition: output.h:63
StreamView::m_streamList
MythUIButtonList * m_streamList
Definition: streamview.h:48
DecoderHandlerEvent::getBufferStatus
void getBufferStatus(int *available, int *maxSize) const
Definition: decoderhandler.cpp:62
EditStreamMetadata::m_formatEdit
MythUITextEdit * m_formatEdit
Definition: streamview.h:88
MusicMetadata::Description
QString Description(void)
Definition: musicmetadata.h:268
EditStreamMetadata::m_cancelButton
MythUIButton * m_cancelButton
Definition: streamview.h:94
EditStreamMetadata::m_broadcasterEdit
MythUITextEdit * m_broadcasterEdit
Definition: streamview.h:79
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:190
RT_Radio
@ RT_Radio
Definition: musicmetadata.h:62
MusicMetadata::toMap
void toMap(InfoMap &metadataMap, const QString &prefix="")
Definition: musicmetadata.cpp:1099
EditStreamMetadata::m_channelEdit
MythUITextEdit * m_channelEdit
Definition: streamview.h:80
MV_VISUALIZER
@ MV_VISUALIZER
Definition: musiccommon.h:36
StreamView::m_currStream
MusicMetadata * m_currStream
Definition: streamview.h:53
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:137
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
MusicMetadata::Language
QString Language(void)
Definition: musicmetadata.h:283
MusicMetadata::getAlbumArtFile
QString getAlbumArtFile(void)
Definition: musicmetadata.cpp:1270
MusicMetadata::setLanguage
void setLanguage(const QString &language)
Definition: musicmetadata.h:282
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:179
SearchStream::m_channelEdit
MythUITextEdit * m_channelEdit
Definition: streamview.h:138
MusicMetadata::setGenre
void setGenre(const QString &lgenre)
Definition: musicmetadata.h:176
MusicData::m_all_streams
AllStream * m_all_streams
Definition: musicdata.h:56
SearchStream::m_broadcasterList
MythUIButtonList * m_broadcasterList
Definition: streamview.h:134
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
StreamView::m_lastStream
MusicMetadata * m_lastStream
Definition: streamview.h:54
StreamView::deleteStream
void deleteStream(MusicMetadata *mdata)
Definition: streamview.cpp:625
StreamView::streamItemVisible
static void streamItemVisible(MythUIButtonListItem *item)
Definition: streamview.cpp:499
StreamView::addStream
void addStream(MusicMetadata *mdata)
Definition: streamview.cpp:519
MusicMetadata::updateStreamList
static bool updateStreamList(void)
Definition: musicmetadata.cpp:325
MusicMetadata::setMetadataFormat
void setMetadataFormat(const QString &metaformat)
Definition: musicmetadata.h:276
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
SearchStream::m_streamList
MythUIButtonList * m_streamList
Definition: streamview.h:139
AllStream::removeStream
void removeStream(MusicMetadata *mdata)
Definition: musicmetadata.cpp:1853
MV_LYRICS
@ MV_LYRICS
Definition: musiccommon.h:33
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3588
MusicPlayer::isPaused
bool isPaused(void)
Definition: musicplayer.h:103
MusicCommon::updateUIPlayedList
void updateUIPlayedList(void)
Definition: musiccommon.cpp:2073
SearchStream::m_matchesText
MythUIText * m_matchesText
Definition: streamview.h:140
EditStreamMetadata::m_streamMeta
MusicMetadata * m_streamMeta
Definition: streamview.h:77
musicdata.h
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
EditStreamMetadata::m_descEdit
MythUITextEdit * m_descEdit
Definition: streamview.h:81
EditStreamMetadata::m_languageEdit
MythUITextEdit * m_languageEdit
Definition: streamview.h:91
MythUIButtonListItem::SetTextFromMap
void SetTextFromMap(const InfoMap &infoMap, const QString &state="")
Definition: mythuibuttonlist.cpp:3289
musiccommon.h
gMusicData
MusicData * gMusicData
Definition: musicdata.cpp:20
streamview.h
MythUIButtonListItem::GetText
QString GetText(const QString &name="") const
Definition: mythuibuttonlist.cpp:3313
EditStreamMetadata::m_genreEdit
MythUITextEdit * m_genreEdit
Definition: streamview.h:89
SearchStream::updateStreams
void updateStreams(void)
Definition: streamview.cpp:986
MusicMetadata::IdType
uint32_t IdType
Definition: musicmetadata.h:86
SearchStream::updateBroadcasters
void updateBroadcasters(void)
Definition: streamview.cpp:884
mythuihelper.h
MusicCommon::updateTrackInfo
void updateTrackInfo(MusicMetadata *mdata)
Definition: musiccommon.cpp:1886
MusicPlayer::getPlayedTracksList
QList< MusicMetadata * > & getPlayedTracksList(void)
Definition: musicplayer.h:130
SearchStream::m_languageList
MythUIButtonList * m_languageList
Definition: streamview.h:137
MythUIButtonListItem::SetFontState
void SetFontState(const QString &state, const QString &name="")
Definition: mythuibuttonlist.cpp:3391
MythMenu
Definition: mythdialogbox.h:92
DecoderHandlerEvent::OperationStop
static Type OperationStop
Definition: decoderhandler.h:51
StreamView::m_noStreams
MythUIText * m_noStreams
Definition: streamview.h:49
EditStreamMetadata::changeStreamMetadata
void changeStreamMetadata(MusicMetadata *mdata)
Definition: streamview.cpp:756
StreamView::removeStream
void removeStream(void)
Definition: streamview.cpp:396
SearchStream::m_oldGenre
QString m_oldGenre
Definition: streamview.h:129
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:3406
SearchStream::m_parent
EditStreamMetadata * m_parent
Definition: streamview.h:123
SearchStream::m_updateTimer
QTimer m_updateTimer
Definition: streamview.h:142
EditStreamMetadata::m_saveButton
MythUIButton * m_saveButton
Definition: streamview.h:95
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
MusicMetadata::Country
QString Country(void)
Definition: musicmetadata.h:280
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
StreamView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: streamview.cpp:338
EditStreamMetadata
Definition: streamview.h:57
MythUIButtonList::GetValue
virtual QString GetValue() const
Definition: mythuibuttonlist.cpp:1609
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:135
MythUIType::SetVisible
virtual void SetVisible(bool visible)
Definition: mythuitype.cpp:1080
mythcontext.h
MythUIButtonList::Reset
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuibuttonlist.cpp:113
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:107
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1557
build_compdb.action
action
Definition: build_compdb.py:9
SearchStream::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: streamview.cpp:837
MusicCommon::m_playedTracksList
MythUIButtonList * m_playedTracksList
Definition: musiccommon.h:204
MusicPlayer::PLAYMODE_RADIO
@ PLAYMODE_RADIO
Definition: musicplayer.h:66
SearchStream::streamVisible
static void streamVisible(MythUIButtonListItem *item)
Definition: streamview.cpp:863
mythuibutton.h
MusicMetadata::Broadcaster
QString Broadcaster(void)
Definition: musicmetadata.h:262
MusicMetadata::setRepo
void setRepo(RepoType repo)
Definition: musicmetadata.h:219
SearchStream::loadStreams
static void loadStreams(void)
Definition: streamview.cpp:879
MusicMetadata::reloadAlbumArtImages
void reloadAlbumArtImages(void)
Definition: musicmetadata.cpp:1381
SearchStream::m_streams
QList< MusicMetadata > m_streams
Definition: streamview.h:124
EditStreamMetadata::m_countryEdit
MythUITextEdit * m_countryEdit
Definition: streamview.h:90
MusicPlayer::stop
void stop(bool stopAll=false)
Definition: musicplayer.cpp:237
StreamView::editStream
void editStream(void)
Definition: streamview.cpp:380
EditStreamMetadata::m_url2Edit
MythUITextEdit * m_url2Edit
Definition: streamview.h:83
mythdownloadmanager.h
MythUIButtonList::SetValue
virtual void SetValue(int value)
Definition: mythuibuttonlist.h:166
MusicMetadata::setFormat
void setFormat(const QString &lformat)
Definition: musicmetadata.h:236
StreamView::StreamView
StreamView(MythScreenStack *parent, MythScreenType *parentScreen)
Definition: streamview.cpp:35
ID_TO_REPO
#define ID_TO_REPO(x)
Definition: musicmetadata.h:71
EditStreamMetadata::m_url1Edit
MythUITextEdit * m_url1Edit
Definition: streamview.h:82
mythmainwindow.h
MusicMetadata::setUrl
void setUrl(const QString &url, uint index=0)
Definition: musicmetadata.cpp:664
MusicMetadata::setCountry
void setCountry(const QString &country)
Definition: musicmetadata.h:279
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
query
MSqlQuery query(MSqlQuery::InitCon())
SearchStream::m_oldChannel
QString m_oldChannel
Definition: streamview.h:130
MusicCommon::customEvent
void customEvent(QEvent *event) override
Definition: musiccommon.cpp:1186
EditStreamMetadata::m_url4Edit
MythUITextEdit * m_url4Edit
Definition: streamview.h:85
StreamView::customEvent
void customEvent(QEvent *event) override
Definition: streamview.cpp:105
MythScreenType::CloseBusyPopup
void CloseBusyPopup(void)
Definition: mythscreentype.cpp:354
EditStreamMetadata::m_parent
StreamView * m_parent
Definition: streamview.h:75
MusicCommon
Definition: musiccommon.h:47
MusicMetadata::setLogoUrl
void setLogoUrl(const QString &logourl)
Definition: musicmetadata.h:273
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808
musicplayer.h