This commit is contained in:
2017-04-12 19:34:08 +02:00
parent 7862af78e9
commit c8e082f7ad
12 changed files with 1747 additions and 44 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ bool cKodiLibrary::init()
m_lpKodiVideoLibrary = new cKodiVideoLibrary(m_szMyVideos);
if(m_lpKodiVideoLibrary->init() != -1)
iVideoCount = m_lpKodiVideoLibrary->load();
iVideoCount = m_lpKodiVideoLibrary->load(m_lpMainWindowStatusBar);
m_lpMainWindowStatusBar->showMessage("Initializing Textures ...");
+129 -4
View File
@@ -9,6 +9,8 @@
#include <QDebug>
#include <QTime>
#include <QDate>
#include <QDateTime>
cKodiVideoLibrary::cKodiVideoLibrary(const QString& szFileName) :
@@ -60,15 +62,27 @@ qint16 cKodiVideoLibrary::version()
return(m_iVersion);
}
qint32 cKodiVideoLibrary::load()
qint32 cKodiVideoLibrary::load(QStatusBar *lpStatusBar)
{
lpStatusBar->showMessage("Loading actors ...");
loadActors();
lpStatusBar->showMessage("Loading countries ...");
loadCountries();
lpStatusBar->showMessage("Loading genres ...");
loadGenres();
lpStatusBar->showMessage("Loading studios ...");
loadStudios();
lpStatusBar->showMessage("Loading sets ...");
loadSets();
return(loadVideos());
lpStatusBar->showMessage("Loading videos ...");
loadVideos();
lpStatusBar->showMessage("Loading tv shows ...");
loadTVShows();
lpStatusBar->showMessage("done.");
return(1);
}
qint32 cKodiVideoLibrary::loadActors()
@@ -150,7 +164,6 @@ qint32 cKodiVideoLibrary::loadVideos()
{
QSqlQuery query(m_db);
//query.exec("SELECT idMovie, idFile, c00, c01, c02, c03, c04, c05, c06, c07, c08, c09, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, idSet, userrating, strSet, strSetOverview, strFileName, strPath, playCount, lastPlayed, dateAdded, resumeTimeInSeconds, totalTimeInSeconds FROM movie_view ORDER BY c00;");
query.exec("SELECT idMovie,"
" idFile,"
" c00,"
@@ -196,7 +209,7 @@ qint32 cKodiVideoLibrary::loadVideos()
" FROM movie_view"
" )"
" ORDER BY sortText,"
" c07;");
" CAST(c07 AS INTEGER);");
while(query.next())
{
m_videosList.add(
@@ -238,6 +251,83 @@ qint32 cKodiVideoLibrary::loadVideos()
return(m_videosList.count());
}
qint32 cKodiVideoLibrary::loadTVShows()
{
QSqlQuery query(m_db);
query.exec("SELECT idEpisode,"
" idFile,"
" c00,"
" c01,"
" c03,"
" c04,"
" c05,"
" c06,"
" c09,"
" c10,"
" c12,"
" c13,"
" c15,"
" c16,"
" c17,"
" c18,"
" idShow,"
" userrating,"
" idSeason,"
" strFileName,"
" strPath,"
" playCount,"
" lastPlayed,"
" dateAdded,"
" strTitle,"
" genre,"
" studio,"
" premiered,"
" mpaa,"
" resumeTimeInSeconds,"
" totalTimeInSeconds"
" FROM episode_view"
" ORDER BY strTitle,"
" CAST(c12 AS INTEGER),"
" CAST(c13 AS INTEGER);");
while(query.next())
{
m_tvShowsList.add(
query.value("idEpisode").toInt(),
query.value("idFile").toInt(),
query.value("c00").toString(),
query.value("c01").toString(),
query.value("c03").toDouble(),
query.value("c04").toString(),
QDateTime::fromString(query.value("c05").toString(), "yyyy-MM-dd"),
query.value("c06").toString(),
query.value("c09").toInt(),
query.value("c10").toString(),
query.value("c12").toInt(),
query.value("c13").toInt(),
query.value("c15").toInt(),
query.value("c16").toInt(),
query.value("c17").toInt(),
query.value("c18").toString(),
query.value("idShow").toInt(),
query.value("userrating").toInt(),
query.value("idSeason").toInt(),
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("strTitle").toString(),
query.value("genre").toString(),
query.value("studio").toString(),
QDateTime::fromString(query.value("premiered").toString(), "yyyy-MM-dd"),
query.value("mpaa").toString(),
query.value("resumeTimeInSeconds").toDouble(),
query.value("totalTimeInSeconds").toDouble());
}
return(m_tvShowsList.count());
}
bool cKodiVideoLibrary::art(const QString& szMediaType, const QString& szType, qint32 idMovie, qint32& artID, QString& szURL)
{
QSqlQuery query(m_db);
@@ -286,6 +376,41 @@ void cKodiVideoLibrary::fillVideoList(QStandardItemModel* lpModel)
}
}
void cKodiVideoLibrary::fillTVShowList(QStandardItemModel* lpModel)
{
lpModel->clear();
QStandardItem* lpRoot = 0;
QStandardItem* lpSeason = 0;
QString szOldTVShow = "";
qint32 iOldSeason = -1;
for(int z = 0;z < m_tvShowsList.count();z++)
{
cMyTVShows* lpTVShows = m_tvShowsList.at(z);
if(szOldTVShow != lpTVShows->title())
{
iOldSeason = -1;
szOldTVShow = lpTVShows->title();
lpRoot = new QStandardItem(QString("<b>%1</b><br><font color='blue'>%2</font>").arg(lpTVShows->title()).arg(lpTVShows->premierDate().date().year()));
lpModel->appendRow(lpRoot);
}
if(iOldSeason != lpTVShows->seasonNumber())
{
iOldSeason = lpTVShows->seasonNumber();
lpSeason = new QStandardItem(QString("Season %1").arg(lpTVShows->seasonNumber()));
lpRoot->appendRow(lpSeason);
}
QStandardItem* lpItem = new QStandardItem(QString("Episode %1: <b>%2</b><br><font color='blue'>%3</font>&nbsp;&nbsp;<i>%4</i>").arg(lpTVShows->episodeNumber()).arg(lpTVShows->episodeTitle()).arg(lpTVShows->firstAired().date().toString(Qt::SystemLocaleShortDate)).arg(lpTVShows->plotSummary()));
QVariant v = qVariantFromValue(lpTVShows);
lpItem->setData(v, Qt::UserRole);
lpSeason->appendRow(lpItem);
}
}
void cKodiVideoLibrary::fillCountriesList(QStandardItemModel *lpModel)
{
lpModel->clear();
+5 -2
View File
@@ -22,10 +22,11 @@ public:
qint16 init();
qint16 version();
qint32 load();
qint32 load(QStatusBar* lpStatusBar);
bool art(const QString& szMediaType, const QString& szType, qint32 idMovie, qint32& artID, QString& szURL);
void fillVideoList(QStandardItemModel* lpModel);
void fillTVShowList(QStandardItemModel* lpModel);
void fillCountriesList(QStandardItemModel* lpModel);
void fillGenresList(QStandardItemModel* lpModel);
void fillStudiosList(QStandardItemModel* lpModel);
@@ -39,7 +40,6 @@ public:
void fillVideoStreamList(QStandardItemModel* lpModel, cMyVideos* lpVideos);
void fillAudioStreamList(QStandardItemModel* lpModel, cMyVideos* lpVideos);
void fillSubtitleStreamList(QStandardItemModel* lpModel, cMyVideos* lpVideos);
private:
QSqlDatabase m_db;
QString m_szFileName;
@@ -53,11 +53,14 @@ private:
cMyVideosSetList m_videosSetList;
cMyVideosList m_videosList;
cMyTVShowsList m_tvShowsList;
qint32 loadActors();
qint32 loadCountries();
qint32 loadGenres();
qint32 loadStudios();
qint32 loadVideos();
qint32 loadTVShows();
qint32 loadSets();
};
+9 -8
View File
@@ -47,14 +47,14 @@ void cMainWindow::initUI()
m_lpMusicWidget = new cMusicWidget(this);
m_lpMusicVideoWidget = new cMusicVideosWidget(this);
// ui->m_lpMainTab->addTab(m_lpVideoWidget, QIcon(":/icons/Videos.ico"), "Movies");
// ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/TV Shows.ico"), "TV Shows");
// ui->m_lpMainTab->addTab(m_lpMusicWidget, QIcon(":/icons/Musics.ico"), "Music");
// ui->m_lpMainTab->addTab(m_lpMusicVideoWidget, QIcon(":/icons/Videos.ico"), "Music Videos");
ui->m_lpMainTab->addTab(m_lpVideoWidget, QIcon(":/icons/empty.ico"), tr("Movies"));
ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/empty.ico"), tr("TV Shows"));
ui->m_lpMainTab->addTab(m_lpMusicWidget, QIcon(":/icons/empty.ico"), tr("Music"));
ui->m_lpMainTab->addTab(m_lpMusicVideoWidget, QIcon(":/icons/empty.ico"), tr("Music Videos"));
ui->m_lpMainTab->addTab(m_lpVideoWidget, QIcon(":/icons/Videos.ico"), "Movies");
ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/TV Shows.ico"), "TV Shows");
ui->m_lpMainTab->addTab(m_lpMusicWidget, QIcon(":/icons/Musics.ico"), "Music");
ui->m_lpMainTab->addTab(m_lpMusicVideoWidget, QIcon(":/icons/Videos.ico"), "Music Videos");
// ui->m_lpMainTab->addTab(m_lpVideoWidget, QIcon(":/icons/empty.ico"), tr("Movies"));
// ui->m_lpMainTab->addTab(m_lpTVShowWidget, QIcon(":/icons/empty.ico"), tr("TV Shows"));
// ui->m_lpMainTab->addTab(m_lpMusicWidget, QIcon(":/icons/empty.ico"), tr("Music"));
// ui->m_lpMainTab->addTab(m_lpMusicVideoWidget, QIcon(":/icons/empty.ico"), tr("Music Videos"));
ui->m_lpMainTab->setCurrentIndex(0);
@@ -67,4 +67,5 @@ void cMainWindow::initDB()
// m_lpKodiLibrary = new cKodiLibrary(ui->m_lpStatusBar, "\\\\MEDIAPC\\system");
m_lpKodiLibrary->init();
m_lpVideoWidget->setLibrary(m_lpKodiLibrary->videoLibrary(), m_lpKodiLibrary->imageList());
m_lpTVShowWidget->setLibrary(m_lpKodiLibrary->videoLibrary(), m_lpKodiLibrary->imageList());
}
+376
View File
@@ -1688,3 +1688,379 @@ bool cMyVideos::isChanged()
{
return(m_values != m_oValues);
}
cMyTVShowsValues::cMyTVShowsValues() :
m_idEpisode(-1),
m_idFile(-1),
m_szEpisodeTitle("UNSET"),
m_szPlotSummary("UNSET"),
m_dRating(-1),
m_szWriters("UNSET"),
m_szThumbnailUrl("UNSET"),
m_iEpisodeLength(-1),
m_szDirector("UNSET"),
m_iSeasonNumber(-1),
m_iEpisodeNumber(-1),
m_iSeasonFormattedForSorting(-1),
m_iEpisodeFormattedForSorting(-1),
m_iBookmark(-1),
m_szFullPath("UNSET"),
m_idShow(-1),
m_iUserrating(-1),
m_idSeason(-1),
m_szFileName("UNSET"),
m_szPath("UNSET"),
m_iPlayCount(-1),
m_szTitle("UNSET"),
m_szGenre("UNSET"),
m_szStudio("UNSET"),
m_szMPAA("UNSET"),
m_dResumeTimeInSeconds(-1),
m_dTotalTimeInSeconds(-1)
{
}
cMyTVShowsValues::cMyTVShowsValues(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattetForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds) :
m_idEpisode(idEpisode),
m_idFile(idFile),
m_szEpisodeTitle(szEpisodeTitle),
m_szPlotSummary(szPlotSummary),
m_dRating(dRating),
m_szWriters(szWriters),
m_firstAired(firstAired),
m_szThumbnailUrl(szThumbnailUrl),
m_iEpisodeLength(iEpisodeLength),
m_szDirector(szDirector),
m_iSeasonNumber(iSeasonNumber),
m_iEpisodeNumber(iEpisodeNumber),
m_iSeasonFormattedForSorting(iSeasonFormattetForSorting),
m_iEpisodeFormattedForSorting(iEpisodeFormattedForSorting),
m_iBookmark(iBookmark),
m_szFullPath(szFullPath),
m_idShow(idShow),
m_iUserrating(iUserrating),
m_idSeason(idSeason),
m_szFileName(szFileName),
m_szPath(szPath),
m_iPlayCount(iPlayCount),
m_lastPlayed(lastPlayed),
m_dateAdded(dateAdded),
m_szTitle(szTitle),
m_szGenre(szGenre),
m_szStudio(szStudio),
m_premiereDate(premiereDate),
m_szMPAA(szMPAA),
m_dResumeTimeInSeconds(dResumeTimeInSeconds),
m_dTotalTimeInSeconds(dTotalTimeInSeconds)
{
}
void cMyTVShowsValues::set(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattedForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds)
{
m_idEpisode = idEpisode;
m_idFile = idFile;
m_szEpisodeTitle = szEpisodeTitle;
m_szPlotSummary = szPlotSummary;
m_dRating = dRating;
m_szWriters = szWriters;
m_firstAired = firstAired;
m_szThumbnailUrl = szThumbnailUrl;
m_iEpisodeLength = iEpisodeLength;
m_szDirector = szDirector;
m_iSeasonNumber = iSeasonNumber;
m_iEpisodeNumber = iEpisodeNumber;
m_iSeasonFormattedForSorting = iSeasonFormattedForSorting;
m_iEpisodeFormattedForSorting = iEpisodeFormattedForSorting;
m_iBookmark = iBookmark;
m_szFullPath = szFullPath;
m_idShow = idShow;
m_iUserrating = iUserrating;
m_idSeason = idSeason;
m_szFileName = szFileName;
m_szPath = szPath;
m_iPlayCount = iPlayCount;
m_lastPlayed = lastPlayed;
m_dateAdded = dateAdded;
m_szTitle = szTitle;
m_szGenre = szGenre;
m_szStudio = szStudio;
m_premiereDate = premiereDate;
m_szMPAA = szMPAA;
m_dResumeTimeInSeconds = dResumeTimeInSeconds;
m_dTotalTimeInSeconds = dTotalTimeInSeconds;
}
inline bool cMyTVShowsValues::operator==(const cMyTVShowsValues b) const
{
if(m_idEpisode != b.m_idEpisode) return(false);
if(m_idFile != b.m_idFile) return(false);
if(m_szEpisodeTitle != b.m_szEpisodeTitle) return(false);
if(m_szPlotSummary != b.m_szPlotSummary) return(false);
if(m_dRating != b.m_dRating) return(false);
if(m_szWriters != b.m_szWriters) return(false);
if(m_firstAired != b.m_firstAired) return(false);
if(m_szThumbnailUrl != b.m_szThumbnailUrl) return(false);
if(m_iEpisodeLength != b.m_iEpisodeLength) return(false);
if(m_szDirector != b.m_szDirector) return(false);
if(m_iSeasonNumber != b.m_iSeasonNumber) return(false);
if(m_iEpisodeNumber != b.m_iEpisodeNumber) return(false);
if(m_iSeasonFormattedForSorting != b.m_iSeasonFormattedForSorting) return(false);
if(m_iEpisodeFormattedForSorting != b.m_iEpisodeFormattedForSorting) return(false);
if(m_iBookmark != b.m_iBookmark) return(false);
if(m_szFullPath != b.m_szFullPath) return(false);
if(m_idShow != b.m_idShow) return(false);
if(m_iUserrating != b.m_iUserrating) return(false);
if(m_idSeason != b.m_idSeason) return(false);
if(m_szFileName != b.m_szFileName) return(false);
if(m_szPath != b.m_szPath) return(false);
if(m_iPlayCount != b.m_iPlayCount) return(false);
if(m_lastPlayed != b.m_lastPlayed) return(false);
if(m_dateAdded != b.m_dateAdded) return(false);
if(m_szTitle != b.m_szTitle) return(false);
if(m_szGenre != b.m_szGenre) return(false);
if(m_szStudio != b.m_szStudio) return(false);
if(m_premiereDate != b.m_premiereDate) return(false);
if(m_szMPAA != b.m_szMPAA) return(false);
if(m_dResumeTimeInSeconds != b.m_dResumeTimeInSeconds) return(false);
if(m_dTotalTimeInSeconds != b.m_dTotalTimeInSeconds) return(false);
return(true);
}
inline bool cMyTVShowsValues::operator!=(const cMyTVShowsValues b) const
{
if(m_idEpisode != b.m_idEpisode
|| m_idFile != b.m_idFile
|| m_szEpisodeTitle != b.m_szEpisodeTitle
|| m_szPlotSummary != b.m_szPlotSummary
|| m_dRating != b.m_dRating
|| m_szWriters != b.m_szWriters
|| m_firstAired != b.m_firstAired
|| m_szThumbnailUrl != b.m_szThumbnailUrl
|| m_iEpisodeLength != b.m_iEpisodeLength
|| m_szDirector != b.m_szDirector
|| m_iSeasonNumber != b.m_iSeasonNumber
|| m_iEpisodeNumber != b.m_iEpisodeNumber
|| m_iSeasonFormattedForSorting != b.m_iSeasonFormattedForSorting
|| m_iEpisodeFormattedForSorting != b.m_iEpisodeFormattedForSorting
|| m_iBookmark != b.m_iBookmark
|| m_szFullPath != b.m_szFullPath
|| m_idShow != b.m_idShow
|| m_iUserrating != b.m_iUserrating
|| m_idSeason != b.m_idSeason
|| m_szFileName != b.m_szFileName
|| m_szPath != b.m_szPath
|| m_iPlayCount != b.m_iPlayCount
|| m_lastPlayed != b.m_lastPlayed
|| m_dateAdded != b.m_dateAdded
|| m_szTitle != b.m_szTitle
|| m_szGenre != b.m_szGenre
|| m_szStudio != b.m_szStudio
|| m_premiereDate != b.m_premiereDate
|| m_szMPAA != b.m_szMPAA
|| m_dResumeTimeInSeconds != b.m_dResumeTimeInSeconds
|| m_dTotalTimeInSeconds != b.m_dTotalTimeInSeconds)
return(true);
return(false);
}
cMyTVShows::cMyTVShows(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattedForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds) :
m_values(idEpisode, idFile, szEpisodeTitle, szPlotSummary, dRating, szWriters, firstAired,
szThumbnailUrl, iEpisodeLength, szDirector, iSeasonNumber, iEpisodeNumber,
iSeasonFormattedForSorting, iEpisodeFormattedForSorting, iBookmark, szFullPath, idShow, iUserrating,
idSeason, szFileName, szPath, iPlayCount, lastPlayed, dateAdded,
szTitle, szGenre, szStudio, premiereDate, szMPAA,
dResumeTimeInSeconds, dTotalTimeInSeconds)
{
m_oValues = m_values;
}
qint32 cMyTVShows::idEpisode()
{
return(m_values.m_idEpisode);
}
qint32 cMyTVShows::idFile()
{
return(m_values.m_idFile);
}
QString cMyTVShows::episodeTitle()
{
return(m_values.m_szEpisodeTitle);
}
QString cMyTVShows::plotSummary()
{
return(m_values.m_szPlotSummary);
}
qreal cMyTVShows::rating()
{
return(m_values.m_dRating);
}
QStringList cMyTVShows::writers()
{
return(m_values.m_szWriters.split(", "));
}
QDateTime cMyTVShows::firstAired()
{
return(m_values.m_firstAired);
}
QString cMyTVShows::thumbnailUrl()
{
return(m_values.m_szThumbnailUrl);
}
qint32 cMyTVShows::episodeLength()
{
return(m_values.m_iEpisodeLength);
}
QStringList cMyTVShows::director()
{
return(m_values.m_szDirector.split(", "));
}
qint32 cMyTVShows::seasonNumber()
{
return(m_values.m_iSeasonNumber);
}
qint32 cMyTVShows::episodeNumber()
{
return(m_values.m_iEpisodeNumber);
}
qint32 cMyTVShows::seasonFormattedForSorting()
{
return(m_values.m_iSeasonFormattedForSorting);
}
qint32 cMyTVShows::episodeFormattedForSorting()
{
return(m_values.m_iEpisodeFormattedForSorting);
}
qint32 cMyTVShows::bookmark()
{
return(m_values.m_iBookmark);
}
QString cMyTVShows::fullPath()
{
return(m_values.m_szFullPath);
}
qint32 cMyTVShows::idShow()
{
return(m_values.m_idShow);
}
qint32 cMyTVShows::userRating()
{
return(m_values.m_iUserrating);
}
qint32 cMyTVShows::idSeason()
{
return(m_values.m_idSeason);
}
QString cMyTVShows::fileName()
{
return(m_values.m_szFileName);
}
QString cMyTVShows::path()
{
return(m_values.m_szPath);
}
qint32 cMyTVShows::playCount()
{
return(m_values.m_iPlayCount);
}
QDateTime cMyTVShows::lastPlayed()
{
return(m_values.m_lastPlayed);
}
QDateTime cMyTVShows::dateAdded()
{
return(m_values.m_dateAdded);
}
QString cMyTVShows::title()
{
return(m_values.m_szTitle);
}
QStringList cMyTVShows::genre()
{
return(m_values.m_szGenre.split(", "));
}
QStringList cMyTVShows::studio()
{
return(m_values.m_szStudio.split(", "));
}
QDateTime cMyTVShows::premierDate()
{
return(m_values.m_premiereDate);
}
QString cMyTVShows::mpaaRating()
{
return(m_values.m_szMPAA);
}
qreal cMyTVShows::resumeTimeInSeconds()
{
return(m_values.m_dResumeTimeInSeconds);
}
qreal cMyTVShows::totalTimeInSeconds()
{
return(m_values.m_dTotalTimeInSeconds);
}
cMyTVShowsList::cMyTVShowsList()
{
}
cMyTVShows* cMyTVShowsList::add(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattetForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds)
{
cMyTVShows* lpNew = new cMyTVShows(idEpisode, idFile, szEpisodeTitle, szPlotSummary, dRating, szWriters, firstAired,
szThumbnailUrl, iEpisodeLength, szDirector, iSeasonNumber, iEpisodeNumber,
iSeasonFormattetForSorting, iEpisodeFormattedForSorting, iBookmark, szFullPath, idShow, iUserrating,
idSeason, szFileName, szPath, iPlayCount, lastPlayed, dateAdded,
szTitle, szGenre, szStudio, premiereDate, szMPAA,
dResumeTimeInSeconds, dTotalTimeInSeconds);
append(lpNew);
return(lpNew);
}
+139
View File
@@ -742,4 +742,143 @@ public:
private:
};
class cMyTVShowsValues
{
public:
cMyTVShowsValues();
cMyTVShowsValues(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattetForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
void set(qint32 idEpisode, qint32 idFile, const QString& szepisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattedForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
inline bool operator==(const cMyTVShowsValues b) const;
inline bool operator!=(const cMyTVShowsValues b) const;
qint32 m_idEpisode;
qint32 m_idFile;
QString m_szEpisodeTitle; // c00
QString m_szPlotSummary; // c01
qreal m_dRating; // c03
QString m_szWriters; // c04
QDateTime m_firstAired; // c05
QString m_szThumbnailUrl; // c06
qint32 m_iEpisodeLength; // c09
QString m_szDirector; // c10
qint32 m_iSeasonNumber; // c12
qint32 m_iEpisodeNumber; // c13
qint32 m_iSeasonFormattedForSorting; // c15
qint32 m_iEpisodeFormattedForSorting; // c16
qint32 m_iBookmark; // c17
QString m_szFullPath; // c18
qint32 m_idShow;
qint32 m_iUserrating; // userrating
qint32 m_idSeason;
QString m_szFileName; // strFileName
QString m_szPath; // strPath
qint32 m_iPlayCount; // playCount
QDateTime m_lastPlayed; // lastPlayed
QDateTime m_dateAdded; // dateAdded
QString m_szTitle; // strTitle
QString m_szGenre; // genre
QString m_szStudio; // studio
QDateTime m_premiereDate; // premiered
QString m_szMPAA; // mpaa
qreal m_dResumeTimeInSeconds; // resumeTimeInSeconds
qreal m_dTotalTimeInSeconds; // totalTimeInSeconds
};
class cMyTVShows
{
public:
cMyTVShows(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattedForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
void loadActors(QSqlDatabase& m_db, cMyVideosActorList videosActorList);
void loadDirectors(QSqlDatabase& m_db, cMyVideosActorList videosActorList);
void loadWriters(QSqlDatabase& m_db, cMyVideosActorList videosActorList);
void loadCountries(QSqlDatabase& m_db, cMyVideosCountryList videosCountryList);
void loadGenres(QSqlDatabase& m_db, cMyVideosGenreList videosGenreList);
void loadStudios(QSqlDatabase& m_db, cMyVideosStudioList videosStudioList);
void loadVideoStream(QSqlDatabase& m_db);
void loadAudioStream(QSqlDatabase& m_db);
void loadSubtitleStream(QSqlDatabase& m_db);
void fillActorsList(QStandardItemModel *lpView);
void fillDirectorsList(QStandardItemModel *lpView);
void fillWritersList(QStandardItemModel *lpView);
void fillCountriesList(QStandardItemModel* lpView);
void fillGenresList(QStandardItemModel* lpView);
void fillStudiosList(QStandardItemModel* lpView);
void fillVideoStreamList(QStandardItemModel* lpView);
void fillAudioStreamList(QStandardItemModel* lpView);
void fillSubtitleStreamList(QStandardItemModel* lpView);
qint32 idEpisode();
qint32 idFile();
QString episodeTitle();
QString plotSummary();
qreal rating();
QStringList writers();
QDateTime firstAired();
QString thumbnailUrl();
qint32 episodeLength();
QStringList director();
qint32 seasonNumber();
qint32 episodeNumber();
qint32 seasonFormattedForSorting();
qint32 episodeFormattedForSorting();
qint32 bookmark();
QString fullPath();
qint32 idShow();
qint32 userRating();
qint32 idSeason();
QString fileName();
QString path();
qint32 playCount();
QDateTime lastPlayed();
QDateTime dateAdded();
QString title();
QStringList genre();
QStringList studio();
QDateTime premierDate();
QString mpaaRating();
qreal resumeTimeInSeconds();
qreal totalTimeInSeconds();
bool isNew();
bool isChanged();
cMyTVShowsValues m_values;
cMyTVShowsValues m_oValues;
};
Q_DECLARE_METATYPE(cMyTVShows*)
class cMyTVShowsList : public QList<cMyTVShows*>
{
public:
cMyTVShowsList();
cMyTVShows* add(qint32 idEpisode, qint32 idFile, const QString& szEpisodeTitle, const QString& szPlotSummary, qreal dRating, const QString& szWriters, const QDateTime firstAired,
const QString& szThumbnailUrl, qint32 iEpisodeLength, const QString& szDirector, qint32 iSeasonNumber, qint32 iEpisodeNumber,
qint32 iSeasonFormattetForSorting, qint32 iEpisodeFormattedForSorting, qint32 iBookmark, const QString& szFullPath, qint32 idShow, qint32 iUserrating,
qint32 idSeason, const QString& szFileName, const QString& szPath, qint32 iPlayCount, const QDateTime& lastPlayed, const QDateTime& dateAdded,
const QString& szTitle, const QString& szGenre, const QString& szStudio, const QDateTime& premiereDate, const QString& szMPAA,
qreal dResumeTimeInSeconds, qreal dTotalTimeInSeconds);
private:
};
#endif // CMYVIDEOS_H
+15
View File
@@ -0,0 +1,15 @@
#ifndef COMMON_H
#define COMMON_H
#define DELETE(x) { if(x) delete x, x=0; }
#define THUMB_WIDTH 220
#define THUMB_HEIGHT 390
#define FANART_WIDTH 480
#define FANART_HEIGHT 270
#define POSTER_WIDTH 220
#define POSTER_HEIGHT 390
#define BANNER_WIDTH 480
#define BANNER_HEIGHT 90
#endif // COMMON_H
+129 -2
View File
@@ -1,14 +1,141 @@
#include "ctvshowwidget.h"
#include "ui_ctvshowwidget.h"
#include "cimage.h"
#include "cvideoviewitemdelegate.h"
#include "ccheckboxitemdelegate.h"
#include "common.h"
cTVShowWidget::cTVShowWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::cTVShowWidget)
ui(new Ui::cTVShowWidget),
m_lpTVShowModel(0),
m_lpImageList(0)
{
ui->setupUi(this);
initUI();
}
cTVShowWidget::~cTVShowWidget()
{
DELETE(m_lpTVShowModel);
DELETE(m_lpCastModel);
DELETE(m_lpDirectorModel);
DELETE(m_lpWriterModel);
DELETE(m_lpCountryModel);
DELETE(m_lpGenreModel);
DELETE(m_lpStudioModel);
// DELETE(m_lpVideoStreamModel);
// DELETE(m_lpAudioStreamModel);
// DELETE(m_lpSubtitleStreamModel);
delete ui;
}
void cTVShowWidget::initUI()
{
ui->setupUi(this);
ui->m_lpBanner->setMinimumSize(BANNER_WIDTH, BANNER_HEIGHT);
ui->m_lpFanart->setMinimumSize(FANART_WIDTH, FANART_HEIGHT);
ui->m_lpPoster->setMinimumSize(POSTER_WIDTH, POSTER_HEIGHT);
ui->m_lpThumb->setMinimumSize(THUMB_WIDTH, THUMB_HEIGHT);
ui->m_lpInformationTab->setCurrentIndex(0);
m_lpTVShowModel = new QStandardItemModel(0, 1);
QStringList headerLabels = QStringList() << tr("TV Show");
m_lpTVShowModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpTVShowView->setModel(m_lpTVShowModel);
ui->m_lpTVShowView->setItemDelegate(new cVideoViewItemDelegate());
m_lpCastModel = new QStandardItemModel(0, 2);
headerLabels = QStringList() << tr("Name") << tr("Role");
m_lpCastModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpCastView->setModel(m_lpCastModel);
m_lpDirectorModel = new QStandardItemModel(0, 1);
headerLabels = QStringList() << tr("Name");
m_lpDirectorModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpDirectorView->setModel(m_lpDirectorModel);
m_lpWriterModel = new QStandardItemModel(0, 1);
headerLabels = QStringList() << tr("Name");
m_lpWriterModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpWriterView->setModel(m_lpWriterModel);
m_lpCountryModel = new QStandardItemModel(0, 1);
headerLabels = QStringList() << tr("Name");
m_lpCountryModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpCountryView->setModel(m_lpCountryModel);
ui->m_lpCountryView->setItemDelegate(new cCheckBoxItemDelegate());
m_lpGenreModel = new QStandardItemModel(0, 1);
headerLabels = QStringList() << tr("Name");
m_lpGenreModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpGenreView->setModel(m_lpGenreModel);
ui->m_lpGenreView->setItemDelegate(new cCheckBoxItemDelegate());
m_lpStudioModel = new QStandardItemModel(0, 1);
headerLabels = QStringList() << tr("Name");
m_lpStudioModel->setHorizontalHeaderLabels(headerLabels);
ui->m_lpStudioView->setModel(m_lpStudioModel);
ui->m_lpStudioView->setItemDelegate(new cCheckBoxItemDelegate());
// m_lpVideoStreamModel = new QStandardItemModel(0, 4);
// ui->m_lpVideoStreamView->setModel(m_lpVideoStreamModel);
// m_lpAudioStreamModel = new QStandardItemModel(0, 4);
// ui->m_lpAudioStreamView->setModel(m_lpAudioStreamModel);
// m_lpSubtitleStreamModel = new QStandardItemModel(0, 1);
// ui->m_lpSubtitleStreamView->setModel(m_lpSubtitleStreamModel);
ui->m_lpCountryView->setWrapping(true);
ui->m_lpGenreView->setWrapping(true);
ui->m_lpStudioView->setWrapping(true);
QList<int> sizes;
sizes << 500 << 1000;
ui->m_lpSplitter->setSizes(sizes);
// QItemSelectionModel* selectionModel = ui->m_lpVideoView->selectionModel();
// connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(videoSelectionChanged(QItemSelection,QItemSelection)));
// selectionModel = ui->m_lpCastView->selectionModel();
// connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(castSelectionChanged(QItemSelection,QItemSelection)));
// selectionModel = ui->m_lpDirectorView->selectionModel();
// connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(directorSelectionChanged(QItemSelection,QItemSelection)));
// selectionModel = ui->m_lpWriterView->selectionModel();
// connect(selectionModel, SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(writerSelectionChanged(QItemSelection,QItemSelection)));
}
void cTVShowWidget::setLibrary(cKodiVideoLibrary* lpVideoLibrary, cImageList* lpImageList)
{
m_lpVideoLibrary = lpVideoLibrary;
m_lpImageList = lpImageList;
showList();
}
void cTVShowWidget::showList()
{
m_lpTVShowModel->clear();
m_lpVideoLibrary->fillTVShowList(m_lpTVShowModel);
ui->m_lpTVShowView->resizeColumnToContents(0);
ui->m_lpTVShowView->selectionModel()->setCurrentIndex(m_lpTVShowModel->index(0, 0), QItemSelectionModel::Select | QItemSelectionModel::Current);
m_lpCountryModel->clear();
m_lpVideoLibrary->fillCountriesList(m_lpCountryModel);
m_lpGenreModel->clear();
m_lpVideoLibrary->fillGenresList(m_lpGenreModel);
m_lpStudioModel->clear();
m_lpVideoLibrary->fillStudiosList(m_lpStudioModel);
ui->m_lpSet->clear();
m_lpVideoLibrary->fillSetsList(ui->m_lpSet);
}
+27
View File
@@ -1,12 +1,26 @@
#ifndef CTVSHOWWIDGET_H
#define CTVSHOWWIDGET_H
#include "ckodivideolibrary.h"
#include <QWidget>
#include <QStandardItemModel>
#include <QItemSelection>
#include <QDoubleSpinBox>
#include <QSpinBox>
#include <QDateTimeEdit>
#include <QTextEdit>
namespace Ui {
class cTVShowWidget;
}
class cImage;
class cImageList;
class cTVShowWidget : public QWidget
{
Q_OBJECT
@@ -15,8 +29,21 @@ public:
explicit cTVShowWidget(QWidget *parent = 0);
~cTVShowWidget();
void setLibrary(cKodiVideoLibrary* lpVideoLibrary, cImageList* lpImageList);
private:
Ui::cTVShowWidget *ui;
QStandardItemModel* m_lpTVShowModel;
QStandardItemModel* m_lpCastModel;
QStandardItemModel* m_lpDirectorModel;
QStandardItemModel* m_lpWriterModel;
QStandardItemModel* m_lpCountryModel;
QStandardItemModel* m_lpGenreModel;
QStandardItemModel* m_lpStudioModel;
cKodiVideoLibrary* m_lpVideoLibrary;
cImageList* m_lpImageList;
void initUI();
void showList();
};
#endif // CTVSHOWWIDGET_H
+913 -15
View File
@@ -6,26 +6,924 @@
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
<width>953</width>
<height>778</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>90</x>
<y>90</y>
<width>91</width>
<height>16</height>
</rect>
</property>
<property name="text">
<string>TV Show</string>
</property>
</widget>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QSplitter" name="m_lpSplitter">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTreeView" name="m_lpTVShowView">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="headerHidden">
<bool>true</bool>
</property>
</widget>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>899</width>
<height>881</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_16">
<item row="0" column="0">
<widget class="QTabWidget" name="m_lpInformationTab">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="m_lpInformationTabBasic">
<attribute name="title">
<string>Basic</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_7">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Set</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="m_lpTagline"/>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Rating</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Tagline</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QDoubleSpinBox" name="m_lpRating"/>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>Votes</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="m_lpRatingVotes">
<property name="maximum">
<number>99999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Top 250</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="m_lpTop250">
<property name="maximum">
<number>99999</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Original Title</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="m_lpOriginalTitle"/>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="m_lpTitle"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="m_lpTitleForSorting"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Title for Sorting</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Released</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLineEdit" name="m_lpCertification"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Trailer</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Certification</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Outline</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="m_lpTrailer"/>
</item>
<item>
<widget class="QPushButton" name="m_lpTrailerPlay">
<property name="text">
<string>&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="6" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QSpinBox" name="m_lpReleased">
<property name="maximum">
<number>2999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>Runtime</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="m_lpRuntime">
<property name="maximum">
<number>99999</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="11" column="1">
<widget class="QTextEdit" name="m_lpOutline"/>
</item>
<item row="10" column="1">
<widget class="QTextEdit" name="m_lpPlot"/>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Play Count</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="9" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QSpinBox" name="m_lpPlayCount">
<property name="maximum">
<number>99999</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_16">
<property name="text">
<string>Last Played</string>
</property>
</widget>
</item>
<item>
<widget class="QDateTimeEdit" name="m_lpLastPlayed"/>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Plot</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</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">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_lpInformationTabExtended">
<attribute name="title">
<string>Extended</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_11">
<item row="3" column="0">
<widget class="QGroupBox" name="m_lpGenresGroup">
<property name="title">
<string>Genres</string>
</property>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<widget class="QListView" name="m_lpGenreView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="5" column="0">
<widget class="QGroupBox" name="m_lpStudiosGroup">
<property name="title">
<string>Studios</string>
</property>
<layout class="QGridLayout" name="gridLayout_15">
<item row="0" column="0">
<widget class="QListView" name="m_lpStudioView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QGroupBox" name="m_lpCountriesGroup">
<property name="title">
<string>Countries</string>
</property>
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<widget class="QListView" name="m_lpCountryView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_lpInformationTabCrew">
<attribute name="title">
<string>Crew</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_9">
<item row="2" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Writer</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Director</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Cast</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="m_lpCastPicture">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="m_lpDirectorPicture">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="m_lpWriterPicture">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QTreeView" name="m_lpCastView">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
<item row="1" column="1">
<widget class="QListView" name="m_lpDirectorView">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QListView" name="m_lpWriterView">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_lpInformationTabStream">
<attribute name="title">
<string>Stream</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_18">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_17">
<item row="5" column="0" colspan="2">
<widget class="QGroupBox" name="m_lpVideoStreamBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Video Streams</string>
</property>
<layout class="QGridLayout" name="gridLayout_19">
<item row="0" column="0">
<widget class="QTreeView" name="m_lpVideoStreamView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QGroupBox" name="m_lpAudioStreamBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Audio Streams</string>
</property>
<layout class="QGridLayout" name="gridLayout_20">
<item row="0" column="0">
<widget class="QTreeView" name="m_lpAudioStreamView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="8" column="0" colspan="2">
<widget class="QGroupBox" name="m_lpSubtitleStreamBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Subtitles</string>
</property>
<layout class="QGridLayout" name="gridLayout_21">
<item row="0" column="0">
<widget class="QTreeView" name="m_lpSubtitleStreamView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>10</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>100</height>
</size>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="9" column="0" colspan="2">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_12">
<property name="text">
<string>Video Duration</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QTimeEdit" name="m_lpVideoDuration"/>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_6">
<item row="3" column="0">
<widget class="QGroupBox" name="m_lpPosterBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Poster</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QLabel" name="m_lpPoster">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>220</width>
<height>390</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="1">
<widget class="QGroupBox" name="m_lpThumbBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Thumb</string>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="m_lpThumb">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>220</width>
<height>390</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QGroupBox" name="m_lpFanartBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="title">
<string>Fanart</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="m_lpFanart">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>270</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="m_lpBannerBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Banner</string>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="m_lpBanner">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>480</width>
<height>90</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
+2 -11
View File
@@ -5,17 +5,7 @@
#include "cvideoviewitemdelegate.h"
#include "ccheckboxitemdelegate.h"
#define DELETE(x) { if(x) delete x, x=0; }
#define THUMB_WIDTH 220
#define THUMB_HEIGHT 390
#define FANART_WIDTH 480
#define FANART_HEIGHT 270
#define POSTER_WIDTH 220
#define POSTER_HEIGHT 390
#define BANNER_WIDTH 480
#define BANNER_HEIGHT 90
#include "common.h"
cVideoWidget::cVideoWidget(QWidget *parent) :
@@ -134,6 +124,7 @@ void cVideoWidget::showList()
m_lpVideoModel->clear();
m_lpVideoLibrary->fillVideoList(m_lpVideoModel);
ui->m_lpVideoView->resizeColumnToContents(0);
ui->m_lpVideoView->selectionModel()->setCurrentIndex(m_lpVideoModel->index(0, 0), QItemSelectionModel::Select | QItemSelectionModel::Current);
m_lpCountryModel->clear();
m_lpVideoLibrary->fillCountriesList(m_lpCountryModel);
+2 -1
View File
@@ -42,7 +42,8 @@ HEADERS += cmainwindow.h \
cvideoviewitemdelegate.h \
ckoditextureslibrary.h \
cimage.h \
ccheckboxitemdelegate.h
ccheckboxitemdelegate.h \
common.h
FORMS += cmainwindow.ui \
ctvshowwidget.ui \