2016-05-17 03:04:11 +12:00
|
|
|
#pragma once
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#ifndef TSIO_RAW_INCLUDED
|
|
|
|
#define TSIO_RAW_INCLUDED
|
|
|
|
|
|
|
|
#include "tsound_io.h"
|
|
|
|
|
|
|
|
//==========================================================
|
|
|
|
|
|
|
|
/*!
|
|
|
|
The class TSoundTrackReaderRaw reads audio files having
|
|
|
|
.raw extension (this kind of file contains only the sample)
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
class TSoundTrackReaderRaw final : public TSoundTrackReader {
|
2016-03-19 06:57:51 +13:00
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackReaderRaw(const TFilePath &fp);
|
|
|
|
~TSoundTrackReaderRaw() {}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Loads the .raw audio file whose path has been specified in the constructor.
|
|
|
|
It returns a TSoundTrackP created from the audio file
|
|
|
|
*/
|
2016-06-19 20:06:29 +12:00
|
|
|
TSoundTrackP load() override;
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns a soundtrack reader able to read .raw audio files
|
|
|
|
*/
|
|
|
|
static TSoundTrackReader *create(const TFilePath &fp) {
|
|
|
|
return new TSoundTrackReaderRaw(fp);
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
//==========================================================
|
|
|
|
|
|
|
|
/*!
|
|
|
|
The class TSoundTrackWriterRaw writes audio file having
|
|
|
|
.raw extension (this kind of file contains only the sample)
|
|
|
|
*/
|
2016-06-29 18:17:12 +12:00
|
|
|
class TSoundTrackWriterRaw final : public TSoundTrackWriter {
|
2016-03-19 06:57:51 +13:00
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
TSoundTrackWriterRaw(const TFilePath &fp);
|
|
|
|
~TSoundTrackWriterRaw() {}
|
|
|
|
|
|
|
|
/*!
|
|
|
|
Saves the informations of the soundtrack in .raw audio file
|
|
|
|
whose path has been specified in the constructor.
|
|
|
|
*/
|
2016-06-19 20:06:29 +12:00
|
|
|
bool save(const TSoundTrackP &) override;
|
2016-06-15 18:43:10 +12:00
|
|
|
|
|
|
|
/*!
|
|
|
|
Returns a soundtrack writer able to write .raw audio files
|
|
|
|
*/
|
|
|
|
static TSoundTrackWriter *create(const TFilePath &fp) {
|
|
|
|
return new TSoundTrackWriterRaw(fp);
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|