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

View file

@ -44,21 +44,21 @@ std::unique_ptr<Effect> EffectFactory::makeEffect(absl::Span<const Opcode> membe
if (!opcode) { if (!opcode) {
DBG("The effect does not specify a type"); 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 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()) { if (it == _entries.end()) {
DBG("Unsupported effect type: " << type); DBG("Unsupported effect type: " << type);
return std::make_unique<sfz::fx::Nothing>(); return absl::make_unique<sfz::fx::Nothing>();
} }
auto fx = it->make(members); auto fx = it->make(members);
if (!fx) { if (!fx) {
DBG("Could not instantiate effect of type: " << type); DBG("Could not instantiate effect of type: " << type);
return std::make_unique<sfz::fx::Nothing>(); return absl::make_unique<sfz::fx::Nothing>();
} }
return fx; return fx;

View file

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

View file

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