Init
This commit is contained in:
+32
-10
@@ -66,6 +66,7 @@ qint32 cKodiVideoLibrary::load()
|
||||
loadCountries();
|
||||
loadGenres();
|
||||
loadStudios();
|
||||
loadSets();
|
||||
|
||||
return(loadVideos());
|
||||
}
|
||||
@@ -131,6 +132,20 @@ qint32 cKodiVideoLibrary::loadStudios()
|
||||
return(m_videosStudioList.count());
|
||||
}
|
||||
|
||||
qint32 cKodiVideoLibrary::loadSets()
|
||||
{
|
||||
QSqlQuery query(m_db);
|
||||
|
||||
query.exec("SELECT idSet, strSet, strOverview FROM sets ORDER BY strSet;");
|
||||
while(query.next())
|
||||
{
|
||||
m_videosSetList.add(query.value("idSet").toInt(),
|
||||
query.value("strSet").toString(),
|
||||
query.value("strOverview").toString());
|
||||
}
|
||||
return(m_videosSetList.count());
|
||||
}
|
||||
|
||||
qint32 cKodiVideoLibrary::loadVideos()
|
||||
{
|
||||
QSqlQuery query(m_db);
|
||||
@@ -210,18 +225,15 @@ qint32 cKodiVideoLibrary::loadVideos()
|
||||
query.value("c21").toString(),
|
||||
query.value("c22").toString(),
|
||||
query.value("c23").toInt(),
|
||||
query.value("idSet").toInt(),
|
||||
query.value("userrating").toInt(),
|
||||
query.value("strSet").toString(),
|
||||
query.value("strSetOverview").toString(),
|
||||
query.value("strFileName").toString(),
|
||||
query.value("strPath").toString(),
|
||||
query.value("playCount").toInt(),
|
||||
QDateTime::fromString(query.value("lastPlayed").toString(), "yyyy-MM-dd HH:mm:ss"),
|
||||
QDateTime::fromString(query.value("dateAdded").toString(), "yyyy-MM-dd HH:mm:ss"),
|
||||
query.value("resumeTimeInSeconds").toDouble(),
|
||||
query.value("totalTimeInSeconds").toDouble());
|
||||
|
||||
query.value("totalTimeInSeconds").toDouble(),
|
||||
m_videosSetList.get(query.value("idSet").toInt()));
|
||||
}
|
||||
return(m_videosList.count());
|
||||
}
|
||||
@@ -250,13 +262,13 @@ void cKodiVideoLibrary::fillVideoList(QStandardItemModel* lpModel)
|
||||
{
|
||||
cMyVideos* lpVideos = m_videosList.at(z);
|
||||
|
||||
if(lpVideos->set().length())
|
||||
if(lpVideos->set())
|
||||
{
|
||||
if(szOldSet != lpVideos->set())
|
||||
if(szOldSet != lpVideos->set()->strSet())
|
||||
{
|
||||
szOldSet = lpVideos->set();
|
||||
lpRoot = new QStandardItem(QString("<b><i>%1</i></b>").arg(lpVideos->set()));
|
||||
QVariant v = qVariantFromValue(lpVideos);
|
||||
szOldSet = lpVideos->set()->strSet();
|
||||
lpRoot = new QStandardItem(QString("<b><i>%1</i></b>").arg(lpVideos->set()->strSet()));
|
||||
QVariant v = qVariantFromValue(lpVideos->set());
|
||||
lpRoot->setData(v, Qt::UserRole);
|
||||
lpModel->appendRow(lpRoot);
|
||||
}
|
||||
@@ -322,6 +334,16 @@ void cKodiVideoLibrary::fillStudiosList(QStandardItemModel *lpModel)
|
||||
}
|
||||
}
|
||||
|
||||
void cKodiVideoLibrary::fillSetsList(QComboBox* lpComboBox)
|
||||
{
|
||||
lpComboBox->addItem("");
|
||||
for(int z = 0;z < m_videosSetList.count();z++)
|
||||
{
|
||||
QVariant v = QVariant::fromValue(m_videosSetList.at(z));
|
||||
lpComboBox->addItem(m_videosSetList.at(z)->strSet(), v);
|
||||
}
|
||||
}
|
||||
|
||||
void cKodiVideoLibrary::fillActorList(QStandardItemModel *lpList, cMyVideos* lpVideos)
|
||||
{
|
||||
lpList->clear();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <QStandardItemModel>
|
||||
#include <QTreeView>
|
||||
#include <QComboBox>
|
||||
|
||||
|
||||
class cKodiVideoLibrary
|
||||
@@ -28,6 +29,7 @@ public:
|
||||
void fillCountriesList(QStandardItemModel* lpModel);
|
||||
void fillGenresList(QStandardItemModel* lpModel);
|
||||
void fillStudiosList(QStandardItemModel* lpModel);
|
||||
void fillSetsList(QComboBox* lpComboBox);
|
||||
void fillActorList(QStandardItemModel* lpList, cMyVideos* lpVideos);
|
||||
void fillDirectorsList(QStandardItemModel* lpList, cMyVideos* lpVideos);
|
||||
void fillWritersList(QStandardItemModel* lpList, cMyVideos* lpVideos);
|
||||
@@ -48,6 +50,7 @@ private:
|
||||
cMyVideosCountryList m_videosCountryList;
|
||||
cMyVideosGenreList m_videosGenreList;
|
||||
cMyVideosStudioList m_videosStudioList;
|
||||
cMyVideosSetList m_videosSetList;
|
||||
cMyVideosList m_videosList;
|
||||
|
||||
qint32 loadActors();
|
||||
@@ -55,6 +58,7 @@ private:
|
||||
qint32 loadGenres();
|
||||
qint32 loadStudios();
|
||||
qint32 loadVideos();
|
||||
qint32 loadSets();
|
||||
};
|
||||
|
||||
#endif // CKODIVIDEOLIBRARY_H
|
||||
|
||||
+119
-43
@@ -4,6 +4,98 @@
|
||||
#include <QStandardItem>
|
||||
|
||||
|
||||
cMyVideosSetValues::cMyVideosSetValues() :
|
||||
m_idSet(-1),
|
||||
m_strSet("UNSET"),
|
||||
m_strOverview("UNSET")
|
||||
{
|
||||
}
|
||||
|
||||
cMyVideosSetValues::cMyVideosSetValues(qint32 idSet, const QString& strSet, const QString& strOverview) :
|
||||
m_idSet(idSet),
|
||||
m_strSet(strSet),
|
||||
m_strOverview(strOverview)
|
||||
{
|
||||
}
|
||||
|
||||
void cMyVideosSetValues::set(qint32 idSet, const QString& strSet, const QString& strOverview)
|
||||
{
|
||||
m_idSet = idSet;
|
||||
m_strSet = strSet;
|
||||
m_strOverview = strOverview;
|
||||
}
|
||||
|
||||
inline bool cMyVideosSetValues::operator==(const cMyVideosSetValues b) const
|
||||
{
|
||||
if(m_idSet != b.m_idSet) return(false);
|
||||
if(m_strSet != b.m_strSet) return(false);
|
||||
if(m_strOverview != b.m_strOverview) return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
inline bool cMyVideosSetValues::operator!=(const cMyVideosSetValues b) const
|
||||
{
|
||||
if(m_idSet != b.m_idSet
|
||||
|| m_strSet != b.m_strSet
|
||||
|| m_strOverview != b.m_strOverview)
|
||||
return(true);
|
||||
return(false);
|
||||
}
|
||||
|
||||
cMyVideosSet::cMyVideosSet(qint32 idSet, const QString& strSet, const QString& strOverview) :
|
||||
m_values(idSet, strSet, strOverview)
|
||||
{
|
||||
m_oValues = m_values;
|
||||
}
|
||||
|
||||
qint32 cMyVideosSet::idSet()
|
||||
{
|
||||
return(m_values.m_idSet);
|
||||
}
|
||||
|
||||
QString cMyVideosSet::strSet()
|
||||
{
|
||||
return(m_values.m_strSet);
|
||||
}
|
||||
|
||||
QString cMyVideosSet::strOverview()
|
||||
{
|
||||
return(m_values.m_strOverview);
|
||||
}
|
||||
|
||||
bool cMyVideosSet::isNew()
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cMyVideosSet::isChanged()
|
||||
{
|
||||
if(m_values != m_oValues)
|
||||
return(true);
|
||||
return(false);
|
||||
}
|
||||
|
||||
cMyVideosSetList::cMyVideosSetList()
|
||||
{
|
||||
}
|
||||
|
||||
cMyVideosSet* cMyVideosSetList::add(qint32 idSet, const QString& strSet, const QString& strOverview)
|
||||
{
|
||||
cMyVideosSet* lpNew = new cMyVideosSet(idSet, strSet, strOverview);
|
||||
append(lpNew);
|
||||
return(lpNew);
|
||||
}
|
||||
|
||||
cMyVideosSet* cMyVideosSetList::get(qint32 idSet)
|
||||
{
|
||||
for(int z = 0;z < count();z++)
|
||||
{
|
||||
if(at(z)->idSet() == idSet)
|
||||
return(at(z));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
cMyVideosStreamDetailsVideoValues::cMyVideosStreamDetailsVideoValues() :
|
||||
m_szVideoCodec("UNSET"),
|
||||
m_dAspectRatio(-1),
|
||||
@@ -921,9 +1013,9 @@ cMyVideosValues::cMyVideosValues() :
|
||||
m_szMovieTagline("UNSET"), m_iRatingVotes(-1), m_dRating(-1), m_szWriters("UNSET"), m_iYearReleased(-1),
|
||||
m_szThumbnails("UNSET"), m_szIMDBID("UNSET"), m_szTitleFormattedForSorting("UNSET"), m_iRuntime(-1),
|
||||
m_szMPAARating("UNSET"), m_iIMDBTop250Ranking(-1), m_szGenre("UNSET"), m_szDirector("UNSET"), m_szOriginalMovieTitle("UNSET"),
|
||||
m_szStudio("UNSET"), m_szTrailerURL("UNSET"), m_szFanartURLs("UNSET"), m_szCountry("UNSET"), m_szFilePath("UNSET"), m_idPath(-1), m_idSet(-1),
|
||||
m_iUserrating(-1), m_szSet("UNSET"), m_szSetOverview("UNSET"), m_szFileName("UNSET"), m_szPathURL("UNSET"), m_iPlayCount(-1),
|
||||
m_dResumeTimeInSeconds(-1), m_dTotalTimeInSeconds(-1), m_iVideoDuration(-1)
|
||||
m_szStudio("UNSET"), m_szTrailerURL("UNSET"), m_szFanartURLs("UNSET"), m_szCountry("UNSET"), m_szFilePath("UNSET"), m_idPath(-1),
|
||||
m_iUserrating(-1), m_szFileName("UNSET"), m_szPathURL("UNSET"), m_iPlayCount(-1),
|
||||
m_dResumeTimeInSeconds(-1), m_dTotalTimeInSeconds(-1), m_lpSet(0), m_iVideoDuration(-1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -932,16 +1024,16 @@ cMyVideosValues::cMyVideosValues(qint32 idMovie, qint32 idFile, const QString& s
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds) :
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet) :
|
||||
m_idMovie(idMovie), m_idFile(idFile), m_szLocalMovieTitle(szLocalMovieTitle), m_szMoviePlot(szMoviePlot), m_szMoviePlotOutline(szMoviePlotOutline),
|
||||
m_szMovieTagline(szMovieTagline), m_iRatingVotes(iRatingVotes), m_dRating(dRating), m_szWriters(szWriters), m_iYearReleased(iYearReleased),
|
||||
m_szThumbnails(szThumbnails), m_szIMDBID(szIMDBID), m_szTitleFormattedForSorting(szTitleFormattedForSorting), m_iRuntime(iRuntime),
|
||||
m_szMPAARating(szMPAARating), m_iIMDBTop250Ranking(iIMDBTop250Ranking), m_szGenre(szGenre), m_szDirector(szDirector), m_szOriginalMovieTitle(szOriginalMovieTitle),
|
||||
m_szStudio(szStudio), m_szTrailerURL(szTrailerURL), m_szFanartURLs(szFanartURLs), m_szCountry(szCountry), m_szFilePath(szFilePath), m_idPath(idPath), m_idSet(idSet),
|
||||
m_iUserrating(iUserrating), m_szSet(szSet), m_szSetOverview(szSetOverview), m_szFileName(szFileName), m_szPathURL(szPathURL), m_iPlayCount(iPlayCount),
|
||||
m_lastPlayed(lastPlayed), m_dateAdded(dateAdded), m_dResumeTimeInSeconds(dResumeTimeInSeconds), m_dTotalTimeInSeconds(dTotalTimeInSeconds), m_iVideoDuration(-1)
|
||||
m_szStudio(szStudio), m_szTrailerURL(szTrailerURL), m_szFanartURLs(szFanartURLs), m_szCountry(szCountry), m_szFilePath(szFilePath), m_idPath(idPath),
|
||||
m_iUserrating(iUserrating), m_szFileName(szFileName), m_szPathURL(szPathURL), m_iPlayCount(iPlayCount),
|
||||
m_lastPlayed(lastPlayed), m_dateAdded(dateAdded), m_dResumeTimeInSeconds(dResumeTimeInSeconds), m_dTotalTimeInSeconds(dTotalTimeInSeconds), m_lpSet(lpSet), m_iVideoDuration(-1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -950,9 +1042,9 @@ void cMyVideosValues::set(qint32 idMovie, qint32 idFile, const QString& szLocalM
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds)
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet)
|
||||
{
|
||||
m_idMovie = idMovie;
|
||||
m_idFile = idFile;
|
||||
@@ -979,10 +1071,7 @@ void cMyVideosValues::set(qint32 idMovie, qint32 idFile, const QString& szLocalM
|
||||
m_szCountry = szCountry;
|
||||
m_szFilePath = szFilePath;
|
||||
m_idPath = idPath;
|
||||
m_idSet = idSet;
|
||||
m_iUserrating = iUserrating;
|
||||
m_szSet = szSet;
|
||||
m_szSetOverview = szSetOverview;
|
||||
m_szFileName = szFileName;
|
||||
m_szPathURL = szPathURL;
|
||||
m_iPlayCount = iPlayCount;
|
||||
@@ -990,6 +1079,7 @@ void cMyVideosValues::set(qint32 idMovie, qint32 idFile, const QString& szLocalM
|
||||
m_dateAdded = dateAdded;
|
||||
m_dResumeTimeInSeconds = dResumeTimeInSeconds;
|
||||
m_dTotalTimeInSeconds = dTotalTimeInSeconds;
|
||||
m_lpSet = lpSet;
|
||||
}
|
||||
|
||||
inline bool cMyVideosValues::operator==(const cMyVideosValues b) const
|
||||
@@ -1019,10 +1109,7 @@ inline bool cMyVideosValues::operator==(const cMyVideosValues b) const
|
||||
if(m_szCountry != b.m_szCountry) return(false);
|
||||
if(m_szFilePath != b.m_szFilePath) return(false);
|
||||
if(m_idPath != b.m_idPath) return(false);
|
||||
if(m_idSet != b.m_idSet) return(false);
|
||||
if(m_iUserrating != b.m_iUserrating) return(false);
|
||||
if(m_szSet != b.m_szSet) return(false);
|
||||
if(m_szSetOverview != b.m_szSetOverview) return(false);
|
||||
if(m_szFileName != b.m_szFileName) return(false);
|
||||
if(m_szPathURL != b.m_szPathURL) return(false);
|
||||
if(m_iPlayCount != b.m_iPlayCount) return(false);
|
||||
@@ -1031,6 +1118,7 @@ inline bool cMyVideosValues::operator==(const cMyVideosValues b) const
|
||||
if(m_dResumeTimeInSeconds != b.m_dResumeTimeInSeconds) return(false);
|
||||
if(m_dTotalTimeInSeconds != b.m_dTotalTimeInSeconds) return(false);
|
||||
if(m_iVideoDuration != b.m_iVideoDuration) return(false);
|
||||
if(m_lpSet != b.m_lpSet) return(false);
|
||||
return(true);
|
||||
}
|
||||
|
||||
@@ -1061,10 +1149,7 @@ inline bool cMyVideosValues::operator!=(const cMyVideosValues b) const
|
||||
|| m_szCountry != b.m_szCountry
|
||||
|| m_szFilePath != b.m_szFilePath
|
||||
|| m_idPath != b.m_idPath
|
||||
|| m_idSet != b.m_idSet
|
||||
|| m_iUserrating != b.m_iUserrating
|
||||
|| m_szSet != b.m_szSet
|
||||
|| m_szSetOverview != b.m_szSetOverview
|
||||
|| m_szFileName != b.m_szFileName
|
||||
|| m_szPathURL != b.m_szPathURL
|
||||
|| m_iPlayCount != b.m_iPlayCount
|
||||
@@ -1072,7 +1157,8 @@ inline bool cMyVideosValues::operator!=(const cMyVideosValues b) const
|
||||
|| m_dateAdded != b.m_dateAdded
|
||||
|| m_dResumeTimeInSeconds != b.m_dResumeTimeInSeconds
|
||||
|| m_dTotalTimeInSeconds != b.m_dTotalTimeInSeconds
|
||||
|| m_iVideoDuration != b.m_iVideoDuration)
|
||||
|| m_iVideoDuration != b.m_iVideoDuration
|
||||
|| m_lpSet != b.m_lpSet)
|
||||
return(true);
|
||||
return(false);
|
||||
}
|
||||
@@ -1082,13 +1168,13 @@ cMyVideos::cMyVideos(qint32 idMovie, qint32 idFile, const QString& szLocalMovieT
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds) :
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet) :
|
||||
m_values(idMovie, idFile, szLocalMovieTitle, szMoviePlot, szMoviePlotOutline, szMovieTagline, iRatingVotes, dRating, szWriters, iYearReleased,
|
||||
szThumbnails, szIMDBID, szTitleFormattedForSorting, iRuntime, szMPAARating, iIMDBTop250Ranking, szGenre, szDirector, szOriginalMovieTitle,
|
||||
szStudio, szTrailerURL, szFanartURLs, szCountry, szFilePath, idPath, idSet, iUserrating, szSet, szSetOverview, szFileName, szPathURL, iPlayCount,
|
||||
lastPlayed, dateAdded, dResumeTimeInSeconds, dTotalTimeInSeconds)
|
||||
szStudio, szTrailerURL, szFanartURLs, szCountry, szFilePath, idPath, iUserrating, szFileName, szPathURL, iPlayCount,
|
||||
lastPlayed, dateAdded, dResumeTimeInSeconds, dTotalTimeInSeconds, lpSet)
|
||||
{
|
||||
m_oValues = m_values;
|
||||
}
|
||||
@@ -1102,15 +1188,15 @@ cMyVideos* cMyVideosList::add(qint32 idMovie, qint32 idFile, const QString& szLo
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds)
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet *lpSet)
|
||||
{
|
||||
cMyVideos* lpNew = new cMyVideos(idMovie, idFile, szLocalMovieTitle, szMoviePlot, szMoviePlotOutline, szMovieTagline, iRatingVotes, dRating,
|
||||
szWriters, iYearReleased, szThumbnails, szIMDBID, szTitleFormattedForSorting, iRuntime, szMPAARating,
|
||||
iIMDBTop250Ranking, szGenre, szDirector, szOriginalMovieTitle, szStudio, szTrailerURL, szFanartURLs,
|
||||
szCountry, szFilePath, idPath, idSet, iUserrating, szSet, szSetOverview, szFileName, szPathURL, iPlayCount,
|
||||
lastPlayed, dateAdded, dResumeTimeInSeconds, dTotalTimeInSeconds);
|
||||
szCountry, szFilePath, idPath, iUserrating, szFileName, szPathURL, iPlayCount,
|
||||
lastPlayed, dateAdded, dResumeTimeInSeconds, dTotalTimeInSeconds, lpSet);
|
||||
append(lpNew);
|
||||
return(lpNew);
|
||||
}
|
||||
@@ -1546,26 +1632,11 @@ QString cMyVideos::filePath()
|
||||
return(m_values.m_szFilePath);
|
||||
}
|
||||
|
||||
qint32 cMyVideos::idSet()
|
||||
{
|
||||
return(m_values.m_idSet);
|
||||
}
|
||||
|
||||
qint32 cMyVideos::userRating()
|
||||
{
|
||||
return(m_values.m_iUserrating);
|
||||
}
|
||||
|
||||
QString cMyVideos::set()
|
||||
{
|
||||
return(m_values.m_szSet);
|
||||
}
|
||||
|
||||
QString cMyVideos::setOverview()
|
||||
{
|
||||
return(m_values.m_szSetOverview);
|
||||
}
|
||||
|
||||
QString cMyVideos::fileName()
|
||||
{
|
||||
return(m_values.m_szFileName);
|
||||
@@ -1601,6 +1672,11 @@ qreal cMyVideos::totalTimeInSeconds()
|
||||
return(m_values.m_dTotalTimeInSeconds);
|
||||
}
|
||||
|
||||
cMyVideosSet* cMyVideos::set()
|
||||
{
|
||||
return(m_values.m_lpSet);
|
||||
}
|
||||
|
||||
bool cMyVideos::isNew()
|
||||
{
|
||||
if(m_values.m_idMovie == -1)
|
||||
|
||||
+55
-14
@@ -17,6 +17,49 @@ typedef struct tagSTRING2
|
||||
QString _2;
|
||||
} STRING2;
|
||||
|
||||
class cMyVideosSetValues
|
||||
{
|
||||
public:
|
||||
cMyVideosSetValues();
|
||||
cMyVideosSetValues(qint32 idSet, const QString& strSet, const QString& strOverview);
|
||||
|
||||
void set(qint32 idSet, const QString& strSet, const QString& strOverview);
|
||||
|
||||
inline bool operator==(const cMyVideosSetValues b) const;
|
||||
inline bool operator!=(const cMyVideosSetValues b) const;
|
||||
|
||||
qint32 m_idSet;
|
||||
QString m_strSet;
|
||||
QString m_strOverview;
|
||||
};
|
||||
|
||||
class cMyVideosSet
|
||||
{
|
||||
public:
|
||||
cMyVideosSet(qint32 idSet, const QString& strSet, const QString& strOverview);
|
||||
|
||||
qint32 idSet();
|
||||
QString strSet();
|
||||
QString strOverview();
|
||||
|
||||
bool isNew();
|
||||
bool isChanged();
|
||||
|
||||
cMyVideosSetValues m_values;
|
||||
cMyVideosSetValues m_oValues;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(cMyVideosSet*)
|
||||
|
||||
class cMyVideosSetList : public QList<cMyVideosSet*>
|
||||
{
|
||||
public:
|
||||
cMyVideosSetList();
|
||||
cMyVideosSet* add(qint32 idSet, const QString& strSet, const QString& strOverview);
|
||||
cMyVideosSet* get(qint32 idSet);
|
||||
private:
|
||||
};
|
||||
|
||||
class cMyVideosStreamDetailsVideoValues
|
||||
{
|
||||
public:
|
||||
@@ -544,18 +587,18 @@ public:
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet);
|
||||
|
||||
void set(qint32 idMovie, qint32 idFile, const QString& szLocalMovieTitle, const QString& szMoviePlot, const QString& szMoviePlotOutline,
|
||||
const QString& szMovieTagline, qint32 iRatingVotes, qreal dRating, const QString& szWriters, qint32 iYearReleased,
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet);
|
||||
|
||||
inline bool operator==(const cMyVideosValues b) const;
|
||||
inline bool operator!=(const cMyVideosValues b) const;
|
||||
@@ -585,10 +628,7 @@ public:
|
||||
QString m_szCountry; // c21
|
||||
QString m_szFilePath; // c22
|
||||
qint32 m_idPath; // c23
|
||||
qint32 m_idSet; // idSet
|
||||
qint32 m_iUserrating; // userrating
|
||||
QString m_szSet; // strSet
|
||||
QString m_szSetOverview; // Set overview
|
||||
QString m_szFileName; // strFileName
|
||||
QString m_szPathURL; // strPath
|
||||
qint32 m_iPlayCount; // playCount
|
||||
@@ -596,6 +636,8 @@ public:
|
||||
QDateTime m_dateAdded; // dateAdded
|
||||
qreal m_dResumeTimeInSeconds; // resumeTimeInSeconds
|
||||
qreal m_dTotalTimeInSeconds; // totalTimeInSeconds
|
||||
cMyVideosSet* m_lpSet;
|
||||
|
||||
cMyVideosActorLinkList m_actors;
|
||||
cMyVideosDirectorLinkList m_directors;
|
||||
cMyVideosWriterLinkList m_writers;
|
||||
@@ -616,9 +658,9 @@ public:
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet);
|
||||
|
||||
void loadActors(QSqlDatabase& m_db, cMyVideosActorList videosActorList);
|
||||
void loadDirectors(QSqlDatabase& m_db, cMyVideosActorList videosActorList);
|
||||
@@ -664,10 +706,7 @@ public:
|
||||
QList<STRING2> fanartURL();
|
||||
QStringList country();
|
||||
QString filePath();
|
||||
qint32 idSet();
|
||||
qint32 userRating();
|
||||
QString set();
|
||||
QString setOverview();
|
||||
QString fileName();
|
||||
QString pathURL();
|
||||
qint32 playCount();
|
||||
@@ -675,6 +714,8 @@ public:
|
||||
QDateTime dateAdded();
|
||||
qreal resumeTimeInSeconds();
|
||||
qreal totalTimeInSeconds();
|
||||
QString strSet();
|
||||
cMyVideosSet* set();
|
||||
|
||||
bool isNew();
|
||||
bool isChanged();
|
||||
@@ -694,9 +735,9 @@ public:
|
||||
const QString& szThumbnails, const QString& szIMDBID, const QString& szTitleFormattedForSorting, qint32 iRuntime,
|
||||
const QString& szMPAARating, qint32 iIMDBTop250Ranking, const QString& szGenre, const QString& szDirector,
|
||||
const QString& szOriginalMovieTitle, const QString& szStudio, const QString& szTrailerURL, const QString& szFanartURLs,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 idSet, qint32 iUserrating, const QString& szSet, const QString& szSetOverview,
|
||||
const QString& szCountry, const QString& szFilePath, qint32 idPath, qint32 iUserrating,
|
||||
const QString& szFileName, const QString& szPathURL, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
|
||||
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds, cMyVideosSet* lpSet);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
+262
-74
@@ -143,9 +143,12 @@ void cVideoWidget::showList()
|
||||
|
||||
m_lpStudioModel->clear();
|
||||
m_lpVideoLibrary->fillStudiosList(m_lpStudioModel);
|
||||
|
||||
ui->m_lpSet->clear();
|
||||
m_lpVideoLibrary->fillSetsList(ui->m_lpSet);
|
||||
}
|
||||
|
||||
void cVideoWidget::videoSelectionChanged(const QItemSelection& /*newSelection*/, const QItemSelection& /*oldSelection*/)
|
||||
void cVideoWidget::displaySet(cMyVideosSet* lpSet)
|
||||
{
|
||||
QPixmap thumb;
|
||||
QPixmap fanart;
|
||||
@@ -156,93 +159,64 @@ void cVideoWidget::videoSelectionChanged(const QItemSelection& /*newSelection*/,
|
||||
QString szPoster;
|
||||
QString szBanner;
|
||||
|
||||
const QModelIndex index = ui->m_lpVideoView->selectionModel()->currentIndex();
|
||||
cMyVideos* lpVideos = index.data(Qt::UserRole).value<cMyVideos*>();
|
||||
ui->m_lpSet->setVisible(false);
|
||||
ui->m_lpSetText->setVisible(true);
|
||||
|
||||
m_lpCastModel->clear();
|
||||
m_lpDirectorModel->clear();
|
||||
m_lpWriterModel->clear();
|
||||
|
||||
// Basic Tab
|
||||
ui->m_lpTitle->setText(lpVideos->localMovieTitle());
|
||||
ui->m_lpOriginalTitle->setText(lpVideos->originalMovieTitle());
|
||||
ui->m_lpTitleForSorting->setText(lpVideos->titleFormattedForSorting());
|
||||
ui->m_lpSet->setText(lpVideos->set());
|
||||
ui->m_lpTagline->setText(lpVideos->movieTagline());
|
||||
ui->m_lpRating->setValue(lpVideos->rating());
|
||||
ui->m_lpRatingVotes->setValue(lpVideos->ratingVotes());
|
||||
ui->m_lpTop250->setValue(lpVideos->imdbTop250Ranking());
|
||||
ui->m_lpReleased->setValue(lpVideos->yearReleased());
|
||||
ui->m_lpRuntime->setValue(lpVideos->runtime());
|
||||
ui->m_lpCertification->setText(lpVideos->mpaaRating());
|
||||
ui->m_lpTrailer->setText(lpVideos->trailerURL());
|
||||
ui->m_lpPlayCount->setValue(lpVideos->playCount());
|
||||
ui->m_lpLastPlayed->setDateTime(lpVideos->lastPlayed());
|
||||
ui->m_lpPlot->setText(lpVideos->moviePlot());
|
||||
ui->m_lpOutline->setText(lpVideos->moviePlotOutline());
|
||||
m_lpVideoStreamModel->clear();
|
||||
m_lpAudioStreamModel->clear();
|
||||
m_lpSubtitleStreamModel->clear();
|
||||
|
||||
// Extended Tab
|
||||
m_lpVideoLibrary->fillCountriesList(m_lpCountryModel, lpVideos);
|
||||
m_lpVideoLibrary->fillGenresList(m_lpGenreModel, lpVideos);
|
||||
m_lpVideoLibrary->fillStudiosList(m_lpStudioModel, lpVideos);
|
||||
|
||||
// Crew Tab
|
||||
ui->m_lpCastView->setEnabled(false);
|
||||
ui->m_lpDirectorView->setEnabled(false);
|
||||
ui->m_lpWriterView->setEnabled(false);
|
||||
ui->m_lpCastPicture->clear();
|
||||
ui->m_lpDirectorPicture->clear();
|
||||
ui->m_lpWriterPicture->clear();
|
||||
ui->m_lpCastPicture->setEnabled(false);
|
||||
ui->m_lpDirectorPicture->setEnabled(false);
|
||||
ui->m_lpWriterPicture->setEnabled(false);
|
||||
|
||||
m_lpVideoLibrary->fillActorList(m_lpCastModel, lpVideos);
|
||||
ui->m_lpCastView->resizeColumnToContents(0);
|
||||
ui->m_lpCastView->resizeColumnToContents(1);
|
||||
ui->m_lpGenresGroup->setEnabled(false);
|
||||
ui->m_lpCountriesGroup->setEnabled(false);
|
||||
ui->m_lpStudiosGroup->setEnabled(false);
|
||||
ui->m_lpVideoStreamBox->setEnabled(false);
|
||||
ui->m_lpAudioStreamBox->setEnabled(false);
|
||||
ui->m_lpSubtitleStreamBox->setEnabled(false);
|
||||
|
||||
m_lpVideoLibrary->fillDirectorsList(m_lpDirectorModel, lpVideos);
|
||||
// Basic Tab
|
||||
setValue(ui->m_lpTitle, QString(""), false);
|
||||
setValue(ui->m_lpOriginalTitle, QString(""), false);
|
||||
setValue(ui->m_lpTitleForSorting, QString(""), false);
|
||||
ui->m_lpSet->setCurrentIndex(ui->m_lpSet->findText(lpSet->strSet()));
|
||||
ui->m_lpSetText->setText(lpSet->strSet());
|
||||
setValue(ui->m_lpTagline, QString(""), false);
|
||||
setValue(ui->m_lpRating, 0, false);
|
||||
setValue(ui->m_lpRatingVotes, 0, false);
|
||||
setValue(ui->m_lpTop250, 0, false);
|
||||
setValue(ui->m_lpReleased, 0, false);
|
||||
setValue(ui->m_lpRuntime, 0, false);
|
||||
setValue(ui->m_lpCertification, 0, false);
|
||||
setValue(ui->m_lpTrailer, QString(""), false);
|
||||
setValue(ui->m_lpPlayCount, 0, false);
|
||||
setValue(ui->m_lpLastPlayed, QDateTime(), false);
|
||||
setValue(ui->m_lpPlot, QString(""), false);
|
||||
setValue(ui->m_lpOutline, QString(""), false);
|
||||
|
||||
m_lpVideoLibrary->fillWritersList(m_lpWriterModel, lpVideos);
|
||||
setValue(ui->m_lpVideoDuration, QTime::fromMSecsSinceStartOfDay(0), false);
|
||||
|
||||
// Stream Tab
|
||||
m_lpVideoLibrary->fillVideoStreamList(m_lpVideoStreamModel, lpVideos);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(0);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(1);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(2);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(3);
|
||||
thumb = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_thumb, lpSet->idSet());
|
||||
fanart = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_fanart, lpSet->idSet());
|
||||
poster = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_poster, lpSet->idSet());
|
||||
banner = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_banner, lpSet->idSet());
|
||||
|
||||
m_lpVideoLibrary->fillAudioStreamList(m_lpAudioStreamModel, lpVideos);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(0);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(1);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(2);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(3);
|
||||
|
||||
m_lpVideoLibrary->fillSubtitleStreamList(m_lpSubtitleStreamModel, lpVideos);
|
||||
|
||||
if(lpVideos->m_values.m_iVideoDuration != -1)
|
||||
ui->m_lpVideoDuration->setTime(QTime::fromMSecsSinceStartOfDay(lpVideos->m_values.m_iVideoDuration*1000));
|
||||
else
|
||||
ui->m_lpVideoDuration->setTime(QTime::fromMSecsSinceStartOfDay(0));
|
||||
|
||||
if(m_lpVideoModel->itemFromIndex(index)->hasChildren())
|
||||
{
|
||||
thumb = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_thumb, lpVideos->idSet());
|
||||
fanart = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_fanart, lpVideos->idSet());
|
||||
poster = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_poster, lpVideos->idSet());
|
||||
banner = m_lpImageList->get(cImage::MEDIATYPE_set, cImage::TYPE_banner, lpVideos->idSet());
|
||||
|
||||
szThumb = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_thumb, lpVideos->idSet());
|
||||
szFanart = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_fanart, lpVideos->idSet());
|
||||
szPoster = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_poster, lpVideos->idSet());
|
||||
szBanner = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_banner, lpVideos->idSet());
|
||||
}
|
||||
else
|
||||
{
|
||||
thumb = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_thumb, lpVideos->idMovie());
|
||||
fanart = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_fanart, lpVideos->idMovie());
|
||||
poster = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_poster, lpVideos->idMovie());
|
||||
banner = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_banner, lpVideos->idMovie());
|
||||
|
||||
szThumb = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_thumb, lpVideos->idMovie());
|
||||
szFanart = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_fanart, lpVideos->idMovie());
|
||||
szPoster = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_poster, lpVideos->idMovie());
|
||||
szBanner = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_banner, lpVideos->idMovie());
|
||||
}
|
||||
szThumb = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_thumb, lpSet->idSet());
|
||||
szFanart = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_fanart, lpSet->idSet());
|
||||
szPoster = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_poster, lpSet->idSet());
|
||||
szBanner = m_lpImageList->fileName(cImage::MEDIATYPE_set, cImage::TYPE_banner, lpSet->idSet());
|
||||
|
||||
if(thumb.width())
|
||||
{
|
||||
@@ -297,6 +271,220 @@ void cVideoWidget::videoSelectionChanged(const QItemSelection& /*newSelection*/,
|
||||
}
|
||||
}
|
||||
|
||||
void cVideoWidget::displayVideo(cMyVideos* lpVideos)
|
||||
{
|
||||
QPixmap thumb;
|
||||
QPixmap fanart;
|
||||
QPixmap poster;
|
||||
QPixmap banner;
|
||||
QString szThumb;
|
||||
QString szFanart;
|
||||
QString szPoster;
|
||||
QString szBanner;
|
||||
|
||||
ui->m_lpSet->setVisible(true);
|
||||
ui->m_lpSetText->setVisible(false);
|
||||
|
||||
m_lpCastModel->clear();
|
||||
m_lpDirectorModel->clear();
|
||||
m_lpWriterModel->clear();
|
||||
|
||||
ui->m_lpCastView->setEnabled(true);
|
||||
ui->m_lpDirectorView->setEnabled(true);
|
||||
ui->m_lpWriterView->setEnabled(true);
|
||||
ui->m_lpCastPicture->clear();
|
||||
ui->m_lpDirectorPicture->clear();
|
||||
ui->m_lpWriterPicture->clear();
|
||||
ui->m_lpCastPicture->setEnabled(true);
|
||||
ui->m_lpDirectorPicture->setEnabled(true);
|
||||
ui->m_lpWriterPicture->setEnabled(true);
|
||||
|
||||
ui->m_lpGenresGroup->setEnabled(true);
|
||||
ui->m_lpCountriesGroup->setEnabled(true);
|
||||
ui->m_lpStudiosGroup->setEnabled(true);
|
||||
ui->m_lpVideoStreamBox->setEnabled(true);
|
||||
ui->m_lpAudioStreamBox->setEnabled(true);
|
||||
ui->m_lpSubtitleStreamBox->setEnabled(true);
|
||||
|
||||
// Basic Tab
|
||||
setValue(ui->m_lpTitle, lpVideos->localMovieTitle(), true);
|
||||
setValue(ui->m_lpOriginalTitle, lpVideos->originalMovieTitle(), true);
|
||||
setValue(ui->m_lpTitleForSorting, lpVideos->titleFormattedForSorting(), true);
|
||||
if(lpVideos->set())
|
||||
{
|
||||
ui->m_lpSet->setCurrentIndex(ui->m_lpSet->findText(lpVideos->set()->strSet()));
|
||||
ui->m_lpSetText->setText(lpVideos->set()->strSet());
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpSet->setCurrentIndex(0);
|
||||
ui->m_lpSetText->setText("");
|
||||
}
|
||||
setValue(ui->m_lpTagline, lpVideos->movieTagline(), true);
|
||||
setValue(ui->m_lpRating, lpVideos->rating(), true);
|
||||
setValue(ui->m_lpRatingVotes, lpVideos->ratingVotes(), true);
|
||||
setValue(ui->m_lpTop250, lpVideos->imdbTop250Ranking(), true);
|
||||
setValue(ui->m_lpReleased, lpVideos->yearReleased(), true);
|
||||
setValue(ui->m_lpRuntime, lpVideos->runtime(), true);
|
||||
setValue(ui->m_lpCertification, lpVideos->mpaaRating(), true);
|
||||
setValue(ui->m_lpTrailer, lpVideos->trailerURL(), true);
|
||||
setValue(ui->m_lpPlayCount, lpVideos->playCount(), true);
|
||||
setValue(ui->m_lpLastPlayed, lpVideos->lastPlayed(), true);
|
||||
setValue(ui->m_lpPlot, lpVideos->moviePlot(), true);
|
||||
setValue(ui->m_lpOutline, lpVideos->moviePlotOutline(), true);
|
||||
|
||||
// Extended Tab
|
||||
m_lpVideoLibrary->fillCountriesList(m_lpCountryModel, lpVideos);
|
||||
m_lpVideoLibrary->fillGenresList(m_lpGenreModel, lpVideos);
|
||||
m_lpVideoLibrary->fillStudiosList(m_lpStudioModel, lpVideos);
|
||||
|
||||
// Crew Tab
|
||||
ui->m_lpCastPicture->clear();
|
||||
ui->m_lpDirectorPicture->clear();
|
||||
ui->m_lpWriterPicture->clear();
|
||||
|
||||
m_lpVideoLibrary->fillActorList(m_lpCastModel, lpVideos);
|
||||
ui->m_lpCastView->resizeColumnToContents(0);
|
||||
ui->m_lpCastView->resizeColumnToContents(1);
|
||||
|
||||
m_lpVideoLibrary->fillDirectorsList(m_lpDirectorModel, lpVideos);
|
||||
|
||||
m_lpVideoLibrary->fillWritersList(m_lpWriterModel, lpVideos);
|
||||
|
||||
// Stream Tab
|
||||
m_lpVideoLibrary->fillVideoStreamList(m_lpVideoStreamModel, lpVideos);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(0);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(1);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(2);
|
||||
ui->m_lpVideoStreamView->resizeColumnToContents(3);
|
||||
|
||||
m_lpVideoLibrary->fillAudioStreamList(m_lpAudioStreamModel, lpVideos);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(0);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(1);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(2);
|
||||
ui->m_lpAudioStreamView->resizeColumnToContents(3);
|
||||
|
||||
m_lpVideoLibrary->fillSubtitleStreamList(m_lpSubtitleStreamModel, lpVideos);
|
||||
|
||||
if(lpVideos->m_values.m_iVideoDuration != -1)
|
||||
setValue(ui->m_lpVideoDuration, QTime::fromMSecsSinceStartOfDay(lpVideos->m_values.m_iVideoDuration*1000), true);
|
||||
else
|
||||
setValue(ui->m_lpVideoDuration, QTime::fromMSecsSinceStartOfDay(0), true);
|
||||
|
||||
thumb = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_thumb, lpVideos->idMovie());
|
||||
fanart = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_fanart, lpVideos->idMovie());
|
||||
poster = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_poster, lpVideos->idMovie());
|
||||
banner = m_lpImageList->get(cImage::MEDIATYPE_movie, cImage::TYPE_banner, lpVideos->idMovie());
|
||||
|
||||
szThumb = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_thumb, lpVideos->idMovie());
|
||||
szFanart = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_fanart, lpVideos->idMovie());
|
||||
szPoster = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_poster, lpVideos->idMovie());
|
||||
szBanner = m_lpImageList->fileName(cImage::MEDIATYPE_movie, cImage::TYPE_banner, lpVideos->idMovie());
|
||||
|
||||
if(thumb.width())
|
||||
{
|
||||
ui->m_lpThumb->setPixmap(thumb.scaled(THUMB_WIDTH, THUMB_HEIGHT, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
ui->m_lpThumbBox->setTitle(QString(tr("Thumb (%1 x %2)")).arg(thumb.width()).arg(thumb.height()));
|
||||
ui->m_lpThumb->setToolTip(szThumb);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpThumb->clear();
|
||||
ui->m_lpThumbBox->setTitle("Thumb");
|
||||
ui->m_lpThumb->setToolTip("");
|
||||
}
|
||||
|
||||
if(fanart.width())
|
||||
{
|
||||
ui->m_lpFanart->setPixmap(fanart.scaled(FANART_WIDTH, FANART_HEIGHT, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
ui->m_lpFanartBox->setTitle(QString(tr("Fanart (%1 x %2)")).arg(fanart.width()).arg(fanart.height()));
|
||||
ui->m_lpFanart->setToolTip(szFanart);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpFanart->clear();
|
||||
ui->m_lpFanartBox->setTitle(tr("Fanart"));
|
||||
ui->m_lpFanart->setToolTip("");
|
||||
}
|
||||
|
||||
if(poster.width())
|
||||
{
|
||||
ui->m_lpPoster->setPixmap(poster.scaled(POSTER_WIDTH, POSTER_HEIGHT, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
ui->m_lpPosterBox->setTitle(QString(tr("Poster (%1 x %2)")).arg(poster.width()).arg(poster.height()));
|
||||
ui->m_lpPoster->setToolTip(szPoster);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpPoster->clear();
|
||||
ui->m_lpPosterBox->setTitle(tr("Poster"));
|
||||
ui->m_lpPoster->setToolTip("");
|
||||
}
|
||||
|
||||
if(banner.width())
|
||||
{
|
||||
ui->m_lpBanner->setPixmap(banner.scaled(BANNER_WIDTH, BANNER_HEIGHT, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||
ui->m_lpBannerBox->setTitle(QString(tr("Banner (%1 x %2)")).arg(banner.width()).arg(banner.height()));
|
||||
ui->m_lpBanner->setToolTip(szBanner);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->m_lpBanner->clear();
|
||||
ui->m_lpBannerBox->setTitle(tr("Banner"));
|
||||
ui->m_lpBanner->setToolTip("");
|
||||
}
|
||||
}
|
||||
void cVideoWidget::setValue(QLineEdit* lpLineEdit, QString szText, bool bEnable)
|
||||
{
|
||||
lpLineEdit->setText(szText);
|
||||
lpLineEdit->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::setValue(QTextEdit* lpTextEdit, QString szText, bool bEnable)
|
||||
{
|
||||
lpTextEdit->setText(szText);
|
||||
lpTextEdit->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::setValue(QDoubleSpinBox* lpSpinBox, qreal dValue, bool bEnable)
|
||||
{
|
||||
lpSpinBox->setValue(dValue);
|
||||
lpSpinBox->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::setValue(QSpinBox* lpSpinBox, qint32 iValue, bool bEnable)
|
||||
{
|
||||
lpSpinBox->setValue(iValue);
|
||||
lpSpinBox->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::setValue(QDateTimeEdit* lpDateTimeEdit, QDateTime value, bool bEnable)
|
||||
{
|
||||
lpDateTimeEdit->setDateTime(value);
|
||||
lpDateTimeEdit->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::setValue(QTimeEdit* lpTimeEdit, QTime value, bool bEnable)
|
||||
{
|
||||
lpTimeEdit->setTime(value);
|
||||
lpTimeEdit->setEnabled(bEnable);
|
||||
}
|
||||
|
||||
void cVideoWidget::videoSelectionChanged(const QItemSelection& /*newSelection*/, const QItemSelection& /*oldSelection*/)
|
||||
{
|
||||
const QModelIndex index = ui->m_lpVideoView->selectionModel()->currentIndex();
|
||||
|
||||
if(m_lpVideoModel->itemFromIndex(index)->hasChildren())
|
||||
{
|
||||
cMyVideosSet* lpSet = index.data(Qt::UserRole).value<cMyVideosSet*>();
|
||||
displaySet(lpSet);
|
||||
}
|
||||
else
|
||||
{
|
||||
cMyVideos* lpVideos = index.data(Qt::UserRole).value<cMyVideos*>();
|
||||
displayVideo(lpVideos);
|
||||
}
|
||||
}
|
||||
|
||||
void cVideoWidget::castSelectionChanged(const QItemSelection& /*newSelection*/, const QItemSelection& /*oldSelection*/)
|
||||
{
|
||||
ui->m_lpCastPicture->clear();
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
#include <QItemSelection>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QSpinBox>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QTextEdit>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
@@ -43,6 +47,17 @@ private:
|
||||
|
||||
void initUI();
|
||||
void showList();
|
||||
|
||||
void displaySet(cMyVideosSet* lpSet);
|
||||
void displayVideo(cMyVideos* lpVideos);
|
||||
|
||||
void setValue(QLineEdit* lpLineEdit, QString szText, bool bEnable);
|
||||
void setValue(QTextEdit* lpLineEdit, QString szText, bool bEnable);
|
||||
void setValue(QDoubleSpinBox* lpSpinBox, qreal dValue, bool bEnable);
|
||||
void setValue(QSpinBox* lpSpinBox, qint32 iValue, bool bEnable);
|
||||
void setValue(QDateTimeEdit* lpDateTimeEdit, QDateTime value, bool bEnable);
|
||||
void setValue(QTimeEdit* lpTimeEdit, QTime value, bool bEnable);
|
||||
|
||||
private slots:
|
||||
void videoSelectionChanged(const QItemSelection& newSelection, const QItemSelection& oldSelection);
|
||||
void castSelectionChanged(const QItemSelection& newSelection, const QItemSelection& oldSelection);
|
||||
|
||||
+11
-4
@@ -71,7 +71,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="m_lpInformationTab">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="m_lpInformationTabBasic">
|
||||
<attribute name="title">
|
||||
@@ -113,9 +113,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="m_lpSet"/>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
@@ -371,6 +368,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QComboBox" name="m_lpSet"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpSetText"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
|
||||
Reference in New Issue
Block a user