Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TSOP_INCLUDED
Toshihiro Shimizu 890ddd
#define TSOP_INCLUDED
Toshihiro Shimizu 890ddd
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 DVAPI TSopException : public TException
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	TString m_message;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TSopException(const TString &s) : m_message(s) {}
Toshihiro Shimizu 890ddd
	~TSopException() {}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TString getMessage() const { return m_message; };
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//===================================================================
Toshihiro Shimizu 890ddd
//! \include sop_ex.cpp
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
namespace TSop
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Convert the soundtrack src to the format of the soundtrack dst
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI void convert(TSoundTrackP &dst, const TSoundTrackP &src);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Convert the soundtrack src to the format specified in dstFormat
Toshihiro Shimizu 890ddd
    and return the new soundtrack
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP convert(
Toshihiro Shimizu 890ddd
	const TSoundTrackP &src, const TSoundTrackFormat &dstFormat);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Resampls the soundtrack src at the specified sampleRate and 
Toshihiro Shimizu 890ddd
    returns the obtained soundtrack
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP resample(TSoundTrackP src, TINT32 sampleRate);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Reverbs the soundtrack src with the specified feature and 
Toshihiro Shimizu 890ddd
    returns the obtained soundtrack
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP reverb(
Toshihiro Shimizu 890ddd
	TSoundTrackP src,
Toshihiro Shimizu 890ddd
	double delayTime,
Toshihiro Shimizu 890ddd
	double decayFactor,
Toshihiro Shimizu 890ddd
	double extendTime);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Gates the soundtrack src with the specified feature and 
Toshihiro Shimizu 890ddd
    returns the obtained soundtrack
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP gate(
Toshihiro Shimizu 890ddd
	TSoundTrackP src,
Toshihiro Shimizu 890ddd
	double threshold,
Toshihiro Shimizu 890ddd
	double holdTime,
Toshihiro Shimizu 890ddd
	double releaseTime);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Does the echo effect to the soundtrack src with the specified feature
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI void echo(
Toshihiro Shimizu 890ddd
	TSoundTrackP &dst,
Toshihiro Shimizu 890ddd
	const TSoundTrackP &src,
Toshihiro Shimizu 890ddd
	double delayTime,
Toshihiro Shimizu 890ddd
	double decayFactor,
Toshihiro Shimizu 890ddd
	double extendTime);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Streches the soundtrack src with the specified feature and 
Toshihiro Shimizu 890ddd
    returns the obtained soundtrack
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP timeStrech(TSoundTrackP src, double ratio);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Do the mixing between the two soundtrack a1 and a2 must be inside [0.0,1.0]
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP mix(
Toshihiro Shimizu 890ddd
	const TSoundTrackP &st1, const TSoundTrackP &st2, double a1, double a2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Inserts l blank samples starting from the sample s0 of the soundtrack.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP insertBlank(TSoundTrackP src, TINT32 s0, TINT32 l);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*! 
Toshihiro Shimizu 890ddd
    Inserts a blank portion of duration l into the soundtrack, starting from t0.
Toshihiro Shimizu 890ddd
    t0 and l are expressed in seconds.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP insertBlank(TSoundTrackP src, double t0, double l);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Removes from the soundtrack the samples in the range [s0, s1].
Toshihiro Shimizu 890ddd
    Returns a soundtrack that contains just the samples that have been removed
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP remove(TSoundTrackP src, TINT32 s0, TINT32 s1, TSoundTrackP &paste);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Remove the portion of soundtrack in the range [t0, t1]. 
Toshihiro Shimizu 890ddd
    t0 and t1 are expressed in seconds.
Toshihiro Shimizu 890ddd
    Returns a soundtrack that contains just the portion that has been removed.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP remove(TSoundTrackP src, double t0, double t1, TSoundTrackP &paste);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Returns a soundtrack that has just the riseFactor of sample of src.
Toshihiro Shimizu 890ddd
    The samples of the output soundTrack come from the "zero" sample to
Toshihiro Shimizu 890ddd
    the value of the first sample of src
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP fadeIn(const TSoundTrackP src, double riseFactor);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Returns a soundtrack that has just the decayFactor of sample of src.
Toshihiro Shimizu 890ddd
    The samples of the output soundTrack come from the value of the last sample
Toshihiro Shimizu 890ddd
    of src to the "zero" sample    
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP fadeOut(const TSoundTrackP src, double decayFactor);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Returns a soundtrack that has just the crossFactor of sample of src2.
Toshihiro Shimizu 890ddd
    The samples of the output soundTrack come from the value of the last sample
Toshihiro Shimizu 890ddd
    of src1 to the value of the first sample of src2    
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP crossFade(
Toshihiro Shimizu 890ddd
	const TSoundTrackP src1, const TSoundTrackP src2, double crossFactor);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
    Returns a soundtrack that has the sampleCount of src2.
Toshihiro Shimizu 890ddd
    But the first crossFactor of samples come from the value of the last sample
Toshihiro Shimizu 890ddd
    of src1 to the value of the crossFactor-th sample of src2    
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
DVAPI TSoundTrackP crossFade(
Toshihiro Shimizu 890ddd
	double crossFactor, const TSoundTrackP src1, const TSoundTrackP src2);
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif