MythTV  master
Go to the documentation of this file.
1 #ifndef VIDEOUTILS_H_
2 #define VIDEOUTILS_H_
4 #include "parentalcontrols.h"
5 #include "mythmetaexp.h"
6 #include "metadatacommon.h"
8 template <typename T>
9 inline void CheckedSet(T *uiItem, const QString &value)
10 {
11  if (uiItem)
12  {
13  if (!value.isEmpty())
14  uiItem->SetText(value);
15  else
16  uiItem->Reset();
17  }
18 }
20 class MythUIStateType;
21 class MythUIType;
22 class MythUIImage;
24 template <>
25 META_PUBLIC void CheckedSet( MythUIStateType *uiItem, const QString &value);
27 META_PUBLIC void CheckedSet( MythUIType *container, const QString &itemName,
28  const QString &value);
30 META_PUBLIC void CheckedSet( MythUIImage *uiItem, const QString &filename);
32 META_PUBLIC QStringList GetVideoDirsByHost(const QString& host);
33 META_PUBLIC QStringList GetVideoDirs();
35 META_PUBLIC bool IsDefaultCoverFile(const QString &coverfile);
36 META_PUBLIC bool IsDefaultScreenshot(const QString &screenshot);
37 META_PUBLIC bool IsDefaultBanner(const QString &banner);
38 META_PUBLIC bool IsDefaultFanart(const QString &fanart);
40 class VideoMetadata;
42 META_PUBLIC QString GetDisplayUserRating(float userrating);
43 META_PUBLIC QString GetDisplayLength(int length);
44 META_PUBLIC QString GetDisplayBrowse(bool browse);
45 META_PUBLIC QString GetDisplayWatched(bool watched);
46 META_PUBLIC QString GetDisplayProcessed(bool processed);
47 META_PUBLIC QString GetDisplayYear(int year);
48 META_PUBLIC QString GetDisplayRating(const QString &rating);
50 META_PUBLIC QString GetDisplayGenres(const VideoMetadata &item);
51 META_PUBLIC QString GetDisplayCountries(const VideoMetadata &item);
52 META_PUBLIC QStringList GetDisplayCast(const VideoMetadata &item);
54 META_PUBLIC QString TrailerToState(const QString &trailerFile);
55 META_PUBLIC QString ParentalLevelToState(const ParentalLevel &level);
56 META_PUBLIC QString WatchedToState(bool watched);
61 // this needs to be an inline and pull in the storage group and context
62 // headers since it this used in dbcheck.cpp.
63 #include <storagegroup.h>
64 #include <mythcorecontext.h>
65 inline QString generate_file_url(
66  const QString &storage_group, const QString &host, const QString &path)
67 {
70  return MythCoreContext::GenMythURL(host, port, path,
71  StorageGroup::GetGroupToUse(host, storage_group));
73 }
75 #endif // VIDEOUTILS_H_
void CheckedSet(T *uiItem, const QString &value)
Definition: videoutils.h:9
This widget is used for grouping other widgets for display when a particular named state is called.
META_PUBLIC QString GetDisplayRating(const QString &rating)
Definition: videoutils.cpp:209
META_PUBLIC QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:230
META_PUBLIC QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:299
META_PUBLIC QString WatchedToState(bool watched)
Definition: videoutils.cpp:271
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:97
META_PUBLIC QString GetDisplayGenres(const VideoMetadata &item)
Definition: videoutils.cpp:216
META_PUBLIC QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:162
META_PUBLIC bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:125
META_PUBLIC QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:149
META_PUBLIC QString GetDisplayWatched(bool watched)
Definition: videoutils.cpp:174
META_PUBLIC QStringList GetVideoDirsByHost(const QString &host)
Definition: videoutils.cpp:80
META_PUBLIC QString GetDisplayYear(int year)
Definition: videoutils.cpp:204
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
META_PUBLIC VideoContentType ContentTypeFromString(const QString &type)
Definition: videoutils.cpp:281
The base class on which all widgets and screens are based.
Definition: mythuitype.h:63
int GetBackendServerPort(void)
Returns the locally defined backend control port.
META_PUBLIC QString GetDisplayLength(int length)
Definition: videoutils.cpp:154
def rating(profile, smoonURL, gate)
Definition: mythmetaexp.h:9
static QString GenMythURL(const QString &host=QString(), int port=0, QString path=QString(), const QString &storageGroup=QString())
unsigned int uint
Definition: compat.h:140
META_PUBLIC QString ParentalLevelToState(const ParentalLevel &level)
Definition: videoutils.cpp:237
static QString GetGroupToUse(const QString &host, const QString &sgroup)
META_PUBLIC bool IsDefaultBanner(const QString &banner)
Definition: videoutils.cpp:139
META_PUBLIC QStringList GetVideoDirs()
Definition: videoutils.cpp:120
META_PUBLIC QString GetDisplayProcessed(bool processed)
Definition: videoutils.cpp:186
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Definition: videoutils.h:65
META_PUBLIC bool IsDefaultScreenshot(const QString &screenshot)
Definition: videoutils.cpp:134
META_PUBLIC bool IsDefaultFanart(const QString &fanart)
Definition: videoutils.cpp:144
META_PUBLIC QString TrailerToState(const QString &trailerFile)
Definition: videoutils.cpp:261
META_PUBLIC QString GetDisplayCountries(const VideoMetadata &item)
Definition: videoutils.cpp:223