Add Doxygen skeleton info for general include files.

Originally committed to SVN as r3327.
This commit is contained in:
Amar Takhar 2009-07-30 04:24:23 +00:00
parent d4b71ff85d
commit d82d02010b
6 changed files with 201 additions and 36 deletions

View file

@ -52,21 +52,34 @@
class AudioProvider; class AudioProvider;
///////////////////////////
// Audio Player base class /// @class AudioPlayer
/// @brief DOCME
///
/// DOCME
class AudioPlayer : public wxEvtHandler { class AudioPlayer : public wxEvtHandler {
private: private:
void OnStopAudio(wxCommandEvent &event); void OnStopAudio(wxCommandEvent &event);
protected: protected:
/// DOCME
AudioProvider *provider; AudioProvider *provider;
/// DOCME
wxTimer *displayTimer; wxTimer *displayTimer;
public: public:
AudioPlayer(); AudioPlayer();
virtual ~AudioPlayer(); virtual ~AudioPlayer();
/// @brief DOCME
///
virtual void OpenStream() {} virtual void OpenStream() {}
/// @brief DOCME
///
virtual void CloseStream() {} virtual void CloseStream() {}
virtual void Play(int64_t start,int64_t count)=0; // Play sample range virtual void Play(int64_t start,int64_t count)=0; // Play sample range
@ -94,11 +107,16 @@ public:
}; };
///////////
// Factory /// @class AudioPlayerFactory
/// @brief DOCME
///
/// DOCME
class AudioPlayerFactory { class AudioPlayerFactory {
public: public:
/// @brief DOCME
///
virtual ~AudioPlayerFactory() {} virtual ~AudioPlayerFactory() {}
virtual AudioPlayer *CreatePlayer()=0; virtual AudioPlayer *CreatePlayer()=0;
}; };

View file

@ -48,19 +48,36 @@
class VideoProvider; class VideoProvider;
////////////////////////
// Audio provider class /// @class AudioProvider
/// @brief DOCME
///
/// DOCME
class AudioProvider { class AudioProvider {
private: private:
/// DOCME
char *raw; char *raw;
/// DOCME
int raw_len; int raw_len;
protected: protected:
/// DOCME
int channels; int channels;
/// DOCME
int64_t num_samples; // for one channel, ie. number of PCM frames int64_t num_samples; // for one channel, ie. number of PCM frames
/// DOCME
int sample_rate; int sample_rate;
/// DOCME
int bytes_per_sample; int bytes_per_sample;
/// DOCME
wxString filename; wxString filename;
public: public:
@ -81,11 +98,16 @@ public:
}; };
///////////
// Factory /// @class AudioProviderFactory
/// @brief DOCME
///
/// DOCME
class AudioProviderFactory { class AudioProviderFactory {
public: public:
/// @brief DOCME
///
virtual ~AudioProviderFactory() {} virtual ~AudioProviderFactory() {}
virtual AudioProvider *CreateProvider(wxString filename)=0; virtual AudioProvider *CreateProvider(wxString filename)=0;
}; };

View file

@ -38,55 +38,94 @@
#include <wx/string.h> #include <wx/string.h>
/// DOCME
namespace Aegisub { namespace Aegisub {
// Base class for exceptions
// No public creators, all exceptions throws must be specific /// @class Exception
/// @brief DOCME
///
/// DOCME
class Exception { class Exception {
/// DOCME
wxString message; wxString message;
/// DOCME
Exception *inner; Exception *inner;
protected: protected:
/// @brief DOCME
/// @param msg
/// @param 0
///
Exception(const wxString &msg, Exception *inr = 0) : message(msg), inner(inr) { } Exception(const wxString &msg, Exception *inr = 0) : message(msg), inner(inr) { }
Exception(); // not implemented, not wanted Exception(); // not implemented, not wanted
/// @brief DOCME
/// @return
///
virtual ~Exception() { if (inner) delete inner; } virtual ~Exception() { if (inner) delete inner; }
public: public:
// Error message for outer exception
/// @brief // Error message for outer exception
/// @return
///
virtual wxString GetMessage() const { return message; } virtual wxString GetMessage() const { return message; }
// Error message for outer exception, and chained message for inner exception
/// @brief // Error message for outer exception, and chained message for inner exception
/// @return
///
wxString GetChainedMessage() const { if (inner) return inner->GetChainedMessage() + _T("\r\n") + GetMessage(); else return GetMessage(); } wxString GetChainedMessage() const { if (inner) return inner->GetChainedMessage() + _T("\r\n") + GetMessage(); else return GetMessage(); }
// Name of exception class, should only be implemented by specific classes // Name of exception class, should only be implemented by specific classes
virtual const wxChar * GetName() const = 0; virtual const wxChar * GetName() const = 0;
/// @brief DOCME
/// @return
///
operator const wxChar * () { return GetMessage().c_str(); } operator const wxChar * () { return GetMessage().c_str(); }
/// @brief DOCME
/// @return
///
operator wxString () { return GetMessage(); } operator wxString () { return GetMessage(); }
}; };
// Macro to quickly add location information to an error message
/// DOCME
#define AG_WHERE _T(" (at ") _T(__FILE__) _T(":") _T(#__LINE__) _T(")") #define AG_WHERE _T(" (at ") _T(__FILE__) _T(":") _T(#__LINE__) _T(")")
// Macros to define basic exception classes that do nothing fancy
// These should always be used inside the Aegisub namespace /// DOCME
#define DEFINE_SIMPLE_EXCEPTION_NOINNER(classname,baseclass,displayname) \ #define DEFINE_SIMPLE_EXCEPTION_NOINNER(classname,baseclass,displayname) \
class classname : public baseclass { \ class classname : public baseclass { \
public: \ public: \
classname(const wxString &msg) : baseclass(msg) { } \ classname(const wxString &msg) : baseclass(msg) { } \
const wxChar * GetName() const { return _T(displayname); } \ const wxChar * GetName() const { return _T(displayname); } \
}; };
/// DOCME
#define DEFINE_SIMPLE_EXCEPTION(classname,baseclass,displayname) \ #define DEFINE_SIMPLE_EXCEPTION(classname,baseclass,displayname) \
class classname : public baseclass { \ class classname : public baseclass { \
public: \ public: \
classname(const wxString &msg, Exception *inner) : baseclass(msg, inner) { } \ classname(const wxString &msg, Exception *inner) : baseclass(msg, inner) { } \
const wxChar * GetName() const { return _T(displayname); } \ const wxChar * GetName() const { return _T(displayname); } \
}; };
/// DOCME
#define DEFINE_BASE_EXCEPTION_NOINNER(classname,baseclass) \ #define DEFINE_BASE_EXCEPTION_NOINNER(classname,baseclass) \
class classname : public baseclass { \ class classname : public baseclass { \
public: \ public: \
classname(const wxString &msg) : baseclass(msg) { } \ classname(const wxString &msg) : baseclass(msg) { } \
}; };
/// DOCME
#define DEFINE_BASE_EXCEPTION(classname,baseclass) \ #define DEFINE_BASE_EXCEPTION(classname,baseclass) \
class classname : public baseclass { \ class classname : public baseclass { \
public: \ public: \
@ -111,10 +150,23 @@ namespace Aegisub {
// A file can't be accessed for some reason // A file can't be accessed for some reason
DEFINE_SIMPLE_EXCEPTION_NOINNER(FileNotAccessibleError,FileSystemError,"filesystem/not_accessible") DEFINE_SIMPLE_EXCEPTION_NOINNER(FileNotAccessibleError,FileSystemError,"filesystem/not_accessible")
// A file isn't accessible because it doesn't exist
/// DOCME
/// @class FileNotFoundError
/// @brief DOCME
///
/// DOCME
class FileNotFoundError : public FileNotAccessibleError { class FileNotFoundError : public FileNotAccessibleError {
public: public:
/// @brief DOCME
/// @param filename
/// @return
///
FileNotFoundError(const wxString &filename) : FileNotAccessibleError(wxString(_T("File not found: ")) + filename) { } FileNotFoundError(const wxString &filename) : FileNotAccessibleError(wxString(_T("File not found: ")) + filename) { }
/// @brief DOCME
///
const wxChar * GetName() const { return _T("filesystem/not_accessible/not_found"); } const wxChar * GetName() const { return _T("filesystem/not_accessible/not_found"); }
}; };
@ -127,4 +179,3 @@ namespace Aegisub {
// Define new classes if none fit the error you're reporting // Define new classes if none fit the error you're reporting
}; };

View file

@ -43,14 +43,33 @@
#include "aegisub.h" #include "aegisub.h"
///////////////////////////
// Spellchecking interface /// @class SpellChecker
/// @brief DOCME
///
/// DOCME
class SpellChecker { class SpellChecker {
public: public:
/// @brief DOCME
///
SpellChecker() {} SpellChecker() {}
/// @brief DOCME
///
virtual ~SpellChecker() {} virtual ~SpellChecker() {}
/// @brief DOCME
/// @param word
/// @return
///
virtual void AddWord(wxString word) {} virtual void AddWord(wxString word) {}
/// @brief DOCME
/// @param word
/// @return
///
virtual bool CanAddWord(wxString word) { return false; } virtual bool CanAddWord(wxString word) { return false; }
virtual bool CheckWord(wxString word)=0; virtual bool CheckWord(wxString word)=0;
@ -61,11 +80,18 @@ public:
}; };
///////////
// Factory /// @class SpellCheckerFactory
/// @brief DOCME
///
/// DOCME
class SpellCheckerFactory { class SpellCheckerFactory {
public: public:
/// @brief DOCME
///
virtual ~SpellCheckerFactory() {} virtual ~SpellCheckerFactory() {}
virtual SpellChecker *CreateSpellChecker()=0; virtual SpellChecker *CreateSpellChecker()=0;
}; };

View file

@ -49,22 +49,37 @@
class AssFile; class AssFile;
////////////////////////////////
// Subtitles provider interface /// @class SubtitlesProvider
/// @brief DOCME
///
/// DOCME
class SubtitlesProvider { class SubtitlesProvider {
public: public:
virtual ~SubtitlesProvider(); virtual ~SubtitlesProvider();
virtual void LoadSubtitles(AssFile *subs)=0; virtual void LoadSubtitles(AssFile *subs)=0;
/// @brief DOCME
/// @param dst
/// @param time
///
virtual void DrawSubtitles(AegiVideoFrame &dst,double time) {} virtual void DrawSubtitles(AegiVideoFrame &dst,double time) {}
}; };
///////////
// Factory /// @class SubtitlesProviderFactory
/// @brief DOCME
///
/// DOCME
class SubtitlesProviderFactory { class SubtitlesProviderFactory {
public: public:
/// @brief DOCME
///
virtual ~SubtitlesProviderFactory() {} virtual ~SubtitlesProviderFactory() {}
virtual SubtitlesProvider *CreateProvider(wxString subType=_T(""))=0; virtual SubtitlesProvider *CreateProvider(wxString subType=_T(""))=0;
}; };

View file

@ -45,11 +45,17 @@
#include "aegisub.h" #include "aegisub.h"
#include "vfr.h" #include "vfr.h"
////////////////////////////
// Video Provider interface /// @class VideoProvider
/// @brief DOCME
///
/// DOCME
class VideoProvider { class VideoProvider {
public: public:
// Virtual destructor
/// @brief // Virtual destructor
/// @return
///
virtual ~VideoProvider() {} virtual ~VideoProvider() {}
// Override this method to actually get frames // Override this method to actually get frames
@ -66,27 +72,54 @@ public:
virtual wxArrayInt GetKeyFrames()=0; // Returns list of keyframes virtual wxArrayInt GetKeyFrames()=0; // Returns list of keyframes
virtual FrameRate GetTrueFrameRate()=0; // Returns magic VFR stuff virtual FrameRate GetTrueFrameRate()=0; // Returns magic VFR stuff
// Use this to set any post-loading warnings, such as "being loaded with unreliable seeking"
/// @brief // Use this to set any post-loading warnings, such as "being loaded with unreliable seeking"
/// @return
///
virtual wxString GetWarning() { return L""; } virtual wxString GetWarning() { return L""; }
// Name of decoder, e.g. "Avisynth/FFMpegSource"
/// @brief // Name of decoder, e.g. "Avisynth/FFMpegSource"
/// @return
///
virtual wxString GetDecoderName() { return L"Unknown"; } virtual wxString GetDecoderName() { return L"Unknown"; }
// How many frames does this provider want Aegisub to cache? Set to 0 if it doesn't require caching.
/// @brief // How many frames does this provider want Aegisub to cache? Set to 0 if it doesn't require caching.
/// @return
///
virtual int GetDesiredCacheSize() { return 0; } virtual int GetDesiredCacheSize() { return 0; }
// For "special" providers that don't deal well with VFR (i.e. Avisynth)
/// @brief // For "special" providers that don't deal well with VFR (i.e. Avisynth)
/// @return
///
virtual bool NeedsVFRHack() { return false; }; // Returns true if provider needs special VFR treatment virtual bool NeedsVFRHack() { return false; }; // Returns true if provider needs special VFR treatment
/// @brief DOCME
/// @return
///
virtual bool IsNativelyByFrames() { return true; }; virtual bool IsNativelyByFrames() { return true; };
/// @brief DOCME
/// @param list
///
virtual void OverrideFrameTimeList(std::vector<int> list) {} // Override the list with the provided one, for VFR handling virtual void OverrideFrameTimeList(std::vector<int> list) {} // Override the list with the provided one, for VFR handling
}; };
///////////
// Factory /// @class VideoProviderFactory
/// @brief DOCME
///
/// DOCME
class VideoProviderFactory { class VideoProviderFactory {
public: public:
/// @brief DOCME
///
virtual ~VideoProviderFactory() {} virtual ~VideoProviderFactory() {}
virtual VideoProvider *CreateProvider(wxString video)=0; virtual VideoProvider *CreateProvider(wxString video)=0;
}; };