MythTV  master
mythburn.cpp
Go to the documentation of this file.
1 #include <unistd.h>
2 
3 #include <cstdlib>
4 #include <unistd.h>
5 #include <iostream>
6 #include <cstdlib>
7 #include <sys/wait.h> // for WIFEXITED and WEXITSTATUS
8 
9 // qt
10 #include <QDir>
11 #include <QDomDocument>
12 #include <QApplication>
13 #include <QKeyEvent>
14 #include <QTextStream>
15 
16 // myth
17 #include <mythcontext.h>
18 #include <mythdb.h>
19 #include <mythdirs.h>
20 #include <mythprogressdialog.h>
21 #include <mythuihelper.h>
22 #include <mythdialogbox.h>
23 #include <mythuitext.h>
24 #include <mythuibutton.h>
25 #include <mythuicheckbox.h>
26 #include <mythuibuttonlist.h>
27 #include <mythuiprogressbar.h>
28 #include <mythdate.h>
29 #include <mythsystemlegacy.h>
30 #include <mythmiscutil.h>
31 #include <exitcodes.h>
32 #include <mythconfig.h>
33 
34 // mytharchive
35 #include "archiveutil.h"
36 #include "mythburn.h"
37 #include "editmetadata.h"
38 #include "fileselector.h"
39 #include "thumbfinder.h"
40 #include "recordingselector.h"
41 #include "videoselector.h"
42 #include "logviewer.h"
43 
45  MythScreenType *destinationScreen,
46  MythScreenType *themeScreen,
47  ArchiveDestination archiveDestination, const QString& name) :
48  MythScreenType(parent, name),
49  m_destinationScreen(destinationScreen),
50  m_themeScreen(themeScreen),
51  m_archiveDestination(archiveDestination)
52 {
53  // remove any old thumb images
54  QString thumbDir = getTempDirectory() + "/config/thumbs";
55  QDir dir(thumbDir);
56  if (dir.exists() && !MythRemoveDirectory(dir))
57  LOG(VB_GENERAL, LOG_ERR, "MythBurn: Failed to clear thumb directory");
58 }
59 
61 {
63 
64  while (!m_profileList.isEmpty())
65  delete m_profileList.takeFirst();
66  m_profileList.clear();
67 
68  while (!m_archiveList.isEmpty())
69  delete m_archiveList.takeFirst();
70  m_archiveList.clear();
71 }
72 
73 bool MythBurn::Create(void)
74 {
75  // Load the theme for this screen
76  bool foundtheme = LoadWindowFromXML("mythburn-ui.xml", "mythburn", this);
77  if (!foundtheme)
78  return false;
79 
80  bool err = false;
81  UIUtilE::Assign(this, m_nextButton, "next_button", &err);
82  UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
83  UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
84  UIUtilE::Assign(this, m_nofilesText, "nofiles", &err);
85  UIUtilE::Assign(this, m_archiveButtonList, "archivelist", &err);
86  UIUtilE::Assign(this, m_addrecordingButton, "addrecording_button", &err);
87  UIUtilE::Assign(this, m_addvideoButton, "addvideo_button", &err);
88  UIUtilE::Assign(this, m_addfileButton, "addfile_button", &err);
89  UIUtilE::Assign(this, m_maxsizeText, "maxsize", &err);
90  UIUtilE::Assign(this, m_minsizeText, "minsize", &err);
91  UIUtilE::Assign(this, m_currentsizeErrorText, "currentsize_error", &err);
92  UIUtilE::Assign(this, m_currentsizeText, "currentsize", &err);
93  UIUtilE::Assign(this, m_sizeBar, "size_bar", &err);
94 
95  if (err)
96  {
97  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'mythburn'");
98  return false;
99  }
100 
104 
105 
108 
110 
113 
117  this, &MythBurn::itemClicked);
118 
119  BuildFocusList();
120 
122 
123  return true;
124 }
125 
126 bool MythBurn::keyPressEvent(QKeyEvent *event)
127 {
128  if (!m_moveMode && GetFocusWidget()->keyPressEvent(event))
129  return true;
130 
131  QStringList actions;
132  bool handled = GetMythMainWindow()->TranslateKeyPress("Archive", event, actions);
133 
134  for (int i = 0; i < actions.size() && !handled; i++)
135  {
136  QString action = actions[i];
137  handled = true;
138 
139  // if we are currently moving an item,
140  // we only accept UP/DOWN/SELECT/ESCAPE
141  if (m_moveMode)
142  {
144  if (!item)
145  return false;
146 
147  if (action == "SELECT" || action == "ESCAPE")
148  {
149  m_moveMode = false;
150  item->DisplayState("off", "movestate");
151  }
152  else if (action == "UP")
153  {
154  item->MoveUpDown(true);
155  }
156  else if (action == "DOWN")
157  {
158  item->MoveUpDown(false);
159  }
160 
161  return true;
162  }
163 
164  if (action == "MENU")
165  {
166  ShowMenu();
167  }
168  else if (action == "DELETE")
169  {
170  removeItem();
171  }
172  else if (action == "INFO")
173  {
174  editThumbnails();
175  }
176  else if (action == "TOGGLECUT")
177  {
179  }
180  else
181  handled = false;
182  }
183 
184  if (!handled && MythScreenType::keyPressEvent(event))
185  handled = true;
186 
187  return handled;
188 }
189 
191 {
192  int64_t size = 0;
193  for (const auto *a : qAsConst(m_archiveList))
194  size += a->newsize;
195 
196  uint usedSpace = size / 1024 / 1024;
197 
198  QString tmpSize;
199 
201  m_sizeBar->SetUsed(usedSpace);
202 
203  tmpSize = QString("%1 Mb").arg(m_archiveDestination.freeSpace / 1024);
204 
205  m_maxsizeText->SetText(tmpSize);
206 
207  m_minsizeText->SetText("0 Mb");
208 
209  tmpSize = QString("%1 Mb").arg(usedSpace);
210 
211  if (usedSpace > m_archiveDestination.freeSpace / 1024)
212  {
214 
217  }
218  else
219  {
221 
222  m_currentsizeText->SetText(tmpSize);
224  }
225 }
226 
228 {
229  auto *item = new EncoderProfile;
230  item->name = "NONE";
231  item->description = "";
232  item->bitrate = 0.0F;
233  m_profileList.append(item);
234 
235  // find the encoding profiles
236  // first look in the ConfDir (~/.mythtv)
237  QString filename = GetConfDir() +
238  "/MythArchive/ffmpeg_dvd_" +
239  ((gCoreContext->GetSetting("MythArchiveVideoFormat", "pal")
240  .toLower() == "ntsc") ? "ntsc" : "pal") + ".xml";
241 
242  if (!QFile::exists(filename))
243  {
244  // not found yet so use the default profiles
245  filename = GetShareDir() +
246  "mytharchive/encoder_profiles/ffmpeg_dvd_" +
247  ((gCoreContext->GetSetting("MythArchiveVideoFormat", "pal")
248  .toLower() == "ntsc") ? "ntsc" : "pal") + ".xml";
249  }
250 
251  LOG(VB_GENERAL, LOG_NOTICE,
252  "MythArchive: Loading encoding profiles from " + filename);
253 
254  QDomDocument doc("mydocument");
255  QFile file(filename);
256  if (!file.open(QIODevice::ReadOnly))
257  return;
258 
259  if (!doc.setContent( &file ))
260  {
261  file.close();
262  return;
263  }
264  file.close();
265 
266  QDomElement docElem = doc.documentElement();
267  QDomNodeList profileNodeList = doc.elementsByTagName("profile");
268  QString name;
269  QString desc;
270  QString bitrate;
271 
272  for (int x = 0; x < profileNodeList.count(); x++)
273  {
274  QDomNode n = profileNodeList.item(x);
275  QDomElement e = n.toElement();
276  QDomNode n2 = e.firstChild();
277  while (!n2.isNull())
278  {
279  QDomElement e2 = n2.toElement();
280  if(!e2.isNull())
281  {
282  if (e2.tagName() == "name")
283  name = e2.text();
284  if (e2.tagName() == "description")
285  desc = e2.text();
286  if (e2.tagName() == "bitrate")
287  bitrate = e2.text();
288 
289  }
290  n2 = n2.nextSibling();
291 
292  }
293 
294  auto *item2 = new EncoderProfile;
295  item2->name = name;
296  item2->description = desc;
297  item2->bitrate = bitrate.toFloat();
298  m_profileList.append(item2);
299  }
300 }
301 
303 {
305  auto *a = item->GetData().value<ArchiveItem *>();
306 
307  if (!a)
308  return;
309 
310  if (!a->hasCutlist)
311  return;
312 
313  a->useCutlist = !a->useCutlist;
314 
315  if (a->hasCutlist)
316  {
317  if (a->useCutlist)
318  {
319  item->SetText(tr("Using Cut List"), "cutlist");
320  item->DisplayState("using", "cutliststatus");
321  }
322  else
323  {
324  item->SetText(tr("Not Using Cut List"), "cutlist");
325  item->DisplayState("notusing", "cutliststatus");
326  }
327  }
328  else
329  {
330  item->SetText(tr("No Cut List"), "cutlist");
331  item->DisplayState("none", "cutliststatus");
332  }
333  recalcItemSize(a);
334  updateSizeBar();
335 }
336 
338 {
339  if (m_archiveList.empty())
340  {
341  ShowOkPopup(tr("You need to add at least one item to archive!"));
342  return;
343  }
344 
345  runScript();
346 }
347 
349 {
350  Close();
351 }
352 
354 {
356  m_themeScreen->Close();
357  Close();
358 }
359 
360 QString MythBurn::loadFile(const QString &filename)
361 {
362  QString res = "";
363 
364  QFile file(filename);
365 
366  if (!file.exists())
367  return "";
368 
369  if (file.open( QIODevice::ReadOnly ))
370  {
371  QTextStream stream(&file);
372 
373  while ( !stream.atEnd() )
374  {
375  res = res + stream.readLine();
376  }
377  file.close();
378  }
379  else
380  return "";
381 
382  return res;
383 }
384 
386 {
387  QString message = tr("Retrieving File Information. Please Wait...");
388 
389  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
390 
391  auto *busyPopup = new
392  MythUIBusyDialog(message, popupStack, "mythburnbusydialog");
393 
394  if (busyPopup->Create())
395  popupStack->AddScreen(busyPopup, false);
396  else
397  {
398  delete busyPopup;
399  busyPopup = nullptr;
400  }
401 
402  QCoreApplication::processEvents();
403 
405 
406  if (m_archiveList.empty())
407  {
408  m_nofilesText->Show();
409  }
410  else
411  {
412  for (auto *a : qAsConst(m_archiveList))
413  {
414  QCoreApplication::processEvents();
415  // get duration of this file
416  if (a->duration == 0)
417  {
418  if (!getFileDetails(a))
419  LOG(VB_GENERAL, LOG_ERR,
420  QString("MythBurn: failed to get file details for: %1").arg(a->filename));
421  }
422 
423  // get default encoding profile if needed
424 
425  if (a->encoderProfile == nullptr)
426  a->encoderProfile = getDefaultProfile(a);
427 
428  recalcItemSize(a);
429 
430  auto* item = new MythUIButtonListItem(m_archiveButtonList, a->title);
431  item->SetData(QVariant::fromValue(a));
432  item->SetText(a->subtitle, "subtitle");
433  item->SetText(a->startDate + " " + a->startTime, "date");
434  item->SetText(formatSize(a->newsize / 1024, 2), "size");
435  if (a->hasCutlist)
436  {
437  if (a->useCutlist)
438  {
439  item->SetText(tr("Using Cut List"), "cutlist");
440  item->DisplayState("using", "cutliststatus");
441  }
442  else
443  {
444  item->SetText(tr("Not Using Cut List"), "cutlist");
445  item->DisplayState("notusing", "cutliststatus");
446  }
447  }
448  else
449  {
450  item->SetText(tr("No Cut List"), "cutlist");
451  item->DisplayState("none", "cutliststatus");
452  }
453  item->SetText(tr("Encoder: ") + a->encoderProfile->name, "profile");
454  }
455 
456  m_nofilesText->Hide();
457 
460  }
461 
462  updateSizeBar();
463 
464  if (busyPopup)
465  busyPopup->Close();
466 }
467 
468 bool MythBurn::isArchiveItemValid(const QString &type, const QString &filename)
469 {
470  if (type == "Recording")
471  {
472  QString baseName = getBaseName(filename);
473 
475  query.prepare("SELECT title FROM recorded WHERE basename = :FILENAME");
476  query.bindValue(":FILENAME", baseName);
477  if (query.exec() && query.size())
478  return true;
479  LOG(VB_GENERAL, LOG_ERR,
480  QString("MythArchive: Recording not found (%1)")
481  .arg(filename));
482  }
483  else if (type == "Video")
484  {
486  query.prepare("SELECT title FROM videometadata"
487  " WHERE filename = :FILENAME");
488  query.bindValue(":FILENAME", filename);
489  if (query.exec() && query.size())
490  return true;
491  LOG(VB_GENERAL, LOG_ERR,
492  QString("MythArchive: Video not found (%1)").arg(filename));
493  }
494  else if (type == "File")
495  {
496  if (QFile::exists(filename))
497  return true;
498  LOG(VB_GENERAL, LOG_ERR,
499  QString("MythArchive: File not found (%1)").arg(filename));
500  }
501 
502  LOG(VB_GENERAL, LOG_NOTICE, "MythArchive: Archive item removed from list");
503 
504  return false;
505 }
506 
508 {
509  if (!item)
510  return m_profileList.at(0);
511 
512  EncoderProfile *profile = nullptr;
513 
514  // is the file an mpeg2 file?
515  if (item->videoCodec.toLower() == "mpeg2video (main)")
516  {
517  // does the file already have a valid DVD resolution?
518  if (gCoreContext->GetSetting("MythArchiveVideoFormat", "pal").toLower()
519  == "ntsc")
520  {
521  if ((item->videoWidth == 720 && item->videoHeight == 480) ||
522  (item->videoWidth == 704 && item->videoHeight == 480) ||
523  (item->videoWidth == 352 && item->videoHeight == 480) ||
524  (item->videoWidth == 352 && item->videoHeight == 240))
525  {
526  // don't need to re-encode
527  profile = m_profileList.at(0);
528  }
529  }
530  else
531  {
532  if ((item->videoWidth == 720 && item->videoHeight == 576) ||
533  (item->videoWidth == 704 && item->videoHeight == 576) ||
534  (item->videoWidth == 352 && item->videoHeight == 576) ||
535  (item->videoWidth == 352 && item->videoHeight == 288))
536  {
537  // don't need to re-encode
538  profile = m_profileList.at(0);
539  }
540  }
541  }
542 
543  if (!profile)
544  {
545  // file needs re-encoding - use default profile setting
546  QString defaultProfile =
547  gCoreContext->GetSetting("MythArchiveDefaultEncProfile", "SP");
548 
549  for (auto *x : qAsConst(m_profileList))
550  if (x->name == defaultProfile)
551  profile = x;
552  }
553 
554  return profile;
555 }
556 
558 {
559  QDomDocument doc("mythburn");
560 
561  QDomElement root = doc.createElement("mythburn");
562  doc.appendChild(root);
563 
564  QDomElement job = doc.createElement("job");
565  job.setAttribute("theme", m_theme);
566  root.appendChild(job);
567 
568  QDomElement media = doc.createElement("media");
569  job.appendChild(media);
570 
571  // now loop though selected archive items and add them to the xml file
572  for (int x = 0; x < m_archiveButtonList->GetCount(); x++)
573  {
575  if (!item)
576  continue;
577 
578  auto *a = item->GetData().value<ArchiveItem *>();
579  if (!a)
580  continue;
581 
582  QDomElement file = doc.createElement("file");
583  file.setAttribute("type", a->type.toLower() );
584  file.setAttribute("usecutlist", static_cast<int>(a->useCutlist));
585  file.setAttribute("filename", a->filename);
586  file.setAttribute("encodingprofile", a->encoderProfile->name);
587  if (a->editedDetails)
588  {
589  QDomElement details = doc.createElement("details");
590  file.appendChild(details);
591  details.setAttribute("title", a->title);
592  details.setAttribute("subtitle", a->subtitle);
593  details.setAttribute("startdate", a->startDate);
594  details.setAttribute("starttime", a->startTime);
595  QDomText desc = doc.createTextNode(a->description);
596  details.appendChild(desc);
597  }
598 
599  if (!a->thumbList.empty())
600  {
601  QDomElement thumbs = doc.createElement("thumbimages");
602  file.appendChild(thumbs);
603 
604  for (auto *thumbImage : qAsConst(a->thumbList))
605  {
606  QDomElement thumb = doc.createElement("thumb");
607  thumbs.appendChild(thumb);
608  thumb.setAttribute("caption", thumbImage->caption);
609  thumb.setAttribute("filename", thumbImage->filename);
610  thumb.setAttribute("frame", (int) thumbImage->frame);
611  }
612  }
613 
614  media.appendChild(file);
615  }
616 
617  // add the options to the xml file
618  QDomElement options = doc.createElement("options");
619  options.setAttribute("createiso", static_cast<int>(m_bCreateISO));
620  options.setAttribute("doburn", static_cast<int>(m_bDoBurn));
621  options.setAttribute("mediatype", m_archiveDestination.type);
622  options.setAttribute("dvdrsize", (qint64)m_archiveDestination.freeSpace);
623  options.setAttribute("erasedvdrw", static_cast<int>(m_bEraseDvdRw));
624  options.setAttribute("savefilename", m_saveFilename);
625  job.appendChild(options);
626 
627  // finally save the xml to the file
628  QFile f(filename);
629  if (!f.open(QIODevice::WriteOnly))
630  {
631  LOG(VB_GENERAL, LOG_ERR,
632  QString("MythBurn::createConfigFile: "
633  "Failed to open file for writing - %1") .arg(filename));
634  return;
635  }
636 
637  QTextStream t(&f);
638  t << doc.toString(4);
639  f.close();
640 }
641 
643 {
644  m_theme = gCoreContext->GetSetting("MythBurnMenuTheme", "");
645  m_bCreateISO = (gCoreContext->GetSetting("MythBurnCreateISO", "0") == "1");
646  m_bDoBurn = (gCoreContext->GetSetting("MythBurnBurnDVDr", "1") == "1");
647  m_bEraseDvdRw = (gCoreContext->GetSetting("MythBurnEraseDvdRw", "0") == "1");
648  m_saveFilename = gCoreContext->GetSetting("MythBurnSaveFilename", "");
649 
650  while (!m_archiveList.isEmpty())
651  delete m_archiveList.takeFirst();
652  m_archiveList.clear();
653 
654  // load selected file list
656  query.prepare("SELECT type, title, subtitle, description, startdate, "
657  "starttime, size, filename, hascutlist, duration, "
658  "cutduration, videowidth, videoheight, filecodec, "
659  "videocodec, encoderprofile FROM archiveitems "
660  "ORDER BY intid;");
661 
662  if (!query.exec())
663  {
664  MythDB::DBError("archive item insert", query);
665  return;
666  }
667 
668  while (query.next())
669  {
670  auto *a = new ArchiveItem;
671  a->type = query.value(0).toString();
672  a->title = query.value(1).toString();
673  a->subtitle = query.value(2).toString();
674  a->description = query.value(3).toString();
675  a->startDate = query.value(4).toString();
676  a->startTime = query.value(5).toString();
677  a->size = query.value(6).toLongLong();
678  a->filename = query.value(7).toString();
679  a->hasCutlist = (query.value(8).toInt() == 1);
680  a->useCutlist = false;
681  a->duration = query.value(9).toInt();
682  a->cutDuration = query.value(10).toInt();
683  a->videoWidth = query.value(11).toInt();
684  a->videoHeight = query.value(12).toInt();
685  a->fileCodec = query.value(13).toString();
686  a->videoCodec = query.value(14).toString();
687  a->encoderProfile = getProfileFromName(query.value(15).toString());
688  a->editedDetails = false;
689  m_archiveList.append(a);
690  }
691 }
692 
693 EncoderProfile *MythBurn::getProfileFromName(const QString &profileName)
694 {
695  for (auto *x : qAsConst(m_profileList))
696  if (x->name == profileName)
697  return x;
698 
699  return nullptr;
700 }
701 
703 {
704  // remove all old archive items from DB
706  query.prepare("DELETE FROM archiveitems;");
707  if (!query.exec())
708  MythDB::DBError("MythBurn::saveConfiguration - deleting archiveitems",
709  query);
710 
711  // save new list of archive items to DB
712  for (int x = 0; x < m_archiveButtonList->GetCount(); x++)
713  {
715  if (!item)
716  continue;
717 
718  auto *a = item->GetData().value<ArchiveItem *>();
719  if (!a)
720  continue;
721 
722  query.prepare("INSERT INTO archiveitems (type, title, subtitle, "
723  "description, startdate, starttime, size, filename, "
724  "hascutlist, duration, cutduration, videowidth, "
725  "videoheight, filecodec, videocodec, encoderprofile) "
726  "VALUES(:TYPE, :TITLE, :SUBTITLE, :DESCRIPTION, :STARTDATE, "
727  ":STARTTIME, :SIZE, :FILENAME, :HASCUTLIST, :DURATION, "
728  ":CUTDURATION, :VIDEOWIDTH, :VIDEOHEIGHT, :FILECODEC, "
729  ":VIDEOCODEC, :ENCODERPROFILE);");
730  query.bindValue(":TYPE", a->type);
731  query.bindValue(":TITLE", a->title);
732  query.bindValue(":SUBTITLE", a->subtitle);
733  query.bindValue(":DESCRIPTION", a->description);
734  query.bindValue(":STARTDATE", a->startDate);
735  query.bindValue(":STARTTIME", a->startTime);
736  query.bindValue(":SIZE", (qint64)a->size);
737  query.bindValue(":FILENAME", a->filename);
738  query.bindValue(":HASCUTLIST", a->hasCutlist);
739  query.bindValue(":DURATION", a->duration);
740  query.bindValue(":CUTDURATION", a->cutDuration);
741  query.bindValue(":VIDEOWIDTH", a->videoWidth);
742  query.bindValue(":VIDEOHEIGHT", a->videoHeight);
743  query.bindValue(":FILECODEC", a->fileCodec);
744  query.bindValue(":VIDEOCODEC", a->videoCodec);
745  query.bindValue(":ENCODERPROFILE", a->encoderProfile->name);
746 
747  if (!query.exec())
748  MythDB::DBError("archive item insert", query);
749  }
750 }
751 
753 {
754  if (m_archiveList.empty())
755  return;
756 
758  auto *curItem = item->GetData().value<ArchiveItem *>();
759 
760  if (!curItem)
761  return;
762 
763  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
764 
765  auto *menuPopup = new MythDialogBox(tr("Menu"), popupStack, "actionmenu");
766 
767  if (menuPopup->Create())
768  popupStack->AddScreen(menuPopup);
769 
770  menuPopup->SetReturnEvent(this, "action");
771 
772  if (curItem->hasCutlist)
773  {
774  if (curItem->useCutlist)
775  {
776  menuPopup->AddButton(tr("Don't Use Cut List"),
777  SLOT(toggleUseCutlist()));
778  }
779  else
780  {
781  menuPopup->AddButton(tr("Use Cut List"),
782  SLOT(toggleUseCutlist()));
783  }
784  }
785 
786  menuPopup->AddButton(tr("Remove Item"), SLOT(removeItem()));
787  menuPopup->AddButton(tr("Edit Details"), SLOT(editDetails()));
788  menuPopup->AddButton(tr("Change Encoding Profile"), SLOT(changeProfile()));
789  menuPopup->AddButton(tr("Edit Thumbnails"), SLOT(editThumbnails()));
790 }
791 
793 {
795  auto *curItem = item->GetData().value<ArchiveItem *>();
796 
797  if (!curItem)
798  return;
799 
800  m_archiveList.removeAll(curItem);
801 
803 }
804 
806 {
808  auto *curItem = item->GetData().value<ArchiveItem *>();
809 
810  if (!curItem)
811  return;
812 
814 
815  auto *editor = new EditMetadataDialog(mainStack, curItem);
816 
817  connect(editor, &EditMetadataDialog::haveResult,
818  this, &MythBurn::editorClosed);
819 
820  if (editor->Create())
821  mainStack->AddScreen(editor);
822 }
823 
825 {
827  auto *curItem = item->GetData().value<ArchiveItem *>();
828 
829  if (!curItem)
830  return;
831 
833 
834  auto *finder = new ThumbFinder(mainStack, curItem, m_theme);
835 
836  if (finder->Create())
837  mainStack->AddScreen(finder);
838 }
839 
841 {
843 
844  if (ok && item && gridItem)
845  {
846  // update the grid to reflect any changes
847  gridItem->SetText(item->title);
848  gridItem->SetText(item->subtitle, "subtitle");
849  gridItem->SetText(item->startDate + " " + item->startTime, "date");
850  }
851 }
852 
854 {
856  auto *curItem = item->GetData().value<ArchiveItem *>();
857 
858  if (!curItem)
859  return;
860 
861  MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
862 
863  auto *profileDialog = new ProfileDialog(popupStack, curItem, m_profileList);
864 
865  if (profileDialog->Create())
866  {
867  popupStack->AddScreen(profileDialog, false);
868  connect(profileDialog, &ProfileDialog::haveResult,
869  this, &MythBurn::profileChanged);
870  }
871 }
872 
873 void MythBurn::profileChanged(int profileNo)
874 {
875  if (profileNo > m_profileList.size() - 1)
876  return;
877 
878  EncoderProfile *profile = m_profileList.at(profileNo);
879 
881  if (!item)
882  return;
883 
884  auto *archiveItem = item->GetData().value<ArchiveItem *>();
885  if (!archiveItem)
886  return;
887 
888  archiveItem->encoderProfile = profile;
889 
890  item->SetText(profile->name, "profile");
891  item->SetText(formatSize(archiveItem->newsize / 1024, 2), "size");
892 
893  updateSizeBar();
894 }
895 
897 {
898  QString tempDir = getTempDirectory();
899  QString logDir = tempDir + "logs";
900  QString configDir = tempDir + "config";
901  QString commandline;
902 
903  // remove any existing logs
904  myth_system("rm -f " + logDir + "/*.log");
905 
906  // remove cancel flag file if present
907  if (QFile::exists(logDir + "/mythburncancel.lck"))
908  QFile::remove(logDir + "/mythburncancel.lck");
909 
910  createConfigFile(configDir + "/mydata.xml");
911  commandline = PYTHON_EXE;
912  commandline += " " + GetShareDir() + "mytharchive/scripts/mythburn.py";
913  commandline += " -j " + configDir + "/mydata.xml"; // job file
914  commandline += " -l " + logDir + "/progress.log"; // progress log
915  commandline += " > " + logDir + "/mythburn.log 2>&1 &"; // Logs
916 
917  gCoreContext->SaveSetting("MythArchiveLastRunStatus", "Running");
918 
921  uint retval = myth_system(commandline, flags);
922  if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
923  {
924  ShowOkPopup(tr("It was not possible to create the DVD. "
925  " An error occured when running the scripts"));
926  }
927  else
928  {
929  // now show the log viewer
930  showLogViewer();
931  }
932 
934  m_themeScreen->Close();
935  Close();
936 }
937 
939 {
941 
942  auto *selector = new RecordingSelector(mainStack, &m_archiveList);
943 
944  connect(selector, &RecordingSelector::haveResult,
945  this, &MythBurn::selectorClosed);
946 
947  if (selector->Create())
948  mainStack->AddScreen(selector);
949 }
950 
952 {
953  if (ok)
955 }
956 
958 {
960  query.prepare("SELECT title FROM videometadata");
961  if (query.exec() && query.size())
962  {
963  }
964  else
965  {
966  ShowOkPopup(tr("You don't have any videos!"));
967  return;
968  }
969 
971 
972  auto *selector = new VideoSelector(mainStack, &m_archiveList);
973 
974  connect(selector, &VideoSelector::haveResult,
975  this, &MythBurn::selectorClosed);
976 
977  if (selector->Create())
978  mainStack->AddScreen(selector);
979 }
980 
982 {
983  QString filter = gCoreContext->GetSetting("MythArchiveFileFilter",
984  "*.mpg *.mpeg *.mov *.avi *.nuv");
985 
987 
988  auto *selector = new FileSelector(mainStack, &m_archiveList,
989  FSTYPE_FILELIST, "/", filter);
990 
991  connect(selector, qOverload<bool>(&FileSelector::haveResult),
992  this, &MythBurn::selectorClosed);
993 
994  if (selector->Create())
995  mainStack->AddScreen(selector);
996 }
997 
999 {
1001 
1002  if (m_moveMode)
1003  item->DisplayState("on", "movestate");
1004  else
1005  item->DisplayState("off", "movestate");
1006 }
1007 
1009 
1011 {
1012  if (!LoadWindowFromXML("mythburn-ui.xml", "profilepopup", this))
1013  return false;
1014 
1015  bool err = false;
1016  UIUtilE::Assign(this, m_captionText, "caption_text", &err);
1017  UIUtilE::Assign(this, m_descriptionText, "description_text", &err);
1018  UIUtilE::Assign(this, m_oldSizeText, "oldsize_text", &err);
1019  UIUtilE::Assign(this, m_newSizeText, "newsize_text", &err);
1020  UIUtilE::Assign(this, m_profileBtnList, "profile_list", &err);
1021  UIUtilE::Assign(this, m_okButton, "ok_button", &err);
1022 
1023  if (err)
1024  {
1025  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'profilepopup'");
1026  return false;
1027  }
1028 
1029  for (auto *x : qAsConst(m_profileList))
1030  {
1031  auto *item = new
1033  item->SetData(QVariant::fromValue(x));
1034  }
1035 
1038 
1039 
1041 
1044 
1046 
1047  BuildFocusList();
1048 
1050 
1051  return true;
1052 }
1053 
1055 {
1056  if (!item)
1057  return;
1058 
1059  auto *profile = item->GetData().value<EncoderProfile *>();
1060  if (!profile)
1061  return;
1062 
1063  m_descriptionText->SetText(profile->description);
1064 
1066 
1067  // calc new size
1069 
1071 }
1072 
1073 
1075 {
1077 
1078  Close();
1079 }
1080 
1082 
1084  :QObject(nullptr)
1085 {
1086  setObjectName("BurnMenu");
1087 }
1088 
1090 {
1091  if (!gCoreContext->GetSetting("MythArchiveLastRunStatus").startsWith("Success"))
1092  {
1093  showWarningDialog(tr("Cannot burn a DVD.\n"
1094  "The last run failed to create a DVD."));
1095  return;
1096  }
1097 
1098  // ask the user what type of disk to burn to
1099  QString title = tr("Burn DVD");
1100  QString msg = tr("\nPlace a blank DVD in the"
1101  " drive and select an option below.");
1102  MythScreenStack *mainStack = GetMythMainWindow()->GetStack("main stack");
1103  auto *menuPopup = new MythDialogBox(title, msg, mainStack,
1104  "actionmenu", true);
1105 
1106  if (menuPopup->Create())
1107  mainStack->AddScreen(menuPopup);
1108 
1109  menuPopup->SetReturnEvent(this, "action");
1110 
1111  menuPopup->AddButton(tr("Burn DVD"));
1112  menuPopup->AddButton(tr("Burn DVD Rewritable"));
1113  menuPopup->AddButton(tr("Burn DVD Rewritable (Force Erase)"));
1114 }
1115 
1116 void BurnMenu::customEvent(QEvent *event)
1117 {
1118  if (auto *dce = dynamic_cast<DialogCompletionEvent*>(event))
1119  {
1120  if (dce->GetId() == "action")
1121  {
1122  doBurn(dce->GetResult());
1123  deleteLater();
1124  }
1125  }
1126 }
1127 
1128 void BurnMenu::doBurn(int mode)
1129 {
1130  if ((mode < 0) || (mode > 2))
1131  return;
1132 
1133  QString tempDir = getTempDirectory(true);
1134 
1135  if (tempDir == "")
1136  return;
1137 
1138  QString logDir = tempDir + "logs";
1139  QString commandline;
1140 
1141  // remove existing progress.log if present
1142  if (QFile::exists(logDir + "/progress.log"))
1143  QFile::remove(logDir + "/progress.log");
1144 
1145  // remove cancel flag file if present
1146  if (QFile::exists(logDir + "/mythburncancel.lck"))
1147  QFile::remove(logDir + "/mythburncancel.lck");
1148 
1149  QString sArchiveFormat = QString::number(mode);
1150  bool bEraseDVDRW = (mode == 2);
1151  bool bNativeFormat = gCoreContext->GetSetting("MythArchiveLastRunType")
1152  .startsWith("Native");
1153 
1154  commandline = "mytharchivehelper --burndvd --mediatype " + sArchiveFormat +
1155  (bEraseDVDRW ? " --erasedvdrw" : "") +
1156  (bNativeFormat ? " --nativeformat" : "");
1157  commandline += logPropagateArgs;
1158  if (!logPropagateQuiet())
1159  commandline += " --quiet";
1160  commandline += " > " + logDir + "/progress.log 2>&1 &";
1161 
1164  uint retval = myth_system(commandline, flags);
1165  if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
1166  {
1167  showWarningDialog(tr("It was not possible to run "
1168  "mytharchivehelper to burn the DVD."));
1169  return;
1170  }
1171 
1172  // now show the log viewer
1173  showLogViewer();
1174 }
1175 
1176 /* vim: set expandtab tabstop=4 shiftwidth=4: */
MythUIButton::Clicked
void Clicked()
MythUIButtonList::GetItemAt
MythUIButtonListItem * GetItemAt(int pos) const
Definition: mythuibuttonlist.cpp:1676
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:126
RecordingSelector::haveResult
void haveResult(bool ok)
MythMainWindow::GetMainStack
MythScreenStack * GetMainStack()
Definition: mythmainwindow.cpp:321
e
QDomElement e
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1420
ArchiveDestination
Definition: archiveutil.h:27
ArchiveItem::useCutlist
bool useCutlist
Definition: archiveutil.h:70
MythBurn::m_theme
QString m_theme
Definition: mythburn.h:112
MSqlQuery::size
int size(void) const
Definition: mythdbcon.h:203
MythUIButtonList::GetItemCurrent
MythUIButtonListItem * GetItemCurrent() const
Definition: mythuibuttonlist.cpp:1590
ProfileDialog::m_okButton
MythUIButton * m_okButton
Definition: mythburn.h:49
myth_system
uint myth_system(const QString &command, uint flags, uint timeout)
Definition: mythsystemlegacy.cpp:501
GENERIC_EXIT_OK
#define GENERIC_EXIT_OK
Exited with no error.
Definition: exitcodes.h:10
root
QDomElement root
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:656
mythuitext.h
mythuiprogressbar.h
fileselector.h
MythBurn::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythburn.cpp:126
MythBurn::handleCancel
void handleCancel(void)
Definition: mythburn.cpp:353
ProfileDialog::Create
bool Create() override
Definition: mythburn.cpp:1010
editmetadata.h
MythBurn::m_cancelButton
MythUIButton * m_cancelButton
Definition: mythburn.h:118
ShowOkPopup
MythConfirmationDialog * ShowOkPopup(const QString &message, QObject *parent, const char *slot, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
Definition: mythdialogbox.cpp:551
kMSDontBlockInputDevs
@ kMSDontBlockInputDevs
avoid blocking LIRC & Joystick Menu
Definition: mythsystem.h:34
mythdb.h
VideoSelector::haveResult
void haveResult(bool ok)
EncoderProfile
Definition: archiveutil.h:37
MythUIButtonListItem::DisplayState
void DisplayState(const QString &state, const QString &name)
Definition: mythuibuttonlist.cpp:3499
MythBurn::updateArchiveList
void updateArchiveList(void)
Definition: mythburn.cpp:385
ProfileDialog::m_profileList
QList< EncoderProfile * > m_profileList
Definition: mythburn.h:40
doc
QDomDocument doc("MYTHARCHIVEITEM")
MythBurn::m_currentsizeErrorText
MythUIText * m_currentsizeErrorText
Definition: mythburn.h:130
MythBurn::m_minsizeText
MythUIText * m_minsizeText
Definition: mythburn.h:129
MythBurn::handlePrevPage
void handlePrevPage(void)
Definition: mythburn.cpp:348
MythScreenType::Close
virtual void Close()
Definition: mythscreentype.cpp:402
ProfileDialog::m_archiveItem
ArchiveItem * m_archiveItem
Definition: mythburn.h:39
MythBurn::m_bCreateISO
bool m_bCreateISO
Definition: mythburn.h:108
MythBurn::m_prevButton
MythUIButton * m_prevButton
Definition: mythburn.h:117
title
QString title
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:636
ProfileDialog::m_oldSizeText
MythUIText * m_oldSizeText
Definition: mythburn.h:44
MythBurn::saveConfiguration
void saveConfiguration(void)
Definition: mythburn.cpp:702
ArchiveItem::newsize
int64_t newsize
Definition: archiveutil.h:61
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:1139
MythBurn::removeItem
void removeItem(void)
Definition: mythburn.cpp:792
ArchiveDestination::freeSpace
int64_t freeSpace
Definition: archiveutil.h:31
MythBurn::m_addrecordingButton
MythUIButton * m_addrecordingButton
Definition: mythburn.h:122
MythBurn::m_destinationScreen
MythScreenType * m_destinationScreen
Definition: mythburn.h:101
EditMetadataDialog::haveResult
void haveResult(bool ok, ArchiveItem *item)
MythUIButtonList::itemSelected
void itemSelected(MythUIButtonListItem *item)
VideoSelector
Definition: videoselector.h:39
MythUIProgressBar::SetUsed
void SetUsed(int value)
Definition: mythuiprogressbar.cpp:59
MythBurn::toggleUseCutlist
void toggleUseCutlist(void)
Definition: mythburn.cpp:302
mythdialogbox.h
MSqlQuery::value
QVariant value(int i) const
Definition: mythdbcon.h:198
MythScreenStack
Definition: mythscreenstack.h:16
arg
arg(title).arg(filename).arg(doDelete))
ArchiveItem::videoWidth
int videoWidth
Definition: archiveutil.h:67
MSqlQuery::exec
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
Definition: mythdbcon.cpp:603
logviewer.h
ArchiveItem::startTime
QString startTime
Definition: archiveutil.h:58
LOG
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:23
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:45
MythBurn::getProfileFromName
EncoderProfile * getProfileFromName(const QString &profileName)
Definition: mythburn.cpp:693
MythBurn::itemClicked
void itemClicked(MythUIButtonListItem *item)
Definition: mythburn.cpp:998
MythBurn::m_saveFilename
QString m_saveFilename
Definition: mythburn.h:111
build_compdb.file
file
Definition: build_compdb.py:55
MythBurn::m_bDoBurn
bool m_bDoBurn
Definition: mythburn.h:109
BurnMenu::BurnMenu
BurnMenu(void)
Definition: mythburn.cpp:1083
mythdirs.h
getTempDirectory
QString getTempDirectory(bool showError)
Definition: archiveutil.cpp:68
ArchiveItem::title
QString title
Definition: archiveutil.h:54
MythBurn::m_currentsizeText
MythUIText * m_currentsizeText
Definition: mythburn.h:131
MythBurn::m_profileList
QList< EncoderProfile * > m_profileList
Definition: mythburn.h:106
MythBurn::loadFile
static QString loadFile(const QString &filename)
Definition: mythburn.cpp:360
MythMainWindow::GetStack
MythScreenStack * GetStack(const QString &stackname)
Definition: mythmainwindow.cpp:326
mythuibuttonlist.h
MythUIButtonList::GetCount
int GetCount() const
Definition: mythuibuttonlist.cpp:1655
mythprogressdialog.h
ThumbFinder
Definition: thumbfinder.h:36
MythScreenType::GetFocusWidget
MythUIType * GetFocusWidget(void) const
Definition: mythscreentype.cpp:112
mythsystemlegacy.h
showWarningDialog
void showWarningDialog(const QString &msg)
Definition: archiveutil.cpp:294
MythBurn::m_nextButton
MythUIButton * m_nextButton
Definition: mythburn.h:116
MythUIButtonListItem::SetText
void SetText(const QString &text, const QString &name="", const QString &state="")
Definition: mythuibuttonlist.cpp:3264
MythBurn::editorClosed
void editorClosed(bool ok, ArchiveItem *item)
Definition: mythburn.cpp:840
ProfileDialog::save
void save(void)
Definition: mythburn.cpp:1074
MythRemoveDirectory
bool MythRemoveDirectory(QDir &aDir)
Definition: mythmiscutil.cpp:804
MythUIButtonListItem
Definition: mythuibuttonlist.h:28
recordingselector.h
ArchiveItem::type
QString type
Definition: archiveutil.h:53
MythBurn::~MythBurn
~MythBurn(void) override
Definition: mythburn.cpp:60
baseName
QString baseName
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:593
mythdate.h
FileSelector
Definition: fileselector.h:40
MythUIProgressBar::SetTotal
void SetTotal(int value)
Definition: mythuiprogressbar.cpp:71
RecordingSelector
Definition: recordingselector.h:30
MythUIType::Show
void Show(void)
Definition: mythuitype.cpp:1125
MythBurn::ShowMenu
void ShowMenu(void) override
Definition: mythburn.cpp:752
GetConfDir
QString GetConfDir(void)
Definition: mythdirs.cpp:224
ArchiveItem::size
int64_t size
Definition: archiveutil.h:60
MythBurn::m_archiveDestination
ArchiveDestination m_archiveDestination
Definition: mythburn.h:103
hardwareprofile.scan.profile
profile
Definition: scan.py:99
MythUIButtonList::itemClicked
void itemClicked(MythUIButtonListItem *item)
MythUIButtonList::GetCurrentPos
int GetCurrentPos() const
Definition: mythuibuttonlist.h:190
archiveutil.h
MythScreenType::SetFocusWidget
bool SetFocusWidget(MythUIType *widget=nullptr)
Definition: mythscreentype.cpp:117
hardwareprofile.i18n.t
t
Definition: i18n.py:36
getFileDetails
bool getFileDetails(ArchiveItem *a)
Definition: archiveutil.cpp:221
MythDialogBox
Basic menu dialog, message and a list of options.
Definition: mythdialogbox.h:138
ArchiveDestination::type
ARCHIVEDESTINATION type
Definition: archiveutil.h:28
MSqlQuery::InitCon
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
Definition: mythdbcon.cpp:535
MythDB::DBError
static void DBError(const QString &where, const MSqlQuery &query)
Definition: mythdb.cpp:178
ProfileDialog::haveResult
void haveResult(int profile)
GetShareDir
QString GetShareDir(void)
Definition: mythdirs.cpp:222
MythScreenType::BuildFocusList
void BuildFocusList(void)
Definition: mythscreentype.cpp:222
videoselector.h
ProfileDialog
Definition: mythburn.h:20
ArchiveItem::startDate
QString startDate
Definition: archiveutil.h:57
MythBurn::handleAddFile
void handleAddFile(void)
Definition: mythburn.cpp:981
EditMetadataDialog
Definition: editvideometadata.h:20
showLogViewer
void showLogViewer(void)
Definition: logviewer.cpp:24
MythBurn::m_addvideoButton
MythUIButton * m_addvideoButton
Definition: mythburn.h:123
ProfileDialog::profileChanged
void profileChanged(MythUIButtonListItem *item)
Definition: mythburn.cpp:1054
MythBurn::m_addfileButton
MythUIButton * m_addfileButton
Definition: mythburn.h:124
MythBurn::editDetails
void editDetails(void)
Definition: mythburn.cpp:805
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MythBurn::m_archiveButtonList
MythUIButtonList * m_archiveButtonList
Definition: mythburn.h:120
MythUIBusyDialog
Definition: mythprogressdialog.h:37
f
QTextStream t & f
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:603
thumbfinder.h
MythBurn::m_bEraseDvdRw
bool m_bEraseDvdRw
Definition: mythburn.h:110
MythUIButtonListItem::GetData
QVariant GetData()
Definition: mythuibuttonlist.cpp:3580
MythBurn::Create
bool Create(void) override
Definition: mythburn.cpp:73
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:56
UIUtilDisp::Assign
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
MythBurn::isArchiveItemValid
static bool isArchiveItemValid(const QString &type, const QString &filename)
Definition: mythburn.cpp:468
MythBurn::m_archiveList
QList< ArchiveItem * > m_archiveList
Definition: mythburn.h:105
ArchiveItem::encoderProfile
EncoderProfile * encoderProfile
Definition: archiveutil.h:64
MythUIType::Hide
void Hide(void)
Definition: mythuitype.cpp:1120
kMSRunBackground
@ kMSRunBackground
run child in the background
Definition: mythsystem.h:36
mythuihelper.h
MythBurn::loadConfiguration
void loadConfiguration(void)
Definition: mythburn.cpp:642
ProfileDialog::m_profileBtnList
MythUIButtonList * m_profileBtnList
Definition: mythburn.h:47
MythBurn::runScript
void runScript()
Definition: mythburn.cpp:896
ProfileDialog::m_captionText
MythUIText * m_captionText
Definition: mythburn.h:42
MythScreenType::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: mythscreentype.cpp:414
mythmiscutil.h
ArchiveItem::videoHeight
int videoHeight
Definition: archiveutil.h:68
mythburn.h
MythBurn::m_sizeBar
MythUIProgressBar * m_sizeBar
Definition: mythburn.h:127
MythBurn::selectorClosed
void selectorClosed(bool ok)
Definition: mythburn.cpp:951
XMLParseBase::LoadWindowFromXML
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
Definition: xmlparsebase.cpp:692
dir
QDir dir
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:1174
ProfileDialog::m_newSizeText
MythUIText * m_newSizeText
Definition: mythburn.h:45
MythBurn::m_nofilesText
MythUIText * m_nofilesText
Definition: mythburn.h:121
MythBurn::editThumbnails
void editThumbnails(void)
Definition: mythburn.cpp:824
MSqlQuery::bindValue
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
Definition: mythdbcon.cpp:864
MythBurn::MythBurn
MythBurn(MythScreenStack *parent, MythScreenType *destinationScreen, MythScreenType *themeScreen, ArchiveDestination archiveDestination, const QString &name)
Definition: mythburn.cpp:44
FileSelector::haveResult
void haveResult(bool ok)
DialogCompletionEvent
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:42
BurnMenu::customEvent
void customEvent(QEvent *event) override
Definition: mythburn.cpp:1116
MythBurn::m_moveMode
bool m_moveMode
Definition: mythburn.h:114
MythBurn::handleNextPage
void handleNextPage(void)
Definition: mythburn.cpp:337
MythUIText::SetText
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:134
MythBurn::loadEncoderProfiles
void loadEncoderProfiles(void)
Definition: mythburn.cpp:227
mythcontext.h
ProfileDialog::m_descriptionText
MythUIText * m_descriptionText
Definition: mythburn.h:43
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
GetMythMainWindow
MythMainWindow * GetMythMainWindow(void)
Definition: mythmainwindow.cpp:105
MythUIButtonList::MoveToNamedPosition
bool MoveToNamedPosition(const QString &position_name)
Definition: mythuibuttonlist.cpp:2282
MythBurn::handleAddVideo
void handleAddVideo(void)
Definition: mythburn.cpp:957
MythUIButtonList::SetItemCurrent
void SetItemCurrent(MythUIButtonListItem *item)
Definition: mythuibuttonlist.cpp:1557
MythBurn::profileChanged
void profileChanged(int profileNo)
Definition: mythburn.cpp:873
build_compdb.action
action
Definition: build_compdb.py:9
MythBurn::changeProfile
void changeProfile(void)
Definition: mythburn.cpp:853
BurnMenu::start
void start(void)
Definition: mythburn.cpp:1089
MythBurn::createConfigFile
void createConfigFile(const QString &filename)
Definition: mythburn.cpp:557
mythuibutton.h
recalcItemSize
void recalcItemSize(ArchiveItem *item)
Definition: archiveutil.cpp:303
logPropagateQuiet
bool logPropagateQuiet(void)
Check if we are propagating a "--quiet".
Definition: logging.cpp:684
ArchiveItem::subtitle
QString subtitle
Definition: archiveutil.h:55
FSTYPE_FILELIST
@ FSTYPE_FILELIST
Definition: fileselector.h:28
MythBurn::handleAddRecording
void handleAddRecording(void)
Definition: mythburn.cpp:938
formatSize
static QString formatSize(int64_t sizeKB, int prec)
Definition: recordingutils.cpp:22
logPropagateArgs
QString logPropagateArgs
Definition: logging.cpp:87
ArchiveItem
Definition: archiveutil.h:51
GENERIC_EXIT_RUNNING
#define GENERIC_EXIT_RUNNING
Process is running.
Definition: exitcodes.h:25
MythBurn::m_maxsizeText
MythUIText * m_maxsizeText
Definition: mythburn.h:128
kMSDontDisableDrawing
@ kMSDontDisableDrawing
avoid disabling UI drawing
Definition: mythsystem.h:35
MythCoreContext::SaveSetting
void SaveSetting(const QString &key, int newValue)
Definition: mythcorecontext.cpp:898
getBaseName
QString getBaseName(const QString &filename)
Definition: archiveutil.cpp:145
MythBurn::m_themeScreen
MythScreenType * m_themeScreen
Definition: mythburn.h:102
mythuicheckbox.h
exitcodes.h
MythBurn::getDefaultProfile
EncoderProfile * getDefaultProfile(ArchiveItem *item)
Definition: mythburn.cpp:507
MythUIButtonList::GetItemFirst
MythUIButtonListItem * GetItemFirst() const
Definition: mythuibuttonlist.cpp:1636
MythBurn::updateSizeBar
void updateSizeBar()
Definition: mythburn.cpp:190
MythScreenStack::AddScreen
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Definition: mythscreenstack.cpp:49
MythUIButtonListItem::MoveUpDown
bool MoveUpDown(bool flag)
Definition: mythuibuttonlist.cpp:3585
query
MSqlQuery query(MSqlQuery::InitCon())
build_compdb.options
options
Definition: build_compdb.py:11
EncoderProfile::name
QString name
Definition: archiveutil.h:38
MythCoreContext::GetSetting
QString GetSetting(const QString &key, const QString &defaultval="")
Definition: mythcorecontext.cpp:915
ArchiveItem::videoCodec
QString videoCodec
Definition: archiveutil.h:66
BurnMenu::doBurn
static void doBurn(int mode)
Definition: mythburn.cpp:1128
MSqlQuery::prepare
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
Definition: mythdbcon.cpp:808