Skip to content

Commit f62f2ba

Browse files
committed
Overrides for derived-class methods
1 parent f354850 commit f62f2ba

File tree

11 files changed

+83
-83
lines changed

11 files changed

+83
-83
lines changed

include/ChunkReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ namespace openshot
132132
ChunkReader(std::string path, ChunkVersion chunk_version);
133133

134134
/// Close the reader
135-
void Close();
135+
void Close() override;
136136

137137
/// @brief Get the chunk size (number of frames to write in each chunk)
138138
/// @returns The number of frames in this chunk
@@ -143,27 +143,27 @@ namespace openshot
143143
void SetChunkSize(int64_t new_size) { chunk_size = new_size; };
144144

145145
/// Get the cache object used by this reader (always return NULL for this reader)
146-
openshot::CacheMemory* GetCache() { return NULL; };
146+
openshot::CacheMemory* GetCache() override { return NULL; };
147147

148148
/// @brief Get an openshot::Frame object for a specific frame number of this reader.
149149
/// @returns The requested frame (containing the image and audio)
150150
/// @param requested_frame The frame number you want to retrieve
151-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
151+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
152152

153153
/// Determine if reader is open or closed
154-
bool IsOpen() { return is_open; };
154+
bool IsOpen() override { return is_open; };
155155

156156
/// Return the type name of the class
157-
std::string Name() { return "ChunkReader"; };
157+
std::string Name() override { return "ChunkReader"; };
158158

159159
/// Get and Set JSON methods
160160
std::string Json() const override; ///< Generate JSON string of this object
161-
void SetJson(const std::string value); ///< Load JSON string into this object
161+
void SetJson(const std::string value) override; ///< Load JSON string into this object
162162
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
163-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
163+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
164164

165165
/// Open the reader. This is required before you can access frames or data from the reader.
166-
void Open();
166+
void Open() override;
167167
};
168168

169169
}

include/Clip.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ namespace openshot {
192192

193193
/// Get and Set JSON methods
194194
std::string Json() const override; ///< Generate JSON string of this object
195-
void SetJson(const std::string value); ///< Load JSON string into this object
195+
void SetJson(const std::string value) override; ///< Load JSON string into this object
196196
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
197-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
197+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
198198

199199
/// Get all properties for a specific frame (perfect for a UI to display the current state
200200
/// of all properties at any time)

include/DummyReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,32 +68,32 @@ namespace openshot
6868
virtual ~DummyReader();
6969

7070
/// Close File
71-
void Close();
71+
void Close() override;
7272

7373
/// Get the cache object used by this reader (always returns NULL for this reader)
74-
CacheMemory* GetCache() { return NULL; };
74+
CacheMemory* GetCache() override { return NULL; };
7575

7676
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
7777
/// return the same Frame, since they all share the same image data.
7878
///
7979
/// @returns The requested frame (containing the image)
8080
/// @param requested_frame The frame number that is requested.
81-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
81+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
8282

8383
/// Determine if reader is open or closed
84-
bool IsOpen() { return is_open; };
84+
bool IsOpen() override { return is_open; };
8585

8686
/// Return the type name of the class
87-
std::string Name() { return "DummyReader"; };
87+
std::string Name() override { return "DummyReader"; };
8888

8989
/// Get and Set JSON methods
9090
std::string Json() const override; ///< Generate JSON string of this object
91-
void SetJson(const std::string value); ///< Load JSON string into this object
91+
void SetJson(const std::string value) override; ///< Load JSON string into this object
9292
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
93-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
93+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
9494

9595
/// Open File - which is called by the constructor automatically
96-
void Open();
96+
void Open() override;
9797
};
9898

9999
}

include/FFmpegReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,31 +246,31 @@ namespace openshot {
246246
virtual ~FFmpegReader();
247247

248248
/// Close File
249-
void Close();
249+
void Close() override;
250250

251251
/// Get the cache object used by this reader
252-
CacheMemory *GetCache() { return &final_cache; };
252+
CacheMemory *GetCache() override { return &final_cache; };
253253

254254
/// Get a shared pointer to a openshot::Frame object for a specific frame number of this reader.
255255
///
256256
/// @returns The requested frame of video
257257
/// @param requested_frame The frame number that is requested.
258-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
258+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
259259

260260
/// Determine if reader is open or closed
261-
bool IsOpen() { return is_open; };
261+
bool IsOpen() override { return is_open; };
262262

263263
/// Return the type name of the class
264-
std::string Name() { return "FFmpegReader"; };
264+
std::string Name() override { return "FFmpegReader"; };
265265

266266
/// Get and Set JSON methods
267267
std::string Json() const override; ///< Generate JSON string of this object
268-
void SetJson(const std::string value); ///< Load JSON string into this object
268+
void SetJson(const std::string value) override; ///< Load JSON string into this object
269269
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
270-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
270+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
271271

272272
/// Open File - which is called by the constructor automatically
273-
void Open();
273+
void Open() override;
274274
};
275275

