change: change code style to Linux style except indent.
This commit is contained in:
+57
-55
@@ -7,82 +7,84 @@
|
||||
#include "decoder.h"
|
||||
#include "task/conform/conform.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ConformManager : public QObject
|
||||
namespace olive
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
class ConformManager : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static void CreateInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
instance_ = new ConformManager();
|
||||
}
|
||||
}
|
||||
static void CreateInstance()
|
||||
{
|
||||
if (!instance_) {
|
||||
instance_ = new ConformManager();
|
||||
}
|
||||
}
|
||||
|
||||
static void DestroyInstance()
|
||||
{
|
||||
delete instance_;
|
||||
instance_ = nullptr;
|
||||
}
|
||||
static void DestroyInstance()
|
||||
{
|
||||
delete instance_;
|
||||
instance_ = nullptr;
|
||||
}
|
||||
|
||||
static ConformManager *instance()
|
||||
{
|
||||
return instance_;
|
||||
}
|
||||
static ConformManager *instance()
|
||||
{
|
||||
return instance_;
|
||||
}
|
||||
|
||||
enum ConformState {
|
||||
kConformExists,
|
||||
kConformGenerating
|
||||
};
|
||||
enum ConformState { kConformExists, kConformGenerating };
|
||||
|
||||
struct Conform {
|
||||
ConformState state;
|
||||
QVector<QString> filenames;
|
||||
ConformTask *task;
|
||||
};
|
||||
struct Conform {
|
||||
ConformState state;
|
||||
QVector<QString> filenames;
|
||||
ConformTask *task;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Get conform state, and start conforming if no conform exists
|
||||
*
|
||||
* Thread-safe.
|
||||
*/
|
||||
Conform GetConformState(const QString &decoder_id, const QString &cache_path, const Decoder::CodecStream &stream, const AudioParams ¶ms, bool wait);
|
||||
/**
|
||||
* @brief Get conform state, and start conforming if no conform exists
|
||||
*
|
||||
* Thread-safe.
|
||||
*/
|
||||
Conform GetConformState(const QString &decoder_id,
|
||||
const QString &cache_path,
|
||||
const Decoder::CodecStream &stream,
|
||||
const AudioParams ¶ms, bool wait);
|
||||
|
||||
signals:
|
||||
void ConformReady();
|
||||
void ConformReady();
|
||||
|
||||
private:
|
||||
ConformManager() = default;
|
||||
ConformManager() = default;
|
||||
|
||||
static ConformManager *instance_;
|
||||
static ConformManager *instance_;
|
||||
|
||||
QMutex mutex_;
|
||||
QMutex mutex_;
|
||||
|
||||
QWaitCondition conform_done_condition_;
|
||||
QWaitCondition conform_done_condition_;
|
||||
|
||||
struct ConformData {
|
||||
Decoder::CodecStream stream;
|
||||
AudioParams params;
|
||||
ConformTask *task;
|
||||
QVector<QString> working_filename;
|
||||
QVector<QString> finished_filename;
|
||||
};
|
||||
struct ConformData {
|
||||
Decoder::CodecStream stream;
|
||||
AudioParams params;
|
||||
ConformTask *task;
|
||||
QVector<QString> working_filename;
|
||||
QVector<QString> finished_filename;
|
||||
};
|
||||
|
||||
QVector<ConformData> conforming_;
|
||||
QVector<ConformData> conforming_;
|
||||
|
||||
/**
|
||||
* @brief Get the destination filename of an audio stream conformed to a set of parameters
|
||||
*/
|
||||
static QVector<QString> GetConformedFilename(const QString &cache_path, const Decoder::CodecStream &stream, const AudioParams ¶ms);
|
||||
/**
|
||||
* @brief Get the destination filename of an audio stream conformed to a set of parameters
|
||||
*/
|
||||
static QVector<QString>
|
||||
GetConformedFilename(const QString &cache_path,
|
||||
const Decoder::CodecStream &stream,
|
||||
const AudioParams ¶ms);
|
||||
|
||||
static bool AllConformsExist(const QVector<QString> &filenames);
|
||||
static bool AllConformsExist(const QVector<QString> &filenames);
|
||||
|
||||
private slots:
|
||||
void ConformTaskFinished(Task *task, bool succeeded);
|
||||
|
||||
void ConformTaskFinished(Task *task, bool succeeded);
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace olive
|
||||
|
||||
#endif // CONFORMMANAGER_H
|
||||
|
||||
Reference in New Issue
Block a user