void setTimeDivision(const double division) { if(division <= 0) { logError("Ignoring attempt to set division to %f", division); return; } _getAudioSettings()->timeDivision = division; }
void setTempo(const double tempo) { if(tempo <= 0.0f) { logError("Ignoring attempt to set tempo to %f", tempo); return; } logInfo("Setting tempo to %d", tempo); _getAudioSettings()->tempo = tempo; }
void setSampleRate(const double sampleRate) { if(sampleRate <= 0.0f) { logError("Ignoring attempt to set sample rate to %f", sampleRate); return; } logInfo("Setting sample rate to %gHz", sampleRate); _getAudioSettings()->sampleRate = sampleRate; }
void setNumChannels(const unsigned int numChannels) { if(numChannels <= 0) { logError("Ignoring attempt to set num channels to %d", numChannels); return; } logInfo("Setting %d channels", numChannels); _getAudioSettings()->numChannels = numChannels; }
void setBlocksize(const unsigned long blocksize) { if(blocksize <= 0) { logError("Ignoring attempt to set invalid blocksize to %d", blocksize); return; } logInfo("Setting blocksize to %ld", blocksize); _getAudioSettings()->blocksize = blocksize; }
boolByte setSampleRate(const SampleRate sampleRate) { if (sampleRate <= 0.0f) { logError("Can't set sample rate to %f", sampleRate); return false; } logInfo("Setting sample rate to %gHz", sampleRate); _getAudioSettings()->sampleRate = sampleRate; return true; }
boolByte setNumChannels(const ChannelCount numChannels) { if (numChannels <= 0) { logError("Can't set channel count to %d", numChannels); return false; } logInfo("Setting %d channels", numChannels); _getAudioSettings()->numChannels = numChannels; return true; }
boolByte setBlocksize(const SampleCount blocksize) { if (blocksize <= 0) { logError("Can't set invalid blocksize %d", blocksize); return false; } logInfo("Setting blocksize to %ld", blocksize); _getAudioSettings()->blocksize = blocksize; return true; }
boolByte setTempo(const Tempo tempo) { if (tempo <= 0.0f) { logError("Cannot set tempo to %f", tempo); return false; } logInfo("Setting tempo to %d", tempo); _getAudioSettings()->tempo = tempo; return true; }
void setTimeSignatureNoteValue(const short noteValue) { // Bit of an easter egg :) if(!(noteValue == 2 || noteValue == 4 || noteValue == 8 || noteValue == 16) || noteValue < 2 || noteValue > 16) { logInfo("Interesting time signature you've chosen. I'm sure this piece is going to sound great..."); } if(noteValue <= 0) { logError("Ignoring attempt to set time signature denominator to %d", noteValue); return; } _getAudioSettings()->timeSignatureNoteValue = noteValue; }
void setTimeSignatureBeatsPerMeasure(const short beatsPerMeasure) { // Bit of an easter egg :) if(beatsPerMeasure < 2 || beatsPerMeasure > 12) { logInfo("Freaky time signature, but whatever you say..."); } if(beatsPerMeasure <= 0) { logError("Ignoring attempt to set time signature numerator to %d", beatsPerMeasure); return; } _getAudioSettings()->timeSignatureBeatsPerMeasure = beatsPerMeasure; }
boolByte setBitDepth(const BitDepth bitDepth) { switch (bitDepth) { case kBitDepth8Bit: case kBitDepth16Bit: case kBitDepth24Bit: case kBitDepth32Bit: _getAudioSettings()->bitDepth = bitDepth; return true; default: logError("Invalid bit depth %d", bitDepth); return false; } }
ChannelCount getNumChannels(void) { return _getAudioSettings()->numChannels; }
short getTimeSignatureNoteValue(void) { return _getAudioSettings()->timeSignatureNoteValue; }
short getTimeSignatureBeatsPerMeasure(void) { return _getAudioSettings()->timeSignatureBeatsPerMeasure; }
double getTempo(void) { return _getAudioSettings()->tempo; }
double getTimeDivision(void) { return _getAudioSettings()->timeDivision; }
unsigned long getBlocksize(void) { return _getAudioSettings()->blocksize; }
unsigned int getNumChannels(void) { return _getAudioSettings()->numChannels; }
double getSampleRate(void) { return _getAudioSettings()->sampleRate; }
SampleCount getBlocksize(void) { return _getAudioSettings()->blocksize; }
BitDepth getBitDepth(void) { return _getAudioSettings()->bitDepth; }