MythTV  master
videoutils.h
Go to the documentation of this file.
1 #ifndef VIDEOUTILS_H_
2 #define VIDEOUTILS_H_
3 
4 #include "parentalcontrols.h"
5 #include "mythmetaexp.h"
6 #include "metadatacommon.h"
7 
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 }
19 
20 class MythUIStateType;
21 class MythUIType;
22 class MythUIImage;
23 
24 template <>
25 META_PUBLIC void CheckedSet( MythUIStateType *uiItem, const QString &state);
26 
27 META_PUBLIC void CheckedSet( MythUIType *container, const QString &itemName,
28  const QString &value);
29 
30 META_PUBLIC void CheckedSet( MythUIImage *uiItem, const QString &filename);
31 
32 META_PUBLIC QStringList GetVideoDirsByHost(QString host);
33 META_PUBLIC QStringList GetVideoDirs();
34 
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);
39 
40 class VideoMetadata;
41 
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);
49 
50 META_PUBLIC QString GetDisplayGenres(const VideoMetadata &item);
51 META_PUBLIC QString GetDisplayCountries(const VideoMetadata &item);
52 META_PUBLIC QStringList GetDisplayCast(const VideoMetadata &item);
53 
54 META_PUBLIC QString TrailerToState(const QString &trailerFile);
55 META_PUBLIC QString ParentalLevelToState(const ParentalLevel &level);
56 META_PUBLIC QString WatchedToState(bool watched);
57 
60 
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 {
69 
70  return gCoreContext->GenMythURL(host, port, path,
71  StorageGroup::GetGroupToUse(host, storage_group));
72 
73 }
74 
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:211
META_PUBLIC QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:232
QString GenMythURL(QString host=QString(), QString port=QString(), QString path=QString(), QString storageGroup=QString())
META_PUBLIC QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:301
META_PUBLIC QString WatchedToState(bool watched)
Definition: videoutils.cpp:273
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:218
META_PUBLIC QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:164
META_PUBLIC bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:127
META_PUBLIC QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:151
META_PUBLIC QString GetDisplayWatched(bool watched)
Definition: videoutils.cpp:178
META_PUBLIC QString GetDisplayYear(int year)
Definition: videoutils.cpp:206
unsigned int uint
Definition: compat.h:140
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
META_PUBLIC VideoContentType ContentTypeFromString(const QString &type)
Definition: videoutils.cpp:283
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:156
def rating(profile, smoonURL, gate)
Definition: scan.py:25
#define META_PUBLIC
Definition: mythmetaexp.h:9
META_PUBLIC QString ParentalLevelToState(const ParentalLevel &level)
Definition: videoutils.cpp:239
static QString GetGroupToUse(const QString &host, const QString &sgroup)
META_PUBLIC bool IsDefaultBanner(const QString &banner)
Definition: videoutils.cpp:141
META_PUBLIC QStringList GetVideoDirs()
Definition: videoutils.cpp:122
META_PUBLIC QString GetDisplayProcessed(bool processed)
Definition: videoutils.cpp:192
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Definition: videoutils.h:65
VideoContentType
META_PUBLIC bool IsDefaultScreenshot(const QString &screenshot)
Definition: videoutils.cpp:136
META_PUBLIC bool IsDefaultFanart(const QString &fanart)
Definition: videoutils.cpp:146
META_PUBLIC QStringList GetVideoDirsByHost(QString host)
Definition: videoutils.cpp:80
META_PUBLIC QString TrailerToState(const QString &trailerFile)
Definition: videoutils.cpp:263
META_PUBLIC QString GetDisplayCountries(const VideoMetadata &item)
Definition: videoutils.cpp:225