276276
}

include/FrameMapper.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,36 +176,36 @@ namespace openshot
176176
void ChangeMapping(Fraction target_fps, PulldownType pulldown, int target_sample_rate, int target_channels, ChannelLayout target_channel_layout);
177177

178178
/// Close the openshot::FrameMapper and internal reader
179-
void Close();
179+
void Close() override;
180180

181181
/// Get a frame based on the target frame rate and the new frame number of a frame
182182
MappedFrame GetMappedFrame(int64_t TargetFrameNumber);
183183

184184
/// Get the cache object used by this reader
185-
CacheMemory* GetCache() { return &final_cache; };
185+
CacheMemory* GetCache() override { return &final_cache; };
186186

187187
/// @brief This method is required for all derived classes of ReaderBase, and return the
188188
/// openshot::Frame object, which contains the image and audio information for that
189189
/// frame of video.
190190
///
191191
/// @returns The requested frame of video
192192
/// @param requested_frame The frame number that is requested.
193-
std::shared_ptr<Frame> GetFrame(int64_t requested_frame);
193+
std::shared_ptr<Frame> GetFrame(int64_t requested_frame) override;
194194

195195
/// Determine if reader is open or closed
196-
bool IsOpen();
196+
bool IsOpen() override;
197197

198198
/// Return the type name of the class
199-
std::string Name() { return "FrameMapper"; };
199+
std::string Name() override { return "FrameMapper"; };
200200

201201
/// Get and Set JSON methods
202202
std::string Json() const override; ///< Generate JSON string of this object
203-
void SetJson(const std::string value); ///< Load JSON string into this object
203+
void SetJson(const std::string value) override; ///< Load JSON string into this object
204204
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
205-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
205+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
206206

207207
/// Open the internal reader
208-
void Open();
208+
void Open() override;
209209

210210
/// Print all of the original frames and which new frames they map to
211211
void PrintMapping();

include/ImageReader.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,32 @@ namespace openshot
8787
ImageReader(std::string path, bool inspect_reader);
8888

8989
/// Close File
90-
void Close();
90+
void Close() override;
9191

9292
/// Get the cache object used by this reader (always returns NULL for this object)
93-
CacheMemory* GetCache() { return NULL; };
93+
CacheMemory* GetCache() override { return NULL; };
9494

9595
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
9696
/// return the same Frame, since they all share the same image data.
9797
///
9898
/// @returns The requested frame (containing the image)
9999
/// @param requested_frame The frame number that is requested.
100-
std::shared_ptr<Frame> GetFrame(int64_t requested_frame);
100+
std::shared_ptr<Frame> GetFrame(int64_t requested_frame) override;
101101

102102
/// Determine if reader is open or closed
103-
bool IsOpen() { return is_open; };
103+
bool IsOpen() override { return is_open; };
104104

105105
/// Return the type name of the class
106-
std::string Name() { return "ImageReader"; };
106+
std::string Name() override { return "ImageReader"; };
107107

108108
/// Get and Set JSON methods
109109
std::string Json() const override; ///< Generate JSON string of this object
110-
void SetJson(const std::string value); ///< Load JSON string into this object
111-
Json::Value JsonValue() const; ///< Generate Json::Value for this object
112-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
110+
void SetJson(const std::string value) override; ///< Load JSON string into this object
111+
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
112+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
113113

114114
/// Open File - which is called by the constructor automatically
115-
void Open();
115+
void Open() override;
116116
};
117117

118118
}

include/QtHtmlReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,32 +112,32 @@ namespace openshot
112112
QtHtmlReader(int width, int height, int x_offset, int y_offset, GravityType gravity, std::string html, std::string css, std::string background_color);
113113

114114
/// Close Reader
115-
void Close();
115+
void Close() override;
116116

117117
/// Get the cache object used by this reader (always returns NULL for this object)
118-
openshot::CacheMemory* GetCache() { return NULL; };
118+
openshot::CacheMemory* GetCache() override { return NULL; };
119119

120120
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
121121
/// return the same Frame, since they all share the same image data.
122122
///
123123
/// @returns The requested frame (containing the image)
124124
/// @param requested_frame The frame number that is requested.
125-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
125+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
126126

127127
/// Determine if reader is open or closed
128-
bool IsOpen() { return is_open; };
128+
bool IsOpen() override { return is_open; };
129129

130130
/// Return the type name of the class
131-
std::string Name() { return "QtHtmlReader"; };
131+
std::string Name() override { return "QtHtmlReader"; };
132132

