Buffer& get(DataType type, size_t i)
{
assert(i <= _count.get(type));
- return *_buffers[type.to_index()][i];
+ return *_buffers[type][i];
}
AudioBuffer& get_audio(size_t i)
};
audio_iterator audio_begin() { return audio_iterator(*this, 0); }
- audio_iterator audio_end() { return audio_iterator(*this, _count.get(DataType::AUDIO)); }
+ audio_iterator audio_end() { return audio_iterator(*this, _count.n_audio()); }
class iterator {
public:
iterator& operator++() { ++_index; return *this; } // yes, prefix only
bool operator==(const iterator& other) { return (_index == other._index); }
bool operator!=(const iterator& other) { return (_index != other._index); }
+ iterator operator=(const iterator& other) { _set = other._set; _type = other._type; _index = other._index; return *this; }
private:
friend class BufferSet;
private:
typedef std::vector<Buffer*> BufferVec;
- /// Vector of vectors, indexed by DataType::to_index()
+ /// Vector of vectors, indexed by DataType
std::vector<BufferVec> _buffers;
/// Use counts (there may be more actual buffers than this)
/// Available counts (number of buffers actually allocated)
ChanCount _available;
- /// Whether we (don't) 'own' the contained buffers (are a mirror of a PortSet)
+ /// Whether we (don't) 'own' the contained buffers (otherwise we mirror a PortSet)
bool _is_mirror;
};