various UI reimplementations from 0.1.x

This commit is contained in:
itsmattkc
2019-09-26 03:49:49 +10:00
parent c19718a4a5
commit 56e3fd41e5
70 changed files with 2056 additions and 1483 deletions
+20
View File
@@ -20,6 +20,7 @@
#include "filefunctions.h"
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QDateTime>
#include <QDir>
@@ -73,3 +74,22 @@ QString GetMediaCacheLocation()
return media_cache_dir.absolutePath();
}
QString GetConfigurationLocation()
{
if (IsPortable()) {
return GetApplicationPath();
} else {
return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
}
}
bool IsPortable()
{
return QFileInfo::exists(QDir(GetApplicationPath()).filePath("portable"));
}
QString GetApplicationPath()
{
return QCoreApplication::applicationDirPath();
}
+6
View File
@@ -23,6 +23,8 @@
#include <QString>
bool IsPortable();
QString GetUniqueFileIdentifier(const QString& filename);
QString GetMediaIndexLocation();
@@ -31,4 +33,8 @@ QString GetMediaIndexFilename(const QString& filename);
QString GetMediaCacheLocation();
QString GetConfigurationLocation();
QString GetApplicationPath();
#endif // FILEFUNCTIONS_H
+7
View File
@@ -22,6 +22,8 @@
#include <QtMath>
#include "config/config.h"
QString padded(int arg, int padding) {
return QString("%1").arg(arg, padding, 10, QChar('0'));
}
@@ -91,3 +93,8 @@ int64_t olive::time_to_timestamp(const rational &time, const rational &timebase)
{
return qRound64(time.toDouble() * timebase.flipped().toDouble());
}
olive::TimecodeDisplay olive::CurrentTimecodeDisplay()
{
return static_cast<olive::TimecodeDisplay>(Config::Current()["TimecodeDisplay"].toInt());
}
+2
View File
@@ -34,6 +34,8 @@ enum TimecodeDisplay {
kMilliseconds
};
TimecodeDisplay CurrentTimecodeDisplay();
/**
* @brief Convert a timestamp (according to a rational timebase) to a user-friendly string representation
*/