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 &value);
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(const 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 MythCoreContext::GenMythURL(host, port, path,
71  StorageGroup::GetGroupToUse(host, storage_group));
72 
73 }
74 
75 #endif // VIDEOUTILS_H_
GetDisplayWatched
META_PUBLIC QString GetDisplayWatched(bool watched)
Definition: videoutils.cpp:179
generate_file_url
QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
Definition: videoutils.h:65
VideoMetadata
Definition: videometadata.h:25
GetDisplayLength
META_PUBLIC QString GetDisplayLength(int length)
Definition: videoutils.cpp:159
GetDisplayCountries
META_PUBLIC QString GetDisplayCountries(const VideoMetadata &item)
Definition: videoutils.cpp:228
ParentalLevelToState
META_PUBLIC QString ParentalLevelToState(const ParentalLevel &level)
Definition: videoutils.cpp:242
MythUIImage
Image widget, displays a single image or multiple images in sequence.
Definition: mythuiimage.h:98
IsDefaultBanner
META_PUBLIC bool IsDefaultBanner(const QString &banner)
Definition: videoutils.cpp:144
GetDisplayBrowse
META_PUBLIC QString GetDisplayBrowse(bool browse)
Definition: videoutils.cpp:167
parentalcontrols.h
GetDisplayYear
META_PUBLIC QString GetDisplayYear(int year)
Definition: videoutils.cpp:209
CheckedSet
void CheckedSet(T *uiItem, const QString &value)
Definition: videoutils.h:9
mythmetaexp.h
GetDisplayProcessed
META_PUBLIC QString GetDisplayProcessed(bool processed)
Definition: videoutils.cpp:191
MythCoreContext::GenMythURL
static QString GenMythURL(const QString &host=QString(), int port=0, QString path=QString(), const QString &storageGroup=QString())
Definition: mythcorecontext.cpp:778
ContentTypeFromString
META_PUBLIC VideoContentType ContentTypeFromString(const QString &type)
Definition: videoutils.cpp:286
MythCoreContext::GetBackendServerPort
int GetBackendServerPort(void)
Returns the locally defined backend control port.
Definition: mythcorecontext.cpp:1082
hardwareprofile.scan.rating
def rating(profile, smoonURL, gate)
Definition: scan.py:39
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:634
storagegroup.h
StorageGroup::GetGroupToUse
static QString GetGroupToUse(const QString &host, const QString &sgroup)
Definition: storagegroup.cpp:867
IsDefaultFanart
META_PUBLIC bool IsDefaultFanart(const QString &fanart)
Definition: videoutils.cpp:149
uint
unsigned int uint
Definition: compat.h:140
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
MythUIType
The base class on which all widgets and screens are based.
Definition: mythuitype.h:64
WatchedToState
META_PUBLIC QString WatchedToState(bool watched)
Definition: videoutils.cpp:276
VideoContentType
VideoContentType
Definition: metadatacommon.h:59
GetDisplayRating
META_PUBLIC QString GetDisplayRating(const QString &rating)
Definition: videoutils.cpp:214
mythcorecontext.h
ParentalLevel
Definition: parentalcontrols.h:10
GetDisplayCast
META_PUBLIC QStringList GetDisplayCast(const VideoMetadata &item)
Definition: videoutils.cpp:235
IsDefaultCoverFile
META_PUBLIC bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:130
GetVideoDirsByHost
META_PUBLIC QStringList GetVideoDirsByHost(const QString &host)
Definition: videoutils.cpp:80
IsDefaultScreenshot
META_PUBLIC bool IsDefaultScreenshot(const QString &screenshot)
Definition: videoutils.cpp:139
GetVideoDirs
META_PUBLIC QStringList GetVideoDirs()
Definition: videoutils.cpp:125
ContentTypeToString
META_PUBLIC QString ContentTypeToString(VideoContentType type)
Definition: videoutils.cpp:304
GetDisplayUserRating
META_PUBLIC QString GetDisplayUserRating(float userrating)
Definition: videoutils.cpp:154
TrailerToState
META_PUBLIC QString TrailerToState(const QString &trailerFile)
Definition: videoutils.cpp:266
META_PUBLIC
#define META_PUBLIC
Definition: mythmetaexp.h:9
metadatacommon.h
MythUIStateType
This widget is used for grouping other widgets for display when a particular named state is called.
Definition: mythuistatetype.h:23
GetDisplayGenres
META_PUBLIC QString GetDisplayGenres(const VideoMetadata &item)
Definition: videoutils.cpp:221