From 812e2e802535a60c93bbdd32503b5d01202f8c8a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 12 Mar 2012 00:07:09 +0000 Subject: [PATCH] Document a few classes Originally committed to SVN as r6569. --- aegisub/src/video_box.h | 5 +---- aegisub/src/video_context.h | 22 ++++++++++++------- aegisub/src/visual_feature.h | 41 ++++++++++++++---------------------- 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/aegisub/src/video_box.h b/aegisub/src/video_box.h index 034de1b12..df25761e8 100644 --- a/aegisub/src/video_box.h +++ b/aegisub/src/video_box.h @@ -49,11 +49,8 @@ class AssDialogue; class wxComboBox; class wxTextCtrl; -/// DOCME /// @class VideoBox -/// @brief DOCME -/// -/// DOCME +/// @brief The box containing the video display and associated controls class VideoBox : public wxPanel, private SelectionListener { std::list slots; agi::Context *context; ///< Project context diff --git a/aegisub/src/video_context.h b/aegisub/src/video_context.h index 253bb21cc..2e369ad1e 100644 --- a/aegisub/src/video_context.h +++ b/aegisub/src/video_context.h @@ -58,11 +58,12 @@ namespace agi { class OptionValue; } -/// DOCME /// @class VideoContext -/// @brief DOCME +/// @brief Manage a bunch of things vaguely related to video playback /// -/// DOCME +/// VideoContext's core responsibility is opening and playing videos. Along +/// with that, it also manages video timecodes and keyframes, and some +/// video-related UI properties class VideoContext : public wxEvtHandler { /// Current frame number changed (new frame number) agi::signal::Signal Seek; @@ -93,7 +94,8 @@ class VideoContext : public wxEvtHandler { /// File name of the currently open keyframes or empty if keyframes are not overridden wxString keyFramesFilename; - /// DOCME + /// Playback timer used to periodically check if we should go to the next + /// frame while playing video wxTimer playback; /// Time since playback was last started @@ -114,16 +116,20 @@ class VideoContext : public wxEvtHandler { /// overridden by the user double arValue; - /// DOCME + /// @brief The current AR type + /// + /// 0 is square pixels; 1-3 are predefined ARs; 4 is custom, where the real + /// AR is in arValue int arType; /// Does the currently loaded video file have subtitles muxed into it? bool hasSubtitles; /// Filename of the currently loaded timecodes file, or empty if timecodes - /// have not been overriden + /// have not been overridden wxString ovrTimecodeFile; + /// Cached option for audio playing when frame stepping const agi::OptionValue* playAudioOnStep; void OnPlayTimer(wxTimerEvent &event); @@ -193,6 +199,7 @@ public: /// Get the current frame number int GetFrameN() const { return frame_n; } + /// Get the actual aspect ratio from a predefined AR type double GetARFromType(int type) const; /// Override the aspect ratio of the currently loaded video @@ -200,8 +207,7 @@ public: /// @param value If type is 4 (custom), the aspect ratio to use void SetAspectRatio(int type, double value=1.0); - /// @brief DOCME - /// @return + /// Get the current AR type int GetAspectRatioType() const { return arType; } /// Get the current aspect ratio of the video diff --git a/aegisub/src/visual_feature.h b/aegisub/src/visual_feature.h index 82c49a21d..669819b33 100644 --- a/aegisub/src/visual_feature.h +++ b/aegisub/src/visual_feature.h @@ -41,46 +41,32 @@ class OpenGLWrapper; class AssDialogue; -/// DOCME +/// VisualDraggableFeature display types enum DraggableFeatureType { - - /// DOCME DRAG_NONE, - - /// DOCME DRAG_BIG_SQUARE, - - /// DOCME DRAG_BIG_CIRCLE, - - /// DOCME DRAG_BIG_TRIANGLE, - - /// DOCME DRAG_SMALL_SQUARE, - - /// DOCME DRAG_SMALL_CIRCLE }; -/// DOCME /// @class VisualDraggableFeature -/// @brief Onscreen control used by many visual tools which doesn't do much +/// @brief Onscreen control used by many visual tools +/// +/// By itself this class doesn't do much. It mostly just draws itself at a +/// specified position and performs hit-testing. class VisualDraggableFeature { - Vector2D start; ///< position before the last operation began + Vector2D start; ///< position before the last drag operation began public: - /// @brief Constructor + /// Constructor VisualDraggableFeature(); - /// Shape of feature - DraggableFeatureType type; - - Vector2D pos; - - int layer; /// Layer; Higher = above - - AssDialogue* line; /// The dialogue line this feature is for + DraggableFeatureType type; ///< Shape of feature + Vector2D pos; ///< Position of this feature + int layer; ///< Layer; Higher = above + AssDialogue* line; ///< The dialogue line this feature is for; may be NULL /// @brief Is the given point over this feature? /// @param mouse_pos Position of the mouse @@ -90,9 +76,14 @@ public: /// @param gl OpenGLWrapper to use void Draw(OpenGLWrapper const& gl) const; + /// Start a drag void StartDrag(); + /// Update the position of the feature during a drag + /// @param d New position of the feature + /// @param single_axis Only apply the larger of the two changes to the position void UpdateDrag(Vector2D d, bool single_axis); + /// Has this feature actually moved since a drag was last started? bool HasMoved() const; };