projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Missing virtual destructor.
[dcpomatic.git]
/
src
/
lib
/
subtitle.h
diff --git
a/src/lib/subtitle.h
b/src/lib/subtitle.h
index 6fd0d8772643fe3ca8d92d27238a452b53bd867e..590e0dd31b8ac2865d680b5f3e7343bc76560e39 100644
(file)
--- a/
src/lib/subtitle.h
+++ b/
src/lib/subtitle.h
@@
-17,59
+17,65
@@
*/
*/
+/** @file src/subtitle.h
+ * @brief Representations of subtitles.
+ */
+
#include <list>
#include <boost/shared_ptr.hpp>
#include "util.h"
struct AVSubtitle;
#include <list>
#include <boost/shared_ptr.hpp>
#include "util.h"
struct AVSubtitle;
-class SubtitleImage;
class Image;
class Image;
-class FilmState;
+/** A subtitle, consisting of an image and a position */
class Subtitle
{
public:
class Subtitle
{
public:
- Subtitle (
AVSubtitle const &
);
+ Subtitle (
Position p, boost::shared_ptr<Image> i
);
- bool displayed_at (double t);
+ void set_position (Position p) {
+ _position = p;
+ }
- std::list<boost::shared_ptr<SubtitleImage> > images () const {
- return _images;
+ Position position () const {
+ return _position;
+ }
+
+ boost::shared_ptr<Image> image () const {
+ return _image;
}
}
+ Rect area () const;
+
private:
private:
- /** display from time in seconds from the start of the film */
- double _from;
- /** display to time in seconds from the start of the film */
- double _to;
- std::list<boost::shared_ptr<SubtitleImage> > _images;
+ Position _position;
+ boost::shared_ptr<Image> _image;
};
};
-extern Rectangle transformed_subtitle_area (
+Rect
+subtitle_transformed_area (
float target_x_scale, float target_y_scale,
float target_x_scale, float target_y_scale,
- Rect
angle
sub_area, int subtitle_offset, float subtitle_scale
+ Rect sub_area, int subtitle_offset, float subtitle_scale
);
);
-class SubtitleImage
+/** A Subtitle class with details of the time over which it should be shown */
+class TimedSubtitle
{
public:
{
public:
-
SubtitleImage (AVSubtitleRect const *
);
+
TimedSubtitle (AVSubtitle const &, double c
);
- void set_position (Position p) {
- _position = p;
- }
-
- Position position () const {
- return _position;
- }
+ bool displayed_at (double t) const;
- boost::shared_ptr<
Image> imag
e () const {
- return _
imag
e;
+ boost::shared_ptr<
Subtitle> subtitl
e () const {
+ return _
subtitl
e;
}
}
- Rectangle area () const;
-
private:
private:
- Position _position;
- boost::shared_ptr<Image> _image;
+ /** the subtitle */
+ boost::shared_ptr<Subtitle> _subtitle;
+ /** display from time in seconds from the start of the film */
+ double _from;
+ /** display to time in seconds from the start of the film */
+ double _to;
};
};