2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef TSOUND_IO_INCLUDED
|
|
|
|
#define TSOUND_IO_INCLUDED
|
|
|
|
|
|
|
|
#include <QStringList>
|
|
|
|
#include "tfilepath.h"
|
|
|
|
#include "tsound.h"
|
|
|
|
|
|
|
|
#undef DVAPI
|
|
|
|
#undef DVVAR
|
|
|
|
#ifdef TSOUND_EXPORTS
|
|
|
|
#define DVAPI DV_EXPORT_API
|
|
|
|
#define DVVAR DV_EXPORT_VAR
|
|
|
|
#else
|
|
|
|
#define DVAPI DV_IMPORT_API
|
|
|
|
#define DVVAR DV_IMPORT_VAR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
|
|
|
|
class TSoundTrackReader;
|
|
|
|
typedef TSoundTrackReader *TSoundTrackReaderCreateProc(const TFilePath &path);
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
//!\include sndReader_ex.cpp
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Superclass for specialized reader of a specific type of audio file
|
|
|
|
*/
|
2016-06-15 18:43:10 +12:00
|
|
|
class DVAPI TSoundTrackReader : public TSmartObject {
|
|
|
|
DECLARE_CLASS_CODE
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
TFilePath m_path;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackReader(const TFilePath &fp);
|
|
|
|
~TSoundTrackReader();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
virtual TSoundTrackP load() = 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
// forse sarebbe il caso di aggiungere un metodo loadInfo()
|
|
|
|
// che restituisce una soundtrack con buffer vuoto
|
|
|
|
// per accedere alle informazioni sulla soundtrack
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
static bool load(const TFilePath &, TSoundTrackP &);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
static void getSupportedFormats(QStringList &names);
|
|
|
|
static void define(QString extension, TSoundTrackReaderCreateProc *proc);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
2016-04-15 17:11:23 +12:00
|
|
|
#ifdef _WIN32
|
2016-03-19 06:57:51 +13:00
|
|
|
template class DVAPI TSmartPointerT<TSoundTrackReader>;
|
|
|
|
#endif
|
|
|
|
|
2016-06-29 18:17:12 +12:00
|
|
|
class DVAPI TSoundTrackReaderP final
|
|
|
|
: public TSmartPointerT<TSoundTrackReader> {
|
2016-03-19 06:57:51 +13:00
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackReaderP(const TFilePath &fp);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
//=========================================================
|
|
|
|
|
|
|
|
class TSoundTrackWriter;
|
|
|
|
typedef TSoundTrackWriter *TSoundTrackWriterCreateProc(const TFilePath &path);
|
|
|
|
|
|
|
|
//--------------------------------------------------------
|
|
|
|
//!\include sndWriter_ex.cpp
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Superclass for specialized writer of a specific type of audio file
|
|
|
|
*/
|
2016-06-15 18:43:10 +12:00
|
|
|
class DVAPI TSoundTrackWriter : public TSmartObject {
|
|
|
|
DECLARE_CLASS_CODE
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
TFilePath m_path;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackWriter(const TFilePath &fp);
|
|
|
|
~TSoundTrackWriter();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
virtual bool save(const TSoundTrackP &) = 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
static bool save(const TFilePath &, const TSoundTrackP &);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
static void getSupportedFormats(QStringList &names);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
static void define(QString extension, TSoundTrackWriterCreateProc *proc);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
2016-04-15 17:11:23 +12:00
|
|
|
#ifdef _WIN32
|
2016-03-19 06:57:51 +13:00
|
|
|
template class DVAPI TSmartPointerT<TSoundTrackWriter>;
|
|
|
|
#endif
|
|
|
|
|
2016-06-29 18:17:12 +12:00
|
|
|
class DVAPI TSoundTrackWriterP final
|
|
|
|
: public TSmartPointerT<TSoundTrackWriter> {
|
2016-03-19 06:57:51 +13:00
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackWriterP(const TFilePath &fp);
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|