#ifndef _Manipulation_h_
#define _Manipulation_h_
/* Manipulation.h; Paul Boersma, March 30, 2001 */

#ifndef _Sound_h_
	#include "Sound.h"
#endif
#ifndef _PointProcess_h_
	#include "PointProcess.h"
#endif
#ifndef _PitchTier_h_
	#include "PitchTier.h"
#endif
#ifndef _DurationTier_h_
	#include "DurationTier.h"
#endif
#ifndef _LPC_h_
	#include "LPC.h"
#endif
/* The following have to be included for compatibility. */
#ifndef _IntensityTier_h_
	#include "IntensityTier.h"
#endif
#ifndef _Intensity_h_
	#include "Intensity.h"
#endif
#ifndef _FormantTier_h_
	#include "FormantTier.h"
#endif
#ifndef _Formant_h_
	#include "Formant.h"
#endif
#ifndef _Pitch_h_
	#include "Pitch.h"
#endif
#ifndef _Spectrogram8_h_
	#include "Spectrogram8.h"
#endif

#include "Manipulation_def.h"
#define Manipulation_methods Function_methods
oo_CLASS_CREATE (Manipulation, Function)

/* How to create an Manipulation. */

Manipulation Manipulation_create (double tmin, double tmax, double timeStep,
	double minimumPitch, double maximumPitch);
int Manipulation_replaceOriginalSound (Manipulation me, Sound sound);
int Manipulation_replacePulses (Manipulation me, PointProcess pulses);
int Manipulation_replaceIntensityTier (Manipulation me, IntensityTier intensity);
int Manipulation_replacePitchTier (Manipulation me, PitchTier pitch);
int Manipulation_replaceDurationTier (Manipulation me, DurationTier duration);

Manipulation Sound_to_Manipulation (Sound me, double timeStep, double minimumPitch, double maximumPitch);
Manipulation Sound_Pitch_to_Manipulation (Sound sound, Pitch pitch, double minimumPitch);
Manipulation Sound_PointProcess_to_Manipulation (Sound sound, PointProcess point);
Manipulation Manipulation_AnyTier_to_Manipulation (Manipulation ana, AnyTier tier);

/* Resynthesis. */

#define Manipulation_PSOLA  1
#define Manipulation_PULSES  2
#define Manipulation_PULSES_HUM  3
#define Manipulation_PITCH  4
#define Manipulation_PITCH_HUM  5
#define Manipulation_PULSES_PITCH  6
#define Manipulation_PULSES_PITCH_HUM  7
#define Manipulation_PSOLA_NODUR  8
#define Manipulation_PULSES_FORMANT  9
#define Manipulation_PULSES_FORMANT_INTENSITY  10
#define Manipulation_PULSES_LPC  11
#define Manipulation_PULSES_LPC_INTENSITY  12
#define Manipulation_PITCH_LPC  13
#define Manipulation_PITCH_LPC_INTENSITY  14
#define Manipulation_PITCH_LPC_INT_DUR  15
Sound Sound_Point_Point_to_Sound (Sound me, PointProcess source, PointProcess target, double maxT);
/*void Sound_Formant_Intensity_filter (Sound me, FormantTier formant, IntensityTier intensity);*/

Sound Manipulation_to_Sound (Manipulation me, int method);
int Manipulation_playPart (Manipulation me, double tmin, double tmax, int method);
int Manipulation_play (Manipulation me, int method);
int Manipulation_writeToTextFileWithoutSound (Manipulation me, MelderFile fs);
int Manipulation_writeToBinaryFileWithoutSound (Manipulation me, MelderFile fs);

/* The low-level synthesis routines. */

Sound Sound_Point_Pitch_Duration_to_Sound (Sound me, PointProcess pulses,
	PitchTier pitch, DurationTier duration, double maxT);

/* End of file Manipulation.h */
#endif