133133
/// Get and Set JSON methods
134134
std::string Json() const override; ///< Generate JSON string of this object
135-
void SetJson(const std::string value); ///< Load JSON string into this object
135+
void SetJson(const std::string value) override; ///< Load JSON string into this object
136136
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
137-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
137+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
138138

139139
/// Open Reader - which is called by the constructor automatically
140-
void Open();
140+
void Open() override;
141141
};
142142

143143
}

include/QtImageReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,32 @@ namespace openshot
8585
virtual ~QtImageReader();
8686

8787
/// Close File
88-
void Close();
88+
void Close() override;
8989

9090
/// Get the cache object used by this reader (always returns NULL for this object)
91-
CacheMemory* GetCache() { return NULL; };
91+
CacheMemory* GetCache() override { return NULL; };
9292

9393
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
9494
/// return the same Frame, since they all share the same image data.
9595
///
9696
/// @returns The requested frame (containing the image)
9797
/// @param requested_frame The frame number that is requested.
98-
std::shared_ptr<Frame> GetFrame(int64_t requested_frame);
98+
std::shared_ptr<Frame> GetFrame(int64_t requested_frame) override;
9999

100100
/// Determine if reader is open or closed
101-
bool IsOpen() { return is_open; };
101+
bool IsOpen() override { return is_open; };
102102

103103
/// Return the type name of the class
104-
std::string Name() { return "QtImageReader"; };
104+
std::string Name() override { return "QtImageReader"; };
105105

106106
/// Get and Set JSON methods
107107
std::string Json() const override; ///< Generate JSON string of this object
108-
void SetJson(const std::string value); ///< Load JSON string into this object
108+
void SetJson(const std::string value) override; ///< Load JSON string into this object
109109
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
110-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
110+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
111111

112112
/// Open File - which is called by the constructor automatically
113-
void Open();
113+
void Open() override;
114114
};
115115

116116
}

include/QtTextReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,32 +123,32 @@ namespace openshot
123123
void SetTextBackgroundColor(std::string color);
124124

125125
/// Close Reader
126-
void Close();
126+
void Close() override;
127127

128128
/// Get the cache object used by this reader (always returns NULL for this object)
129-
openshot::CacheMemory* GetCache() { return NULL; };
129+
openshot::CacheMemory* GetCache() override { return NULL; };
130130

131131
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
132132
/// return the same Frame, since they all share the same image data.
133133
///
134134
/// @returns The requested frame (containing the image)
135135
/// @param requested_frame The frame number that is requested.
136-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
136+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
137137

138138
/// Determine if reader is open or closed
139-
bool IsOpen() { return is_open; };
139+
bool IsOpen() override { return is_open; };
140140

141141
/// Return the type name of the class
142-
std::string Name() { return "QtTextReader"; };
142+
std::string Name() override { return "QtTextReader"; };
143143

144144
/// Get and Set JSON methods
145145
std::string Json() const override; ///< Generate JSON string of this object
146-
void SetJson(const std::string value); ///< Load JSON string into this object
146+
void SetJson(const std::string value) override; ///< Load JSON string into this object
147147
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
148-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
148+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
149149

150150
/// Open Reader - which is called by the constructor automatically
151-
void Open();
151+
void Open() override;
152152
};
153153

154154
}

include/TextReader.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,32 +123,32 @@ namespace openshot
123123
void SetTextBackgroundColor(std::string color);
124124

125125
/// Close Reader
126-
void Close();
126+
void Close() override;
127127

128128
/// Get the cache object used by this reader (always returns NULL for this object)
129-
openshot::CacheMemory* GetCache() { return NULL; };
129+
openshot::CacheMemory* GetCache() override { return NULL; };
130130

131131
/// Get an openshot::Frame object for a specific frame number of this reader. All numbers
132132
/// return the same Frame, since they all share the same image data.
133133
///
134134
/// @returns The requested frame (containing the image)
135135
/// @param requested_frame The frame number that is requested.
136-
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame);
136+
std::shared_ptr<openshot::Frame> GetFrame(int64_t requested_frame) override;
137137

138138
/// Determine if reader is open or closed
139-
bool IsOpen() { return is_open; };
139+
bool IsOpen() override { return is_open; };
140140

141141
/// Return the type name of the class
142-
std::string Name() { return "TextReader"; };
142+
std::string Name() override { return "TextReader"; };
143143

144144
/// Get and Set JSON methods
145145
std::string Json() const override; ///< Generate JSON string of this object
146-
void SetJson(const std::string value); ///< Load JSON string into this object
146+
void SetJson(const std::string value) override; ///< Load JSON string into this object
147147
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
148-
void SetJsonValue(const Json::Value root); ///< Load Json::Value into this object
148+
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
149149

150150
/// Open Reader - which is called by the constructor automatically
151-
void Open();
151+
void Open() override;
152152
};
153153

154154
}

0 commit comments

Comments
 (0)