Document a few classes

Originally committed to SVN as r6569.
This commit is contained in:
Thomas Goyne 2012-03-12 00:07:09 +00:00
parent 30d7a18e97
commit 812e2e8025
3 changed files with 31 additions and 37 deletions

View file

@ -49,11 +49,8 @@ class AssDialogue;
class wxComboBox; class wxComboBox;
class wxTextCtrl; class wxTextCtrl;
/// DOCME
/// @class VideoBox /// @class VideoBox
/// @brief DOCME /// @brief The box containing the video display and associated controls
///
/// DOCME
class VideoBox : public wxPanel, private SelectionListener<AssDialogue> { class VideoBox : public wxPanel, private SelectionListener<AssDialogue> {
std::list<agi::signal::Connection> slots; std::list<agi::signal::Connection> slots;
agi::Context *context; ///< Project context agi::Context *context; ///< Project context

View file

@ -58,11 +58,12 @@ namespace agi {
class OptionValue; class OptionValue;
} }
/// DOCME
/// @class VideoContext /// @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 { class VideoContext : public wxEvtHandler {
/// Current frame number changed (new frame number) /// Current frame number changed (new frame number)
agi::signal::Signal<int> Seek; agi::signal::Signal<int> Seek;
@ -93,7 +94,8 @@ class VideoContext : public wxEvtHandler {
/// File name of the currently open keyframes or empty if keyframes are not overridden /// File name of the currently open keyframes or empty if keyframes are not overridden
wxString keyFramesFilename; wxString keyFramesFilename;
/// DOCME /// Playback timer used to periodically check if we should go to the next
/// frame while playing video
wxTimer playback; wxTimer playback;
/// Time since playback was last started /// Time since playback was last started
@ -114,16 +116,20 @@ class VideoContext : public wxEvtHandler {
/// overridden by the user /// overridden by the user
double arValue; 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; int arType;
/// Does the currently loaded video file have subtitles muxed into it? /// Does the currently loaded video file have subtitles muxed into it?
bool hasSubtitles; bool hasSubtitles;
/// Filename of the currently loaded timecodes file, or empty if timecodes /// Filename of the currently loaded timecodes file, or empty if timecodes
/// have not been overriden /// have not been overridden
wxString ovrTimecodeFile; wxString ovrTimecodeFile;
/// Cached option for audio playing when frame stepping
const agi::OptionValue* playAudioOnStep; const agi::OptionValue* playAudioOnStep;
void OnPlayTimer(wxTimerEvent &event); void OnPlayTimer(wxTimerEvent &event);
@ -193,6 +199,7 @@ public:
/// Get the current frame number /// Get the current frame number
int GetFrameN() const { return frame_n; } int GetFrameN() const { return frame_n; }
/// Get the actual aspect ratio from a predefined AR type
double GetARFromType(int type) const; double GetARFromType(int type) const;
/// Override the aspect ratio of the currently loaded video /// 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 /// @param value If type is 4 (custom), the aspect ratio to use
void SetAspectRatio(int type, double value=1.0); void SetAspectRatio(int type, double value=1.0);
/// @brief DOCME /// Get the current AR type
/// @return
int GetAspectRatioType() const { return arType; } int GetAspectRatioType() const { return arType; }
/// Get the current aspect ratio of the video /// Get the current aspect ratio of the video

View file

@ -41,46 +41,32 @@
class OpenGLWrapper; class OpenGLWrapper;
class AssDialogue; class AssDialogue;
/// DOCME /// VisualDraggableFeature display types
enum DraggableFeatureType { enum DraggableFeatureType {
/// DOCME
DRAG_NONE, DRAG_NONE,
/// DOCME
DRAG_BIG_SQUARE, DRAG_BIG_SQUARE,
/// DOCME
DRAG_BIG_CIRCLE, DRAG_BIG_CIRCLE,
/// DOCME
DRAG_BIG_TRIANGLE, DRAG_BIG_TRIANGLE,
/// DOCME
DRAG_SMALL_SQUARE, DRAG_SMALL_SQUARE,
/// DOCME
DRAG_SMALL_CIRCLE DRAG_SMALL_CIRCLE
}; };
/// DOCME
/// @class VisualDraggableFeature /// @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 { class VisualDraggableFeature {
Vector2D start; ///< position before the last operation began Vector2D start; ///< position before the last drag operation began
public: public:
/// @brief Constructor /// Constructor
VisualDraggableFeature(); VisualDraggableFeature();
/// Shape of feature DraggableFeatureType type; ///< Shape of feature
DraggableFeatureType type; Vector2D pos; ///< Position of this feature
int layer; ///< Layer; Higher = above
Vector2D pos; AssDialogue* line; ///< The dialogue line this feature is for; may be NULL
int layer; /// Layer; Higher = above
AssDialogue* line; /// The dialogue line this feature is for
/// @brief Is the given point over this feature? /// @brief Is the given point over this feature?
/// @param mouse_pos Position of the mouse /// @param mouse_pos Position of the mouse
@ -90,9 +76,14 @@ public:
/// @param gl OpenGLWrapper to use /// @param gl OpenGLWrapper to use
void Draw(OpenGLWrapper const& gl) const; void Draw(OpenGLWrapper const& gl) const;
/// Start a drag
void StartDrag(); 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); void UpdateDrag(Vector2D d, bool single_axis);
/// Has this feature actually moved since a drag was last started?
bool HasMoved() const; bool HasMoved() const;
}; };