Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TSOUND_IO_INCLUDED
Toshihiro Shimizu 890ddd
#define TSOUND_IO_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <qstringlist></qstringlist>
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
#include "tsound.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TSOUND_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSoundTrackReader;
Toshihiro Shimizu 890ddd
typedef TSoundTrackReader *TSoundTrackReaderCreateProc(const TFilePath &path);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------
Toshihiro Shimizu 890ddd
//!\include sndReader_ex.cpp
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  Superclass for specialized reader of a specific type of audio file
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka 120a6e
class DVAPI TSoundTrackReader : public TSmartObject {
Shinya Kitaoka 120a6e
  DECLARE_CLASS_CODE
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  TFilePath m_path;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackReader(const TFilePath &fp);
Shinya Kitaoka 120a6e
  ~TSoundTrackReader();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual TSoundTrackP load() = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  // forse sarebbe il caso di aggiungere un metodo loadInfo()
Shinya Kitaoka 120a6e
  // che restituisce una soundtrack con buffer vuoto
Shinya Kitaoka 120a6e
  // per accedere alle informazioni sulla soundtrack
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static bool load(const TFilePath &, TSoundTrackP &);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static void getSupportedFormats(QStringList &names);
Shinya Kitaoka 120a6e
  static void define(QString extension, TSoundTrackReaderCreateProc *proc);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<tsoundtrackreader>;</tsoundtrackreader>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TSoundTrackReaderP final
Shinya Kitaoka d1f6c4
    : public TSmartPointerT<tsoundtrackreader> {</tsoundtrackreader>
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackReaderP(const TFilePath &fp);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TSoundTrackWriter;
Toshihiro Shimizu 890ddd
typedef TSoundTrackWriter *TSoundTrackWriterCreateProc(const TFilePath &path);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//--------------------------------------------------------
Toshihiro Shimizu 890ddd
//!\include sndWriter_ex.cpp
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  Superclass for specialized writer of a specific type of audio file
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka 120a6e
class DVAPI TSoundTrackWriter : public TSmartObject {
Shinya Kitaoka 120a6e
  DECLARE_CLASS_CODE
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
protected:
Shinya Kitaoka 120a6e
  TFilePath m_path;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackWriter(const TFilePath &fp);
Shinya Kitaoka 120a6e
  ~TSoundTrackWriter();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual bool save(const TSoundTrackP &) = 0;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static bool save(const TFilePath &, const TSoundTrackP &);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static void getSupportedFormats(QStringList &names);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  static void define(QString extension, TSoundTrackWriterCreateProc *proc);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<tsoundtrackwriter>;</tsoundtrackwriter>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TSoundTrackWriterP final
Shinya Kitaoka d1f6c4
    : public TSmartPointerT<tsoundtrackwriter> {</tsoundtrackwriter>
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackWriterP(const TFilePath &fp);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif