A few build fixes.
authorCarl Hetherington <cth@carlh.net>
Mon, 3 Jun 2013 10:11:32 +0000 (11:11 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 3 Jun 2013 10:11:32 +0000 (11:11 +0100)
src/lib/film.cc
src/lib/subtitle.cc
src/lib/subtitle.h
src/lib/types.cc
src/lib/types.h
src/lib/video_decoder.cc
src/wx/timeline.cc
src/wx/timeline.h
test/dcp_test.cc

index 57e3791a26a53c14584c7b0f7dd0faf86b09e70f..ef29d35fdde57806a2d0ef8f0a5f9a3def734789 100644 (file)
@@ -170,10 +170,6 @@ Film::video_state_identifier () const
          << "_" << j2k_bandwidth()
          << "_" << lexical_cast<int> (colour_lut());
 
-       if (trim_type() == ENCODE) {
-               s << "_" << trim_start() << "_" << trim_end();
-       }
-
        if (ab()) {
                pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
                s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
index 2815fccd8e19ce538b0e760506dd634ddd8e5728..211f047635f7b98c3f9cadd046dbe04d6be933bc 100644 (file)
@@ -110,13 +110,13 @@ Subtitle::Subtitle (Position p, shared_ptr<Image> i)
  *  in the coordinate space of the source.
  *  @param subtitle_scale scaling factor to apply to the subtitle image.
  */
-dvdomatic::Rect
+dcpomatic::Rect
 subtitle_transformed_area (
        float target_x_scale, float target_y_scale,
-       dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
+       dcpomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
        )
 {
-       dvdomatic::Rect tx;
+       dcpomatic::Rect tx;
 
        sub_area.y += subtitle_offset;
 
@@ -145,8 +145,8 @@ subtitle_transformed_area (
 }
 
 /** @return area that this subtitle takes up, in the original uncropped source's coordinate space */
-dvdomatic::Rect
+dcpomatic::Rect
 Subtitle::area () const
 {
-       return dvdomatic::Rect (_position.x, _position.y, _image->size().width, _image->size().height);
+       return dcpomatic::Rect (_position.x, _position.y, _image->size().width, _image->size().height);
 }
index c3929d676ef721b39de7f6d68bbca40e6dce6513..1151bc01d29379f4c8af291177be90cddf672ccd 100644 (file)
@@ -48,17 +48,17 @@ public:
                return _image;
        }
 
-       dvdomatic::Rect area () const;
+       dcpomatic::Rect area () const;
        
 private:
        Position _position;
        boost::shared_ptr<Image> _image;
 };
 
-dvdomatic::Rect
+dcpomatic::Rect
 subtitle_transformed_area (
        float target_x_scale, float target_y_scale,
-       dvdomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
+       dcpomatic::Rect sub_area, int subtitle_offset, float subtitle_scale
        );
 
 /** A Subtitle class with details of the time over which it should be shown */
index c077bad3e8c2b66607a92e4a54b613dda465327c..78cb4cd6490990bee12d75526c4a6178530152ff 100644 (file)
@@ -36,8 +36,8 @@ bool operator!= (Crop const & a, Crop const & b)
 /** @param other A Rect.
  *  @return The intersection of this with `other'.
  */
-Rect
-Rect::intersection (Rect const & other) const
+dcpomatic::Rect
+dcpomatic::Rect::intersection (Rect const & other) const
 {
        int const tx = max (x, other.x);
        int const ty = max (y, other.y);
@@ -50,7 +50,7 @@ Rect::intersection (Rect const & other) const
 }
 
 bool
-Rect::contains (Position p) const
+dcpomatic::Rect::contains (Position p) const
 {
        return (p.x >= x && p.x <= (x + width) && p.y >= y && p.y <= (y + height));
 }
index 8f2fe2c7165c6a3be02df80441b94877f99a6f84..70262afb0a7c670abf0fd9bc3f23eda9f072b17b 100644 (file)
@@ -76,6 +76,8 @@ struct Position
        int y;
 };
 
