105 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const;
129 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const;
143 Sample(
const QString& filepath,
const License& license =
License(),
int frames=0,
int sample_rate=0,
float* data_l=
nullptr,
float* data_r=
nullptr );
145 Sample( std::shared_ptr<Sample> other );
155 bool write(
const QString& path,
int format= ( SF_FORMAT_WAV|SF_FORMAT_PCM_16 ) );
173 static std::shared_ptr<Sample>
load(
const QString& filepath,
const License& license =
License() );
202 bool load(
float fBpm = 120 );
282 QString
toQString(
const QString& sPrefix =
"",
bool bShort =
true )
const override;
401 return __frames *
sizeof( float ) * 2;
A container for a sample, being able to apply modifications on it.
EnvelopePoint()
default constructor
Wrapper class to help Hydrogen deal with the license information specified in a drumkit.
set of loop configuration flags
QString toQString(const QString &sPrefix="", bool bShort=true) const
Loops(const Loops *other)
copy constructor
LoopMode
possible sample editing loop mode
bool operator==(const Loops &b) const
equal to operator
int end_frame
the frame index where to end the new sample to
int start_frame
the frame index where to start the new sample from
LoopMode mode
one of the possible loop modes
int count
the counts of loops to apply
int loop_frame
the frame index where to start the loop from
set of rubberband configuration flags
QString toQString(const QString &sPrefix="", bool bShort=true) const
int c_settings
TODO should be crispness, see rubberband -h.
float divider
TODO should be ratio : desired time ratio.
bool use
is rubberband enabled
Rubberband(const Rubberband *other)
copy constructor
bool operator==(const Rubberband &b) const
equal to operator
int __frames
number of frames in this sample
bool __is_modified
true if sample is modified
void set_loops(Loops loops)
float * __data_l
left channel data
bool apply_loops()
apply __loops transformation to the sample
void set_rubberband(Rubberband rubberband)
QString get_filepath() const
PanEnvelope * get_pan_envelope()
QString get_loop_mode_string() const
void apply_pan()
apply __pan_envelope transformation to the sample
void set_velocity_envelope(VelocityEnvelope envelope)
int __sample_rate
samplerate for this sample
void set_filepath(const QString &sFilepath)
void set_pan_envelope(PanEnvelope envelope)
static Loops::LoopMode parse_loop_mode(const QString &string)
parse the given string and rturn the corresponding loop_mode
Rubberband __rubberband
set of rubberband parameters
int get_sample_rate() const
void unload()
Flush the current content of the left and right channel and the current metadata.
double get_sample_duration() const
const QString get_filename() const
bool get_is_modified() const
static QString sndfileFormatToQString(int nFormat)
Rubberband get_rubberband() const
void set_is_modified(bool value)
__is_modified setter
float * get_data_l() const
const QString get_raw_filepath() const
Loops __loops
set of loop parameters
License m_license
Transient property indicating the license associated with the sample.
float * __data_r
right channel data
static std::shared_ptr< Sample > load(const QString &filepath, const License &license=License())
std::vector< EnvelopePoint > VelocityEnvelope
define the type used to store velocity envelope points
bool exec_rubberband_cli(float fBpm)
call rubberband cli to modify the sample using __rubberband
float * get_data_r() const
void setLicense(const License &license)
VelocityEnvelope __velocity_envelope
velocity envelope vector
void set_sample_rate(const int sampleRate)
Sample(const QString &filepath, const License &license=License(), int frames=0, int sample_rate=0, float *data_l=nullptr, float *data_r=nullptr)
Sample constructor.
void apply_velocity()
apply __velocity_envelope transformation to the sample
void set_frames(int value)
__frames setter
QString toQString(const QString &sPrefix="", bool bShort=true) const override
Formatted string version for debugging purposes.
QString __filepath
filepath of the sample
bool write(const QString &path, int format=(SF_FORMAT_WAV|SF_FORMAT_PCM_16))
write sample to a file
PanEnvelope __pan_envelope
pan envelope vector
void apply_rubberband(float fBpm)
apply __rubberband transformation to the sample
VelocityEnvelope * get_velocity_envelope()
std::vector< EnvelopePoint > PanEnvelope
define the type used to store pan envelope points
static const std::vector< QString > __loop_modes
loop modes string
void set_filename(const QString &filename)
License getLicense() const
to be able to sort velocity points vectors
bool operator()(const EnvelopePoint &a, const EnvelopePoint &b)