No-op; comments.
authorCarl Hetherington <cth@carlh.net>
Tue, 16 Oct 2012 15:32:52 +0000 (16:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 16 Oct 2012 15:32:52 +0000 (16:32 +0100)
src/lib/film.h
src/lib/film_state.cc
src/lib/film_state.h
src/lib/subtitle.cc
src/lib/subtitle.h
src/lib/util.cc

index a1cf26bc61896f8ac15620cf11c6a5ac06ab10a1..ae0ad7ad1379745ce7388941903fa2b261b60fd3 100644 (file)
@@ -76,6 +76,7 @@ public:
                return _state.dcp_name ();
        }
 
+       /** @return true to use a DCI-spec name for the DCP */
        bool use_dci_name () const {
                return _state.use_dci_name;
        }
@@ -105,6 +106,7 @@ public:
                return _state.dcp_frames;
        }
 
+       /** @return what to do with the end of an encode when trimming */
        TrimAction dcp_trim_action () const {
                return _state.dcp_trim_action;
        }
@@ -117,26 +119,36 @@ public:
                return _state.dcp_ab;
        }
 
+       /** @return gain that should be applied to the audio when making a DCP
+           (in dB).
+       */
        float audio_gain () const {
                return _state.audio_gain;
        }
 
+       /** @return delay to apply to audio (positive moves audio later) in milliseconds */
        int audio_delay () const {
                return _state.audio_delay;
        }
 
+       /** @return duration to make still-sourced films (in seconds) */
        int still_duration () const {
                return _state.still_duration;
        }
 
+       /** @return true to encode DCP with subtitles, if they are available */
        bool with_subtitles () const {
                return _state.with_subtitles;
        }
 
+       /** @return offset to move subtitles by, in source pixels; +ve moves
+           them down the image, -ve moves them up.
+       */
        int subtitle_offset () const {
                return _state.subtitle_offset;
        }
 
+       /** @return scaling factor to apply to subtitle images */
        float subtitle_scale () const {
                return _state.subtitle_scale;
        }
index ca43790f23edc9179c476df5bad53a0c7941d405..aa8bb55636e3b7f56eb417e735bb9f7326ab5edb 100644 (file)
@@ -355,6 +355,7 @@ FilmState::dcp_length () const
        return length;
 }
 
+/** @return a DCI-compliant name for a DCP of this film */
 string
 FilmState::dci_name () const
 {
@@ -367,6 +368,7 @@ FilmState::dci_name () const
                }
        }
 
+       /* Spec is that the name part should be maximum 14 characters, as I understand it */
        if (fixed_name.length() > 14) {
                fixed_name = fixed_name.substr (0, 14);
        }
index 01bcdfd5c09849071c31e5f1928b5f32835e84b4..ea287fb3b7eb3290efbe32139c3fb28d9d04b68e 100644 (file)
@@ -103,6 +103,7 @@ public:
        std::string directory;
        /** Name for DVD-o-matic */
        std::string name;
+       /** True if a auto-generated DCI-compliant name should be used for our DCP */
        bool use_dci_name;
        /** File or directory containing content; may be relative to our directory
         *  or an absolute path.
@@ -135,11 +136,13 @@ public:
        int audio_delay;
        /** Duration to make still-sourced films (in seconds) */
        int still_duration;
+       /** True if subtitles should be shown for this film */
        bool with_subtitles;
        /** y offset for placing subtitles, in source pixels; +ve is further down
            the frame, -ve is further up.
        */
        int subtitle_offset;
+       /** scale factor to apply to subtitles */
        float subtitle_scale;
 
        /* DCI naming stuff */
index 01e8cac1396ea62b386cb60e995fbee50a330cd4..dcb747828a954598074619e6ecf57833aa6ffcf4 100644 (file)
 
 */
 
+/** @file  src/subtitle.cc
+ *  @brief Representations of subtitles.
+ */
+
 #include "subtitle.h"
 #include "image.h"
 #include "exceptions.h"
 using namespace std;
 using namespace boost;
 
+/** Construct a TimedSubtitle.  This is a subtitle image, position,
+ *  and a range of time over which it should be shown.
+ *  @param sub AVSubtitle to read.
+ */
 TimedSubtitle::TimedSubtitle (AVSubtitle const & sub)
 {
        /* subtitle PTS in seconds */
@@ -73,13 +81,27 @@ TimedSubtitle::displayed_at (double t) const
        return t >= _from && t <= _to;
 }
 
+/** Construct a subtitle, which is an image and a position.
+ *  @param p Position within the (uncropped) source frame.
+ *  @param i Image of the subtitle (should be RGBA).
+ */
 Subtitle::Subtitle (Position p, shared_ptr<Image> i)
        : _position (p)
        , _image (i)
 {
 
 }
-       
+
+/** Given the area of a subtitle, work out the area it should
+ *  take up when its video frame is scaled up, and it is optionally
+ *  itself scaled and offset.
+ *  @param target_x_scale the x scaling of the video frame that the subtitle is in.
+ *  @param target_y_scale the y scaling of the video frame that the subtitle is in.
+ *  @param sub_area The area of the subtitle within the original source.
+ *  @param subtitle_offset y offset to apply to the subtitle position (+ve is down)
+ *  in the coordinate space of the source.
+ *  @param subtitle_scale scaling factor to apply to the subtitle image.
+ */
 Rectangle
 subtitle_transformed_area (
        float target_x_scale, float target_y_scale,
@@ -114,6 +136,7 @@ subtitle_transformed_area (
        return tx;
 }
 
+/** @return area that this subtitle take up, in the original uncropped source's coordinate space */
 Rectangle
 Subtitle::area () const
 {
index de8f025964fc468683573813f8948ad6715d81c7..1cc906ce05fcc50f7987267c9572e5659b2eefa0 100644 (file)
 
 */
 
+/** @file  src/subtitle.h
+ *  @brief Representations of subtitles.
+ */
+
 #include <list>
 #include <boost/shared_ptr.hpp>
 #include "util.h"
@@ -24,6 +28,7 @@
 struct AVSubtitle;
 class Image;
 
+/** A subtitle, consisting of an image and a position */
 class Subtitle
 {
 public:
@@ -53,7 +58,8 @@ subtitle_transformed_area (
        float target_x_scale, float target_y_scale,
        Rectangle sub_area, int subtitle_offset, float subtitle_scale
        );
-       
+
+/** A Subtitle class with details of the time over which it should be shown */
 class TimedSubtitle
 {
 public:
@@ -66,8 +72,8 @@ public:
        }
 
 private:
+       /** 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 */
index 9a0a8be827774fd46ad1f47ecf60cbd8bffdf2f6..cc201a0af4df6c6ebe169a8be6dfa489ba6b8938 100644 (file)
@@ -615,6 +615,12 @@ Rectangle::intersection (Rectangle const & other) const
                );
 }
 
+/** Round a number up to the nearest multiple of another number.
+ *  @param a Number to round.
+ *  @param t Multiple to round to.
+ *  @return Rounded number.
+ */
+
 int
 round_up (int a, int t)
 {
@@ -622,6 +628,13 @@ round_up (int a, int t)
        return a - (a % t);
 }
 
+/** Read a sequence of key / value pairs from a text stream;
+ *  the keys are the first words on the line, and the values are
+ *  the remainder of the line following the key.  Lines beginning
+ *  with # are ignored.
+ *  @param s Stream to read.
+ *  @return key/value pairs.
+ */
 multimap<string, string>
 read_key_value (istream &s) 
 {