+namespace dcpomatic {
+
 /** @struct Rect
  *  @brief A rectangle.
  */
@@ -113,4 +115,6 @@ struct Rect
        bool contains (Position) const;
 };
 
+}
+
 #endif
index 086a6b552c8cea76153b991f2ff0de1d0ff2eca5..a5147f42ece1a450ec946681f659ab8435793eb5 100644 (file)
@@ -67,7 +67,7 @@ VideoDecoder::video (shared_ptr<Image> image, bool same, Time t)
        }
 
        if (sub) {
-               Rect const tx = subtitle_transformed_area (
+               dcpomatic::Rect const tx = subtitle_transformed_area (
                        float (image_size.width) / video_size().width,
                        float (image_size.height) / video_size().height,
                        sub->area(), film->subtitle_offset(), film->subtitle_scale()
index 902788bc9efab0fe8867a54ca3633a2d246c529f..113e883fc2014b112d1bef00b0e563b186e2280e 100644 (file)
@@ -55,7 +55,7 @@ public:
                _timeline.force_redraw (bbox ());
        }
 
-       virtual Rect bbox () const = 0;
+       virtual dcpomatic::Rect bbox () const = 0;
 
 protected:
        virtual void do_paint (wxGraphicsContext *) = 0;
@@ -68,7 +68,7 @@ protected:
        Timeline& _timeline;
 
 private:
-       Rect _last_paint_bbox;
+       dcpomatic::Rect _last_paint_bbox;
 };
 
 class ContentView : public View
@@ -83,15 +83,15 @@ public:
                _content_connection = c->Changed.connect (bind (&ContentView::content_changed, this, _2));
        }
 
-       Rect bbox () const
+       dcpomatic::Rect bbox () const
        {
                shared_ptr<const Film> film = _timeline.film ();
                shared_ptr<const Content> content = _content.lock ();
                if (!film || !content) {
-                       return Rect ();
+                       return dcpomatic::Rect ();
                }
                
-               return Rect (
+               return dcpomatic::Rect (
                        time_x (content->start ()) - 8,
                        y_pos (_track) - 8,
                        content->length () * _timeline.pixels_per_time_unit() + 16,
@@ -243,9 +243,9 @@ public:
                , _y (y)
        {}
        
-       Rect bbox () const
+       dcpomatic::Rect bbox () const
        {
-               return Rect (0, _y - 4, _timeline.width(), 24);
+               return dcpomatic::Rect (0, _y - 4, _timeline.width(), 24);
        }
 
        void set_y (int y)
@@ -543,7 +543,7 @@ Timeline::mouse_moved (wxMouseEvent& ev)
 }
 
 void
-Timeline::force_redraw (Rect const & r)
+Timeline::force_redraw (dcpomatic::Rect const & r)
 {
        RefreshRect (wxRect (r.x, r.y, r.width, r.height), false);
 }
index a786e6a096254c480a2ec1187b00b99eb2b4de6a..5c25a6426c97306f9cd2895fd6c43b253ad104cc 100644 (file)
@@ -36,7 +36,7 @@ public:
 
        boost::shared_ptr<const Film> film () const;
 
-       void force_redraw (Rect const &);
+       void force_redraw (dcpomatic::Rect const &);
 
        int x_offset () const {
                return 8;
index 3565c1cfd1b3e718a54fb2629d4a68ab1880c9cc..0729e8cb7a1a72d1e47ba76b2c0f90c536274c7c 100644 (file)
@@ -21,7 +21,9 @@ BOOST_AUTO_TEST_CASE (make_dcp_test)
 {
        shared_ptr<Film> film = new_test_film ("make_dcp_test");
        film->set_name ("test_film2");
-       film->examine_and_add_content (shared_ptr<FFmpegContent> (new FFmpegContent (film, "test/data/test.mp4")));
+       shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
+       c->set_ratio (Ratio::from_id ("185"));
+       film->examine_and_add_content (c);
 
        /* Wait for the examine to finish */
        while (JobManager::instance()->work_to_do ()) {