Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TSIO_RAW_INCLUDED
Toshihiro Shimizu 890ddd
#define TSIO_RAW_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "tsound_io.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//==========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
The class TSoundTrackReaderRaw reads audio files having
Toshihiro Shimizu 890ddd
.raw extension (this kind of file contains only the sample)
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka d1f6c4
class TSoundTrackReaderRaw final : public TSoundTrackReader {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackReaderRaw(const TFilePath &fp);
Shinya Kitaoka 120a6e
  ~TSoundTrackReaderRaw() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Loads the .raw audio file whose path has been specified in the constructor.
Shinya Kitaoka 120a6e
It returns a TSoundTrackP created from the audio file
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 473e70
  TSoundTrackP load() override;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Returns a soundtrack reader able to read .raw audio files
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  static TSoundTrackReader *create(const TFilePath &fp) {
Shinya Kitaoka 120a6e
    return new TSoundTrackReaderRaw(fp);
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//==========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
The class TSoundTrackWriterRaw writes audio file having
Toshihiro Shimizu 890ddd
.raw extension (this kind of file contains only the sample)
Toshihiro Shimizu 890ddd
*/
Shinya Kitaoka d1f6c4
class TSoundTrackWriterRaw final : public TSoundTrackWriter {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TSoundTrackWriterRaw(const TFilePath &fp);
Shinya Kitaoka 120a6e
  ~TSoundTrackWriterRaw() {}
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
luz paz 6454c4
Saves the information of the soundtrack in .raw audio file
Shinya Kitaoka 120a6e
whose path has been specified in the constructor.
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 473e70
  bool save(const TSoundTrackP &) override;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*!
Shinya Kitaoka 120a6e
Returns a soundtrack writer able to write .raw audio files
Shinya Kitaoka 120a6e
*/
Shinya Kitaoka 120a6e
  static TSoundTrackWriter *create(const TFilePath &fp) {
Shinya Kitaoka 120a6e
    return new TSoundTrackWriterRaw(fp);
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif