diff --git a/aegisub/libaegisub/common/cajun/writer.cpp b/aegisub/libaegisub/common/cajun/writer.cpp index 998d23ff4..61a12163e 100644 --- a/aegisub/libaegisub/common/cajun/writer.cpp +++ b/aegisub/libaegisub/common/cajun/writer.cpp @@ -20,14 +20,9 @@ TODO: */ -namespace json -{ +namespace json { -Writer::Writer(std::ostream& ostr) -: m_ostr(ostr) -, tab_depth(0) -{ -} +Writer::Writer(std::ostream& ostr) : m_ostr(ostr) { } void Writer::Write(Array const& array) { if (array.empty()) diff --git a/aegisub/libaegisub/common/charset_conv.cpp b/aegisub/libaegisub/common/charset_conv.cpp index 0865ae4ea..9bd77bb78 100644 --- a/aegisub/libaegisub/common/charset_conv.cpp +++ b/aegisub/libaegisub/common/charset_conv.cpp @@ -285,9 +285,7 @@ namespace { namespace agi { namespace charset { IconvWrapper::IconvWrapper(const char* sourceEncoding, const char* destEncoding, bool enableSubst) -: toNulLen(0) -, fromNulLen(0) -, conv(get_converter(enableSubst, sourceEncoding, destEncoding)) +: conv(get_converter(enableSubst, sourceEncoding, destEncoding)) { // These need to be set only after we verify that the source and dest // charsets are valid diff --git a/aegisub/libaegisub/common/color.cpp b/aegisub/libaegisub/common/color.cpp index 730e49adc..182277911 100644 --- a/aegisub/libaegisub/common/color.cpp +++ b/aegisub/libaegisub/common/color.cpp @@ -23,15 +23,11 @@ namespace agi { -Color::Color() : r(0), g(0), b(0), a(0) { } - Color::Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a) : r(r), g(g), b(b), a(a) { } -Color::Color(std::string const& str) -: r(0), g(0), b(0), a(0) -{ +Color::Color(std::string const& str) { parser::parse(*this, str); } diff --git a/aegisub/libaegisub/common/log.cpp b/aegisub/libaegisub/common/log.cpp index 46aace6b1..20bb57281 100644 --- a/aegisub/libaegisub/common/log.cpp +++ b/aegisub/libaegisub/common/log.cpp @@ -44,10 +44,7 @@ LogSink *log; /// Keep this ordered the same as Severity const char *Severity_ID = "EAWID"; -LogSink::LogSink() -: messages(250) -, queue(dispatch::Create()) -{ } +LogSink::LogSink() : queue(dispatch::Create()) { } LogSink::~LogSink() { // The destructor for emitters may try to log messages, so disable all the @@ -86,13 +83,8 @@ decltype(LogSink::messages) LogSink::GetMessages() const { Message::Message(const char *section, Severity severity, const char *file, const char *func, int line) : msg(buffer, sizeof buffer) +, sm{section, severity, file, func, line, util::time_log(), ""} { - sm.section = section; - sm.severity = severity; - sm.file = file; - sm.func = func; - sm.line = line; - sm.tv = util::time_log(); } Message::~Message() { diff --git a/aegisub/libaegisub/common/vfr.cpp b/aegisub/libaegisub/common/vfr.cpp index 252c1f554..15dadf99a 100644 --- a/aegisub/libaegisub/common/vfr.cpp +++ b/aegisub/libaegisub/common/vfr.cpp @@ -151,8 +151,6 @@ namespace vfr { Framerate::Framerate(double fps) : denominator(default_denominator) , numerator(int64_t(fps * denominator)) -, last(0) -, drop(false) { if (fps < 0.) throw BadFPS("FPS must be greater than zero"); if (fps > 1000.) throw BadFPS("FPS must not be greater than 1000"); @@ -162,7 +160,6 @@ Framerate::Framerate(double fps) Framerate::Framerate(int64_t numerator, int64_t denominator, bool drop) : denominator(denominator) , numerator(numerator) -, last(0) , drop(drop && numerator % denominator != 0) { if (numerator <= 0 || denominator <= 0) @@ -181,14 +178,12 @@ void Framerate::SetFromTimecodes() { Framerate::Framerate(std::vector timecodes) : timecodes(std::move(timecodes)) -, drop(false) { SetFromTimecodes(); } Framerate::Framerate(std::initializer_list timecodes) : timecodes(timecodes) -, drop(false) { SetFromTimecodes(); } @@ -203,8 +198,6 @@ void Framerate::swap(Framerate &right) throw() { Framerate::Framerate(fs::path const& filename) : denominator(default_denominator) -, numerator(0) -, drop(false) { auto file = agi::io::Open(filename); auto encoding = agi::charset::Detect(filename); diff --git a/aegisub/libaegisub/include/libaegisub/cajun/writer.h b/aegisub/libaegisub/include/libaegisub/cajun/writer.h index 0eb4c94a2..f663927e3 100644 --- a/aegisub/libaegisub/include/libaegisub/cajun/writer.h +++ b/aegisub/libaegisub/include/libaegisub/cajun/writer.h @@ -35,7 +35,7 @@ class Writer : private ConstVisitor { void Visit(const Null& null) override; std::ostream& m_ostr; - int tab_depth; + int tab_depth = 0; public: template @@ -51,5 +51,4 @@ inline std::ostream& operator <<(std::ostream& ostr, UnknownElement const& eleme return ostr; } - } // End namespace diff --git a/aegisub/libaegisub/include/libaegisub/charset_conv.h b/aegisub/libaegisub/include/libaegisub/charset_conv.h index 4d7352eb9..fb7048ed2 100644 --- a/aegisub/libaegisub/include/libaegisub/charset_conv.h +++ b/aegisub/libaegisub/include/libaegisub/charset_conv.h @@ -46,8 +46,8 @@ struct Converter { /// @brief A C++ wrapper for iconv class IconvWrapper { - size_t toNulLen; - size_t fromNulLen; + size_t toNulLen = 0; + size_t fromNulLen = 0; std::unique_ptr conv; public: diff --git a/aegisub/libaegisub/include/libaegisub/color.h b/aegisub/libaegisub/include/libaegisub/color.h index d84427e51..b45b58fb9 100644 --- a/aegisub/libaegisub/include/libaegisub/color.h +++ b/aegisub/libaegisub/include/libaegisub/color.h @@ -18,12 +18,12 @@ namespace agi { struct Color { - unsigned char r; ///< Red component - unsigned char g; ///< Green component - unsigned char b; ///< Blue component - unsigned char a; ///< Alpha component + unsigned char r = 0; ///< Red component + unsigned char g = 0; ///< Green component + unsigned char b = 0; ///< Blue component + unsigned char a = 0; ///< Alpha component - Color(); + Color() { } Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a = 0); Color(std::string const& str); diff --git a/aegisub/libaegisub/include/libaegisub/log.h b/aegisub/libaegisub/include/libaegisub/log.h index 3d6e72304..26bdb801d 100644 --- a/aegisub/libaegisub/include/libaegisub/log.h +++ b/aegisub/libaegisub/include/libaegisub/log.h @@ -83,7 +83,7 @@ class Emitter; /// Log sink, single destination for all messages class LogSink { - boost::circular_buffer messages; + boost::circular_buffer messages{250}; std::unique_ptr queue; /// List of pointers to emitters diff --git a/aegisub/libaegisub/include/libaegisub/vfr.h b/aegisub/libaegisub/include/libaegisub/vfr.h index b8cc8cdd4..d38edfdac 100644 --- a/aegisub/libaegisub/include/libaegisub/vfr.h +++ b/aegisub/libaegisub/include/libaegisub/vfr.h @@ -64,24 +64,24 @@ class Framerate { /// Denominator of the FPS /// /// For v1 VFR, the assumed FPS is used, for v2 the average FPS - int64_t denominator; + int64_t denominator = 0; /// Numerator of the FPS /// /// For v1 VFR, the assumed FPS is used, for v2 the average FPS - int64_t numerator; + int64_t numerator = 0; /// Unrounded frame-seconds of the final frame in timecodes. For CFR and v2, /// this is simply frame count * denominator, but for v1 it's the /// "unrounded" frame count, since override ranges generally don't exactly /// cover timebase-unit ranges of time. This is needed to match mkvmerge's /// rounding past the end of the final override range. - int64_t last; + int64_t last = 0; /// Start time in milliseconds of each frame std::vector timecodes; /// Does this frame rate need drop frames and have them enabled? - bool drop; + bool drop = false; /// Set FPS properties from the timecodes vector void SetFromTimecodes(); diff --git a/aegisub/src/ass_dialogue.cpp b/aegisub/src/ass_dialogue.cpp index 6c86fe502..19f9568e2 100644 --- a/aegisub/src/ass_dialogue.cpp +++ b/aegisub/src/ass_dialogue.cpp @@ -55,11 +55,6 @@ static int next_id = 0; AssDialogue::AssDialogue() : Id(++next_id) -, Comment(false) -, Layer(0) -, Start(0) -, End(5000) -, Style("Default") { memset(Margin, 0, sizeof Margin); } diff --git a/aegisub/src/ass_dialogue.h b/aegisub/src/ass_dialogue.h index 530dae808..85b5a6f71 100644 --- a/aegisub/src/ass_dialogue.h +++ b/aegisub/src/ass_dialogue.h @@ -136,17 +136,17 @@ public: const int Id; /// Is this a comment line? - bool Comment; + bool Comment = false; /// Layer number - int Layer; + int Layer = 0; /// Margins: 0 = Left, 1 = Right, 2 = Top (Vertical) int Margin[3]; /// Starting time - AssTime Start; + AssTime Start = 0; /// Ending time - AssTime End; + AssTime End = 5000; /// Style name - boost::flyweight Style; + boost::flyweight Style{ "Default" }; /// Actor name boost::flyweight Actor; /// Effect name diff --git a/aegisub/src/ass_exporter.cpp b/aegisub/src/ass_exporter.cpp index 12d02558e..fa2da55fe 100644 --- a/aegisub/src/ass_exporter.cpp +++ b/aegisub/src/ass_exporter.cpp @@ -45,11 +45,7 @@ #include #include -AssExporter::AssExporter(agi::Context *c) -: c(c) -, is_default(true) -{ -} +AssExporter::AssExporter(agi::Context *c) : c(c) { } void AssExporter::DrawSettings(wxWindow *parent, wxSizer *target_sizer) { is_default = false; diff --git a/aegisub/src/ass_exporter.h b/aegisub/src/ass_exporter.h index 7afcf50ac..6c2670046 100644 --- a/aegisub/src/ass_exporter.h +++ b/aegisub/src/ass_exporter.h @@ -58,7 +58,7 @@ class AssExporter { /// Have the config windows been created, or should filters simply use /// their default settings - bool is_default; + bool is_default = true; public: AssExporter(agi::Context *c); diff --git a/aegisub/src/ass_karaoke.cpp b/aegisub/src/ass_karaoke.cpp index 90ffc7c81..b22b9e48f 100644 --- a/aegisub/src/ass_karaoke.cpp +++ b/aegisub/src/ass_karaoke.cpp @@ -50,9 +50,7 @@ std::string AssKaraoke::Syllable::GetText(bool k_tag) const { } -AssKaraoke::AssKaraoke(AssDialogue *line, bool auto_split, bool normalize) -: no_announce(false) -{ +AssKaraoke::AssKaraoke(AssDialogue *line, bool auto_split, bool normalize) { if (line) SetLine(line, auto_split, normalize); } diff --git a/aegisub/src/ass_karaoke.h b/aegisub/src/ass_karaoke.h index 2ff8161d4..a612a4150 100644 --- a/aegisub/src/ass_karaoke.h +++ b/aegisub/src/ass_karaoke.h @@ -50,7 +50,7 @@ public: private: std::vector syls; - bool no_announce; + bool no_announce = false; agi::signal::Signal<> AnnounceSyllablesChanged; void ParseSyllables(AssDialogue *line, Syllable &syl); diff --git a/aegisub/src/ass_override.cpp b/aegisub/src/ass_override.cpp index d6a0fe85a..55bffde97 100644 --- a/aegisub/src/ass_override.cpp +++ b/aegisub/src/ass_override.cpp @@ -54,7 +54,6 @@ using namespace boost::adaptors; AssOverrideParameter::AssOverrideParameter(VariableDataType type, AssParameterClass classification) : type(type) , classification(classification) -, omitted(true) { } diff --git a/aegisub/src/ass_override.h b/aegisub/src/ass_override.h index 0eb94c099..9e2119c48 100644 --- a/aegisub/src/ass_override.h +++ b/aegisub/src/ass_override.h @@ -77,7 +77,7 @@ public: AssParameterClass classification; /// Is this parameter actually present? - bool omitted; + bool omitted = true; VariableDataType GetType() const { return type; } template void Set(T param); diff --git a/aegisub/src/ass_parser.cpp b/aegisub/src/ass_parser.cpp index 2663b63a9..883142b5e 100644 --- a/aegisub/src/ass_parser.cpp +++ b/aegisub/src/ass_parser.cpp @@ -31,7 +31,6 @@ AssParser::AssParser(AssFile *target, int version) : target(target) , version(version) -, attach(nullptr) , state(&AssParser::ParseScriptInfoLine) { std::fill(begin(insertion_positions), end(insertion_positions), nullptr); diff --git a/aegisub/src/ass_style.cpp b/aegisub/src/ass_style.cpp index 9781d927c..88f551929 100644 --- a/aegisub/src/ass_style.cpp +++ b/aegisub/src/ass_style.cpp @@ -49,26 +49,7 @@ #include -AssStyle::AssStyle() -: name("Default") -, font("Arial") -, fontsize(20.) -, primary(255, 255, 255) -, secondary(255, 0, 0) -, bold(false) -, italic(false) -, underline(false) -, strikeout(false) -, scalex(100.) -, scaley(100.) -, spacing(0.) -, angle(0.) -, borderstyle(1) -, outline_w(2.) -, shadow_w(2.) -, alignment(2) -, encoding(1) -{ +AssStyle::AssStyle() { std::fill(Margin.begin(), Margin.end(), 10); UpdateData(); diff --git a/aegisub/src/ass_style.h b/aegisub/src/ass_style.h index ead95b777..aa4af02d4 100644 --- a/aegisub/src/ass_style.h +++ b/aegisub/src/ass_style.h @@ -43,30 +43,30 @@ class AssStyle : public AssEntry { std::string data; public: - std::string name; ///< Name of the style; must be case-insensitively unique within a file despite being case-sensitive - std::string font; ///< Font face name - double fontsize; ///< Font size + std::string name = "Default"; ///< Name of the style; must be case-insensitively unique within a file despite being case-sensitive + std::string font = "Arial"; ///< Font face name + double fontsize = 20.; ///< Font size - agi::Color primary; ///< Default text color - agi::Color secondary; ///< Text color for not-yet-reached karaoke syllables - agi::Color outline; ///< Outline color - agi::Color shadow; ///< Shadow color + agi::Color primary{ 255, 255, 255 }; ///< Default text color + agi::Color secondary{ 255, 0, 0 }; ///< Text color for not-yet-reached karaoke syllables + agi::Color outline{ 0, 0, 0 }; ///< Outline color + agi::Color shadow{ 0, 0, 0 }; ///< Shadow color - bool bold; - bool italic; - bool underline; - bool strikeout; + bool bold = false; + bool italic = false; + bool underline = false; + bool strikeout = false; - double scalex; ///< Font x scale with 100 = 100% - double scaley; ///< Font y scale with 100 = 100% - double spacing; ///< Additional spacing between characters in pixels - double angle; ///< Counterclockwise z rotation in degrees - int borderstyle; ///< 1: Normal; 3: Opaque box; others are unused in Aegisub - double outline_w; ///< Outline width in pixels - double shadow_w; ///< Shadow distance in pixels - int alignment; ///< \an-style line alignment - std::array Margin; ///< Left/Right/Vertical - int encoding; ///< ASS font encoding needed for some non-unicode fonts + double scalex = 100.; ///< Font x scale with 100 = 100% + double scaley = 100.; ///< Font y scale with 100 = 100% + double spacing = 0.; ///< Additional spacing between characters in pixels + double angle = 0.1; ///< Counterclockwise z rotation in degrees + int borderstyle = 1; ///< 1: Normal; 3: Opaque box; others are unused in Aegisub + double outline_w = 2.; ///< Outline width in pixels + double shadow_w = 2.; ///< Shadow distance in pixels + int alignment = 2; ///< \an-style line alignment + std::array Margin; ///< Left / Right / Vertical + int encoding = 1; ///< ASS font encoding needed for some non-unicode fonts /// Update the raw line data after one or more of the public members have been changed void UpdateData(); diff --git a/aegisub/src/ass_time.cpp b/aegisub/src/ass_time.cpp index 589ceef25..57fd96852 100644 --- a/aegisub/src/ass_time.cpp +++ b/aegisub/src/ass_time.cpp @@ -35,9 +35,7 @@ AssTime::AssTime(int time) : time(mid(0, time, 10 * 60 * 60 * 1000 - 1)) { } -AssTime::AssTime(std::string const& text) -: time(0) -{ +AssTime::AssTime(std::string const& text) { int after_decimal = -1; int current = 0; for (char c : text | boost::adaptors::filtered(boost::is_any_of(",.0123456789:"))) { diff --git a/aegisub/src/ass_time.h b/aegisub/src/ass_time.h index 6210df06a..2e04a7f66 100644 --- a/aegisub/src/ass_time.h +++ b/aegisub/src/ass_time.h @@ -27,7 +27,7 @@ class AssTime { /// Time in milliseconds - int time; + int time = 0; public: AssTime(int ms = 0); diff --git a/aegisub/src/audio_box.cpp b/aegisub/src/audio_box.cpp index 57b9ae3ef..c474e7f4c 100644 --- a/aegisub/src/audio_box.cpp +++ b/aegisub/src/audio_box.cpp @@ -83,7 +83,6 @@ AudioBox::AudioBox(wxWindow *parent, agi::Context *context) , HorizontalZoom(new wxSlider(panel, Audio_Horizontal_Zoom, -OPT_GET("Audio/Zoom/Horizontal")->GetInt(), -50, 30, wxDefaultPosition, wxSize(-1, 20), wxSL_VERTICAL|wxSL_BOTH)) , VerticalZoom(new wxSlider(panel, Audio_Vertical_Zoom, OPT_GET("Audio/Zoom/Vertical")->GetInt(), 0, 100, wxDefaultPosition, wxSize(-1, 20), wxSL_VERTICAL|wxSL_BOTH|wxSL_INVERSE)) , VolumeBar(new wxSlider(panel, Audio_Volume, OPT_GET("Audio/Volume")->GetInt(), 0, 100, wxDefaultPosition, wxSize(-1, 20), wxSL_VERTICAL|wxSL_BOTH|wxSL_INVERSE)) -, mouse_zoom_accum(0) { SetSashVisible(wxSASH_BOTTOM, true); Bind(wxEVT_SASH_DRAGGED, &AudioBox::OnSashDrag, this); diff --git a/aegisub/src/audio_box.h b/aegisub/src/audio_box.h index 7de60aac0..ee5ca6078 100644 --- a/aegisub/src/audio_box.h +++ b/aegisub/src/audio_box.h @@ -74,7 +74,7 @@ class AudioBox : public wxSashWindow { wxSlider *VolumeBar; // Mouse wheel zoom accumulator - int mouse_zoom_accum; + int mouse_zoom_accum = 0; void SetHorizontalZoom(int new_zoom); void OnAudioOpen(); diff --git a/aegisub/src/audio_display.cpp b/aegisub/src/audio_display.cpp index 4c8a4ae2f..5d33fc6af 100644 --- a/aegisub/src/audio_display.cpp +++ b/aegisub/src/audio_display.cpp @@ -559,14 +559,6 @@ AudioDisplay::AudioDisplay(wxWindow *parent, AudioController *controller, agi::C , controller(controller) , scrollbar(agi::util::make_unique(this)) , timeline(agi::util::make_unique(this)) -, dragged_object(nullptr) -, scroll_left(0) -, pixel_audio_width(0) -, ms_per_pixel(0.0) -, scale_amplitude(1.0f) -, audio_top(0) -, audio_height(0) -, track_cursor_pos(-1) { style_ranges[0] = AudioStyle_Normal; diff --git a/aegisub/src/audio_display.h b/aegisub/src/audio_display.h index 1fe34f7c8..ecf9b6ec9 100644 --- a/aegisub/src/audio_display.h +++ b/aegisub/src/audio_display.h @@ -124,7 +124,7 @@ class AudioDisplay: public wxWindow { /// Current object on display being dragged, if any - AudioDisplayInteractionObject *dragged_object; + AudioDisplayInteractionObject *dragged_object = nullptr; /// Change the dragged object and update mouse capture void SetDraggedObject(AudioDisplayInteractionObject *new_obj); @@ -133,22 +133,22 @@ class AudioDisplay: public wxWindow { wxTimer scroll_timer; /// Leftmost pixel in the virtual audio image being displayed - int scroll_left; + int scroll_left = 0; /// Total width of the audio in pixels - int pixel_audio_width; + int pixel_audio_width = 0; /// Horizontal zoom measured in millisecond per pixels - double ms_per_pixel; + double ms_per_pixel = 0.; /// Amplitude scaling ("vertical zoom") as a factor, 1.0 is neutral - float scale_amplitude; + float scale_amplitude = 1.f; /// Top of the main audio area in pixels - int audio_top; + int audio_top = 0; /// Height of main audio area in pixels - int audio_height; + int audio_height = 0; /// Width of the audio marker feet in pixels static const int foot_size = 6; @@ -157,7 +157,7 @@ class AudioDisplay: public wxWindow { int zoom_level; /// Absolute pixel position of the tracking cursor (mouse or playback) - int track_cursor_pos; + int track_cursor_pos = -1; /// Label to show by track cursor wxString track_cursor_label; /// Bounding rectangle last drawn track cursor label diff --git a/aegisub/src/audio_karaoke.cpp b/aegisub/src/audio_karaoke.cpp index 828a9545c..d8ec4bff0 100644 --- a/aegisub/src/audio_karaoke.cpp +++ b/aegisub/src/audio_karaoke.cpp @@ -68,15 +68,7 @@ AudioKaraoke::AudioKaraoke(wxWindow *parent, agi::Context *c) , audio_opened(c->audioController->AddAudioOpenListener(&AudioKaraoke::OnAudioOpened, this)) , audio_closed(c->audioController->AddAudioCloseListener(&AudioKaraoke::OnAudioClosed, this)) , active_line_changed(c->selectionController->AddActiveLineListener(&AudioKaraoke::OnActiveLineChanged, this)) -, active_line(nullptr) , kara(agi::util::make_unique()) -, scroll_x(0) -, scroll_dir(0) -, char_height(0) -, char_width(0) -, mouse_pos(0) -, click_will_remove_split(false) -, enabled(false) { using std::bind; diff --git a/aegisub/src/audio_karaoke.h b/aegisub/src/audio_karaoke.h index 0be105088..cf4a293a6 100644 --- a/aegisub/src/audio_karaoke.h +++ b/aegisub/src/audio_karaoke.h @@ -76,7 +76,7 @@ class AudioKaraoke : public wxWindow { agi::signal::Connection active_line_changed; /// Currently active dialogue line - AssDialogue *active_line; + AssDialogue *active_line = nullptr; /// Karaoke data std::unique_ptr kara; @@ -101,18 +101,18 @@ class AudioKaraoke : public wxWindow { /// Cached width of characters from GetTextExtent std::unordered_map char_widths; - int scroll_x; ///< Distance the display has been shifted to the left in pixels - int scroll_dir; ///< Direction the display will be scrolled on scroll_timer ticks (+/- 1) + int scroll_x = 0; ///< Distance the display has been shifted to the left in pixels + int scroll_dir = 0; ///< Direction the display will be scrolled on scroll_timer ticks (+/- 1) wxTimer scroll_timer; ///< Timer to scroll every 50ms when user holds down scroll button - int char_height; ///< Maximum character height in pixels - int char_width; ///< Maximum character width in pixels - int mouse_pos; ///< Last x coordinate of the mouse - bool click_will_remove_split; ///< If true a click at mouse_pos will remove a split rather than adding one + int char_height = 0; ///< Maximum character height in pixels + int char_width = 0; ///< Maximum character width in pixels + int mouse_pos = 0; ///< Last x coordinate of the mouse + bool click_will_remove_split = false; ///< If true a click at mouse_pos will remove a split rather than adding one wxFont split_font; ///< Font used in the split/join interface - bool enabled; ///< Is karaoke mode enabled? + bool enabled = false; ///< Is karaoke mode enabled? wxButton *accept_button; ///< Accept pending splits button wxButton *cancel_button; ///< Revert pending changes diff --git a/aegisub/src/audio_player_openal.cpp b/aegisub/src/audio_player_openal.cpp index b9be1c7c3..a3dbc75da 100644 --- a/aegisub/src/audio_player_openal.cpp +++ b/aegisub/src/audio_player_openal.cpp @@ -52,20 +52,8 @@ DEFINE_SIMPLE_EXCEPTION(OpenALException, agi::AudioPlayerOpenError, "audio/open/ OpenALPlayer::OpenALPlayer(AudioProvider *provider) : AudioPlayer(provider) -, playing(false) -, volume(1.f) , samplerate(provider->GetSampleRate()) , bpf(provider->GetChannels() * provider->GetBytesPerSample()) -, start_frame(0) -, cur_frame(0) -, end_frame(0) -, device(nullptr) -, context(nullptr) -, source(0) -, buf_first_free(0) -, buf_first_queued(0) -, buffers_free(0) -, buffers_played(0) { try { // Open device diff --git a/aegisub/src/audio_player_openal.h b/aegisub/src/audio_player_openal.h index ddd822122..bdb64dc22 100644 --- a/aegisub/src/audio_player_openal.h +++ b/aegisub/src/audio_player_openal.h @@ -55,32 +55,32 @@ class OpenALPlayer : public AudioPlayer, wxTimer { /// Number of OpenAL buffers to use static const ALsizei num_buffers = 8; - bool playing; ///< Is audio currently playing? + bool playing = false; ///< Is audio currently playing? - float volume; ///< Current audio volume + float volume = 1.f; ///< Current audio volume ALsizei samplerate; ///< Sample rate of the audio int bpf; ///< Bytes per frame - int64_t start_frame; ///< First frame of playbacka - int64_t cur_frame; ///< Next frame to write to playback buffers - int64_t end_frame; ///< Last frame to play + int64_t start_frame = 0; ///< First frame of playbacka + int64_t cur_frame = 0; ///< Next frame to write to playback buffers + int64_t end_frame = 0; ///< Last frame to play - ALCdevice *device; ///< OpenAL device handle - ALCcontext *context; ///< OpenAL sound context + ALCdevice *device = nullptr; ///< OpenAL device handle + ALCcontext *context = nullptr; ///< OpenAL sound context ALuint buffers[num_buffers]; ///< OpenAL sound buffers - ALuint source; ///< OpenAL playback source + ALuint source = 0; ///< OpenAL playback source /// Index into buffers, first free (unqueued) buffer to be filled - ALsizei buf_first_free; + ALsizei buf_first_free = 0; /// Index into buffers, first queued (non-free) buffer - ALsizei buf_first_queued; + ALsizei buf_first_queued = 0; /// Number of free buffers - ALsizei buffers_free; + ALsizei buffers_free = 0; /// Number of buffers which have been fully played since playback was last started - ALsizei buffers_played; + ALsizei buffers_played = 0; wxStopWatch playback_segment_timer; diff --git a/aegisub/src/audio_player_oss.cpp b/aegisub/src/audio_player_oss.cpp index 95470dd40..35198cbad 100644 --- a/aegisub/src/audio_player_oss.cpp +++ b/aegisub/src/audio_player_oss.cpp @@ -50,15 +50,6 @@ DEFINE_SIMPLE_EXCEPTION(OSSError, agi::AudioPlayerOpenError, "audio/player/open/ OSSPlayer::OSSPlayer(AudioProvider *provider) : AudioPlayer(provider) -, rate(0) -, thread(0) -, playing(false) -, volume(1.0f) -, start_frame(0) -, cur_frame(0) -, end_frame(0) -, bpf(0) -, dspdev(0) { OpenStream(); } diff --git a/aegisub/src/audio_player_oss.h b/aegisub/src/audio_player_oss.h index eb8cd52c0..6bc763120 100644 --- a/aegisub/src/audio_player_oss.h +++ b/aegisub/src/audio_player_oss.h @@ -69,31 +69,31 @@ class OSSPlayer : public AudioPlayer { friend class OSSPlayerThread; /// sample rate of audio - unsigned int rate; + unsigned int rate = 0; /// Worker thread that does the actual writing - OSSPlayerThread *thread; + OSSPlayerThread *thread = nullptr; /// Is the player currently playing? - volatile bool playing; + volatile bool playing = false; /// Current volume level - volatile float volume; + volatile float volume = 1.f; /// first frame of playback - volatile unsigned long start_frame; + volatile unsigned long start_frame = 0; /// last written frame + 1 - volatile unsigned long cur_frame; + volatile unsigned long cur_frame = 0; /// last frame to play - volatile unsigned long end_frame; + volatile unsigned long end_frame = 0; /// bytes per frame - unsigned long bpf; + unsigned long bpf = 0; /// OSS audio device handle - volatile int dspdev; + volatile int dspdev = 0; void OpenStream(); diff --git a/aegisub/src/audio_player_portaudio.cpp b/aegisub/src/audio_player_portaudio.cpp index 27dbb5c21..f99cc7c18 100644 --- a/aegisub/src/audio_player_portaudio.cpp +++ b/aegisub/src/audio_player_portaudio.cpp @@ -69,12 +69,7 @@ static const PaHostApiTypeId pa_host_api_priority[] = { }; static const size_t pa_host_api_priority_count = sizeof(pa_host_api_priority) / sizeof(pa_host_api_priority[0]); -PortAudioPlayer::PortAudioPlayer(AudioProvider *provider) -: AudioPlayer(provider) -, volume(1.0f) -, pa_start(0.0) -, stream(0) -{ +PortAudioPlayer::PortAudioPlayer(AudioProvider *provider) : AudioPlayer(provider) { PaError err = Pa_Initialize(); if (err != paNoError) @@ -131,7 +126,7 @@ PortAudioPlayer::~PortAudioPlayer() { } void PortAudioPlayer::OpenStream() { - DeviceVec *device_ids = 0; + DeviceVec *device_ids = nullptr; std::string device_name = OPT_GET("Player/Audio/PortAudio/Device Name")->GetString(); if (devices.count(device_name)) { diff --git a/aegisub/src/audio_player_portaudio.h b/aegisub/src/audio_player_portaudio.h index f64fb16e2..1c5ad5767 100644 --- a/aegisub/src/audio_player_portaudio.h +++ b/aegisub/src/audio_player_portaudio.h @@ -57,13 +57,13 @@ class PortAudioPlayer : public AudioPlayer { /// The index of the default output devices sorted by host API priority DeviceVec default_device; - float volume; ///< Current volume level - int64_t current; ///< Current position - int64_t start; ///< Start position - int64_t end; ///< End position - PaTime pa_start; ///< PortAudio internal start position + float volume = 1.f; ///< Current volume level + int64_t current = 0; ///< Current position + int64_t start = 0; ///< Start position + int64_t end = 0; ///< End position + PaTime pa_start; ///< PortAudio internal start position - PaStream *stream; ///< PortAudio stream + PaStream *stream = nullptr; ///< PortAudio stream /// @brief PortAudio callback, used to fill buffer for playback, and prime the playback buffer. /// @param inputBuffer Input buffer. diff --git a/aegisub/src/audio_player_pulse.cpp b/aegisub/src/audio_player_pulse.cpp index 09801b7b7..a6cfb6cda 100644 --- a/aegisub/src/audio_player_pulse.cpp +++ b/aegisub/src/audio_player_pulse.cpp @@ -48,20 +48,7 @@ #include -PulseAudioPlayer::PulseAudioPlayer(AudioProvider *provider) -: AudioPlayer(provider) -, volume(1.0f) -, is_playing(false) -, start_frame(0) -, cur_frame(0) -, end_frame(0) -, bpf(0) -, context_notify(0, 1) -, context_success(0, 1) -, stream_notify(0, 1) -, stream_success(0, 1) -, paerror(0) -{ +PulseAudioPlayer::PulseAudioPlayer(AudioProvider *provider) : AudioPlayer(provider) { // Initialise a mainloop mainloop = pa_threaded_mainloop_new(); if (!mainloop) diff --git a/aegisub/src/audio_player_pulse.h b/aegisub/src/audio_player_pulse.h index f2f3428ba..28865f5d9 100644 --- a/aegisub/src/audio_player_pulse.h +++ b/aegisub/src/audio_player_pulse.h @@ -40,34 +40,34 @@ class PulseAudioPlayer; class PulseAudioPlayer : public AudioPlayer { - float volume; - bool is_playing; + float volume = 1.f; + bool is_playing = false; - volatile unsigned long start_frame; - volatile unsigned long cur_frame; - volatile unsigned long end_frame; + volatile unsigned long start_frame = 0; + volatile unsigned long cur_frame = 0; + volatile unsigned long end_frame = 0; - unsigned long bpf; // bytes per frame + unsigned long bpf = 0; // bytes per frame - wxSemaphore context_notify; - wxSemaphore context_success; + wxSemaphore context_notify{0, 1}; + wxSemaphore context_success{0, 1}; volatile int context_success_val; - wxSemaphore stream_notify; - wxSemaphore stream_success; + wxSemaphore stream_notify{0, 1}; + wxSemaphore stream_success{0, 1}; volatile int stream_success_val; - pa_threaded_mainloop *mainloop; // pulseaudio mainloop handle - pa_context *context; // connection context + pa_threaded_mainloop *mainloop = nullptr; // pulseaudio mainloop handle + pa_context *context = nullptr; // connection context volatile pa_context_state_t cstate; - pa_stream *stream; + pa_stream *stream = nullptr; volatile pa_stream_state_t sstate; volatile pa_usec_t play_start_time; // timestamp when playback was started - int paerror; + int paerror = 0; /// Called by PA to notify about contetxt operation completion static void pa_context_success(pa_context *c, int success, PulseAudioPlayer *thread); diff --git a/aegisub/src/audio_provider.cpp b/aegisub/src/audio_provider.cpp index 820238e1d..5786a39f1 100644 --- a/aegisub/src/audio_provider.cpp +++ b/aegisub/src/audio_provider.cpp @@ -110,12 +110,10 @@ void AudioProvider::GetAudio(void *buf, int64_t start, int64_t count) const { namespace { struct provider_creator { - bool found_file; - bool found_audio; + bool found_file = false; + bool found_audio = false; std::string msg; - provider_creator() : found_file(false) , found_audio(false) { } - template std::unique_ptr try_create(std::string const& name, Factory&& create) { try { diff --git a/aegisub/src/audio_provider_pcm.cpp b/aegisub/src/audio_provider_pcm.cpp index f45fec3c6..8e3377814 100644 --- a/aegisub/src/audio_provider_pcm.cpp +++ b/aegisub/src/audio_provider_pcm.cpp @@ -52,11 +52,8 @@ #endif PCMAudioProvider::PCMAudioProvider(agi::fs::path const& filename) -: current_mapping(nullptr) -, mapping_start(0) -, mapping_length(0) #ifdef _WIN32 -, file_handle(0, CloseHandle) +: file_handle(0, CloseHandle) , file_mapping(0, CloseHandle) { file_handle = CreateFile( @@ -81,7 +78,7 @@ PCMAudioProvider::PCMAudioProvider(agi::fs::path const& filename) if (file_mapping == 0) throw agi::AudioProviderOpenError("Failed creating file mapping", 0); #else -, file_handle(open(filename.c_str(), O_RDONLY), close) +: file_handle(open(filename.c_str(), O_RDONLY), close) { if (file_handle == -1) throw agi::fs::FileNotFound(filename.string()); diff --git a/aegisub/src/audio_provider_pcm.h b/aegisub/src/audio_provider_pcm.h index 3025f3ebd..fbd4cbf11 100644 --- a/aegisub/src/audio_provider_pcm.h +++ b/aegisub/src/audio_provider_pcm.h @@ -44,17 +44,17 @@ #include class PCMAudioProvider : public AudioProvider { - mutable void *current_mapping; + mutable void *current_mapping = nullptr; #ifdef _WIN32 - mutable int64_t mapping_start; - mutable size_t mapping_length; + mutable int64_t mapping_start = 0; + mutable size_t mapping_length = 0; agi::scoped_holder file_handle; agi::scoped_holder file_mapping; #else - mutable off_t mapping_start; - mutable size_t mapping_length; + mutable off_t mapping_start = 0; + mutable size_t mapping_length = 0; agi::scoped_holder file_handle; #endif @@ -65,7 +65,7 @@ protected: char * EnsureRangeAccessible(int64_t range_start, int64_t range_length) const; // Ensure that the given range of bytes are accessible in the file mapping and return a pointer to the first byte of the requested range /// Size of the opened file - int64_t file_size; + int64_t file_size = 0; struct IndexPoint { int64_t start_byte; diff --git a/aegisub/src/audio_renderer.cpp b/aegisub/src/audio_renderer.cpp index 94b486b65..8b96ac975 100644 --- a/aegisub/src/audio_renderer.cpp +++ b/aegisub/src/audio_renderer.cpp @@ -65,14 +65,6 @@ size_t AudioRendererBitmapCacheBitmapFactory::GetBlockSize() const AudioRenderer::AudioRenderer() -: pixel_ms(0) -, pixel_height(0) -, amplitude_scale(0) -, cache_bitmap_width(32) // arbitrary value for now -, cache_bitmap_maxsize(0) -, cache_renderer_maxsize(0) -, renderer(nullptr) -, provider(nullptr) { for (int i = 0; i < AudioStyle_MAX; ++i) bitmaps.emplace_back(256, AudioRendererBitmapCacheBitmapFactory(this)); diff --git a/aegisub/src/audio_renderer.h b/aegisub/src/audio_renderer.h index 7ab7ef9f4..91f83df90 100644 --- a/aegisub/src/audio_renderer.h +++ b/aegisub/src/audio_renderer.h @@ -89,31 +89,31 @@ class AudioRenderer { friend struct AudioRendererBitmapCacheBitmapFactory; /// Horizontal zoom level, milliseconds per pixel - double pixel_ms; + double pixel_ms = 0.f; /// Rendering height in pixels - int pixel_height; + int pixel_height = 0; /// Vertical zoom level/amplitude scale - float amplitude_scale; + float amplitude_scale = 0.f; /// Width of bitmaps to store in cache - const int cache_bitmap_width; + const int cache_bitmap_width = 32; // Completely arbitrary value /// Cached bitmaps for audio ranges std::vector bitmaps; /// Number of blocks in the bitmap caches - size_t cache_numblocks; + size_t cache_numblocks = 0; /// The maximum allowed size of each bitmap cache, in bytes - size_t cache_bitmap_maxsize; + size_t cache_bitmap_maxsize = 0; /// The maximum allowed size of the renderer's cache, in bytes - size_t cache_renderer_maxsize; + size_t cache_renderer_maxsize = 0; /// Do the caches need to be aged? - bool needs_age; + bool needs_age = false; /// Actual renderer for bitmaps - AudioRendererBitmapProvider *renderer; + AudioRendererBitmapProvider *renderer = nullptr; /// Audio provider to use as source - AudioProvider *provider; + AudioProvider *provider = nullptr; /// @brief Make sure bitmap index i is in cache /// @param i Index of bitmap to get into cache diff --git a/aegisub/src/audio_renderer_spectrum.cpp b/aegisub/src/audio_renderer_spectrum.cpp index d16b92e1a..017c34468 100644 --- a/aegisub/src/audio_renderer_spectrum.cpp +++ b/aegisub/src/audio_renderer_spectrum.cpp @@ -97,13 +97,6 @@ public: AudioSpectrumRenderer::AudioSpectrumRenderer(std::string const& color_scheme_name) -: derivation_size(8) -, derivation_dist(8) -#ifdef WITH_FFTW3 -, dft_plan(nullptr) -, dft_input(nullptr) -, dft_output(nullptr) -#endif { colors.reserve(AudioStyle_MAX); for (int i = 0; i < AudioStyle_MAX; ++i) diff --git a/aegisub/src/audio_renderer_spectrum.h b/aegisub/src/audio_renderer_spectrum.h index f66c9b182..b322c1c32 100644 --- a/aegisub/src/audio_renderer_spectrum.h +++ b/aegisub/src/audio_renderer_spectrum.h @@ -62,10 +62,10 @@ class AudioSpectrumRenderer : public AudioRendererBitmapProvider { std::vector colors; /// Binary logarithm of number of samples to use in deriving frequency-power data - size_t derivation_size; + size_t derivation_size = 0; /// Binary logarithm of number of samples between the start of derivations - size_t derivation_dist; + size_t derivation_dist = 0; /// @brief Reset in response to changing audio provider /// @@ -92,11 +92,11 @@ class AudioSpectrumRenderer : public AudioRendererBitmapProvider { #ifdef WITH_FFTW3 /// FFTW plan data - fftw_plan dft_plan; + fftw_plan dft_plan = nullptr; /// Pre-allocated input array for FFTW - double *dft_input; + double *dft_input = nullptr; /// Pre-allocated output array for FFTW - fftw_complex *dft_output; + fftw_complex *dft_output = nullptr; #else /// Pre-allocated scratch area for doing FFT derivations std::vector fft_scratch; diff --git a/aegisub/src/audio_renderer_waveform.cpp b/aegisub/src/audio_renderer_waveform.cpp index 6bafa6e46..4ebdd3ce9 100644 --- a/aegisub/src/audio_renderer_waveform.cpp +++ b/aegisub/src/audio_renderer_waveform.cpp @@ -55,8 +55,7 @@ enum { }; AudioWaveformRenderer::AudioWaveformRenderer(std::string const& color_scheme_name) -: audio_buffer(nullptr) -, render_averages(OPT_GET("Audio/Display/Waveform Style")->GetInt() == Waveform_MaxAvg) +: render_averages(OPT_GET("Audio/Display/Waveform Style")->GetInt() == Waveform_MaxAvg) { colors.reserve(AudioStyle_MAX); for (int i = 0; i < AudioStyle_MAX; ++i) diff --git a/aegisub/src/audio_renderer_waveform.h b/aegisub/src/audio_renderer_waveform.h index 3fdd7a690..e1f80d09a 100644 --- a/aegisub/src/audio_renderer_waveform.h +++ b/aegisub/src/audio_renderer_waveform.h @@ -45,7 +45,7 @@ class AudioWaveformRenderer : public AudioRendererBitmapProvider { std::vector colors; /// Pre-allocated buffer for audio fetched from provider - char *audio_buffer; + char *audio_buffer = nullptr; /// Whether to render max+avg or just max bool render_averages; diff --git a/aegisub/src/audio_timing_karaoke.cpp b/aegisub/src/audio_timing_karaoke.cpp index 5e95847d0..6be7398ad 100644 --- a/aegisub/src/audio_timing_karaoke.cpp +++ b/aegisub/src/audio_timing_karaoke.cpp @@ -89,7 +89,7 @@ class AudioTimingControllerKaraoke : public AudioTimingController { AssDialogue *active_line; ///< Currently active line AssKaraoke *kara; ///< Parsed karaoke model provided by karaoke controller - size_t cur_syl; ///< Index of currently selected syllable in the line + size_t cur_syl = 0; ///< Index of currently selected syllable in the line /// Pen used for the mid-syllable markers Pen separator_pen; @@ -114,8 +114,8 @@ class AudioTimingControllerKaraoke : public AudioTimingController { /// Labels containing the stripped text of each syllable std::vector labels; - bool auto_commit; ///< Should changes be automatically commited? - int commit_id; ///< Last commit id used for an autocommit + bool auto_commit; ///< Should changes be automatically commited? + int commit_id = -1; ///< Last commit id used for an autocommit bool pending_changes; ///< Are there any pending changes to be committed? void OnAutoCommitChange(agi::OptionValue const& opt); @@ -160,7 +160,6 @@ AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, AssK , c(c) , active_line(c->selectionController->GetActiveLine()) , kara(kara) -, cur_syl(0) , separator_pen("Colour/Audio Display/Syllable Boundaries", "Audio/Line Boundaries Thickness", wxPENSTYLE_DOT) , start_pen("Colour/Audio Display/Line boundary Start", "Audio/Line Boundaries Thickness") , end_pen("Colour/Audio Display/Line boundary End", "Audio/Line Boundaries Thickness") @@ -169,7 +168,6 @@ AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, AssK , keyframes_provider(c, "Audio/Display/Draw/Keyframes in Karaoke Mode") , video_position_provider(c) , auto_commit(OPT_GET("Audio/Auto/Commit")->GetBool()) -, commit_id(-1) { slots.push_back(kara->AddSyllablesChangedListener(&AudioTimingControllerKaraoke::Revert, this)); slots.push_back(OPT_SUB("Audio/Auto/Commit", &AudioTimingControllerKaraoke::OnAutoCommitChange, this)); diff --git a/aegisub/src/base_grid.cpp b/aegisub/src/base_grid.cpp index 22aac6490..9422bf962 100644 --- a/aegisub/src/base_grid.cpp +++ b/aegisub/src/base_grid.cpp @@ -100,16 +100,8 @@ namespace std { BaseGrid::BaseGrid(wxWindow* parent, agi::Context *context, const wxSize& size, long style, const wxString& name) : wxWindow(parent, -1, wxDefaultPosition, size, style, name) -, lineHeight(1) // non-zero to avoid div by 0 -, holding(false) , scrollBar(new wxScrollBar(this, GRID_SCROLLBAR, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL)) -, byFrame(false) -, extendRow(-1) -, active_line(nullptr) -, batch_level(0) -, batch_active_line_changed(false) , seek_listener(context->videoController->AddSeekListener(std::bind(&BaseGrid::Refresh, this, false, nullptr))) -, yPos(0) , context(context) { scrollBar->SetScrollbar(0,10,100,10); diff --git a/aegisub/src/base_grid.h b/aegisub/src/base_grid.h index 7894d8393..2d829fd04 100644 --- a/aegisub/src/base_grid.h +++ b/aegisub/src/base_grid.h @@ -50,27 +50,27 @@ namespace agi { class AssDialogue; class BaseGrid : public wxWindow, public SubtitleSelectionController { - int lineHeight; ///< Height of a line in pixels in the current font - bool holding; ///< Is a drag selection in process? + int lineHeight = 1; ///< Height of a line in pixels in the current font + bool holding = false; ///< Is a drag selection in process? wxFont font; ///< Current grid font wxScrollBar *scrollBar; ///< The grid's scrollbar - bool byFrame; ///< Should times be displayed as frame numbers + bool byFrame = false; ///< Should times be displayed as frame numbers wxBrush rowColors[7]; ///< Cached brushes used for row backgrounds /// Row from which the selection shrinks/grows from when selecting via the /// keyboard, shift-clicking or dragging - int extendRow; + int extendRow = -1; - Selection selection; ///< Currently selected lines - AssDialogue *active_line; ///< The currently active line or 0 if none + Selection selection; ///< Currently selected lines + AssDialogue *active_line = nullptr; ///< The currently active line or 0 if none std::vector index_line_map; ///< Row number -> dialogue line std::map line_index_map; ///< Dialogue line -> row number /// Selection batch nesting depth; changes are commited only when this /// hits zero - int batch_level; + int batch_level = 0; /// Has the active line been changed in the current batch? - bool batch_active_line_changed; + bool batch_active_line_changed = false; /// Lines which will be added to the selection when the current batch is /// completed; should be disjoint from selection Selection batch_selection_added; @@ -112,7 +112,7 @@ class BaseGrid : public wxWindow, public SubtitleSelectionController { bool showCol[10]; ///< Column visibility mask - int yPos; + int yPos = 0; void AdjustScrollbar(); void SetColumnWidths(); diff --git a/aegisub/src/dialog_kara_timing_copy.cpp b/aegisub/src/dialog_kara_timing_copy.cpp index d5a8d8a64..75f130df2 100644 --- a/aegisub/src/dialog_kara_timing_copy.cpp +++ b/aegisub/src/dialog_kara_timing_copy.cpp @@ -451,8 +451,6 @@ bool KaraokeLineMatchDisplay::UndoMatch() DialogKanjiTimer::DialogKanjiTimer(agi::Context *c) : wxDialog(c->parent, -1, _("Kanji timing")) , subs(c->ass) -, currentSourceLine(nullptr) -, currentDestinationLine(nullptr) { SetIcon(GETICON(kara_timing_copier_16)); diff --git a/aegisub/src/dialog_kara_timing_copy.h b/aegisub/src/dialog_kara_timing_copy.h index a26da0677..c74f0ba1a 100644 --- a/aegisub/src/dialog_kara_timing_copy.h +++ b/aegisub/src/dialog_kara_timing_copy.h @@ -55,8 +55,8 @@ class DialogKanjiTimer : public wxDialog { std::vector> LinesToChange; - AssEntry *currentSourceLine; - AssEntry *currentDestinationLine; + AssEntry *currentSourceLine = nullptr; + AssEntry *currentDestinationLine = nullptr; void OnClose(wxCommandEvent &event); void OnStart(wxCommandEvent &event); diff --git a/aegisub/src/dialog_progress.cpp b/aegisub/src/dialog_progress.cpp index 6c9552d79..330925ca3 100644 --- a/aegisub/src/dialog_progress.cpp +++ b/aegisub/src/dialog_progress.cpp @@ -115,8 +115,6 @@ public: DialogProgress::DialogProgress(wxWindow *parent, wxString const& title_text, wxString const& message) : wxDialog(parent, -1, title_text, wxDefaultPosition, wxDefaultSize, wxBORDER_RAISED) , pulse_timer(GetEventHandler()) -, progress_current(0) -, progress_target(0) { title = new wxStaticText(this, -1, title_text, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE | wxST_NO_AUTORESIZE); gauge = new wxGauge(this, -1, 300, wxDefaultPosition, wxSize(300,20)); diff --git a/aegisub/src/dialog_progress.h b/aegisub/src/dialog_progress.h index 9b7c87cd5..14b1c31a9 100644 --- a/aegisub/src/dialog_progress.h +++ b/aegisub/src/dialog_progress.h @@ -44,11 +44,11 @@ class DialogProgress : public wxDialog, public agi::BackgroundRunner { wxTimer pulse_timer; wxString pending_log; - int progress_anim_start_value; - int progress_current; - int progress_target; + int progress_anim_start_value = 0; + int progress_current = 0; + int progress_target = 0; std::chrono::steady_clock::time_point progress_anim_start_time; - int progress_anim_duration; + int progress_anim_duration = 0; void OnShow(wxShowEvent&); void OnCancel(wxCommandEvent &); diff --git a/aegisub/src/dialog_spellchecker.cpp b/aegisub/src/dialog_spellchecker.cpp index 2fb735784..007c0d4cf 100644 --- a/aegisub/src/dialog_spellchecker.cpp +++ b/aegisub/src/dialog_spellchecker.cpp @@ -54,9 +54,6 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context) : wxDialog(context->parent, -1, _("Spell Checker")) , context(context) , spellchecker(SpellCheckerFactory::GetSpellChecker()) -, start_line(nullptr) -, active_line(nullptr) -, has_looped(false) { SetIcon(GETICON(spellcheck_toolbutton_16)); diff --git a/aegisub/src/dialog_spellchecker.h b/aegisub/src/dialog_spellchecker.h index bd57e0b6a..d295442e9 100644 --- a/aegisub/src/dialog_spellchecker.h +++ b/aegisub/src/dialog_spellchecker.h @@ -59,9 +59,9 @@ class DialogSpellChecker : public wxDialog { wxButton *add_button; ///< Add word to currently active dictionary wxButton *remove_button; ///< Remove word from currently active dictionary - AssDialogue *start_line; ///< The first line checked - AssDialogue *active_line; ///< The most recently checked line - bool has_looped; ///< Has the search already looped from the end to beginning? + AssDialogue *start_line = nullptr; ///< The first line checked + AssDialogue *active_line = nullptr; ///< The most recently checked line + bool has_looped = false; ///< Has the search already looped from the end to beginning? /// Find the next misspelled word and close the dialog if there are none /// @return Are there any more misspelled words? diff --git a/aegisub/src/dialog_style_editor.cpp b/aegisub/src/dialog_style_editor.cpp index d1b6c80a6..44a751a6b 100644 --- a/aegisub/src/dialog_style_editor.cpp +++ b/aegisub/src/dialog_style_editor.cpp @@ -142,7 +142,6 @@ static wxTextCtrl *num_text_ctrl(wxWindow *parent, double *value, bool allow_neg DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Context *c, AssStyleStorage *store, std::string const& new_name, wxArrayString const& font_list) : wxDialog (parent, -1, _("Style Editor"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) , c(c) -, is_new(false) , style(style) , store(store) { diff --git a/aegisub/src/dialog_style_editor.h b/aegisub/src/dialog_style_editor.h index 1ed545869..76e21b995 100644 --- a/aegisub/src/dialog_style_editor.h +++ b/aegisub/src/dialog_style_editor.h @@ -54,7 +54,7 @@ class DialogStyleEditor : public wxDialog { /// If true, the style was just created and so the user should not be /// asked if they want to change any existing lines should they rename /// the style - bool is_new; + bool is_new = false; /// The style currently being edited AssStyle *style; diff --git a/aegisub/src/dialog_styling_assistant.cpp b/aegisub/src/dialog_styling_assistant.cpp index 9e6a1da34..d8ff9f8d4 100644 --- a/aegisub/src/dialog_styling_assistant.cpp +++ b/aegisub/src/dialog_styling_assistant.cpp @@ -56,7 +56,6 @@ DialogStyling::DialogStyling(agi::Context *context) : wxDialog(context->parent, -1, _("Styling Assistant"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX) , c(context) , active_line_connection(context->selectionController->AddActiveLineListener(&DialogStyling::OnActiveLineChanged, this)) -, active_line(nullptr) { SetIcon(GETICON(styling_toolbutton_16)); diff --git a/aegisub/src/dialog_styling_assistant.h b/aegisub/src/dialog_styling_assistant.h index 5fbe5d729..74820308e 100644 --- a/aegisub/src/dialog_styling_assistant.h +++ b/aegisub/src/dialog_styling_assistant.h @@ -55,7 +55,7 @@ class DialogStyling : public wxDialog { void OnActiveLineChanged(AssDialogue *); - AssDialogue *active_line; + AssDialogue *active_line = nullptr; std::unique_ptr persist; diff --git a/aegisub/src/dialog_translation.cpp b/aegisub/src/dialog_translation.cpp index 993a4461a..5c0dc43d1 100644 --- a/aegisub/src/dialog_translation.cpp +++ b/aegisub/src/dialog_translation.cpp @@ -66,10 +66,8 @@ DialogTranslation::DialogTranslation(agi::Context *c) , file_change_connection(c->ass->AddCommitListener(&DialogTranslation::OnExternalCommit, this)) , active_line_connection(c->selectionController->AddActiveLineListener(&DialogTranslation::OnActiveLineChanged, this)) , active_line(c->selectionController->GetActiveLine()) -, cur_block(0) , line_count(count_if(c->ass->Line.begin(), c->ass->Line.end(), cast())) , line_number(count_if(c->ass->Line.begin(), c->ass->Line.iterator_to(*active_line), cast()) + 1) -, switching_lines(false) { SetIcon(GETICON(translation_toolbutton_16)); diff --git a/aegisub/src/dialog_translation.h b/aegisub/src/dialog_translation.h index 0a3064385..70202f212 100644 --- a/aegisub/src/dialog_translation.h +++ b/aegisub/src/dialog_translation.h @@ -47,7 +47,7 @@ class DialogTranslation : public wxDialog { /// The parsed dialogue blocks for the active line boost::ptr_vector blocks; /// Which dialogue block in the active line is currently being translated - size_t cur_block; + size_t cur_block = 0; /// Total number of dialogue lines in the file size_t line_count; @@ -55,7 +55,7 @@ class DialogTranslation : public wxDialog { size_t line_number; /// Should active line change announcements be ignored? - bool switching_lines; + bool switching_lines = false; wxStaticText *line_number_display; ScintillaTextCtrl *original_text; diff --git a/aegisub/src/export_framerate.cpp b/aegisub/src/export_framerate.cpp index 2ad31d137..aa71f2602 100644 --- a/aegisub/src/export_framerate.cpp +++ b/aegisub/src/export_framerate.cpp @@ -59,14 +59,6 @@ AssTransformFramerateFilter::AssTransformFramerateFilter() : AssExportFilter(from_wx(_("Transform Framerate")), from_wx(_("Transform subtitle times, including those in override tags, from an input framerate to an output framerate.\n\nThis is useful for converting regular time subtitles to VFRaC time subtitles for hardsubbing.\nIt can also be used to convert subtitles to a different speed video, such as NTSC to PAL speedup.")), 1000) -, c(nullptr) -, line(nullptr) -, newStart(0) -, newEnd(0) -, newK(0) -, oldK(0) -, Input(nullptr) -, Output(nullptr) { } diff --git a/aegisub/src/export_framerate.h b/aegisub/src/export_framerate.h index 71f46c6cc..803cdfe85 100644 --- a/aegisub/src/export_framerate.h +++ b/aegisub/src/export_framerate.h @@ -45,16 +45,16 @@ class wxTextCtrl; /// @class AssTransformFramerateFilter /// @brief Transform subtitle times, including those in override tags, from an input framerate to an output framerate class AssTransformFramerateFilter : public AssExportFilter { - agi::Context *c; - AssDialogue *line; - int newStart; - int newEnd; - int newK; - int oldK; + agi::Context *c = nullptr; + AssDialogue *line = nullptr; + int newStart = 0; + int newEnd = 0; + int newK = 0; + int oldK = 0; - // Yes, these are backwards - const agi::vfr::Framerate *Input; ///< Destination frame rate - const agi::vfr::Framerate *Output; ///< Source frame rate + // Yes, these are backwards. It sort of makes sense if you think about what it's doing. + const agi::vfr::Framerate *Input = nullptr; ///< Destination frame rate + const agi::vfr::Framerate *Output = nullptr; ///< Source frame rate agi::vfr::Framerate t1,t2; diff --git a/aegisub/src/font_file_lister.cpp b/aegisub/src/font_file_lister.cpp index b7f6920ae..9a7316e8d 100644 --- a/aegisub/src/font_file_lister.cpp +++ b/aegisub/src/font_file_lister.cpp @@ -64,8 +64,6 @@ namespace { FontCollector::FontCollector(FontCollectorStatusCallback status_callback, FontFileLister &lister) : status_callback(std::move(status_callback)) , lister(lister) -, missing(0) -, missing_glyphs(0) { } diff --git a/aegisub/src/font_file_lister.h b/aegisub/src/font_file_lister.h index 87efd4a5b..9448b7a35 100644 --- a/aegisub/src/font_file_lister.h +++ b/aegisub/src/font_file_lister.h @@ -87,9 +87,9 @@ class FontCollector { /// Paths to found required font files std::set results; /// Number of fonts which could not be found - int missing; + int missing = 0; /// Number of fonts which were found, but did not contain all used glyphs - int missing_glyphs; + int missing_glyphs = 0; /// Gather all of the unique styles with text on a line void ProcessDialogueLine(const AssDialogue *line, int index); diff --git a/aegisub/src/frame_main.cpp b/aegisub/src/frame_main.cpp index b3ae45cc0..3e8659ac6 100644 --- a/aegisub/src/frame_main.cpp +++ b/aegisub/src/frame_main.cpp @@ -183,10 +183,6 @@ public: FrameMain::FrameMain() : wxFrame(nullptr, -1, "", wxDefaultPosition, wxSize(920,700), wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN) , context(agi::util::make_unique()) -, showVideo(true) -, showAudio(true) -, blockVideoLoad(false) -, blockAudioLoad(false) { StartupLog("Entering FrameMain constructor"); diff --git a/aegisub/src/frame_main.h b/aegisub/src/frame_main.h index a51060682..3b360dc19 100644 --- a/aegisub/src/frame_main.h +++ b/aegisub/src/frame_main.h @@ -66,14 +66,14 @@ class FrameMain: public wxFrame { void Thaw(void) {} #endif - bool showVideo; ///< Is the video display shown? - bool showAudio; ///< Is the audio display shown? - wxTimer StatusClear; ///< Status bar timeout timer + bool showVideo = true; ///< Is the video display shown? + bool showAudio = true; ///< Is the audio display shown? + wxTimer StatusClear; ///< Status bar timeout timer /// Block video loading; used when both video and subtitles are opened at /// the same time, so that the video associated with the subtitles (if any) /// isn't loaded - bool blockVideoLoad; - bool blockAudioLoad; + bool blockVideoLoad = false; + bool blockAudioLoad = false; void InitToolbar(); void InitContents(); diff --git a/aegisub/src/gl_text.cpp b/aegisub/src/gl_text.cpp index 2d883dc01..82d63cecc 100644 --- a/aegisub/src/gl_text.cpp +++ b/aegisub/src/gl_text.cpp @@ -229,19 +229,8 @@ public: } -OpenGLText::OpenGLText() -: r(1.f) -, g(1.f) -, b(1.f) -, a(1.f) -, fontSize(0) -, fontBold(false) -, fontItalics(false) -{ -} - -OpenGLText::~OpenGLText() { -} +OpenGLText::OpenGLText() { } +OpenGLText::~OpenGLText() { } void OpenGLText::SetFont(std::string const& face, int size, bool bold, bool italics) { // No change required diff --git a/aegisub/src/gl_text.h b/aegisub/src/gl_text.h index dbb0a3991..aeb888bef 100644 --- a/aegisub/src/gl_text.h +++ b/aegisub/src/gl_text.h @@ -50,11 +50,11 @@ namespace agi { struct Color; } typedef boost::container::map glyphMap; class OpenGLText { - float r,g,b,a; + float r = 1.f, g = 1.f, b = 1.f, a = 1.f; - int fontSize; - bool fontBold; - bool fontItalics; + int fontSize = 0; + bool fontBold = false; + bool fontItalics = false; std::string fontFace; wxFont font; @@ -62,8 +62,8 @@ class OpenGLText { std::vector textures; - OpenGLText(OpenGLText const&); - OpenGLText& operator=(OpenGLText const&); + OpenGLText(OpenGLText const&) = delete; + OpenGLText& operator=(OpenGLText const&) = delete; /// @brief Get the glyph for the character chr, creating it if necessary /// @param chr Character to get the glyph of diff --git a/aegisub/src/hotkey_data_view_model.cpp b/aegisub/src/hotkey_data_view_model.cpp index 7c338efc3..8ef05da47 100644 --- a/aegisub/src/hotkey_data_view_model.cpp +++ b/aegisub/src/hotkey_data_view_model.cpp @@ -261,7 +261,6 @@ public: HotkeyDataViewModel::HotkeyDataViewModel(Preferences *parent) : root(agi::util::make_unique(this)) , parent(parent) -, has_pending_changes(false) { } diff --git a/aegisub/src/hotkey_data_view_model.h b/aegisub/src/hotkey_data_view_model.h index 8937edaad..e0c7bfecc 100644 --- a/aegisub/src/hotkey_data_view_model.h +++ b/aegisub/src/hotkey_data_view_model.h @@ -31,7 +31,7 @@ class Preferences; class HotkeyDataViewModel : public wxDataViewModel { std::unique_ptr root; Preferences *parent; - bool has_pending_changes; + bool has_pending_changes = false; /// Get the real item from the wrapper, or root if it's wrapping nullptr const HotkeyModelItem *get(wxDataViewItem const& item) const; diff --git a/aegisub/src/mkv_wrap.cpp b/aegisub/src/mkv_wrap.cpp index 2867b6d70..353468276 100644 --- a/aegisub/src/mkv_wrap.cpp +++ b/aegisub/src/mkv_wrap.cpp @@ -66,8 +66,8 @@ public: MkvStdIO(agi::fs::path const& filename); ~MkvStdIO() { if (fp) fclose(fp); } - FILE *fp; - int error; + FILE *fp = nullptr; + int error = 0; }; #define CACHESIZE 1024 @@ -284,9 +284,7 @@ longlong StdIoGetFileSize(InputStream *st) { return epos; } -MkvStdIO::MkvStdIO(agi::fs::path const& filename) -: error(0) -{ +MkvStdIO::MkvStdIO(agi::fs::path const& filename) { read = StdIoRead; scan = StdIoScan; getcachesize = [](InputStream *) -> unsigned int { return CACHESIZE; }; diff --git a/aegisub/src/spline.cpp b/aegisub/src/spline.cpp index 866c479b1..68599daa4 100644 --- a/aegisub/src/spline.cpp +++ b/aegisub/src/spline.cpp @@ -46,8 +46,6 @@ Spline::Spline(const VisualToolBase &tl) : coord_translator(tl) -, scale(1) -, raw_scale(1) { } diff --git a/aegisub/src/spline.h b/aegisub/src/spline.h index 6024782da..9ce54de9d 100644 --- a/aegisub/src/spline.h +++ b/aegisub/src/spline.h @@ -43,8 +43,8 @@ class Spline : private std::list { /// Visual tool to do the conversion between script and video pixels const VisualToolBase &coord_translator; /// Spline scale - int scale; - int raw_scale; + int scale = 0; + int raw_scale = 0; /// Video coordinates -> Script coordinates Vector2D ToScript(Vector2D vec) const; diff --git a/aegisub/src/subs_controller.cpp b/aegisub/src/subs_controller.cpp index 5bf93544a..a03051069 100644 --- a/aegisub/src/subs_controller.cpp +++ b/aegisub/src/subs_controller.cpp @@ -59,9 +59,6 @@ struct SubsController::UndoInfo { SubsController::SubsController(agi::Context *context) : context(context) , undo_connection(context->ass->AddUndoManager(&SubsController::OnCommit, this)) -, commit_id(0) -, saved_commit_id(0) -, autosaved_commit_id(0) { autosave_timer_changed(&autosave_timer); OPT_SUB("App/Auto/Save", autosave_timer_changed, &autosave_timer); diff --git a/aegisub/src/subs_controller.h b/aegisub/src/subs_controller.h index 04e1e6c45..6ca52a351 100644 --- a/aegisub/src/subs_controller.h +++ b/aegisub/src/subs_controller.h @@ -37,11 +37,11 @@ class SubsController { boost::container::list redo_stack; /// Revision counter for undo coalescing and modified state tracking - int commit_id; + int commit_id = 0; /// Last saved version of this file - int saved_commit_id; + int saved_commit_id = 0; /// Last autosaved version of this file - int autosaved_commit_id; + int autosaved_commit_id = 0; /// Timer for triggering autosaves wxTimer autosave_timer; diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 61371c09c..451b653a4 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -93,11 +93,7 @@ void time_edit_char_hook(wxKeyEvent &event) { SubsEditBox::SubsEditBox(wxWindow *parent, agi::Context *context) : wxPanel(parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxRAISED_BORDER, "SubsEditBox") -, line(nullptr) -, button_bar_split(true) -, controls_enabled(true) , c(context) -, commit_id(-1) , undo_timer(GetEventHandler()) { using std::bind; diff --git a/aegisub/src/subs_edit_box.h b/aegisub/src/subs_edit_box.h index b46fd1128..a75001b24 100644 --- a/aegisub/src/subs_edit_box.h +++ b/aegisub/src/subs_edit_box.h @@ -78,14 +78,14 @@ class SubsEditBox : public wxPanel { std::deque connections; /// Currently active dialogue line - AssDialogue *line; + AssDialogue *line = nullptr; /// Last seen grid selection SubtitleSelection sel; /// Are the buttons currently split into two lines? - bool button_bar_split; + bool button_bar_split = true; /// Are the controls currently enabled? - bool controls_enabled; + bool controls_enabled = true; agi::Context *c; @@ -120,7 +120,7 @@ class SubsEditBox : public wxPanel { void CommitText(wxString const& desc); /// Last commit ID for undo coalescing - int commit_id; + int commit_id = -1; /// Last used commit message to avoid coalescing different types of changes wxString last_commit_type; diff --git a/aegisub/src/subs_edit_ctrl.cpp b/aegisub/src/subs_edit_ctrl.cpp index 907308387..9922138ed 100644 --- a/aegisub/src/subs_edit_ctrl.cpp +++ b/aegisub/src/subs_edit_ctrl.cpp @@ -86,7 +86,6 @@ SubsTextEditCtrl::SubsTextEditCtrl(wxWindow* parent, wxSize wsize, long style, a : ScintillaTextCtrl(parent, -1, "", wxDefaultPosition, wsize, style) , spellchecker(SpellCheckerFactory::GetSpellChecker()) , context(context) -, calltip_position(0) { // Set properties SetWrapMode(wxSTC_WRAP_WORD); diff --git a/aegisub/src/subs_edit_ctrl.h b/aegisub/src/subs_edit_ctrl.h index fd754c4bc..84b611f4d 100644 --- a/aegisub/src/subs_edit_ctrl.h +++ b/aegisub/src/subs_edit_ctrl.h @@ -78,7 +78,7 @@ class SubsTextEditCtrl : public ScintillaTextCtrl { std::string calltip_text; /// Position of the currently show calltip - size_t calltip_position; + size_t calltip_position = 0; /// Cursor position which the current calltip is for int cursor_pos; diff --git a/aegisub/src/subtitles_provider_libass.cpp b/aegisub/src/subtitles_provider_libass.cpp index 97dd60d2d..1347b50fe 100644 --- a/aegisub/src/subtitles_provider_libass.cpp +++ b/aegisub/src/subtitles_provider_libass.cpp @@ -83,10 +83,7 @@ void msg_callback(int level, const char *fmt, va_list args, void *) { #endif } -LibassSubtitlesProvider::LibassSubtitlesProvider(std::string) -: ass_renderer(nullptr) -, ass_track(nullptr) -{ +LibassSubtitlesProvider::LibassSubtitlesProvider(std::string) { auto done = std::make_shared(false); auto renderer = std::make_shared(nullptr); cache_queue->Async([=]{ diff --git a/aegisub/src/subtitles_provider_libass.h b/aegisub/src/subtitles_provider_libass.h index 2a818c3cd..cbce7873d 100644 --- a/aegisub/src/subtitles_provider_libass.h +++ b/aegisub/src/subtitles_provider_libass.h @@ -39,8 +39,8 @@ extern "C" { } class LibassSubtitlesProvider : public SubtitlesProvider { - ASS_Renderer* ass_renderer; - ASS_Track* ass_track; + ASS_Renderer* ass_renderer = nullptr; + ASS_Track* ass_track = nullptr; public: LibassSubtitlesProvider(std::string); diff --git a/aegisub/src/threaded_frame_source.cpp b/aegisub/src/threaded_frame_source.cpp index 955ddb8ed..9cf073376 100644 --- a/aegisub/src/threaded_frame_source.cpp +++ b/aegisub/src/threaded_frame_source.cpp @@ -114,10 +114,6 @@ ThreadedFrameSource::ThreadedFrameSource(agi::fs::path const& video_filename, st , subs_provider(get_subs_provider(parent)) , video_provider(VideoProviderFactory::GetProvider(video_filename, colormatrix)) , parent(parent) -, frame_number(-1) -, time(-1.) -, single_frame(-1) -, version(0) { } diff --git a/aegisub/src/threaded_frame_source.h b/aegisub/src/threaded_frame_source.h index 1bcb7156a..fa7223245 100644 --- a/aegisub/src/threaded_frame_source.h +++ b/aegisub/src/threaded_frame_source.h @@ -50,8 +50,8 @@ class ThreadedFrameSource { /// Event handler to send FrameReady events to wxEvtHandler *parent; - int frame_number; ///< Last frame number requested - double time; ///< Time of the frame to pass to the subtitle renderer + int frame_number = -1; ///< Last frame number requested + double time = -1.; ///< Time of the frame to pass to the subtitle renderer /// Copy of the subtitles file to avoid having to touch the project context std::unique_ptr subs; @@ -59,7 +59,7 @@ class ThreadedFrameSource { /// If >= 0, the subtitles provider current has just the lines visible on /// that frame loaded. If -1, the entire file is loaded. If -2, the /// currently loaded file is out of date. - int single_frame; + int single_frame = -1; std::shared_ptr ProcFrame(int frame, double time, bool raw = false); @@ -68,7 +68,7 @@ class ThreadedFrameSource { /// Monotonic counter used to drop frames when changes arrive faster than /// they can be rendered - std::atomic version; + std::atomic version{ 0 }; public: /// @brief Load the passed subtitle file diff --git a/aegisub/src/timeedit_ctrl.cpp b/aegisub/src/timeedit_ctrl.cpp index 4e5379a43..8cb7efdc7 100644 --- a/aegisub/src/timeedit_ctrl.cpp +++ b/aegisub/src/timeedit_ctrl.cpp @@ -60,7 +60,6 @@ enum { TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const std::string& value, const wxSize& size, bool asEnd) : wxTextCtrl(parent, id, to_wx(value), wxDefaultPosition, size, wxTE_CENTRE | wxTE_PROCESS_ENTER) , c(c) -, byFrame(false) , isEnd(asEnd) , insert(!OPT_GET("Subtitle/Time Edit/Insert Mode")->GetBool()) , insert_opt(OPT_SUB("Subtitle/Time Edit/Insert Mode", &TimeEdit::OnInsertChanged, this)) diff --git a/aegisub/src/timeedit_ctrl.h b/aegisub/src/timeedit_ctrl.h index 30b650fca..fd570f32a 100644 --- a/aegisub/src/timeedit_ctrl.h +++ b/aegisub/src/timeedit_ctrl.h @@ -48,8 +48,8 @@ namespace agi { /// This control constrains values to valid times, and can display the time /// being edited as either a h:mm:ss.cc formatted time, or a frame number class TimeEdit : public wxTextCtrl { + bool byFrame = false; ///< Is the time displayed as a frame number? agi::Context *c; ///< Project context - bool byFrame; ///< Is the time displayed as a frame number? bool isEnd; ///< Should the time be treated as an end time for time <-> frame conversions? AssTime time; ///< The time, which may be displayed as either a frame number or time bool insert; ///< If true, disable overwriting behavior in time mode diff --git a/aegisub/src/video_context.cpp b/aegisub/src/video_context.cpp index ff549cb67..a6b8913ff 100644 --- a/aegisub/src/video_context.cpp +++ b/aegisub/src/video_context.cpp @@ -60,14 +60,7 @@ VideoContext::VideoContext() : playback(this) -, start_ms(0) -, end_frame(0) -, frame_n(0) -, ar_value(1.) -, ar_type(AspectRatio::Default) -, has_subtitles(false) , playAudioOnStep(OPT_GET("Audio/Plays When Stepping Video")) -, no_amend(false) { Bind(EVT_VIDEO_ERROR, &VideoContext::OnVideoError, this); Bind(EVT_SUBTITLES_ERROR, &VideoContext::OnSubtitlesError, this); diff --git a/aegisub/src/video_context.h b/aegisub/src/video_context.h index f8a808e42..ea2c72e45 100644 --- a/aegisub/src/video_context.h +++ b/aegisub/src/video_context.h @@ -110,24 +110,24 @@ class VideoContext : public wxEvtHandler { /// The start time of the first frame of the current playback; undefined if /// video is not currently playing - int start_ms; + int start_ms = 0; /// The last frame to play if video is currently playing - int end_frame; + int end_frame = 0; /// The frame number which was last requested from the video provider, /// which may not be the same thing as the currently displayed frame - int frame_n; + int frame_n = 0; /// The picture aspect ratio of the video if the aspect ratio has been /// overridden by the user - double ar_value; + double ar_value = 1.; /// The current AR type - AspectRatio ar_type; + AspectRatio ar_type = AspectRatio::Default; /// Does the currently loaded video file have subtitles muxed into it? - bool has_subtitles; + bool has_subtitles = false; /// Filename of the currently loaded timecodes file, or empty if timecodes /// have not been overridden @@ -140,7 +140,7 @@ class VideoContext : public wxEvtHandler { /// be kept in perfect sync. Saving the file can add lines to the file /// without a commit, breaking this sync, so force a non-amend after each /// save. - bool no_amend; + bool no_amend = false; void OnPlayTimer(wxTimerEvent &event); diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 26a695ac1..1db23d5f3 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -95,11 +95,6 @@ VideoDisplay::VideoDisplay( : wxGLCanvas(parent, -1, attribList) , autohideTools(OPT_GET("Tool/Visual/Autohide")) , con(c) -, viewport_left(0) -, viewport_width(0) -, viewport_bottom(0) -, viewport_top(0) -, viewport_height(0) , zoomValue(OPT_GET("Video/Default Zoom")->GetInt() * .125 + .125) , toolBar(visualSubToolBar) , zoomBox(zoomBox) diff --git a/aegisub/src/video_display.h b/aegisub/src/video_display.h index 96c9636d3..977c5f829 100644 --- a/aegisub/src/video_display.h +++ b/aegisub/src/video_display.h @@ -73,15 +73,15 @@ class VideoDisplay : public wxGLCanvas { Vector2D last_mouse_pos, mouse_pos; /// Screen pixels between the left of the canvas and the left of the video - int viewport_left; + int viewport_left = 0; /// The width of the video in screen pixels - int viewport_width; + int viewport_width = 0; /// Screen pixels between the bottom of the canvas and the bottom of the video; used for glViewport - int viewport_bottom; + int viewport_bottom = 0; /// Screen pixels between the bottom of the canvas and the top of the video; used for coordinate space conversion - int viewport_top; + int viewport_top = 0; /// The height of the video in screen pixels - int viewport_height; + int viewport_height = 0; /// The current zoom level, where 1.0 = 100% double zoomValue; diff --git a/aegisub/src/video_out_gl.cpp b/aegisub/src/video_out_gl.cpp index f68e36b08..cbfe2c251 100644 --- a/aegisub/src/video_out_gl.cpp +++ b/aegisub/src/video_out_gl.cpp @@ -50,16 +50,10 @@ /// @brief Structure tracking all precomputable information about a subtexture struct VideoOutGL::TextureInfo { - GLuint textureID; - int dataOffset; - int sourceH; - int sourceW; - TextureInfo() - : textureID(0) - , dataOffset(0) - , sourceH(0) - , sourceW(0) - { } + GLuint textureID = 0; + int dataOffset = 0; + int sourceH = 0; + int sourceW = 0; }; /// @brief Test if a texture can be created @@ -76,21 +70,7 @@ static bool TestTexture(int width, int height, GLint format) { return format != 0; } -VideoOutGL::VideoOutGL() -: maxTextureSize(0) -, supportsRectangularTextures(false) -, internalFormat(0) -, frameWidth(0) -, frameHeight(0) -, frameFormat(0) -, frameFlipped(false) -, textureIdList() -, textureList() -, dl(0) -, textureCount(0) -, textureRows(0) -, textureCols(0) -{ } +VideoOutGL::VideoOutGL() { } /// @brief Runtime detection of required OpenGL capabilities void VideoOutGL::DetectOpenGLCapabilities() { diff --git a/aegisub/src/video_out_gl.h b/aegisub/src/video_out_gl.h index 39abe4a35..be690eae1 100644 --- a/aegisub/src/video_out_gl.h +++ b/aegisub/src/video_out_gl.h @@ -31,38 +31,38 @@ class VideoOutGL { struct TextureInfo; /// The maximum texture size supported by the user's graphics card - int maxTextureSize; + int maxTextureSize = 0; /// Whether rectangular textures are supported by the user's graphics card - bool supportsRectangularTextures; + bool supportsRectangularTextures = false; /// The internalformat to use - int internalFormat; + int internalFormat = 0; /// The frame height which the texture grid has been set up for - int frameWidth; + int frameWidth = 0; /// The frame width which the texture grid has been set up for - int frameHeight; + int frameHeight = 0; /// The frame format which the texture grid has been set up for - GLenum frameFormat; + GLenum frameFormat = 0; /// Whether the grid is set up for flipped video - bool frameFlipped; + bool frameFlipped = false; /// List of OpenGL texture ids used in the grid std::vector textureIdList; /// List of precalculated texture display information std::vector textureList; /// OpenGL display list which draws the frames - GLuint dl; + GLuint dl = 0; /// The total texture count - int textureCount; + int textureCount = 0; /// The number of rows of textures - int textureRows; + int textureRows = 0; /// The number of columns of textures - int textureCols; + int textureCols = 0; void DetectOpenGLCapabilities(); void InitTextures(int width, int height, GLenum format, int bpp, bool flipped); - VideoOutGL(const VideoOutGL &); - VideoOutGL& operator=(const VideoOutGL&); + VideoOutGL(const VideoOutGL &) = delete; + VideoOutGL& operator=(const VideoOutGL&) = delete; public: /// @brief Set the frame to be displayed when Render() is called /// @param frame The frame to be displayed diff --git a/aegisub/src/video_provider_ffmpegsource.cpp b/aegisub/src/video_provider_ffmpegsource.cpp index c12df4abc..b0d359dc4 100644 --- a/aegisub/src/video_provider_ffmpegsource.cpp +++ b/aegisub/src/video_provider_ffmpegsource.cpp @@ -74,9 +74,6 @@ std::string colormatrix_description(int cs, int cr) { FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(agi::fs::path const& filename, std::string const& colormatrix) try : VideoSource(nullptr, FFMS_DestroyVideoSource) -, VideoInfo(nullptr) -, Width(-1) -, Height(-1) { ErrInfo.Buffer = FFMSErrMsg; ErrInfo.BufferSize = sizeof(FFMSErrMsg); diff --git a/aegisub/src/video_provider_ffmpegsource.h b/aegisub/src/video_provider_ffmpegsource.h index 11db850f4..f9793fbec 100644 --- a/aegisub/src/video_provider_ffmpegsource.h +++ b/aegisub/src/video_provider_ffmpegsource.h @@ -41,10 +41,10 @@ class FFmpegSourceVideoProvider : public VideoProvider, FFmpegSourceProvider { /// video source object agi::scoped_holder VideoSource; - const FFMS_VideoProperties *VideoInfo; ///< video properties + const FFMS_VideoProperties *VideoInfo = nullptr; ///< video properties - int Width; ///< width in pixels - int Height; ///< height in pixels + int Width = -1; ///< width in pixels + int Height = -1; ///< height in pixels double DAR; ///< display aspect ratio std::vector KeyFramesList; ///< list of keyframes agi::vfr::Framerate Timecodes; ///< vfr object diff --git a/aegisub/src/video_provider_yuv4mpeg.cpp b/aegisub/src/video_provider_yuv4mpeg.cpp index eec44a6d8..8ffbd8c29 100644 --- a/aegisub/src/video_provider_yuv4mpeg.cpp +++ b/aegisub/src/video_provider_yuv4mpeg.cpp @@ -58,15 +58,7 @@ /// @brief Constructor /// @param filename The filename to open -YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(agi::fs::path const& filename, std::string const&) -: sf(nullptr) -, inited(false) -, w (0) -, h (0) -, num_frames(-1) -, pixfmt(Y4M_PIXFMT_NONE) -, imode(Y4M_ILACE_NOTSET) -{ +YUV4MPEGVideoProvider::YUV4MPEGVideoProvider(agi::fs::path const& filename, std::string const&) { fps_rat.num = -1; fps_rat.den = 1; diff --git a/aegisub/src/video_provider_yuv4mpeg.h b/aegisub/src/video_provider_yuv4mpeg.h index 370aac799..d60170853 100644 --- a/aegisub/src/video_provider_yuv4mpeg.h +++ b/aegisub/src/video_provider_yuv4mpeg.h @@ -100,17 +100,17 @@ class YUV4MPEGVideoProvider : public VideoProvider { Y4M_FFLAG_C_UNKNOWN = 0x0800 /// unknown (only allowed for non-4:2:0 sampling) }; - FILE *sf; /// source file - bool inited; /// initialization state + FILE *sf = nullptr; /// source file + bool inited = false; /// initialization state - int w, h; /// frame width/height - int num_frames; /// length of file in frames + int w = 0, h = 0; /// frame width/height + int num_frames = -1; /// length of file in frames int frame_sz; /// size of each frame in bytes int luma_sz; /// size of the luma plane of each frame, in bytes int chroma_sz; /// size of one of the two chroma planes of each frame, in bytes - Y4M_PixelFormat pixfmt; /// colorspace/pixel format - Y4M_InterlacingMode imode; /// interlacing mode (for the entire stream) + Y4M_PixelFormat pixfmt = Y4M_PIXFMT_NONE; /// colorspace/pixel format + Y4M_InterlacingMode imode = Y4M_ILACE_NOTSET; /// interlacing mode (for the entire stream) struct { int num; /// numerator int den; /// denominator diff --git a/aegisub/src/video_slider.cpp b/aegisub/src/video_slider.cpp index f86fee77a..db5fa076d 100644 --- a/aegisub/src/video_slider.cpp +++ b/aegisub/src/video_slider.cpp @@ -50,8 +50,6 @@ VideoSlider::VideoSlider (wxWindow* parent, agi::Context *c) : wxWindow(parent, -1, wxDefaultPosition, wxDefaultSize, wxWANTS_CHARS | wxFULL_REPAINT_ON_RESIZE) , c(c) -, val(0) -, max(1) { SetClientSize(20,25); SetMinSize(wxSize(20, 25)); diff --git a/aegisub/src/video_slider.h b/aegisub/src/video_slider.h index d37dfee2f..8ae03025c 100644 --- a/aegisub/src/video_slider.h +++ b/aegisub/src/video_slider.h @@ -49,8 +49,8 @@ class VideoSlider: public wxWindow { std::vector keyframes; ///< Currently loaded keyframes std::vector slots; - int val; ///< Current frame number - int max; ///< Last frame number + int val = 0; ///< Current frame number + int max = 1; ///< Last frame number /// Get the frame number for the given x coordinate int GetValueAtX(int x); diff --git a/aegisub/src/visual_feature.cpp b/aegisub/src/visual_feature.cpp index 2a94edd89..366694b0c 100644 --- a/aegisub/src/visual_feature.cpp +++ b/aegisub/src/visual_feature.cpp @@ -37,13 +37,6 @@ #include "gl_wrap.h" #include "visual_feature.h" -VisualDraggableFeature::VisualDraggableFeature() -: type(DRAG_NONE) -, layer(0) -, line(nullptr) -{ -} - bool VisualDraggableFeature::IsMouseOver(Vector2D mouse_pos) const { if (!pos) return false; diff --git a/aegisub/src/visual_feature.h b/aegisub/src/visual_feature.h index ef4c935b5..4b3fb6ed0 100644 --- a/aegisub/src/visual_feature.h +++ b/aegisub/src/visual_feature.h @@ -60,13 +60,10 @@ class VisualDraggableFeature : public boost::intrusive::make_list_base_hookvideoController->GetFrameN()) -, shift_down(false) -, ctrl_down(false) -, alt_down(false) , file_changed_connection(c->ass->AddCommitListener(&VisualToolBase::OnCommit, this)) -, commit_id(-1) { int script_w, script_h; c->ass->GetResolution(script_w, script_h); @@ -169,8 +162,6 @@ Vector2D VisualToolBase::FromScriptCoords(Vector2D point) const { template VisualTool::VisualTool(VideoDisplay *parent, agi::Context *context) : VisualToolBase(parent, context) -, sel_changed(false) -, active_feature(nullptr) { } diff --git a/aegisub/src/visual_tool.h b/aegisub/src/visual_tool.h index 01632f3e6..1d4b14abc 100644 --- a/aegisub/src/visual_tool.h +++ b/aegisub/src/visual_tool.h @@ -92,15 +92,15 @@ protected: agi::Context *c; VideoDisplay *parent; - bool holding; ///< Is a hold currently in progress? - AssDialogue *active_line; ///< Active dialogue line; nullptr if it is not visible on the current frame - bool dragging; ///< Is a drag currently in progress? + bool holding = false; ///< Is a hold currently in progress? + AssDialogue *active_line = nullptr; ///< Active dialogue line; nullptr if it is not visible on the current frame + bool dragging = false; ///< Is a drag currently in progress? int frame_number; ///< Current frame number - bool shift_down; ///< Is shift down? - bool ctrl_down; ///< Is ctrl down? - bool alt_down; ///< Is alt down? + bool shift_down = false; ///< Is shift down? + bool ctrl_down = false; ///< Is ctrl down? + bool alt_down = false; ///< Is alt down? Vector2D mouse_pos; ///< Last seen mouse position Vector2D drag_start; ///< Mouse position at the beginning of the last drag @@ -109,7 +109,7 @@ protected: Vector2D video_res; ///< Video resolution agi::signal::Connection file_changed_connection; - int commit_id; ///< Last used commit id for coalescing + int commit_id = -1; ///< Last used commit id for coalescing /// @brief Commit the current file state /// @param message Description of changes for undo @@ -153,7 +153,7 @@ protected: typedef agi::owning_intrusive_list feature_list; private: - bool sel_changed; /// Has the selection already been changed in the current click? + bool sel_changed = false; /// Has the selection already been changed in the current click? /// @brief Called when a hold is begun /// @return Should the hold actually happen? @@ -176,7 +176,7 @@ protected: std::set sel_features; ///< Currently selected visual features /// Topmost feature under the mouse; generally only valid during a drag - FeatureType *active_feature; + FeatureType *active_feature = nullptr; /// List of features which are drawn and can be clicked on /// List is used here for the iterator invalidation properties feature_list features; diff --git a/aegisub/src/visual_tool_clip.cpp b/aegisub/src/visual_tool_clip.cpp index ad9965a89..c7f8ce6a8 100644 --- a/aegisub/src/visual_tool_clip.cpp +++ b/aegisub/src/visual_tool_clip.cpp @@ -34,7 +34,6 @@ VisualToolClip::VisualToolClip(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) , cur_1(0, 0) , cur_2(video_res) -, inverse(false) { ClipCorner *feats[4]; for (auto& feat : feats) { diff --git a/aegisub/src/visual_tool_clip.h b/aegisub/src/visual_tool_clip.h index 443def1ed..651657eac 100644 --- a/aegisub/src/visual_tool_clip.h +++ b/aegisub/src/visual_tool_clip.h @@ -33,7 +33,7 @@ class VisualToolClip : public VisualTool { Vector2D cur_1; Vector2D cur_2; - bool inverse; ///< Is this currently in iclip mode? + bool inverse = false; ///< Is this currently in iclip mode? bool InitializeHold() override; void UpdateHold() override; diff --git a/aegisub/src/visual_tool_drag.cpp b/aegisub/src/visual_tool_drag.cpp index 7eacf62e6..8ef89b34e 100644 --- a/aegisub/src/visual_tool_drag.cpp +++ b/aegisub/src/visual_tool_drag.cpp @@ -48,8 +48,6 @@ static const DraggableFeatureType DRAG_END = DRAG_BIG_CIRCLE; VisualToolDrag::VisualToolDrag(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) -, primary(nullptr) -, button_is_move(true) { c->selectionController->GetSelectedSet(selection); connections.push_back(c->selectionController->AddSelectionListener(&VisualToolDrag::OnSelectedSetChanged, this)); diff --git a/aegisub/src/visual_tool_drag.h b/aegisub/src/visual_tool_drag.h index 461e9909d..ce1e604ab 100644 --- a/aegisub/src/visual_tool_drag.h +++ b/aegisub/src/visual_tool_drag.h @@ -43,13 +43,13 @@ class VisualToolDrag : public VisualTool { /// Equal to curFeature during drags; possibly different at all other times /// nullptr if no features have been clicked on or the last clicked on one no /// longer exists - Feature *primary; + Feature *primary = nullptr; /// The last announced selection set SubtitleSelection selection; /// When the button is pressed, will it convert the line to a move (vs. from /// move to pos)? Used to avoid changing the button's icon unnecessarily - bool button_is_move; + bool button_is_move = false; /// @brief Create the features for a line /// @param diag Line to create the features for diff --git a/aegisub/src/visual_tool_rotatexy.cpp b/aegisub/src/visual_tool_rotatexy.cpp index 294dbf9bb..7df36e07a 100644 --- a/aegisub/src/visual_tool_rotatexy.cpp +++ b/aegisub/src/visual_tool_rotatexy.cpp @@ -27,11 +27,6 @@ VisualToolRotateXY::VisualToolRotateXY(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) -, angle_x(0) -, angle_y(0) -, angle_z(0) -, orig_x(0) -, orig_y(0) { org = new Feature; org->type = DRAG_BIG_TRIANGLE; diff --git a/aegisub/src/visual_tool_rotatexy.h b/aegisub/src/visual_tool_rotatexy.h index 4df6a93ff..9379ba8af 100644 --- a/aegisub/src/visual_tool_rotatexy.h +++ b/aegisub/src/visual_tool_rotatexy.h @@ -23,12 +23,12 @@ #include "visual_tool.h" class VisualToolRotateXY : public VisualTool { - float angle_x; /// Current x rotation - float angle_y; /// Current y rotation - float angle_z; /// Current z rotation + float angle_x = 0.f; /// Current x rotation + float angle_y = 0.f; /// Current y rotation + float angle_z = 0.f; /// Current z rotation - float orig_x; ///< x rotation at the beginning of the current hold - float orig_y; ///< y rotation at the beginning of the current hold + float orig_x = 0.f; ///< x rotation at the beginning of the current hold + float orig_y = 0.f; ///< y rotation at the beginning of the current hold Feature *org; diff --git a/aegisub/src/visual_tool_rotatez.cpp b/aegisub/src/visual_tool_rotatez.cpp index ae83a948a..a23b935e1 100644 --- a/aegisub/src/visual_tool_rotatez.cpp +++ b/aegisub/src/visual_tool_rotatez.cpp @@ -32,10 +32,6 @@ static const float rad2deg = 180.f / 3.1415926536f; VisualToolRotateZ::VisualToolRotateZ(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) -, angle(0) -, orig_angle(0) -, rotation_x(0) -, rotation_y(0) , org(new Feature) { features.push_back(*org); diff --git a/aegisub/src/visual_tool_rotatez.h b/aegisub/src/visual_tool_rotatez.h index 336e9720d..b1083947c 100644 --- a/aegisub/src/visual_tool_rotatez.h +++ b/aegisub/src/visual_tool_rotatez.h @@ -23,13 +23,13 @@ #include "visual_tool.h" class VisualToolRotateZ : public VisualTool { - float angle; ///< Current Z rotation - float orig_angle; ///< Z rotation at the beginning of the current hold + float angle = 0.f; ///< Current Z rotation + float orig_angle = 0.f; ///< Z rotation at the beginning of the current hold Vector2D pos; ///< Position of the dialogue line Vector2D scale; ///< Current scale - float rotation_x; ///< Current X rotation - float rotation_y; ///< Current Y rotation + float rotation_x = 0.f; ///< Current X rotation + float rotation_y = 0.f; ///< Current Y rotation Feature *org; ///< The origin feature diff --git a/aegisub/src/visual_tool_scale.cpp b/aegisub/src/visual_tool_scale.cpp index 362fafc04..8e4670ac2 100644 --- a/aegisub/src/visual_tool_scale.cpp +++ b/aegisub/src/visual_tool_scale.cpp @@ -28,9 +28,6 @@ VisualToolScale::VisualToolScale(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) -, rx(0) -, ry(0) -, rz(0) { } diff --git a/aegisub/src/visual_tool_scale.h b/aegisub/src/visual_tool_scale.h index 1cb069344..623f73ce4 100644 --- a/aegisub/src/visual_tool_scale.h +++ b/aegisub/src/visual_tool_scale.h @@ -27,9 +27,9 @@ class VisualToolScale : public VisualTool { Vector2D initial_scale; ///< The scale at the beginning of the current hold Vector2D pos; ///< Position of the line - float rx; ///< X rotation - float ry; ///< Y rotation - float rz; ///< Z rotation + float rx = 0.f; ///< X rotation + float ry = 0.f; ///< Y rotation + float rz = 0.f; ///< Z rotation bool InitializeHold() override; void UpdateHold() override; diff --git a/aegisub/src/visual_tool_vector_clip.cpp b/aegisub/src/visual_tool_vector_clip.cpp index c9c8f9a49..0619b625f 100644 --- a/aegisub/src/visual_tool_vector_clip.cpp +++ b/aegisub/src/visual_tool_vector_clip.cpp @@ -52,9 +52,6 @@ enum { VisualToolVectorClip::VisualToolVectorClip(VideoDisplay *parent, agi::Context *context) : VisualTool(parent, context) , spline(*this) -, toolBar(nullptr) -, mode(0) -, inverse(false) { } diff --git a/aegisub/src/visual_tool_vector_clip.h b/aegisub/src/visual_tool_vector_clip.h index 11cd541a6..761a26219 100644 --- a/aegisub/src/visual_tool_vector_clip.h +++ b/aegisub/src/visual_tool_vector_clip.h @@ -42,9 +42,9 @@ struct VisualToolVectorClipDraggableFeature : public VisualDraggableFeature { class VisualToolVectorClip : public VisualTool { Spline spline; /// The current spline - wxToolBar *toolBar; /// The subtoolbar - int mode; /// 0-7 - bool inverse; /// is iclip? + wxToolBar *toolBar = nullptr; /// The subtoolbar + int mode = 0; /// 0-7 + bool inverse = false; /// is iclip? std::set box_added;