for (
auto j:
- _active_texts[static_cast<int>(TextType::OPEN_SUBTITLE)].get_burnt(DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_open_subtitles)
+ _active_texts[TextType::OPEN_SUBTITLE].get_burnt(DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_open_subtitles)
) {
/* Bitmap subtitles */
}
DCPTime from(content_time_to_dcp(piece, subtitle.from()));
- _active_texts[static_cast<int>(content->type())].add_from(weak_content, ps, from);
+ _active_texts[content->type()].add_from(weak_content, ps, from);
}
ps.string.push_back (s);
}
- _active_texts[static_cast<int>(content->type())].add_from(weak_content, ps, from);
+ _active_texts[content->type()].add_from(weak_content, ps, from);
}
return;
}
- if (!_active_texts[static_cast<int>(content->type())].have(weak_content)) {
+ if (!_active_texts[content->type()].have(weak_content)) {
return;
}
return;
}
- auto from = _active_texts[static_cast<int>(content->type())].add_to(weak_content, dcp_to);
+ auto from = _active_texts[content->type()].add_to(weak_content, dcp_to);
bool const always = (content->type() == TextType::OPEN_SUBTITLE && _always_burn_open_subtitles);
if (content->use() && !always && !content->burn()) {
}
_audio_merger.clear ();
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- _active_texts[i].clear ();
- }
+ std::for_each(_active_texts.begin(), _active_texts.end(), [](ActiveText& a) { a.clear(); });
for (auto i: _pieces) {
if (time < i->content->position()) {
Player::do_emit_video (shared_ptr<PlayerVideo> pv, DCPTime time)
{
if (pv->eyes() == Eyes::BOTH || pv->eyes() == Eyes::RIGHT) {
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- _active_texts[i].clear_before (time);
- }
+ std::for_each(_active_texts.begin(), _active_texts.end(), [time](ActiveText& a) { a.clear_before(time); });
}
auto subtitles = open_subtitles_for_frame (time);
#include "content_text.h"
#include "content_video.h"
#include "empty.h"
+#include "enum_indexed_vector.h"
#include "film.h"
#include "image.h"
#include "player_text.h"
Empty _black;
Empty _silent;
- ActiveText _active_texts[static_cast<int>(TextType::COUNT)];
+ EnumIndexedVector<ActiveText, TextType> _active_texts;
std::shared_ptr<AudioProcessor> _audio_processor;
boost::atomic<dcpomatic::DCPTime> _playback_length;