}
shared_ptr<Resampler> resampler;
- map<AudioStreamPtr, shared_ptr<Resampler> >::iterator i = _resamplers.find(stream);
+ ResamplerMap::iterator i = _resamplers.find(stream);
if (i != _resamplers.end ()) {
resampler = i->second;
} else {
ContentTime
AudioDecoder::stream_position (AudioStreamPtr stream) const
{
- map<AudioStreamPtr, Frame>::const_iterator i = _positions.find (stream);
+ PositionMap::const_iterator i = _positions.find (stream);
DCPOMATIC_ASSERT (i != _positions.end ());
return ContentTime::from_frames (i->second, _content->resampled_frame_rate());
}
AudioDecoder::position () const
{
optional<ContentTime> p;
- for (map<AudioStreamPtr, Frame>::const_iterator i = _positions.begin(); i != _positions.end(); ++i) {
+ for (PositionMap::const_iterator i = _positions.begin(); i != _positions.end(); ++i) {
ContentTime const ct = stream_position (i->first);
if (!p || ct < *p) {
p = ct;
void
AudioDecoder::seek ()
{
- for (map<AudioStreamPtr, shared_ptr<Resampler> >::iterator i = _resamplers.begin(); i != _resamplers.end(); ++i) {
+ for (ResamplerMap::iterator i = _resamplers.begin(); i != _resamplers.end(); ++i) {
i->second->flush ();
i->second->reset ();
}
- for (map<AudioStreamPtr, Frame>::iterator i = _positions.begin(); i != _positions.end(); ++i) {
+ for (PositionMap::iterator i = _positions.begin(); i != _positions.end(); ++i) {
i->second = 0;
}
}
void
AudioDecoder::flush ()
{
- for (map<AudioStreamPtr, shared_ptr<Resampler> >::iterator i = _resamplers.begin(); i != _resamplers.end(); ++i) {
+ for (ResamplerMap::iterator i = _resamplers.begin(); i != _resamplers.end(); ++i) {
shared_ptr<const AudioBuffers> ro = i->second->flush ();
if (ro->frames() > 0) {
Data (i->first, ContentAudio (ro, _positions[i->first]));
/** Frame after the last one that was emitted from Data (i.e. at the resampled rate, if applicable)
* for each AudioStream.
*/
- std::map<AudioStreamPtr, Frame> _positions;
- std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > _resamplers;
+ typedef std::map<AudioStreamPtr, Frame> PositionMap;
+ PositionMap _positions;
+ typedef std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > ResamplerMap;
+ ResamplerMap _resamplers;
bool _fast;
};