1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
#ifndef INCLUDED_ECA_CONTROL_POSITION_H
#define INCLUDED_ECA_CONTROL_POSITION_H
#include "sample-specs.h"
#include "eca-audio-position.h"
/**
* Virtual class implementing position and
* length related chainsetup features.
*/
class ECA_CHAINSETUP_POSITION : public ECA_AUDIO_POSITION {
public:
/** @name Init and cleaup */
/*@{*/
ECA_CHAINSETUP_POSITION(void);
virtual ~ECA_CHAINSETUP_POSITION(void);
/*@}*/
/** @name Public getter/setter functions for max length information.
* Note that this length information is different from
* that defined in ECA_AUDIO_POSITION. Max length can be
* set by the users of this class, and can be either shorter
* or longer than the actual length. */
/*@{*/
void set_max_length_in_samples(SAMPLE_SPECS::sample_pos_t pos);
void set_max_length_in_seconds(double pos_in_seconds);
inline bool is_over_max_length(void) const { return((position_in_samples() > max_length_in_samples() && max_length_set() == true) ? true : false); }
SAMPLE_SPECS::sample_pos_t max_length_in_samples(void) const;
double max_length_in_seconds_exact(void) const;
bool max_length_set(void) const { return(max_length_set_rep); }
/*@}*/
/** @name Functions reimplemented from ECA_SAMPLERATE_AWARE */
/*@{*/
virtual void set_samples_per_second(SAMPLE_SPECS::sample_rate_t new_value);
/*@}*/
/** @name Functions implemented from ECA_AUDIO_POSITION */
/*@{*/
virtual bool supports_seeking(void) const { return true; }
virtual bool supports_seeking_sample_accurate(void) const { return true; }
/*@}*/
protected:
/** @name Protected functions for controlling looping */
/*@{*/
void toggle_looping(bool v) { looping_rep = v; }
bool looping_enabled(void) const { return(looping_rep); }
/*@}*/
private:
bool looping_rep, max_length_set_rep;
SAMPLE_SPECS::sample_pos_t max_length_in_samples_rep;
};
#endif
|