plugin: namespace everything
This commit is contained in:
parent
59d8f7602d
commit
cfc1dc447c
10 changed files with 41 additions and 1 deletions
|
|
@ -7,6 +7,8 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <aubio/aubio.h>
|
#include <aubio/aubio.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
BeatTracker::BeatTracker(uint_t sampleRate, uint_t hopSize, QObject* parent)
|
BeatTracker::BeatTracker(uint_t sampleRate, uint_t hopSize, QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_tempo(new_aubio_tempo("default", 1024, hopSize, sampleRate))
|
, m_tempo(new_aubio_tempo("default", 1024, hopSize, sampleRate))
|
||||||
|
|
@ -103,4 +105,6 @@ void BeatTracker::handleStateChanged(QtAudio::State state) const {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
#include <aubio/aubio.h>
|
#include <aubio/aubio.h>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
class BeatTracker : public QObject {
|
class BeatTracker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
@ -45,3 +47,5 @@ private:
|
||||||
void process();
|
void process();
|
||||||
void handleStateChanged(QtAudio::State state) const;
|
void handleStateChanged(QtAudio::State state) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,8 @@
|
||||||
#include <QtQuick/QQuickItem>
|
#include <QtQuick/QQuickItem>
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
qreal CachingImageManager::effectiveScale() const {
|
qreal CachingImageManager::effectiveScale() const {
|
||||||
if (m_item && m_item->window()) {
|
if (m_item && m_item->window()) {
|
||||||
return m_item->window()->devicePixelRatio();
|
return m_item->window()->devicePixelRatio();
|
||||||
|
|
@ -220,3 +222,5 @@ QString CachingImageManager::sha256sum(const QString& path) {
|
||||||
|
|
||||||
return hash.result().toHex();
|
return hash.result().toHex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@
|
||||||
#include <QtQuick/QQuickItem>
|
#include <QtQuick/QQuickItem>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
class CachingImageManager : public QObject {
|
class CachingImageManager : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
@ -59,3 +61,5 @@ private:
|
||||||
void createCache(const QString& path, const QString& cache, const QString& fillMode, const QSize& size) const;
|
void createCache(const QString& path, const QString& cache, const QString& fillMode, const QSize& size) const;
|
||||||
[[nodiscard]] static QString sha256sum(const QString& path);
|
[[nodiscard]] static QString sha256sum(const QString& path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@
|
||||||
#include <QtQuick/QQuickItemGrabResult>
|
#include <QtQuick/QQuickItemGrabResult>
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
void CUtils::saveItem(QQuickItem* target, const QUrl& path) {
|
void CUtils::saveItem(QQuickItem* target, const QUrl& path) {
|
||||||
this->saveItem(target, path, QRect(), QJSValue(), QJSValue());
|
this->saveItem(target, path, QRect(), QJSValue(), QJSValue());
|
||||||
}
|
}
|
||||||
|
|
@ -346,3 +348,5 @@ QString CUtils::toLocalFile(const QUrl& url) const {
|
||||||
|
|
||||||
return url.toLocalFile();
|
return url.toLocalFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@
|
||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
class CUtils : public QObject {
|
class CUtils : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
@ -37,3 +39,5 @@ private:
|
||||||
QColor findDominantColour(const QImage& image, int rescaleSize) const;
|
QColor findDominantColour(const QImage& image, int rescaleSize) const;
|
||||||
qreal findAverageLuminance(const QImage& image, int rescaleSize) const;
|
qreal findAverageLuminance(const QImage& image, int rescaleSize) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include <QtConcurrent>
|
#include <QtConcurrent>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
int FileSystemModel::rowCount(const QModelIndex& parent) const {
|
int FileSystemModel::rowCount(const QModelIndex& parent) const {
|
||||||
if (parent != QModelIndex()) {
|
if (parent != QModelIndex()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -366,3 +368,5 @@ bool FileSystemModel::compareEntries(const FileSystemEntry* a, const FileSystemE
|
||||||
}
|
}
|
||||||
return a->relativePath().localeAwareCompare(b->relativePath()) < 0;
|
return a->relativePath().localeAwareCompare(b->relativePath()) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
class FileSystemEntry : public QObject {
|
class FileSystemEntry : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
@ -157,3 +159,5 @@ private:
|
||||||
void applyChanges(const QSet<QString>& removedPaths, const QSet<QString>& addedPaths);
|
void applyChanges(const QSet<QString>& removedPaths, const QSet<QString>& addedPaths);
|
||||||
[[nodiscard]] static bool compareEntries(const FileSystemEntry* a, const FileSystemEntry* b);
|
[[nodiscard]] static bool compareEntries(const FileSystemEntry* a, const FileSystemEntry* b);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <libqalculate/qalculate.h>
|
#include <libqalculate/qalculate.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
Qalculator::Qalculator(QObject* parent)
|
Qalculator::Qalculator(QObject* parent)
|
||||||
: QObject(parent) {
|
: QObject(parent) {
|
||||||
if (!CALCULATOR) {
|
if (!CALCULATOR) {
|
||||||
|
|
@ -47,3 +49,5 @@ QString Qalculator::eval(const QString& expr, bool printExpr) const {
|
||||||
|
|
||||||
return QString::fromStdString(result);
|
return QString::fromStdString(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <qqmlintegration.h>
|
#include <qqmlintegration.h>
|
||||||
|
|
||||||
|
namespace caelestia {
|
||||||
|
|
||||||
class Qalculator : public QObject {
|
class Qalculator : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_ELEMENT
|
QML_ELEMENT
|
||||||
|
|
@ -13,3 +15,5 @@ public:
|
||||||
|
|
||||||
Q_INVOKABLE QString eval(const QString& expr, bool printExpr = true) const;
|
Q_INVOKABLE QString eval(const QString& expr, bool printExpr = true) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace caelestia
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue