Minor touchups.

This commit is contained in:
byuu 2019-10-05 14:30:55 +09:00
parent e3f2e634c8
commit c6f92b782c
3 changed files with 4 additions and 5 deletions

View File

@ -63,7 +63,7 @@ struct Stream {
auto addLowPassFilter(double cutoffFrequency, Filter::Order order, uint passes = 1) -> void;
auto addHighPassFilter(double cutoffFrequency, Filter::Order order, uint passes = 1) -> void;
auto pending() const -> uint;
auto pending() const -> bool;
auto read(double samples[]) -> uint;
auto write(const double samples[]) -> void;

View File

@ -81,9 +81,8 @@ auto Stream::addHighPassFilter(double cutoffFrequency, Filter::Order order, uint
}
}
auto Stream::pending() const -> uint {
if(!channels) return 0;
return channels[0].resampler.pending();
auto Stream::pending() const -> bool {
return channels && channels[0].resampler.pending();
}
auto Stream::read(double samples[]) -> uint {

View File

@ -41,7 +41,7 @@ struct queue {
template<typename U = T> auto capacity() const -> uint { return _capacity * sizeof(T) / sizeof(U); }
template<typename U = T> auto size() const -> uint { return _size * sizeof(T) / sizeof(U); }
auto empty() const -> bool { return _size == 0; }
auto pending() const -> bool { return _size; }
auto pending() const -> bool { return _size > 0; }
auto full() const -> bool { return _size >= (int)_capacity; }
auto underflow() const -> bool { return _size < 0; }
auto overflow() const -> bool { return _size > (int)_capacity; }