#include "generic.h"
#include <wx/filename.h>
Functions | |
wxString | SetFilename (const wxString path, const wxString name, const wxString ext, const wxString fsuffix) |
Construct filename from components. | |
size_t | sample_len_generic (const enum encoding_t encoding, const enum bitencoding_t bitencoding, const enum samplewidth_t samplewidth) |
size_t | SampleLen (const format_t &format) |
Size of one sample. | |
size_t | SampleLen (const format_ex_t &format) |
Size of one sample (for format_ex_t). | |
void * | alloc_samples_generic (const enum encoding_t encoding, const enum bitencoding_t bitencoding, const enum samplewidth_t samplewidth, const samples_t count, const track_t channels) |
void * | AllocSamples (const format_t &format, const samples_t count) |
Allocates memory for the given number of samples. | |
void * | AllocSamples (const format_ex_t &format, const samples_t count) |
Allocates memory for the given number of samples (for format_ex_t). | |
void | free_samples_generic (const enum encoding_t encoding, const enum bitencoding_t bitencoding, const enum samplewidth_t samplewidth, const void *data) |
void | FreeSamples (const format_t &format, const void *data) |
Safely deallocates memory for samples. | |
void | FreeSamples (const format_ex_t &format, const void *data) |
Safely deallocates memory for samples (for format_ex_t). | |
floatsample_t | samples_average_generic (const format_t &format, const samples_t samples, const void *inbuf) |
void | SamplesAverage (const format_t &format, const samples_t samples, const void *inbuf, const void *outbuf) |
Returns average sample. | |
void | SamplesMax (const format_t &format, const samples_t samples, const void *inbuf, const void *outbuf) |
Returns maximal sample. | |
floatsample_t | NormSample (const format_t &format, const void *sample, const floatsample_t max) |
Returns normalized value of the sample (in internal format). | |
floatsample_t | SamplesAverageNorm (const format_t &format, const samples_t samples, const void *inbuf, const floatsample_t max) |
Returns average sample in normalized internal format. | |
floatsample_t | SamplesMaxNorm (const format_t &format, const samples_t samples, const void *inbuf, const floatsample_t max) |
Returns normalized value of the sample (in internal format). | |
samples_t | SamplesCmp (const format_t &infmt, const format_t &outfmt, const samples_t samples) |
Converts number of samples from one format to another. | |
samples_t | SamplesCmpIn (const format_t &infmt, const format_t &outfmt, const samples_t insamples) |
Converts number of samples from one format to another (reverse conversion). | |
void | CnvSample (const format_t infmt, const format_t outfmt, void *inbuf, void *outbuf) |
samples_t | SamplesConv (const format_t &infmt, const format_ex_t &outfmt, const samples_t samples, void *inbuf, void *outbuf) |
Local coversion between various formats. | |
void | ClearSamples (const format_ex_t &format, const samples_t samples, void *buf) |
Zero modulation. | |
bool | AddSamples (const format_ex_t &format, const volume_t volume[], const samples_t tsamples, const samples_t samples, const void *tbuf, const void *buf) |
Add additional samples to given samples. | |
void | FormatAlias (const format_ex_t &infmt, format_t &outfmt) |
Convert format_ex_t to format_t. | |
Variables | |
const wxUint16 | fmfile_version_major = 1 |
Major version number in project file header. | |
const wxUint16 | fmfile_version_minor = 0 |
Minor version number in project file header. | |
const volume_t | volume_min = 0 |
Minimal channel volume. | |
const volume_t | volume_max = 255 |
Maximal channel volume. | |
const sample_pcm8u_t | sample_pcm8u_min = 0 |
Sample precision constants. | |
const sample_pcm8u_t | sample_pcm8u_max = 255 |
const sample_pcm8u_t | sample_pcm8u_0 = 127 |
const sample_pcm8u_w_t | sample_pcm8u_dr = 128 |
const sample_pcm8s_t | sample_pcm8s_min = -128 |
const sample_pcm8s_t | sample_pcm8s_max = 127 |
const sample_pcm8s_t | sample_pcm8s_0 = 0 |
const sample_pcm8s_w_t | sample_pcm8s_dr = 128 |
const sample_pcm16u_t | sample_pcm16u_min = 0 |
const sample_pcm16u_t | sample_pcm16u_max = 65535 |
const sample_pcm16u_t | sample_pcm16u_0 = 32767 |
const sample_pcm16u_w_t | sample_pcm16u_dr = 32768 |
const sample_pcm16s_t | sample_pcm16s_min = -32768 |
const sample_pcm16s_t | sample_pcm16s_max = 32767 |
const sample_pcm16s_t | sample_pcm16s_0 = 0 |
const sample_pcm16s_w_t | sample_pcm16s_dr = 32768 |
|
Add additional samples to given samples. This function adds additional samples to the samples already present in the buffer, practically performing an overlay-mix. The samples are simply added together, however underflow or overflow is checked and handled by cropping (setting maximal or minimal valid value). The return value indicates whether the overflow or underflow occured. Raises Fatal on unknown format.
|
|
|
|
Allocates memory for the given number of samples (for format_ex_t). Dynamicaly allocates memory for storing given number of samples in given format. Raises Fatal on unknown format.
|
|
Allocates memory for the given number of samples. Dynamicaly allocates memory for storing given number of samples in given format. Raises Fatal on unknown format.
|
|
Zero modulation. Sets the buffer to zero amplitude. Raises Fatal on unknown format.
|
|
|
|
Convert format_ex_t to format_t. Converts format_ex_t structure to format_t, discarting the number of channels.
|
|
|
|
Safely deallocates memory for samples (for format_ex_t). Safely deallocates memory previously allocated by AllocSamples. Raises Fatal on unknown format, other error states indicates in the same way as delete operator.
|
|
Safely deallocates memory for samples. Safely deallocates memory previously allocated by AllocSamples. Raises Fatal on unknown format, other error states indicates in the same way as delete operator.
|
|
Returns normalized value of the sample (in internal format). Calculates the value of the sample in internal representation (zero amplitude is 0, maximal amplitude is +max, maximal negative amplitude is -max). Raises Fatal on unknown format.
|
|
|
|
Size of one sample (for format_ex_t). Returns the size in bytes of one sample in given format. Raises Fatal on unknown format.
|
|
Size of one sample. Returns the size in bytes of one sample in given format. Raises Fatal on unknown format.
|
|
|
|
Returns average sample. Calculates the average value of all samples from input buffer. Raises Fatal on unknown format.
|
|
Returns average sample in normalized internal format. Calculates the average value of all samples from input buffer. Raises Fatal on unknown format.
|
|
Converts number of samples from one format to another. Converts the number of samples in one sample format to the number of samples that would be needed after conversion to another sample format. The calculation is based on encoding, bit encoding, sample width and sample rate. The returned value is consistent with the output buffer requirements of SampleConv (both local and global conversion). Raises Fatal on unknown format.
|
|
Converts number of samples from one format to another (reverse conversion). Converts the number of samples in one sample format to the number of samples that would be needed after conversion to another sample format. The calculation is based on encoding, bit encoding, sample width and sample rate. The returned value is consistent with the output buffer requirements of SampleConv (both local and global conversion). Raises Fatal on unknown format.
|
|
Local coversion between various formats. Converts audio data between given formats. The conversion is done using the nearest neibourghood algorithm w/o antialiasing, which makes it suitable for both global and local (partial) conversion. The conversion is based on encoding, bit encoding, sample width and sample rate. The function can also duplicate the output data to multiple output channels if needed. Sample rate is converted always in the more precise format of both input and output. Channel multiplication is done always as the final step. Raises Fatal on unknown format.
|
|
Returns maximal sample. Calculates the maximal value of all samples from input buffer. Raises Fatal on unknown format.
|
|
Returns normalized value of the sample (in internal format). Calculates the value of the sample in internal representation (zero amplitude is 0, maximal amplitude is +max, maximal negative amplitude is -max). Raises Fatal on unknown format.
|
|
Construct filename from components. Constructs filename with path (in standard wxWidgets representation). Extension and path is chopped from the name of the file (second parameter), the new path is prepended at the beginning and the new suffix and extension is appended.
|
|
Major version number in project file header.
|
|
Minor version number in project file header.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sample precision constants.
|
|
Maximal channel volume.
|
|
Minimal channel volume.
|