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;
///////////////////////////
// Audio Player base class
/// @class AudioPlayer
/// @brief DOCME
///
/// DOCME
class AudioPlayer : public wxEvtHandler {
private:
void OnStopAudio(wxCommandEvent &event);
protected:
/// DOCME
AudioProvider *provider;
/// DOCME
wxTimer *displayTimer;
public:
AudioPlayer();
virtual ~AudioPlayer();
/// @brief DOCME
///
virtual void OpenStream() {}
/// @brief DOCME
///
virtual void CloseStream() {}
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 {
public:
/// @brief DOCME
///
virtual ~AudioPlayerFactory() {}
virtual AudioPlayer *CreatePlayer()=0;
};

View File

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

View File

@ -38,55 +38,94 @@
#include <wx/string.h>
/// DOCME
namespace Aegisub {
// Base class for exceptions
// No public creators, all exceptions throws must be specific
/// @class Exception
/// @brief DOCME
///
/// DOCME
class Exception {
/// DOCME
wxString message;
/// DOCME
Exception *inner;
protected:
/// @brief DOCME
/// @param msg
/// @param 0
///
Exception(const wxString &msg, Exception *inr = 0) : message(msg), inner(inr) { }
Exception(); // not implemented, not wanted
/// @brief DOCME
/// @return
///
virtual ~Exception() { if (inner) delete inner; }
public:
// Error message for outer exception
/// @brief // Error message for outer exception
/// @return
///
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(); }
// Name of exception class, should only be implemented by specific classes
virtual const wxChar * GetName() const = 0;
/// @brief DOCME
/// @return
///
operator const wxChar * () { return GetMessage().c_str(); }
/// @brief DOCME
/// @return
///
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(")")
// 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) \
class classname : public baseclass { \
public: \
classname(const wxString &msg) : baseclass(msg) { } \
const wxChar * GetName() const { return _T(displayname); } \
};
/// DOCME
#define DEFINE_SIMPLE_EXCEPTION(classname,baseclass,displayname) \
class classname : public baseclass { \
public: \
classname(const wxString &msg, Exception *inner) : baseclass(msg, inner) { } \
const wxChar * GetName() const { return _T(displayname); } \
};
/// DOCME
#define DEFINE_BASE_EXCEPTION_NOINNER(classname,baseclass) \
class classname : public baseclass { \
public: \
classname(const wxString &msg) : baseclass(msg) { } \
};
/// DOCME
#define DEFINE_BASE_EXCEPTION(classname,baseclass) \
class classname : public baseclass { \
public: \
@ -111,10 +150,23 @@ namespace Aegisub {
// A file can't be accessed for some reason
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 {
public:
/// @brief DOCME
/// @param filename
/// @return
///
FileNotFoundError(const wxString &filename) : FileNotAccessibleError(wxString(_T("File not found: ")) + filename) { }
/// @brief DOCME
///
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
};

View File

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

View File

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

View File

@ -45,11 +45,17 @@
#include "aegisub.h"
#include "vfr.h"
////////////////////////////
// Video Provider interface
/// @class VideoProvider
/// @brief DOCME
///
/// DOCME
class VideoProvider {
public:
// Virtual destructor
/// @brief // Virtual destructor
/// @return
///
virtual ~VideoProvider() {}
// Override this method to actually get frames
@ -66,27 +72,54 @@ public:
virtual wxArrayInt GetKeyFrames()=0; // Returns list of keyframes
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""; }
// Name of decoder, e.g. "Avisynth/FFMpegSource"
/// @brief // Name of decoder, e.g. "Avisynth/FFMpegSource"
/// @return
///
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; }
// 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
/// @brief DOCME
/// @return
///
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
};
///////////
// Factory
/// @class VideoProviderFactory
/// @brief DOCME
///
/// DOCME
class VideoProviderFactory {
public:
/// @brief DOCME
///
virtual ~VideoProviderFactory() {}
virtual VideoProvider *CreateProvider(wxString video)=0;
};