chrono literals

This commit is contained in:
Paul Fd 2020-03-10 17:52:41 +01:00
parent de189371f5
commit 2daf53ab6c
4 changed files with 7 additions and 11 deletions

View file

@ -3,7 +3,6 @@
#include <thread>
#include "absl/algorithm/container.h"
#include "SIMDHelpers.h"
using namespace std::chrono_literals;
sfz::EQHolder::EQHolder(const MidiState& state)
:midiState(state)
@ -114,7 +113,7 @@ size_t sfz::EQPool::setnumEQs(size_t numEQs)
AtomicDisabler disabler { canGiveOutEQs };
while(givingOutEQs)
std::this_thread::sleep_for(1ms);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
auto eqIterator = eqs.begin();
auto eqSentinel = eqs.rbegin();

View file

@ -44,21 +44,21 @@ std::unique_ptr<Effect> EffectFactory::makeEffect(absl::Span<const Opcode> membe
if (!opcode) {
DBG("The effect does not specify a type");
return std::make_unique<sfz::fx::Nothing>();
return absl::make_unique<sfz::fx::Nothing>();
}
const absl::string_view type = opcode->value;
const auto it = absl::c_find_if(_entries, [&](auto&& entry) { return entry.name == type; });
const auto it = absl::c_find_if(_entries, [&](const FactoryEntry& entry) { return entry.name == type; });
if (it == _entries.end()) {
DBG("Unsupported effect type: " << type);
return std::make_unique<sfz::fx::Nothing>();
return absl::make_unique<sfz::fx::Nothing>();
}
auto fx = it->make(members);
if (!fx) {
DBG("Could not instantiate effect of type: " << type);
return std::make_unique<sfz::fx::Nothing>();
return absl::make_unique<sfz::fx::Nothing>();
}
return fx;

View file

@ -4,7 +4,6 @@
#include "AtomicGuard.h"
#include <thread>
#include <chrono>
using namespace std::chrono_literals;
sfz::FilterHolder::FilterHolder(const MidiState& midiState)
: midiState(midiState)
@ -113,7 +112,7 @@ size_t sfz::FilterPool::setNumFilters(size_t numFilters)
AtomicDisabler disabler { canGiveOutFilters };
while(givingOutFilters)
std::this_thread::sleep_for(1ms);
std::this_thread::sleep_for(std::chrono::milliseconds(1));
auto filterIterator = filters.begin();
auto filterSentinel = filters.rbegin();

View file

@ -13,8 +13,6 @@
#include <sstream>
#include <cmath>
using namespace std::chrono_literals;
template<class T>
void printStatistics(std::vector<T>& data)
{
@ -141,7 +139,7 @@ void sfz::Logger::moveEvents() noexcept
callbackTimes.clear();
}
std::this_thread::sleep_for(10ms);
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
}