Sélectionner une révision Git

Kubat authored
DOCUMENT & MISC: Add the AudioContext to the AudioSubDocument and create the Lib folder to store all the code that is not a UI code but can be included by all other src's sub-folders
Utils.hh 1,76 Kio
#ifndef VIVY_UTILS_H
#define VIVY_UTILS_H
#include <QString>
#include <QFileInfo>
#include <QStringList>
#include <QDebug>
#include <QMessageLogger>
#include <QtGlobal>
#include <type_traits>
#define VIVY_UNMOVABLE_OBJECT(classname) \
/* Don't move this object around */ \
classname(const classname &) = delete; /* Copy */ \
classname(classname &&) = delete; /* Move */ \
classname &operator=(const classname &) = delete; /* Copy assign */ \
classname &operator=(classname &&) = delete; /* Move assign */
namespace Vivy::Utils
{
static const QStringList audioFileSuffix = { "wave", "wav", "ogg", "mp3", "m4a" };
static const QStringList videoFileSuffix = { "mkv", "mp4" };
static const QStringList assFileSuffix = { "ass" };
static const QStringList vivyFileSuffix = { "vivy" };
enum class DocumentType : quint64 {
/* Basic types */
Vivy = (1 << 1),
ASS = (1 << 2),
/* Audio */
WAVE = (1 << 3),
WAV = WAVE,
OGG = (1 << 4),
MP3 = (1 << 5),
M4A = (1 << 6),
/* Video */
MKV = (1 << 7),
MP4 = (1 << 8),
/* Meta-types */
Audio = (WAVE | OGG | MP3),
Video = (MKV | MP4),
};
template <typename E>
constexpr auto
to_underlying(E e) noexcept
{
return static_cast<std::underlying_type_t<E>>(e);
}
bool detectDocumentType(const QFileInfo &, DocumentType *);
}
/* All forward delcarations are placed here */
class QMenu;
class QAction;
class QTabWidget;
class QGraphicsPixmapItem;
namespace Vivy
{
class VivyApplication;
class MainWindow;
}
#endif // VIVY_UTILS_H