switch (i.h_align()) {
case dcp::HALIGN_LEFT:
- rs.horizontal_position = LEFT;
+ rs.horizontal_position.reference = LEFT_OF_SCREEN;
break;
case dcp::HALIGN_CENTER:
- rs.horizontal_position = CENTRE;
+ rs.horizontal_position.reference = HORIZONTAL_CENTRE_OF_SCREEN;
break;
case dcp::HALIGN_RIGHT:
- rs.horizontal_position = RIGHT;
+ rs.horizontal_position.reference = RIGHT_OF_SCREEN;
break;
}
#ifndef LIBSUB_HORIZONTAL_POSITION_H
#define LIBSUB_HORIZONTAL_POSITION_H
+#include "horizontal_reference.h"
+
namespace sub {
-enum HorizontalPosition
+class HorizontalPosition
{
- LEFT,
- CENTRE,
- RIGHT
+public:
+ HorizontalReference reference;
+
+ bool operator== (HorizontalPosition const & other) const;
};
-
+
}
#endif
switch (h) {
case 0:
case 2:
- sub.horizontal_position = CENTRE;
+ sub.horizontal_position.reference = HORIZONTAL_CENTRE_OF_SCREEN;
break;
case 1:
- sub.horizontal_position = LEFT;
+ sub.horizontal_position.reference = LEFT_OF_SCREEN;
break;
case 3:
- sub.horizontal_position = RIGHT;
+ sub.horizontal_position.reference = RIGHT_OF_SCREEN;
break;
}
/* Justification code */
/* XXX: this assumes the first line has the right value */
- switch (i->lines.front().horizontal_position) {
- case LEFT:
+ switch (i->lines.front().horizontal_position.reference) {
+ case LEFT_OF_SCREEN:
put_int_as_int (buffer + 14, tables.justification_enum_to_file (JUSTIFICATION_LEFT), 1);
break;
- case CENTRE:
+ case HORIZONTAL_CENTRE_OF_SCREEN:
put_int_as_int (buffer + 14, tables.justification_enum_to_file (JUSTIFICATION_CENTRE), 1);
break;
- case RIGHT:
+ case RIGHT_OF_SCREEN:
put_int_as_int (buffer + 14, tables.justification_enum_to_file (JUSTIFICATION_RIGHT), 1);
break;
}
{
public:
Line ()
- : horizontal_position (CENTRE)
- {}
+ {
+ horizontal_position.reference = HORIZONTAL_CENTRE_OF_SCREEN;
+ }
/** Construct a Line taking any relevant information from a RawSubtitle */
Line (RawSubtitle s);
effect.cc
exceptions.cc
font_size.cc
+ horizontal_position.cc
iso6937.cc
iso6937_tables.cc
rational.cc
exceptions.h
font_size.h
horizontal_position.h
+ horizontal_reference.h
rational.h
raw_subtitle.h
reader.h