, _ignore_deselect (false)
, _no_check_selection (false)
{
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- _text_panel[i] = 0;
- }
-
_splitter = new LimitedSplitter (n);
_top_panel = new wxPanel (_splitter);
bool have_video = false;
bool have_audio = false;
- bool have_text[static_cast<int>(TextType::COUNT)] = { false, false };
+ EnumIndexedVector<bool, TextType> have_text;
for (auto i: selected()) {
if (i->video) {
have_video = true;
_text_panel[i]->create ();
} else if (!have_text[i] && _text_panel[i]) {
_notebook->DeletePage (off);
- _text_panel[i] = 0;
+ _text_panel[i] = nullptr;
}
if (have_text[i]) {
++off;
if (_audio_panel) {
_audio_panel->Enable (_generally_sensitive && audio_selection.size() > 0);
}
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- if (_text_panel[i]) {
- _text_panel[i]->Enable (_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
+ for (auto text: _text_panel) {
+ if (text) {
+ text->Enable(_generally_sensitive && selection.size() == 1 && !selection.front()->text.empty());
}
}
_timing_panel->Enable (_generally_sensitive);
if (_audio_panel) {
p.push_back (_audio_panel);
}
- for (int i = 0; i < static_cast<int>(TextType::COUNT); ++i) {
- if (_text_panel[i]) {
- p.push_back (_text_panel[i]);
+ for (auto text: _text_panel) {
+ if (text) {
+ p.push_back(text);
}
}
p.push_back (_timing_panel);
#include "content_menu.h"
+#include "lib/enum_indexed_vector.h"
#include "lib/film.h"
#include "lib/types.h"
#include <dcp/warnings.h>
wxButton* _timeline;
VideoPanel* _video_panel = nullptr;
AudioPanel* _audio_panel = nullptr;
- TextPanel* _text_panel[static_cast<int>(TextType::COUNT)];
+ EnumIndexedVector<TextPanel*, TextType> _text_panel;
TimingPanel* _timing_panel;
ContentMenu* _menu;
TimelineDialog* _timeline_dialog = nullptr;