Some doxygen documentation improvements.
authorCarl Hetherington <cth@carlh.net>
Mon, 24 Sep 2012 00:58:56 +0000 (01:58 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 24 Sep 2012 00:58:56 +0000 (01:58 +0100)
14 files changed:
Doxyfile
doc/mainpage.txt
src/lib/config.h
src/lib/decoder.cc
src/lib/encoder.cc
src/lib/encoder.h
src/lib/exceptions.h
src/lib/job.cc
src/lib/job.h
src/lib/util.cc
src/lib/util.h
src/wx/film_viewer.cc
src/wx/wx_util.cc
src/wx/wx_util.h

index 80a4b9c2595d269d7183c430a4646e78dfe79dc5..56f7e1d3c334c7a085aa50517b638f1ee5aad790 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -661,7 +661,7 @@ WARN_LOGFILE           =
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = src \
+INPUT                  = src/lib src/wx src/tools \
                          doc/mainpage.txt
 
 # This tag can be used to specify the character encoding of the source files
index 81c3b45583e9a073eca81651dad25828700a0e1a..e89ca8d26a4ae3e79e94d501ab0565c0b527604d 100644 (file)
@@ -23,7 +23,7 @@
  *  and libsndfile (http://www.mega-nerd.com/libsndfile/) for WAV file manipulation.  It
  *  also makes heavy use of the boost libraries (http://www.boost.org/).  libtiff
  *  (http://www.libtiff.org/) is used for TIFF encoding and decoding, and the GUI is
- *  built using GTK (http://www.gtk.org/) and GTKMM (http://www.gtkmm.org).  It also uses libmhash (http://mhash.sourceforge.net/)
+ *  built using wxWidgets (http://wxwidgets.org/).  It also uses libmhash (http://mhash.sourceforge.net/)
  *  for debugging purposes.
  *
  *  Thanks are due to the authors and communities of all DVD-o-matic's dependencies.
index b002da7df3978eba94a9e0020870502092f4db40..840dcdaef7a5ebcea32f0c5bd680c6ab0de1b878 100644 (file)
@@ -81,18 +81,22 @@ public:
                return _reference_filters;
        }
 
+       /** @return The IP address of a TMS that we can copy DCPs to */
        std::string tms_ip () const {
                return _tms_ip;
        }
 
+       /** @return The path on a TMS that we should write DCPs to */
        std::string tms_path () const {
                return _tms_path;
        }
 
+       /** @return User name to log into the TMS with */
        std::string tms_user () const {
                return _tms_user;
        }
 
+       /** @return Password to log into the TMS with */
        std::string tms_password () const {
                return _tms_password;
        }
@@ -146,21 +150,25 @@ public:
                Changed ();
        }
 
+       /** @param i IP address of a TMS that we can copy DCPs to */
        void set_tms_ip (std::string i) {
                _tms_ip = i;
                Changed ();
        }
 
+       /** @param p Path on a TMS that we should write DCPs to */
        void set_tms_path (std::string p) {
                _tms_path = p;
                Changed ();
        }
 
+       /** @param u User name to log into the TMS with */
        void set_tms_user (std::string u) {
                _tms_user = u;
                Changed ();
        }
 
+       /** @param p Password to log into the TMS with */
        void set_tms_password (std::string p) {
                _tms_password = p;
                Changed ();
@@ -189,21 +197,21 @@ private:
 
        /** J2K encoding servers to use */
        std::vector<ServerDescription *> _servers;
-
        /** Screen definitions */
        std::vector<boost::shared_ptr<Screen> > _screens;
-
        /** Scaler to use for the "A" part of A/B comparisons */
        Scaler const * _reference_scaler;
-
        /** Filters to use for the "A" part of A/B comparisons */
        std::vector<Filter const *> _reference_filters;
-
+       /** The IP address of a TMS that we can copy DCPs to */
        std::string _tms_ip;
+       /** The path on a TMS that we should write DCPs to */
        std::string _tms_path;
+       /** User name to log into the TMS with */
        std::string _tms_user;
+       /** Password to log into the TMS with */
        std::string _tms_password;
-
+       /** Our sound processor */
        SoundProcessor const * _sound_processor;
 
        /** Singleton instance, or 0 */
index fc808d819883bf8c1843548ef45031ac5fbd6b4e..9332511bcea0c96b7670dc2126e794aa3c7966b4 100644 (file)
@@ -87,6 +87,7 @@ Decoder::~Decoder ()
        delete _delay_line;
 }
 
+/** Start off a decode processing run */
 void
 Decoder::process_begin ()
 {
@@ -120,6 +121,7 @@ Decoder::process_begin ()
        _audio_frames_processed = 0;
 }
 
+/** Finish off a decode processing run */
 void
 Decoder::process_end ()
 {
index 18ccd3f5757b7d1250600704a970e399a7ac876c..62ba922daffc5c66f881afe11ee9cc8e63a7765b 100644 (file)
@@ -60,6 +60,7 @@ Encoder::current_frames_per_second () const
        return _history_size / (seconds (now) - seconds (_time_history.back ()));
 }
 
+/** @return true if the last frame to be processed was skipped as it already existed */
 bool
 Encoder::skipping () const
 {
@@ -67,6 +68,7 @@ Encoder::skipping () const
        return _just_skipped;
 }
 
+/** @return Index of last frame to be successfully encoded */
 int
 Encoder::last_frame () const
 {
@@ -74,6 +76,9 @@ Encoder::last_frame () const
        return _last_frame;
 }
 
+/** Should be called when a frame has been encoded successfully.
+ *  @param n Frame index.
+ */
 void
 Encoder::frame_done (int n)
 {
index 5c0c4c03fdb95fabf993b5f7ad1fbc08f19cf111..539b2912ce9580c36b6aad8766dbf5e92ee9b871 100644 (file)
@@ -84,10 +84,15 @@ protected:
 
        /** Mutex for _time_history, _just_skipped and _last_frame */
        mutable boost::mutex _history_mutex;
+       /** List of the times of completion of the last _history_size frames;
+           first is the most recently completed.
+       */
        std::list<struct timeval> _time_history;
+       /** Number of frames that we should keep history for */
        static int const _history_size;
        /** true if the last frame we processed was skipped (because it was already done) */
        bool _just_skipped;
+       /** Index of the last frame to be processed */
        int _last_frame;
 };
 
index 6b567805b1fcd46ac7d1c78c13423624ef1f5b3d..8ef09875ba89383af42fe35ad2cdd99b08fa574a 100644 (file)
@@ -77,6 +77,9 @@ public:
 class FileError : public StringError
 {
 public:
+       /** @param m Error message.
+        *  @param f Name of the file that this exception concerns.
+        */
        FileError (std::string m, std::string f)
                : StringError (m)
                , _file (f)
@@ -84,11 +87,13 @@ public:
 
        virtual ~FileError () throw () {}
 
+       /** @return name of the file that this exception concerns */
        std::string file () const {
                return _file;
        }
 
 private:
+       /** name of the file that this exception concerns */
        std::string _file;
 };
        
index d446b3913208ee897913a27b1a938821258d9071..22754eb909659ffd8693b48c77a9c184b6c40f9b 100644 (file)
@@ -223,7 +223,7 @@ Job::set_error (string e)
        _error = e;
 }
 
-/** Set that this job's progress will always be unknown */
+/** Say that this job's progress will always be unknown */
 void
 Job::set_progress_unknown ()
 {
@@ -231,6 +231,7 @@ Job::set_progress_unknown ()
        _progress_unknown = true;
 }
 
+/** @return Human-readable status of this job */
 string
 Job::status () const
 {
@@ -252,6 +253,7 @@ Job::status () const
        return s.str ();
 }
 
+/** @return An estimate of the remaining time for this job, in seconds */
 int
 Job::remaining_time () const
 {
index 95599bdbb65bf1dd1ca8bae44b4347ac5bb1015d..fee887b428673d3501112bc613408a76e4fab2e7 100644 (file)
@@ -72,6 +72,7 @@ protected:
 
        virtual int remaining_time () const;
 
+       /** Description of a job's state */
        enum State {
                NEW,           ///< the job hasn't been started yet
                RUNNING,       ///< the job is running
@@ -82,10 +83,11 @@ protected:
        void set_state (State);
        void set_error (std::string e);
 
+       /** FilmState for this job */
        boost::shared_ptr<const FilmState> _fs;
+       /** options in use for this job */
        boost::shared_ptr<const Options> _opt;
-
-       /** A log that this job can write to */
+       /** a log that this job can write to */
        Log* _log;
 
 private:
@@ -94,11 +96,15 @@ private:
 
        /** mutex for _state and _error */
        mutable boost::mutex _state_mutex;
+       /** current state of the job */
        State _state;
+       /** message for an error that has occurred (when state == FINISHED_ERROR) */
        std::string _error;
 
+       /** time that this job was started */
        time_t _start_time;
-       
+
+       /** mutex for _stack and _progress_unknown */
        mutable boost::mutex _progress_mutex;
 
        struct Level {
index d12bd3e775a52a32187fa8ee5a4fc0d75d30c92a..73222083a81c5ee5adf18d2f67c613c2bd938449 100644 (file)
@@ -369,6 +369,9 @@ md5_data (string title, void const * data, int size)
 }
 #endif
 
+/** @param file File name.
+ *  @return MD5 digest of file's contents.
+ */
 string
 md5_digest (string file)
 {
@@ -404,6 +407,9 @@ md5_digest (string file)
        return s.str ();
 }
 
+/** @param An arbitrary sampling rate.
+ *  @return The appropriate DCP-approved sampling rate (48kHz or 96kHz).
+ */
 int
 dcp_audio_sample_rate (int fs)
 {
@@ -424,6 +430,9 @@ bool operator!= (Crop const & a, Crop const & b)
        return !(a == b);
 }
 
+/** @param index Colour LUT index.
+ *  @return Human-readable name.
+ */
 string
 colour_lut_index_to_name (int index)
 {
@@ -458,6 +467,10 @@ Socket::check ()
        _deadline.async_wait (boost::bind (&Socket::check, this));
 }
 
+/** Blocking connect with timeout.
+ *  @param endpoint End-point to connect to.
+ *  @param timeout Time-out in seconds.
+ */
 void
 Socket::connect (asio::ip::basic_resolver_entry<asio::ip::tcp> const & endpoint, int timeout)
 {
@@ -472,6 +485,11 @@ Socket::connect (asio::ip::basic_resolver_entry<asio::ip::tcp> const & endpoint,
        }
 }
 
+/** Blocking write with timeout.
+ *  @param data Buffer to write.
+ *  @param size Number of bytes to write.
+ *  @param timeout Time-out, in seconds.
+ */
 void
 Socket::write (uint8_t const * data, int size, int timeout)
 {
@@ -488,6 +506,11 @@ Socket::write (uint8_t const * data, int size, int timeout)
        }
 }
 
+/** Blocking read with timeout.
+ *  @param data Buffer to read to.
+ *  @param size Number of bytes to read.
+ *  @param timeout Time-out, in seconds.
+ */
 int
 Socket::read (uint8_t* data, int size, int timeout)
 {
index d7f2330038cd653f0c8336fb1b11d9e209a67b9e..63d492e60ab762dd5f75bd7f2158dfb53e80d338 100644 (file)
@@ -80,19 +80,25 @@ struct Size
        int height;
 };
 
+/** A description of the crop of an image or video. */
 struct Crop
 {
        Crop () : left (0), right (0), top (0), bottom (0) {}
-       
+
+       /** Number of pixels to remove from the left-hand side */
        int left;
+       /** Number of pixels to remove from the right-hand side */
        int right;
+       /** Number of pixels to remove from the top */
        int top;
+       /** Number of pixels to remove from the bottom */
        int bottom;
 };
 
 extern bool operator== (Crop const & a, Crop const & b);
 extern bool operator!= (Crop const & a, Crop const & b);
 
+/** A position */
 struct Position
 {
        Position ()
@@ -105,7 +111,9 @@ struct Position
                , y (y_)
        {}
 
+       /** x coordinate */
        int x;
+       /** y coordinate */
        int y;
 };
 
@@ -113,11 +121,20 @@ extern std::string crop_string (Position, Size);
 extern int dcp_audio_sample_rate (int);
 extern std::string colour_lut_index_to_name (int index);
 
+/** @class Socket
+ *  @brief A class to wrap a boost::asio::ip::tcp::socket with some things
+ *  that are useful for DVD-o-matic.
+ *
+ *  This class wraps some things that I could not work out how to do with boost;
+ *  most notably, sync read/write calls with timeouts, and the ability to peak into
+ *  data being read.
+ */
 class Socket
 {
 public:
        Socket ();
 
+       /** @return Our underlying socket */
        boost::asio::ip::tcp::socket& socket () {
                return _socket;
        }
index 56f20449b1ec3abfe686a177aac4423b99b7098d..0d17baf8325f2a22805eb3a63c51b91ff0c44a90 100644 (file)
@@ -47,6 +47,7 @@ public:
        {
        }
 
+       /** Handle a paint event */
        void paint_event (wxPaintEvent& ev)
        {
                if (_current_image != _pending_image) {
@@ -67,6 +68,7 @@ public:
                }
        }
 
+       /** Handle a size event */
        void size_event (wxSizeEvent &)
        {
                if (!_image) {
@@ -101,6 +103,7 @@ public:
                }
        }
 
+       /** Clear our thumbnail image */
        void clear ()
        {
                delete _bitmap;
index 44d9462e504404e1379111eb5effdc59cfb2aac3..4277ed12dc03a9f26d1242977ebb5d38b557f9a3 100644 (file)
 using namespace std;
 using namespace boost;
 
+/** Add a wxStaticText to a wxSizer, aligning it at vertical centre.
+ *  @param s Sizer to add to.
+ *  @param p Parent window for the wxStaticText.
+ *  @param t Text for the wxStaticText.
+ *  @param prop Properties to pass when calling Add() on the wxSizer.
+ */
 wxStaticText *
 add_label_to_sizer (wxSizer* s, wxWindow* p, string t, int prop)
 {
@@ -35,6 +41,10 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, string t, int prop)
        return m;
 }
 
+/** Pop up an error dialogue box.
+ *  @param parent Parent.
+ *  @param m Message.
+ */
 void
 error_dialog (wxWindow* parent, string m)
 {
@@ -43,12 +53,18 @@ error_dialog (wxWindow* parent, string m)
        d->Destroy ();
 }
 
+/** @param s wxWidgets string.
+ *  @return Corresponding STL string.
+ */
 string
 wx_to_std (wxString s)
 {
        return string (s.mb_str ());
 }
 
+/** @param s STL string.
+ *  @return Corresponding wxWidgets string.
+ */
 wxString
 std_to_wx (string s)
 {
@@ -75,15 +91,16 @@ ThreadedStaticText::~ThreadedStaticText ()
        delete _thread;
 }
 
+/** Run our thread and post the result to the GUI thread via AddPendingEvent */
 void
 ThreadedStaticText::run (function<string ()> fn)
 {
-       /* Run the thread and post the result to the GUI thread via AddPendingEvent */
        wxCommandEvent ev (wxEVT_COMMAND_TEXT_UPDATED, _update_event_id);
        ev.SetString (std_to_wx (fn ()));
        GetEventHandler()->AddPendingEvent (ev);
 }
 
+/** Called in the GUI thread when our worker thread has finished */
 void
 ThreadedStaticText::thread_finished (wxCommandEvent& ev)
 {
index 3a454c7c4f3cbd4d7d8cd205a48b8689a3d45496..12a6e8837d071b353d4536a18fc4c7634d4a53fb 100644 (file)
@@ -30,7 +30,9 @@ extern wxStaticText* add_label_to_sizer (wxSizer *, wxWindow *, std::string, int
 extern std::string wx_to_std (wxString);
 extern wxString std_to_wx (std::string);
 
-/** A wxStaticText whose content is computed in a separate thread, to avoid holding
+/** @class ThreadedStaticText
+ *
+ *  @brief A wxStaticText whose content is computed in a separate thread, to avoid holding
  *  up the GUI while work is done.
  */
 class ThreadedStaticText : public wxStaticText
@@ -43,6 +45,7 @@ private:
        void run (boost::function<std::string ()> fn);
        void thread_finished (wxCommandEvent& ev);
 
+       /** Thread to do our work in */
        boost::thread* _thread;
        
        static const int _update_event_id;