#include <Sample.h>
|
| static const std::vector< QString > | __loop_modes = { "forward", "reverse", "pingpong" } |
| | loop modes string
|
| |
Definition at line 67 of file Sample.h.
◆ PanEnvelope
define the type used to store pan envelope points
Definition at line 73 of file Sample.h.
◆ VelocityEnvelope
define the type used to store velocity envelope points
Definition at line 75 of file Sample.h.
◆ Sample() [1/2]
| 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.
- Parameters
-
| filepath | the path to the sample |
| license | associated with the sample |
| frames | the number of frames per channel in the sample |
| sample_rate | the sample rate of the sample |
| data_l | the left channel array of data |
| data_r | the right channel array of data |
Definition at line 66 of file Sample.cpp.
◆ Sample() [2/2]
◆ ~Sample()
◆ apply_loops()
◆ apply_pan()
◆ apply_rubberband()
| void apply_rubberband |
( |
float | fBpm | ) |
|
|
private |
◆ apply_velocity()
◆ exec_rubberband_cli()
| bool exec_rubberband_cli |
( |
float | fBpm | ) |
|
|
private |
◆ get_data_l()
| float * get_data_l |
( |
| ) |
const |
|
inline |
◆ get_data_r()
| float * get_data_r |
( |
| ) |
const |
|
inline |
◆ get_filename()
| const QString get_filename |
( |
| ) |
const |
|
inline |
◆ get_filepath()
| QString get_filepath |
( |
| ) |
const |
◆ get_frames()
◆ get_is_modified()
| bool get_is_modified |
( |
| ) |
const |
|
inline |
◆ get_loop_mode_string()
| QString get_loop_mode_string |
( |
| ) |
const |
|
inline |
◆ get_loops()
◆ get_pan_envelope()
◆ get_raw_filepath()
| const QString get_raw_filepath |
( |
| ) |
const |
|
inline |
◆ get_rubberband()
◆ get_sample_duration()
| double get_sample_duration |
( |
| ) |
const |
|
inline |
- Returns
- sample duration in seconds
Definition at line 392 of file Sample.h.
◆ get_sample_rate()
| int get_sample_rate |
( |
| ) |
const |
|
inline |
◆ get_size()
- Returns
- data size, which is calculated by __frames time sizeof( float ) * 2
Definition at line 397 of file Sample.h.
◆ get_velocity_envelope()
◆ getLicense()
◆ is_empty()
- Returns
- true if both data channels are null pointers
Definition at line 352 of file Sample.h.
◆ load() [1/2]
◆ load() [2/2]
| bool load |
( |
float | fBpm = 120 | ) |
|
◆ parse_loop_mode()
parse the given string and rturn the corresponding loop_mode
- Parameters
-
| string | the loop mode text to be parsed |
Definition at line 664 of file Sample.cpp.
◆ set_filename()
| void set_filename |
( |
const QString & | filename | ) |
|
◆ set_filepath()
| void set_filepath |
( |
const QString & | sFilepath | ) |
|
|
inline |
◆ set_frames()
| void set_frames |
( |
int | value | ) |
|
|
inline |
◆ set_is_modified()
| void set_is_modified |
( |
bool | value | ) |
|
|
inline |
◆ set_loops()
| void set_loops |
( |
Loops | loops | ) |
|
|
inline |
◆ set_pan_envelope()
◆ set_rubberband()
◆ set_sample_rate()
| void set_sample_rate |
( |
const int | sampleRate | ) |
|
|
inline |
◆ set_velocity_envelope()
◆ setLicense()
| void setLicense |
( |
const License & | license | ) |
|
|
inline |
◆ toQString()
| QString toQString |
( |
const QString & | sPrefix = "", |
|
|
bool | bShort = true ) const |
|
overridevirtual |
Formatted string version for debugging purposes.
- Parameters
-
| sPrefix | String prefix which will be added in front of every new line |
| bShort | Instead of the whole content of all classes stored as members just a single unique identifier will be displayed without line breaks. |
- Returns
- String presentation of current object.
Reimplemented from Base.
Definition at line 772 of file Sample.cpp.
◆ unload()
Flush the current content of the left and right channel and the current metadata.
Definition at line 336 of file Sample.h.
◆ write()
| bool write |
( |
const QString & | path, |
|
|
int | format = ( SF_FORMAT_WAV|SF_FORMAT_PCM_16 ) ) |
write sample to a file
- Parameters
-
| path | the path to write the sample to |
| format | the format of the output |
Definition at line 677 of file Sample.cpp.
◆ __data_l
left channel data
Definition at line 309 of file Sample.h.
◆ __data_r
right channel data
Definition at line 310 of file Sample.h.
◆ __filepath
filepath of the sample
Definition at line 306 of file Sample.h.
◆ __frames
number of frames in this sample
Definition at line 307 of file Sample.h.
◆ __is_modified
true if sample is modified
Definition at line 311 of file Sample.h.
◆ __loop_modes
| const std::vector< QString > __loop_modes = { "forward", "reverse", "pingpong" } |
|
staticprivate |
loop modes string
Definition at line 317 of file Sample.h.
◆ __loops
set of loop parameters
Definition at line 314 of file Sample.h.
◆ __pan_envelope
pan envelope vector
Definition at line 312 of file Sample.h.
◆ __rubberband
set of rubberband parameters
Definition at line 315 of file Sample.h.
◆ __sample_rate
samplerate for this sample
Definition at line 308 of file Sample.h.
◆ __velocity_envelope
velocity envelope vector
Definition at line 313 of file Sample.h.
◆ m_license
Transient property indicating the license associated with the sample.
This variable is not stored on disk but either derived from the license of the drumkit containing the sample or specified by the user when loading the it directly.
It's value is only important for samples associated with a drumkit (stored in the InstrumentLayers of a kit). For "free" ones, like metronome or sound feedback when inserting notes in the Pattern Editor, it does not have to be specified.
Definition at line 331 of file Sample.h.