Skip to content

Commit

Permalink
Addedd std:: were ever needed
Browse files Browse the repository at this point in the history
  • Loading branch information
admin committed Nov 5, 2023
1 parent 2fe436f commit ea76e82
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion src/Renderers/ofx2DCanvas.cpp
Expand Up @@ -51,7 +51,7 @@ string ofx2DCanvas::getDebugInfo(){
ss << "pressPos" << pressPos << "\n";
ss << "cam pos: " << cam.getPosition() << "\n";
ss << "cam scale: " << cam.getScale() << "\n";
ss << "bTranslate: " << boolalpha << bTranslate << "\n";
ss << "bTranslate: " << std::boolalpha << bTranslate << "\n";
ss << "viewport: " << viewport << "\n";
ss << "canvasConstraint: " << canvasConstraint << "\n";

Expand Down
2 changes: 1 addition & 1 deletion src/Renderers/ofxSlidersGrid.cpp
Expand Up @@ -209,7 +209,7 @@ void ofxSlidersGrid::setGridSize(size_t _x, size_t _y){
parameters[y].clear();
parameters[y].resize(xSize);
for(size_t x = 0; x < parameters[y].size(); x++){
parameters[y][x] = make_unique<ofxSlidersGrid::GridParameter>();
parameters[y][x] = std::make_unique<ofxSlidersGrid::GridParameter>();
}
}
buildMeshes();
Expand Down
16 changes: 8 additions & 8 deletions src/SoundObjects/VUMeter.cpp
Expand Up @@ -245,41 +245,41 @@ float VUMeter::getPeakForChannel(size_t channel) const{
}
//--------------------------------------------------------------
ofColor& VUMeter::getRmsColor(){
static std::unique_ptr<ofColor> i = make_unique<ofColor>(150);
static std::unique_ptr<ofColor> i = std::make_unique<ofColor>(150);
return *i;
}
//--------------------------------------------------------------
ofColor& VUMeter::getPeakColor(){
static std::unique_ptr<ofColor> i = make_unique<ofColor>(ofColor::yellow);
static std::unique_ptr<ofColor> i = std::make_unique<ofColor>(ofColor::yellow);
return *i;
}
//--------------------------------------------------------------
ofColor& VUMeter::getPeakHoldColor(){
static std::unique_ptr<ofColor> i = make_unique<ofColor>(ofColor::white);
static std::unique_ptr<ofColor> i = std::make_unique<ofColor>(ofColor::white);
return *i;
}
//--------------------------------------------------------------
ofColor& VUMeter::getBorderColor(){
static std::unique_ptr<ofColor> i = make_unique<ofColor>(70);
static std::unique_ptr<ofColor> i = std:: make_unique<ofColor>(70);
return *i;
}
//--------------------------------------------------------------
ofColor& VUMeter::getClippingColor(){
static std::unique_ptr<ofColor> i = make_unique<ofColor>(ofColor::red);
static std::unique_ptr<ofColor> i = std::make_unique<ofColor>(ofColor::red);
return *i;
}
//--------------------------------------------------------------
uint64_t& VUMeter::getPeakHoldTime(){
static std::unique_ptr<uint64_t> i = make_unique<uint64_t>(5000);
static std::unique_ptr<uint64_t> i = std::make_unique<uint64_t>(5000);
return *i;
}
//--------------------------------------------------------------
uint64_t& VUMeter::getPeakReleaseTime(){
static std::unique_ptr<uint64_t> i = make_unique<uint64_t>(1000);
static std::unique_ptr<uint64_t> i = std::make_unique<uint64_t>(1000);
return *i;
}
//--------------------------------------------------------------
bool& VUMeter::getForceRebuild(){
static std::unique_ptr<bool> i = make_unique<bool>(false);
static std::unique_ptr<bool> i = std::make_unique<bool>(false);
return *i;
}
6 changes: 3 additions & 3 deletions src/ofxMultiSoundPlayer.cpp
Expand Up @@ -41,14 +41,14 @@ bool ofxMultiSoundPlayer::loadAsync(std::filesystem::path filePath, bool bAutopl
setNumInstances(1);

bool ret = instances[0]->loadAsync(filePath, bAutoplay);
ofLogVerbose("ofxMultiSoundPlayer::loadAsync" ) << filePath << " success: " << boolalpha << ret;
ofLogVerbose("ofxMultiSoundPlayer::loadAsync" ) << filePath << " success: " << std::boolalpha << ret;
return ret;
}
//--------------------------------------------------------------
bool ofxMultiSoundPlayer::load(std::filesystem::path filePath, bool _stream){
setNumInstances(1);
bool ret = instances[0]->load(filePath, _stream);
ofLogVerbose("ofxMultiSoundPlayer::load" ) << filePath << " success: " << boolalpha << ret;
ofLogVerbose("ofxMultiSoundPlayer::load" ) << filePath << " success: " << std::boolalpha << ret;
return ret;
}
//--------------------------------------------------------------
Expand Down Expand Up @@ -206,7 +206,7 @@ void ofxMultiSoundPlayer::setNumInstances(const size_t & num){
/// the instances will get automatically disconnected from the mixer upon their destruction.
instances.resize(num);
for(size_t i = prevSize; i < instances.size(); i++){
instances[i] = make_unique<ofxSingleSoundPlayer>();
instances[i] = std::make_unique<ofxSingleSoundPlayer>();
instances[i]->setId(i);
instances[i]->setLoop(bDefaultlLooping);
instances[i]->connectTo(_mixer);
Expand Down
2 changes: 1 addition & 1 deletion src/ofxMultiSoundPlayer.h
Expand Up @@ -101,7 +101,7 @@ class ofxMultiSoundPlayer: public ofxBaseSoundPlayer {

private:

vector<unique_ptr<ofxSingleSoundPlayer>> instances;
vector<std::unique_ptr<ofxSingleSoundPlayer>> instances;



Expand Down
14 changes: 7 additions & 7 deletions src/ofxSingleSoundPlayer.cpp
Expand Up @@ -17,9 +17,9 @@ ofSoundBuffer ofxSingleSoundPlayer::_dummyBuffer = ofSoundBuffer();
ofxSoundFile ofxSingleSoundPlayer::_dummySoundFile = {};

size_t makeUniqueId(){
static unique_ptr<size_t> count;
static std::unique_ptr<size_t> count;
if(!count){
count = make_unique<size_t>(0);
count = std::make_unique<size_t>(0);
}
(*count.get())++;
return *count.get();
Expand Down Expand Up @@ -329,7 +329,7 @@ void ofxSingleSoundPlayer::audioOut(ofSoundBuffer& outputBuffer){
else {
#ifdef USE_OFX_SAMPLE_RATE
if(sampleRateConverter == nullptr){
sampleRateConverter = make_unique<ofxSamplerate>() ;
sampleRateConverter = std::make_unique<ofxSamplerate>() ;
}
auto resamplingResults = sampleRateConverter->changeSpeed(sourceBuffer, outputBuffer, relativeSpeed.load(), position,loop);
nFrames = resamplingResults.inputFramesUsed;
Expand Down Expand Up @@ -452,7 +452,7 @@ bool ofxSingleSoundPlayer::preprocessBuffer(){
bNeedsPreprocessBuffer = true;
if(isLoaded() && !bNeedsRelativeSpeedUpdate && outputSampleRate != 0 && sourceSampleRate != 0){
setState(RESAMPLING);
preprocessedBuffer = make_unique<ofSoundBuffer>();
preprocessedBuffer = std::make_unique<ofSoundBuffer>();

if(buffer != nullptr){
(*preprocessedBuffer) = (*buffer);
Expand Down Expand Up @@ -678,7 +678,7 @@ void ofxSingleSoundPlayer::_makeSoundFile(){
//--------------------------------------------------------------
void ofxSingleSoundPlayer::_makeSoundBuffer(){
if(!buffer){
buffer = make_unique<ofSoundBuffer>();
buffer = std::make_unique<ofSoundBuffer>();
}
}

Expand All @@ -699,12 +699,12 @@ std::string ofxSingleSoundPlayer::getPlaybackInfo() const {
stringstream ss;
ss << "Position: " << getPosition() << endl;
ss << "PositionMS: " << getPositionMS() << endl;
ss << "Playing: " << boolalpha << isPlaying() << endl;
ss << "Playing: " << std::boolalpha << isPlaying() << endl;
ss << "Speed: " << getSpeed() << endl;
ss << "Rel. Speed: " << getRelativeSpeed() << endl;
ss << "Pan: " << getPan() << endl;
ss << "Volume: " << getVolume() << endl;
ss << "IsLooping: " << boolalpha << isLooping() << endl;
ss << "IsLooping: " << std::boolalpha << isLooping() << endl;

return ss.str();

Expand Down
22 changes: 11 additions & 11 deletions src/ofxSingleSoundPlayer.h
Expand Up @@ -191,8 +191,8 @@ class ofxSingleSoundPlayer: public ofxBaseSoundPlayer {

size_t id = 0;

atomic<bool> bNeedsFade = {false};
atomic<bool> bFadeIn = {true};
std::atomic<bool> bNeedsFade = {false};
std::atomic<bool> bFadeIn = {true};

enum State{
UNLOADED = 0,
Expand All @@ -219,11 +219,11 @@ class ofxSingleSoundPlayer: public ofxBaseSoundPlayer {



atomic<size_t> sourceSampleRate;
atomic<size_t> sourceNumFrames;
atomic<size_t> sourceNumChannels;
std::atomic<size_t> sourceSampleRate;
std::atomic<size_t> sourceNumFrames;
std::atomic<size_t> sourceNumChannels;
size_t sourceDuration;
atomic<size_t> outputSampleRate;
std::atomic<size_t> outputSampleRate;


std::atomic<bool> bIsPlaying;
Expand All @@ -235,14 +235,14 @@ class ofxSingleSoundPlayer: public ofxBaseSoundPlayer {
std::atomic<float> volumeLeft, volumeRight;

void updateRelativeSpeed();
atomic<bool> bNeedsRelativeSpeedUpdate;
std::atomic<bool> bNeedsRelativeSpeedUpdate;

void volumeChanged(float&);


unique_ptr<ofSoundBuffer> buffer = nullptr;
unique_ptr<ofSoundBuffer> preprocessedBuffer = nullptr;
shared_ptr<ofxSoundFile> soundFile = nullptr;
std::unique_ptr<ofSoundBuffer> buffer = nullptr;
std::unique_ptr<ofSoundBuffer> preprocessedBuffer = nullptr;
std::shared_ptr<ofxSoundFile> soundFile = nullptr;

std::atomic<bool> bStreaming;

Expand Down Expand Up @@ -272,7 +272,7 @@ class ofxSingleSoundPlayer: public ofxBaseSoundPlayer {

size_t _id = 0;
#ifdef USE_OFX_SAMPLE_RATE
unique_ptr<ofxSamplerate> sampleRateConverter = nullptr;
std::unique_ptr<ofxSamplerate> sampleRateConverter = nullptr;
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion src/ofxSoundMatrixMixer.cpp
Expand Up @@ -100,7 +100,7 @@ ofxSoundMatrixMixer::ofxSoundMatrixMixer():ofxSoundObject(OFX_SOUND_OBJECT_PROCE
ofParameter<bool>& ofxSoundMatrixMixer::getComputeRMSandPeak(){
static std::unique_ptr<ofParameter<bool>> i;
if(!i){
i = make_unique<ofParameter<bool>>();
i = std::make_unique<ofParameter<bool>>();
i->set("Compute RMS / Peak", true);
}
return *i;
Expand Down
2 changes: 1 addition & 1 deletion src/ofxSoundMatrixMixer.h
Expand Up @@ -213,7 +213,7 @@ class ofxSoundMatrixMixer: public ofxSoundObject{

#endif

atomic<float> defaultOutputVol = {0.0f};
std::atomic<float> defaultOutputVol = {0.0f};


private:
Expand Down

0 comments on commit ea76e82

Please sign in to comment.