CENTRE_OF_SCREEN -> VERTICAL_CENTRE_OF_SCREEN.
authorCarl Hetherington <cth@carlh.net>
Fri, 28 Jul 2017 14:44:48 +0000 (15:44 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 28 Jul 2017 14:44:48 +0000 (15:44 +0100)
src/dcp_reader.cc
src/ssa_reader.cc
src/stl_binary_writer.cc
src/vertical_position.cc
src/vertical_reference.cc
src/vertical_reference.h
test/ssa_reader_test.cc
test/vertical_position_test.cc
tools/dumpsubs.cc

index 5144a4157b8b149e307b096e85badc7ac222505c..bedd0e24bc9861ce926fbe9876ac12317cded0a5 100644 (file)
@@ -113,7 +113,7 @@ DCPReader::DCPReader (boost::filesystem::path file)
                        rs.vertical_position.reference = TOP_OF_SCREEN;
                        break;
                case dcp::VALIGN_CENTER:
-                       rs.vertical_position.reference = CENTRE_OF_SCREEN;
+                       rs.vertical_position.reference = VERTICAL_CENTRE_OF_SCREEN;
                        break;
                case dcp::VALIGN_BOTTOM:
                        rs.vertical_position.reference = BOTTOM_OF_SCREEN;
index 147f1bad75691a7c2bddd9caee6b9da2b3a27e0d..81b6b9d567f74021728487a51d6e4c20c0c2c289 100644 (file)
@@ -113,7 +113,7 @@ public:
                                        vertical_reference = TOP_OF_SCREEN;
                                        break;
                                case 8:
-                                       vertical_reference = CENTRE_OF_SCREEN;
+                                       vertical_reference = VERTICAL_CENTRE_OF_SCREEN;
                                        break;
                                case 0:
                                        vertical_reference = BOTTOM_OF_SCREEN;
@@ -213,7 +213,7 @@ SSAReader::parse_line (RawSubtitle base, string line)
        case TOP_OF_SUBTITLE:
                /* Nothing to do */
                break;
-       case CENTRE_OF_SCREEN:
+       case VERTICAL_CENTRE_OF_SCREEN:
                current.vertical_position.proportional = current.vertical_position.proportional.get() - ((line_breaks + 1) * line_size) / 2;
                break;
        case BOTTOM_OF_SCREEN:
@@ -254,7 +254,7 @@ SSAReader::parse_line (RawSubtitle base, string line)
                                } else if (style == "\\an1" || style == "\\an2" || style == "\\an3") {
                                        current.vertical_position.reference = sub::BOTTOM_OF_SCREEN;
                                } else if (style == "\\an4" || style == "\\an5" || style == "\\an6") {
-                                       current.vertical_position.reference = sub::CENTRE_OF_SCREEN;
+                                       current.vertical_position.reference = sub::VERTICAL_CENTRE_OF_SCREEN;
                                } else if (style == "\\an7" || style == "\\an8" || style == "\\an9") {
                                        current.vertical_position.reference = sub::TOP_OF_SCREEN;
                                }
index 60adda4bf2df1d1082aa3b0859bb42c6dc7291cd..e4e06fb5cbb9eed672d268dbb2491c436d6ea267 100644 (file)
@@ -99,7 +99,7 @@ vertical_position (sub::Line const & line)
                case TOP_OF_SCREEN:
                        vp = rint (line.vertical_position.proportional.get() * ROWS);
                        break;
-               case CENTRE_OF_SCREEN:
+               case VERTICAL_CENTRE_OF_SCREEN:
                        vp = rint (line.vertical_position.proportional.get() * ROWS + (ROWS / 2.0));
                        break;
                case BOTTOM_OF_SCREEN:
@@ -114,7 +114,7 @@ vertical_position (sub::Line const & line)
                case TOP_OF_SCREEN:
                        vp = prop * ROWS;
                        break;
-               case CENTRE_OF_SCREEN:
+               case VERTICAL_CENTRE_OF_SCREEN:
                        vp = (prop + 0.5) * ROWS;
                        break;
                case BOTTOM_OF_SCREEN:
index 817c3662075340f37a6ad031cf846d50452c1de6..aca327f36fe18c9aff6e20b0913b864b4f084ec8 100644 (file)
@@ -34,7 +34,7 @@ VerticalPosition::fraction_from_screen_top () const
        switch (reference.get ()) {
        case TOP_OF_SCREEN:
                return prop;
-       case CENTRE_OF_SCREEN:
+       case VERTICAL_CENTRE_OF_SCREEN:
                return prop + 0.5;
        case BOTTOM_OF_SCREEN:
                return 1 - prop;
index 7dff96515379ef3e6a67f3948ac2b4db18a0d873..d7833a1c9caa8451d92f540ff1021e321c7eb515 100644 (file)
@@ -30,7 +30,7 @@ sub::string_to_vertical_reference (string s)
        if (s == "top") {
                return TOP_OF_SCREEN;
        } else if (s == "center") {
-               return CENTRE_OF_SCREEN;
+               return VERTICAL_CENTRE_OF_SCREEN;
        } else if (s == "bottom") {
                return BOTTOM_OF_SCREEN;
        }
index 91565500a2e53cf8dc5115ace2d758c05fee5eae..ca079cbbd617eebe157d143424a6f602434c582a 100644 (file)
@@ -29,7 +29,7 @@ enum VerticalReference
        /** distance is from the top of the screen, positive moves down */
        TOP_OF_SCREEN,
        /** distance is from the centre of the screen, positive moves down */
-       CENTRE_OF_SCREEN,
+       VERTICAL_CENTRE_OF_SCREEN,
        /** distance is from the bottom of the screen, positive moves up */
        BOTTOM_OF_SCREEN,
        /** position on screen is not known, so we are referring
index 74faf49b7034df468b15796836c51b9a416d4c96..bf7b7a8c3ad5041a4ff1840933cf0a9666778d3f 100644 (file)
@@ -224,17 +224,17 @@ BOOST_AUTO_TEST_CASE (ssa_reader_test3)
        SUB_END ();
 
        SUB_START (sub::Time::from_hms (0, 0, 9, 260), sub::Time::from_hms (0, 0, 11, 560));
-       LINE (0, sub::CENTRE_OF_SCREEN);
+       LINE (0, sub::VERTICAL_CENTRE_OF_SCREEN);
        BLOCK("middle left", "Arial", 20, false, false, false);
        SUB_END ();
 
        SUB_START (sub::Time::from_hms (0, 0, 9, 270), sub::Time::from_hms (0, 0, 11, 560));
-       LINE (0, sub::CENTRE_OF_SCREEN);
+       LINE (0, sub::VERTICAL_CENTRE_OF_SCREEN);
        BLOCK("middle centre", "Arial", 20, false, false, false);
        SUB_END ();
 
        SUB_START (sub::Time::from_hms (0, 0, 9, 280), sub::Time::from_hms (0, 0, 11, 560));
-       LINE (0, sub::CENTRE_OF_SCREEN);
+       LINE (0, sub::VERTICAL_CENTRE_OF_SCREEN);
        BLOCK("middle right", "Arial", 20, false, false, false);
        SUB_END ();
 
index c106a27aa5d2757e219dd8cef7a450e3cc590332..f4c6ffc5e355986c77dade67cdccffa794a3d621 100644 (file)
@@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE (vertical_position_test)
        a.proportional = 0.7;
        a.reference = sub::TOP_OF_SCREEN;
        b.proportional = 0.3;
-       b.reference = sub::CENTRE_OF_SCREEN;
+       b.reference = sub::VERTICAL_CENTRE_OF_SCREEN;
        BOOST_CHECK (a < b);
 
        a.proportional = 0.9;
index f69ecf874f9844d4329c7eb2e487757403eb4a0d..7b07ac80020f7bbcefb4486c9599f347ad106432 100644 (file)
@@ -102,7 +102,7 @@ main (int argc, char* argv[])
                                case TOP_OF_SCREEN:
                                        cout << "top";
                                        break;
-                               case CENTRE_OF_SCREEN:
+                               case VERTICAL_CENTRE_OF_SCREEN:
                                        cout << "centre";
                                        break;
                                case BOTTOM_OF_SCREEN: