mirror of https://github.com/odrling/Aegisub
Strip trailing whitespace from all cpp and h files
Originally committed to SVN as r6600.
This commit is contained in:
parent
1077b9b5c4
commit
b32515da80
|
@ -1,29 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2004-2009 Mike Matsnev. All Rights Reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Absolutely no warranty of function or purpose is made by the author
|
||||
* Mike Matsnev.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice immediately at the beginning of the file, without modification,
|
||||
* this list of conditions, and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Absolutely no warranty of function or purpose is made by the author
|
||||
* Mike Matsnev.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -87,8 +87,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint16_t Reverse(uint16_t val)
|
||||
{
|
||||
|
@ -99,8 +99,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint32_t Reverse(uint32_t val)
|
||||
{
|
||||
|
@ -113,8 +113,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint64_t Reverse(uint64_t val)
|
||||
{
|
||||
|
@ -134,8 +134,8 @@ namespace Endian {
|
|||
// Regular, fast, templatized conditional reversing
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
template <class T>
|
||||
inline T LittleToMachine(T val)
|
||||
|
@ -150,8 +150,8 @@ namespace Endian {
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
template <class T>
|
||||
inline T BigToMachine(T val)
|
||||
|
@ -166,8 +166,8 @@ namespace Endian {
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
template <class T>
|
||||
inline T MachineToLittle(T val)
|
||||
|
@ -182,8 +182,8 @@ namespace Endian {
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
template <class T>
|
||||
inline T MachineToBig(T val)
|
||||
|
@ -242,8 +242,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint16_t MachineToBig(uint16_t val)
|
||||
{
|
||||
|
@ -257,8 +257,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint16_t MachineToLittle(uint16_t val)
|
||||
{
|
||||
|
@ -272,8 +272,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint16_t BigToMachine(uint16_t val)
|
||||
{
|
||||
|
@ -286,8 +286,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint16_t LittleToMachine(uint16_t val)
|
||||
{
|
||||
|
@ -303,8 +303,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint32_t MachineToBig(uint32_t val)
|
||||
{
|
||||
|
@ -318,8 +318,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint32_t MachineToLittle(uint32_t val)
|
||||
{
|
||||
|
@ -333,8 +333,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint32_t BigToMachine(uint32_t val)
|
||||
{
|
||||
|
@ -349,8 +349,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint32_t LittleToMachine(uint32_t val)
|
||||
{
|
||||
|
@ -368,8 +368,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint64_t MachineToBig(uint64_t val)
|
||||
{
|
||||
|
@ -387,8 +387,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint64_t MachineToLittle(uint64_t val)
|
||||
{
|
||||
|
@ -406,8 +406,8 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @return
|
||||
/// @param val
|
||||
/// @return
|
||||
///
|
||||
inline uint64_t BigToMachine(uint64_t val)
|
||||
{
|
||||
|
@ -426,7 +426,7 @@ namespace Endian {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param val
|
||||
/// @param val
|
||||
///
|
||||
inline uint64_t LittleToMachine(uint64_t val)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "aegisublocale.h"
|
||||
#include "standard_paths.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
///
|
||||
AegisubLocale::AegisubLocale () {
|
||||
locale = NULL;
|
||||
|
@ -67,8 +67,8 @@ AegisubLocale::~AegisubLocale() {
|
|||
}
|
||||
|
||||
|
||||
/// @brief Initialize
|
||||
/// @param language
|
||||
/// @brief Initialize
|
||||
/// @param language
|
||||
///
|
||||
void AegisubLocale::Init(int language) {
|
||||
if (language == -1) language = wxLANGUAGE_ENGLISH;
|
||||
|
@ -95,8 +95,8 @@ void AegisubLocale::Init(int language) {
|
|||
|
||||
|
||||
|
||||
/// @brief Pick a language
|
||||
/// @return
|
||||
/// @brief Pick a language
|
||||
/// @return
|
||||
///
|
||||
int AegisubLocale::PickLanguage() {
|
||||
// Get list
|
||||
|
@ -131,7 +131,7 @@ int AegisubLocale::PickLanguage() {
|
|||
|
||||
|
||||
|
||||
/// @brief Get list of available languages
|
||||
/// @brief Get list of available languages
|
||||
///
|
||||
wxArrayInt AegisubLocale::GetAvailableLanguages() {
|
||||
wxArrayInt final;
|
||||
|
@ -183,7 +183,7 @@ wxArrayInt AegisubLocale::GetAvailableLanguages() {
|
|||
for (size_t i=0; i<len; i++) {
|
||||
const wxLanguageInfo *lang = wxLocale::FindLanguageInfo(langs[i]);
|
||||
|
||||
// If the locale file doesn't exist then don't list it as an option.
|
||||
// If the locale file doesn't exist then don't list it as an option.
|
||||
wxString locDir = wxStandardPaths::Get().GetLocalizedResourcesDir(langs[i], wxStandardPathsBase::ResourceCat_Messages);
|
||||
wxFileName file(wxString::Format("%s/%s.mo", locDir, GETTEXT_PACKAGE));
|
||||
if (lang && file.FileExists()) final.Add(lang->Language);
|
||||
|
|
|
@ -74,8 +74,8 @@ AssDialogue::AssDialogue(AssDialogue const& that)
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param _data
|
||||
/// @param version
|
||||
/// @param _data
|
||||
/// @param version
|
||||
AssDialogue::AssDialogue(wxString _data,int version)
|
||||
: AssEntry(wxString(), "[Events]")
|
||||
, Comment(false)
|
||||
|
@ -259,7 +259,7 @@ void AssDialogue::ParseASSTags() {
|
|||
work = Text.substr(cur, end - cur);
|
||||
cur = end + 1;
|
||||
}
|
||||
|
||||
|
||||
if (work.size() && work.Find("\\") == wxNOT_FOUND) {
|
||||
//We've found an override block with no backslashes
|
||||
//We're going to assume it's a comment and not consider it an override block
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
ASS_BlockType GetType() const { return BLOCK_OVERRIDE; }
|
||||
wxString GetText();
|
||||
|
@ -132,7 +132,7 @@ public:
|
|||
|
||||
/// Type of callback function passed to ProcessParameters
|
||||
typedef void (*ProcessParametersCallback)(wxString,int,AssOverrideParameter*,void *);
|
||||
/// @brief Process parameters via callback
|
||||
/// @brief Process parameters via callback
|
||||
/// @param callback The callback function to call per tag paramer
|
||||
/// @param userData User data to pass to callback function
|
||||
void ProcessParameters(ProcessParametersCallback callback,void *userData);
|
||||
|
@ -183,7 +183,7 @@ public:
|
|||
/// Clear all blocks, ALWAYS call this after you're done processing tags
|
||||
void ClearBlocks();
|
||||
|
||||
/// @brief Process parameters via callback
|
||||
/// @brief Process parameters via callback
|
||||
/// @param callback The callback function to call per tag parameter
|
||||
/// @param userData User data to pass to callback function
|
||||
void ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData=NULL);
|
||||
|
@ -202,7 +202,7 @@ public:
|
|||
|
||||
template<int which>
|
||||
void SetMarginString(const wxString value) { SetMarginString(value, which);}
|
||||
/// @brief Set a margin
|
||||
/// @brief Set a margin
|
||||
/// @param value New value of the margin
|
||||
/// @param which 0 = left, 1 = right, 2 = vertical/top, 3 = bottom
|
||||
void SetMarginString(const wxString value,int which);
|
||||
|
|
|
@ -83,7 +83,7 @@ void AssExporter::DrawSettings(wxWindow *parent, wxSizer *target_sizer) {
|
|||
|
||||
void AssExporter::AddFilter(wxString const& name) {
|
||||
AssExportFilter *filter = AssExportFilterChain::GetFilter(name);
|
||||
|
||||
|
||||
if (!filter) throw wxString::Format("Filter not found: %s", name);
|
||||
|
||||
filters.push_back(filter);
|
||||
|
|
|
@ -156,7 +156,7 @@ static void load_protos() {
|
|||
proto[++i].Set("\\shad", VARDATA_FLOAT,PARCLASS_ABSOLUTE_SIZE); // \shad<depth>
|
||||
proto[++i].Set("\\xshad", VARDATA_FLOAT,PARCLASS_ABSOLUTE_SIZE); // \xshad<depth>
|
||||
proto[++i].Set("\\yshad", VARDATA_FLOAT,PARCLASS_ABSOLUTE_SIZE); // \yshad<depth>
|
||||
|
||||
|
||||
// \fade(<a1>,<a2>,<a3>,<t1>,<t2>,<t3>,<t4>)
|
||||
i++;
|
||||
proto[i].name = "\\fade";
|
||||
|
|
|
@ -63,8 +63,8 @@ AssColor::AssColor(const wxColour &color)
|
|||
SetWXColor(color);
|
||||
}
|
||||
|
||||
/// @brief Parse from SSA/ASS
|
||||
/// @param value
|
||||
/// @brief Parse from SSA/ASS
|
||||
/// @param value
|
||||
void AssColor::Parse(wxString const& value) {
|
||||
if (value.size() > 0 && value[0] == '#') {
|
||||
// HTML colour
|
||||
|
@ -97,14 +97,14 @@ void AssColor::Parse(wxString const& value) {
|
|||
a = (outval>>24) & 0xFF;
|
||||
}
|
||||
|
||||
/// @brief Gets a wxColour
|
||||
/// @return
|
||||
/// @brief Gets a wxColour
|
||||
/// @return
|
||||
wxColour AssColor::GetWXColor() const {
|
||||
return wxColour(r,g,b,255-a);
|
||||
}
|
||||
|
||||
/// @brief Sets color from wx
|
||||
/// @param color
|
||||
/// @brief Sets color from wx
|
||||
/// @param color
|
||||
void AssColor::SetWXColor(const wxColor &color) {
|
||||
r = color.Red();
|
||||
g = color.Green();
|
||||
|
@ -112,11 +112,11 @@ void AssColor::SetWXColor(const wxColor &color) {
|
|||
//a = color.Alpha();
|
||||
}
|
||||
|
||||
/// @brief Get formatted in ASS format
|
||||
/// @param alpha
|
||||
/// @param stripped
|
||||
/// @param isStyle
|
||||
/// @return
|
||||
/// @brief Get formatted in ASS format
|
||||
/// @param alpha
|
||||
/// @param stripped
|
||||
/// @param isStyle
|
||||
/// @return
|
||||
wxString AssColor::GetASSFormatted(bool alpha,bool stripped,bool isStyle) const {
|
||||
wxString work;
|
||||
if (!stripped) work += "&H";
|
||||
|
@ -126,8 +126,8 @@ wxString AssColor::GetASSFormatted(bool alpha,bool stripped,bool isStyle) const
|
|||
return work;
|
||||
}
|
||||
|
||||
/// @brief Get decimal formatted
|
||||
/// @return
|
||||
/// @brief Get decimal formatted
|
||||
/// @return
|
||||
wxString AssColor::GetSSAFormatted() const {
|
||||
long color = (a<<24)+(b<<16)+(g<<8)+r;
|
||||
wxString output=wxString::Format("%i",(long)color);
|
||||
|
|
|
@ -53,7 +53,7 @@ AssTime::AssTime(wxString const& text)
|
|||
size_t pos = 0, end = 0;
|
||||
|
||||
int colons = text.Freq(':');
|
||||
|
||||
|
||||
// Set start so that there are only two colons at most
|
||||
for (; colons > 2; --colons) pos = text.find(':', pos) + 1;
|
||||
|
||||
|
@ -137,7 +137,7 @@ wxString FractionalTime::ToSMPTE(AssTime time, char sep) {
|
|||
almost 4 seconds (108000 frames versus 107892).
|
||||
|
||||
DEATH TO SMPTE
|
||||
*/
|
||||
*/
|
||||
int fps_approx = floor(fps.FPS() + 0.5);
|
||||
int frames_per_h = 3600*fps_approx;
|
||||
int frames_per_m = 60*fps_approx;
|
||||
|
|
|
@ -1051,7 +1051,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event)
|
|||
{
|
||||
SetCursor(wxCursor(wxCURSOR_SIZEWE));
|
||||
new_obj = timeline.get();
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (new_obj)
|
||||
|
|
|
@ -90,7 +90,7 @@ class ScopedAliveFlag {
|
|||
|
||||
ScopedAliveFlag(const ScopedAliveFlag &); // uncopyable
|
||||
ScopedAliveFlag(); // no default
|
||||
ScopedAliveFlag& operator=(ScopedAliveFlag const&);
|
||||
ScopedAliveFlag& operator=(ScopedAliveFlag const&);
|
||||
|
||||
public:
|
||||
explicit ScopedAliveFlag(bool &var) : flag(var) { flag = true; }
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "main.h"
|
||||
#include "utils.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
///
|
||||
DirectSoundPlayer::DirectSoundPlayer() {
|
||||
playing = false;
|
||||
|
@ -61,13 +61,13 @@ DirectSoundPlayer::DirectSoundPlayer() {
|
|||
thread = NULL;
|
||||
}
|
||||
|
||||
/// @brief Destructor
|
||||
/// @brief Destructor
|
||||
///
|
||||
DirectSoundPlayer::~DirectSoundPlayer() {
|
||||
CloseStream();
|
||||
}
|
||||
|
||||
/// @brief Open stream
|
||||
/// @brief Open stream
|
||||
///
|
||||
void DirectSoundPlayer::OpenStream() {
|
||||
// Get provider
|
||||
|
@ -117,7 +117,7 @@ void DirectSoundPlayer::OpenStream() {
|
|||
offset = 0;
|
||||
}
|
||||
|
||||
/// @brief Close stream
|
||||
/// @brief Close stream
|
||||
///
|
||||
void DirectSoundPlayer::CloseStream() {
|
||||
// Stop it
|
||||
|
@ -136,9 +136,9 @@ void DirectSoundPlayer::CloseStream() {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Fill buffer
|
||||
/// @param fill
|
||||
/// @return
|
||||
/// @brief Fill buffer
|
||||
/// @param fill
|
||||
/// @return
|
||||
///
|
||||
bool DirectSoundPlayer::FillBuffer(bool fill) {
|
||||
if (playPos >= endPos) return false;
|
||||
|
@ -225,9 +225,9 @@ RetryLock:
|
|||
return playPos < endPos;
|
||||
}
|
||||
|
||||
/// @brief Play
|
||||
/// @param start
|
||||
/// @param count
|
||||
/// @brief Play
|
||||
/// @param start
|
||||
/// @param count
|
||||
///
|
||||
void DirectSoundPlayer::Play(int64_t start,int64_t count) {
|
||||
// Make sure that it's stopped
|
||||
|
@ -267,8 +267,8 @@ void DirectSoundPlayer::Play(int64_t start,int64_t count) {
|
|||
if (displayTimer && !displayTimer->IsRunning()) displayTimer->Start(15);
|
||||
}
|
||||
|
||||
/// @brief Stop
|
||||
/// @param timerToo
|
||||
/// @brief Stop
|
||||
/// @param timerToo
|
||||
///
|
||||
void DirectSoundPlayer::Stop(bool timerToo) {
|
||||
// Stop the thread
|
||||
|
@ -297,23 +297,23 @@ void DirectSoundPlayer::Stop(bool timerToo) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Set end
|
||||
/// @param pos
|
||||
/// @brief Set end
|
||||
/// @param pos
|
||||
///
|
||||
void DirectSoundPlayer::SetEndPosition(int64_t pos) {
|
||||
if (playing) endPos = pos;
|
||||
}
|
||||
|
||||
/// @brief Set current position
|
||||
/// @param pos
|
||||
/// @brief Set current position
|
||||
/// @param pos
|
||||
///
|
||||
void DirectSoundPlayer::SetCurrentPosition(int64_t pos) {
|
||||
startPos = playPos = pos;
|
||||
startTime = GetTickCount();
|
||||
}
|
||||
|
||||
/// @brief Get current position
|
||||
/// @return
|
||||
/// @brief Get current position
|
||||
/// @return
|
||||
///
|
||||
int64_t DirectSoundPlayer::GetCurrentPosition() {
|
||||
// Check if buffer is loaded
|
||||
|
@ -326,22 +326,22 @@ int64_t DirectSoundPlayer::GetCurrentPosition() {
|
|||
return startPos + tdiff * provider->GetSampleRate() / 1000;
|
||||
}
|
||||
|
||||
/// @brief Thread constructor
|
||||
/// @param par
|
||||
/// @brief Thread constructor
|
||||
/// @param par
|
||||
///
|
||||
DirectSoundPlayerThread::DirectSoundPlayerThread(DirectSoundPlayer *par) : wxThread(wxTHREAD_JOINABLE) {
|
||||
parent = par;
|
||||
stopnotify = CreateEvent(NULL, true, false, NULL);
|
||||
}
|
||||
|
||||
/// @brief Thread destructor
|
||||
/// @brief Thread destructor
|
||||
///
|
||||
DirectSoundPlayerThread::~DirectSoundPlayerThread() {
|
||||
CloseHandle(stopnotify);
|
||||
}
|
||||
|
||||
/// @brief Thread entry point
|
||||
/// @return
|
||||
/// @brief Thread entry point
|
||||
/// @return
|
||||
///
|
||||
wxThread::ExitCode DirectSoundPlayerThread::Entry() {
|
||||
CoInitialize(0);
|
||||
|
@ -390,7 +390,7 @@ wxThread::ExitCode DirectSoundPlayerThread::Entry() {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/// @brief Stop playback thread
|
||||
/// @brief Stop playback thread
|
||||
///
|
||||
void DirectSoundPlayerThread::Stop() {
|
||||
// Increase the stopnotify by one, causing a wait for it to succeed
|
||||
|
|
|
@ -140,17 +140,17 @@ public:
|
|||
void Stop(bool timerToo=true);
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
bool IsPlaying() { return playing; }
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
int64_t GetStartPosition() { return startPos; }
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
int64_t GetEndPosition() { return endPos; }
|
||||
int64_t GetCurrentPosition();
|
||||
|
@ -158,13 +158,13 @@ public:
|
|||
void SetCurrentPosition(int64_t pos);
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param vol
|
||||
/// @return
|
||||
/// @param vol
|
||||
/// @return
|
||||
///
|
||||
void SetVolume(double vol) { volume = vol; }
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
double GetVolume() { return volume; }
|
||||
};
|
||||
|
|
|
@ -106,7 +106,7 @@ void PulseAudioPlayer::OpenStream()
|
|||
// otherwise loop once more
|
||||
}
|
||||
//printf("Context connected\n");
|
||||
|
||||
|
||||
// Set up stream
|
||||
bpf = provider->GetChannels() * provider->GetBytesPerSample();
|
||||
pa_sample_spec ss;
|
||||
|
|
|
@ -158,7 +158,7 @@ AudioProvider *AudioProviderFactory::GetProvider(wxString const& filename, int c
|
|||
throw agi::AudioCacheOpenError("Unknown caching method", 0);
|
||||
}
|
||||
|
||||
/// @brief Register all providers
|
||||
/// @brief Register all providers
|
||||
///
|
||||
void AudioProviderFactory::RegisterProviders() {
|
||||
#ifdef WITH_AVISYNTH
|
||||
|
|
|
@ -54,8 +54,8 @@
|
|||
#include "standard_paths.h"
|
||||
#include "utils.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @param _filename
|
||||
/// @brief Constructor
|
||||
/// @param _filename
|
||||
///
|
||||
AvisynthAudioProvider::AvisynthAudioProvider(wxString filename)
|
||||
: filename(filename)
|
||||
|
@ -108,8 +108,8 @@ AvisynthAudioProvider::AvisynthAudioProvider(wxString filename)
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Read from environment
|
||||
/// @param _clip
|
||||
/// @brief Read from environment
|
||||
/// @param _clip
|
||||
///
|
||||
void AvisynthAudioProvider::LoadFromClip(AVSValue _clip) {
|
||||
AVSValue script;
|
||||
|
@ -150,10 +150,10 @@ void AvisynthAudioProvider::LoadFromClip(AVSValue _clip) {
|
|||
clip = tempclip;
|
||||
}
|
||||
|
||||
/// @brief Get audio
|
||||
/// @param buf
|
||||
/// @param start
|
||||
/// @param count
|
||||
/// @brief Get audio
|
||||
/// @param buf
|
||||
/// @param start
|
||||
/// @param count
|
||||
///
|
||||
void AvisynthAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) const {
|
||||
// Requested beyond the length of audio
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "compat.h"
|
||||
#include "main.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
/// @param filename The filename to open
|
||||
FFmpegSourceAudioProvider::FFmpegSourceAudioProvider(wxString filename) try
|
||||
: AudioSource(NULL, FFMS_DestroyAudioSource)
|
||||
|
@ -102,7 +102,7 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) {
|
|||
|
||||
if (Index && FFMS_IndexBelongsToFile(Index, FileNameShort.utf8_str(), &ErrInfo))
|
||||
Index = NULL;
|
||||
|
||||
|
||||
// index valid but track number still not set?
|
||||
if (Index) {
|
||||
// track number not set? just grab the first track
|
||||
|
@ -118,10 +118,10 @@ void FFmpegSourceAudioProvider::LoadAudio(wxString filename) {
|
|||
Index = NULL;
|
||||
}
|
||||
// no valid index exists and the file only has one audio track, index it
|
||||
else if (TrackNumber < 0)
|
||||
else if (TrackNumber < 0)
|
||||
TrackNumber = FFMS_TRACKMASK_ALL;
|
||||
// else: do nothing (keep track mask as it is)
|
||||
|
||||
|
||||
// moment of truth
|
||||
if (!Index) {
|
||||
int TrackMask;
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param filename
|
||||
/// @param filename
|
||||
///
|
||||
PCMAudioProvider::PCMAudioProvider(const wxString &filename)
|
||||
#ifdef _WIN32
|
||||
|
@ -130,9 +130,9 @@ PCMAudioProvider::~PCMAudioProvider()
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param range_start
|
||||
/// @param range_length
|
||||
/// @return
|
||||
/// @param range_start
|
||||
/// @param range_length
|
||||
/// @return
|
||||
///
|
||||
char * PCMAudioProvider::EnsureRangeAccessible(int64_t range_start, int64_t range_length) const
|
||||
{
|
||||
|
@ -203,9 +203,9 @@ char * PCMAudioProvider::EnsureRangeAccessible(int64_t range_start, int64_t rang
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param buf
|
||||
/// @param start
|
||||
/// @param count
|
||||
/// @param buf
|
||||
/// @param start
|
||||
/// @param count
|
||||
///
|
||||
void PCMAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) const
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ class RiffWavPCMAudioProvider : public PCMAudioProvider {
|
|||
public:
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param _filename
|
||||
/// @param _filename
|
||||
///
|
||||
RiffWavPCMAudioProvider(const wxString &_filename)
|
||||
: PCMAudioProvider(_filename)
|
||||
|
@ -388,7 +388,7 @@ public:
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
bool AreSamplesNativeEndian() const
|
||||
{
|
||||
|
@ -486,9 +486,9 @@ class Wave64AudioProvider : public PCMAudioProvider {
|
|||
};
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param guid1
|
||||
/// @param guid2
|
||||
/// @return
|
||||
/// @param guid1
|
||||
/// @param guid2
|
||||
/// @return
|
||||
///
|
||||
inline bool CheckGuid(const uint8_t *guid1, const uint8_t *guid2)
|
||||
{
|
||||
|
@ -498,7 +498,7 @@ class Wave64AudioProvider : public PCMAudioProvider {
|
|||
public:
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param _filename
|
||||
/// @param _filename
|
||||
///
|
||||
Wave64AudioProvider(const wxString &_filename)
|
||||
: PCMAudioProvider(_filename)
|
||||
|
@ -579,7 +579,7 @@ public:
|
|||
}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
bool AreSamplesNativeEndian() const
|
||||
{
|
||||
|
|
|
@ -138,10 +138,10 @@ void RAMAudioProvider::GetAudio(void *buf, int64_t start, int64_t count) const {
|
|||
int i = (start*bytes_per_sample) >> CacheBits;
|
||||
int start_offset = (start*bytes_per_sample) & (CacheBlockSize-1);
|
||||
int64_t bytesremaining = count*bytes_per_sample;
|
||||
|
||||
|
||||
// Copy
|
||||
while (bytesremaining) {
|
||||
int readsize = std::min<int>(bytesremaining, CacheBlockSize - start_offset);
|
||||
int readsize = std::min<int>(bytesremaining, CacheBlockSize - start_offset);
|
||||
|
||||
memcpy(charbuf,(char *)(blockcache[i++]+start_offset),readsize);
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ void AudioRendererBitmapProvider::SetMillisecondsPerPixel(double new_pixel_ms)
|
|||
if (pixel_ms == new_pixel_ms) return;
|
||||
|
||||
pixel_ms = new_pixel_ms;
|
||||
|
||||
|
||||
OnSetMillisecondsPerPixel();
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ void AudioWaveformRenderer::Render(wxBitmap &bmp, int start, AudioRenderingStyle
|
|||
{
|
||||
provider->GetAudio(audio_buffer, (int64_t)cur_sample, (int64_t)pixel_samples);
|
||||
cur_sample += pixel_samples;
|
||||
|
||||
|
||||
int peak_min = 0, peak_max = 0;
|
||||
int64_t avg_min_accum = 0, avg_max_accum = 0;
|
||||
const int16_t *aud = (const int16_t *)audio_buffer;
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
virtual void GetRenderingStyles(AudioRenderingStyleRanges &ranges) const = 0;
|
||||
|
||||
/// @brief Go to next timing unit
|
||||
///
|
||||
///
|
||||
/// Advances the timing controller cursor to the next timing unit, for
|
||||
/// example the next dialogue line or the next karaoke syllable.
|
||||
virtual void Next() = 0;
|
||||
|
|
|
@ -169,7 +169,7 @@ AudioTimingControllerKaraoke::AudioTimingControllerKaraoke(agi::Context *c, AssK
|
|||
video_position_provider.AddMarkerMovedListener(std::tr1::bind(std::tr1::ref(AnnounceMarkerMoved)));
|
||||
|
||||
Revert();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void AudioTimingControllerKaraoke::OnAutoCommitChange(agi::OptionValue const& opt) {
|
||||
|
|
|
@ -110,7 +110,7 @@ namespace Automation4 {
|
|||
HFONT thefont = CreateFontIndirect(&lf);
|
||||
if (!thefont) return false;
|
||||
SelectObject(thedc, thefont);
|
||||
|
||||
|
||||
SIZE sz;
|
||||
size_t thetextlen = text.length();
|
||||
const TCHAR *thetext = text.wc_str();
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace {
|
|||
}
|
||||
|
||||
int regex_init(lua_State *L)
|
||||
{
|
||||
{
|
||||
if (luaL_newmetatable(L, "aegisub.regex")) {
|
||||
set_field(L, "__gc", regex_gc);
|
||||
lua_pop(L, 1);
|
||||
|
|
|
@ -45,8 +45,8 @@ enum { AVISYNTH_INTERFACE_VERSION = 3 };
|
|||
/* Define all types necessary for interfacing with avisynth.dll
|
||||
Moved from internal.h */
|
||||
|
||||
// Win32 API macros, notably the types BYTE, DWORD, ULONG, etc.
|
||||
#include <windef.h>
|
||||
// Win32 API macros, notably the types BYTE, DWORD, ULONG, etc.
|
||||
#include <windef.h>
|
||||
|
||||
// COM interface macros
|
||||
#include <objbase.h>
|
||||
|
@ -79,7 +79,7 @@ typedef long PixOffset;
|
|||
#define _RPT2(a,b,c,d) ((void)0)
|
||||
#define _RPT3(a,b,c,d,e) ((void)0)
|
||||
#define _RPT4(a,b,c,d,e,f) ((void)0)
|
||||
|
||||
|
||||
#define _ASSERTE(x) assert(x)
|
||||
#include <assert.h>
|
||||
#endif
|
||||
|
@ -101,7 +101,7 @@ typedef long PixOffset;
|
|||
typedef float SFLOAT;
|
||||
|
||||
enum {SAMPLE_INT8 = 1<<0,
|
||||
SAMPLE_INT16 = 1<<1,
|
||||
SAMPLE_INT16 = 1<<1,
|
||||
SAMPLE_INT24 = 1<<2, // Int24 is a very stupid thing to code, but it's supported by some hardware.
|
||||
SAMPLE_INT32 = 1<<3,
|
||||
SAMPLE_FLOAT = 1<<4};
|
||||
|
@ -124,7 +124,7 @@ struct VideoInfo {
|
|||
|
||||
// Colorspace properties.
|
||||
enum {
|
||||
CS_BGR = 1<<28,
|
||||
CS_BGR = 1<<28,
|
||||
CS_YUV = 1<<29,
|
||||
CS_INTERLEAVED = 1<<30,
|
||||
CS_PLANAR = 1<<31
|
||||
|
@ -140,7 +140,7 @@ struct VideoInfo {
|
|||
CS_IYUV = 1<<4 | CS_YUV | CS_PLANAR // same as above
|
||||
};
|
||||
int pixel_type; // changed to int as of 2.5
|
||||
|
||||
|
||||
|
||||
int audio_samples_per_second; // 0 means no audio
|
||||
int sample_type; // as of 2.5
|
||||
|
@ -164,7 +164,7 @@ struct VideoInfo {
|
|||
bool IsRGB24() const { return (pixel_type&CS_BGR24)==CS_BGR24; } // Clear out additional properties
|
||||
bool IsRGB32() const { return (pixel_type & CS_BGR32) == CS_BGR32 ; }
|
||||
bool IsYUV() const { return !!(pixel_type&CS_YUV ); }
|
||||
bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; }
|
||||
bool IsYUY2() const { return (pixel_type & CS_YUY2) == CS_YUY2; }
|
||||
bool IsYV12() const { return ((pixel_type & CS_YV12) == CS_YV12)||((pixel_type & CS_I420) == CS_I420); }
|
||||
bool IsColorSpace(int c_space) const { return ((pixel_type & c_space) == c_space); }
|
||||
bool Is(int property) const { return ((pixel_type & property)==property ); }
|
||||
|
@ -173,8 +173,8 @@ struct VideoInfo {
|
|||
bool IsParityKnown() const { return ((image_type & IT_FIELDBASED)&&(image_type & (IT_BFF|IT_TFF))); }
|
||||
bool IsBFF() const { return !!(image_type & IT_BFF); }
|
||||
bool IsTFF() const { return !!(image_type & IT_TFF); }
|
||||
|
||||
bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this
|
||||
|
||||
bool IsVPlaneFirst() const {return ((pixel_type & CS_YV12) == CS_YV12); } // Don't use this
|
||||
int BytesFromPixels(int pixels) const { return pixels * (BitsPerPixel()>>3); } // Will not work on planar images, but will return only luma planes
|
||||
int RowSize() const { return BytesFromPixels(width); } // Also only returns first plane on planar images
|
||||
int BMPSize() const { if (IsPlanar()) {int p = height * ((RowSize()+3) & ~3); p+=p>>1; return p; } return height * ((RowSize()+3) & ~3); }
|
||||
|
@ -191,7 +191,7 @@ struct VideoInfo {
|
|||
void Set(int property) { image_type|=property; }
|
||||
void Clear(int property) { image_type&=~property; }
|
||||
|
||||
int BitsPerPixel() const {
|
||||
int BitsPerPixel() const {
|
||||
switch (pixel_type) {
|
||||
case CS_BGR24:
|
||||
return 24;
|
||||
|
@ -206,7 +206,7 @@ struct VideoInfo {
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
int BytesPerChannelSample() const {
|
||||
int BytesPerChannelSample() const {
|
||||
switch (sample_type) {
|
||||
case SAMPLE_INT8:
|
||||
return sizeof(signed char);
|
||||
|
@ -343,20 +343,20 @@ public:
|
|||
int GetPitch() const { return pitch; }
|
||||
int GetPitch(int plane) const { switch (plane) {case PLANAR_U: case PLANAR_V: return pitchUV;} return pitch; }
|
||||
int GetRowSize() const { return row_size; }
|
||||
int GetRowSize(int plane) const {
|
||||
int GetRowSize(int plane) const {
|
||||
switch (plane) {
|
||||
case PLANAR_U: case PLANAR_V: if (pitchUV) return row_size>>1; else return 0;
|
||||
case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED:
|
||||
if (pitchUV) {
|
||||
case PLANAR_U_ALIGNED: case PLANAR_V_ALIGNED:
|
||||
if (pitchUV) {
|
||||
int r = ((row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)) )>>1; // Aligned rowsize
|
||||
if (r<=pitchUV)
|
||||
return r;
|
||||
return row_size>>1;
|
||||
if (r<=pitchUV)
|
||||
return r;
|
||||
return row_size>>1;
|
||||
} else return 0;
|
||||
case PLANAR_Y_ALIGNED:
|
||||
int r = (row_size+FRAME_ALIGN-1)&(~(FRAME_ALIGN-1)); // Aligned rowsize
|
||||
if (r<=pitch)
|
||||
return r;
|
||||
if (r<=pitch)
|
||||
return r;
|
||||
return row_size;
|
||||
}
|
||||
return row_size; }
|
||||
|
@ -419,7 +419,7 @@ public:
|
|||
IClip() : refcnt(0) {}
|
||||
|
||||
virtual int __stdcall GetVersion() { return AVISYNTH_INTERFACE_VERSION; }
|
||||
|
||||
|
||||
virtual PVideoFrame __stdcall GetFrame(int n, IScriptEnvironment* env) = 0;
|
||||
virtual bool __stdcall GetParity(int n) = 0; // return field parity if field_based, else parity of first field in frame
|
||||
virtual void __stdcall GetAudio(void* buf, __int64 start, __int64 count, IScriptEnvironment* env) = 0; // start and count are in samples
|
||||
|
@ -529,8 +529,8 @@ public:
|
|||
|
||||
PClip AsClip() const { _ASSERTE(IsClip()); return IsClip()?clip:0; }
|
||||
bool AsBool() const { _ASSERTE(IsBool()); return boolean; }
|
||||
int AsInt() const { _ASSERTE(IsInt()); return integer; }
|
||||
// int AsLong() const { _ASSERTE(IsLong()); return longlong; }
|
||||
int AsInt() const { _ASSERTE(IsInt()); return integer; }
|
||||
// int AsLong() const { _ASSERTE(IsLong()); return longlong; }
|
||||
const char* AsString() const { _ASSERTE(IsString()); return IsString()?string:0; }
|
||||
double AsFloat() const { _ASSERTE(IsFloat()); return IsInt()?integer:floating_pt; }
|
||||
|
||||
|
@ -599,7 +599,7 @@ public:
|
|||
|
||||
/* Helper classes useful to plugin authors */
|
||||
|
||||
class AlignPlanar : public GenericVideoFilter
|
||||
class AlignPlanar : public GenericVideoFilter
|
||||
{
|
||||
public:
|
||||
AlignPlanar(PClip _clip);
|
||||
|
@ -609,7 +609,7 @@ public:
|
|||
|
||||
|
||||
|
||||
class FillBorder : public GenericVideoFilter
|
||||
class FillBorder : public GenericVideoFilter
|
||||
{
|
||||
public:
|
||||
FillBorder(PClip _clip);
|
||||
|
@ -619,7 +619,7 @@ public:
|
|||
|
||||
|
||||
|
||||
class ConvertAudio : public GenericVideoFilter
|
||||
class ConvertAudio : public GenericVideoFilter
|
||||
/**
|
||||
* Helper class to convert audio to any format
|
||||
**/
|
||||
|
@ -662,7 +662,7 @@ private:
|
|||
|
||||
|
||||
// For GetCPUFlags. These are backwards-compatible with those in VirtualDub.
|
||||
enum {
|
||||
enum {
|
||||
/* slowest CPU to support extension */
|
||||
CPUF_FORCE = 0x01, // N/A
|
||||
CPUF_FPU = 0x02, // 386/486DX
|
||||
|
|
|
@ -217,12 +217,12 @@ void hsv_to_rgb(int H, int S, int V, unsigned char *R, unsigned char *G, unsigne
|
|||
unsigned int q = v * (65535 - (f * s)/256) / 65536;
|
||||
unsigned int t = v * (65535 - ((255 - f) * s)/256) / 65536;
|
||||
switch (Hi) {
|
||||
case 0:
|
||||
case 0:
|
||||
r = v;
|
||||
g = t;
|
||||
b = p;
|
||||
break;
|
||||
case 1:
|
||||
case 1:
|
||||
r = q;
|
||||
g = v;
|
||||
b = p;
|
||||
|
|
|
@ -89,7 +89,7 @@ wxColour ColourButton::GetColour() {
|
|||
}
|
||||
|
||||
/// @brief Click handler
|
||||
/// @param event
|
||||
/// @param event
|
||||
void ColourButton::OnClick(wxCommandEvent &event) {
|
||||
if (event.GetClientData() != this)
|
||||
GetColorFromUser<ColourButton, &ColourButton::SetColour>(GetParent(), colour, this);
|
||||
|
|
|
@ -93,7 +93,7 @@ struct audio_open : public Command {
|
|||
|
||||
void operator()(agi::Context *c) {
|
||||
try {
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Audio")->GetString());
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Audio")->GetString());
|
||||
wxString str = _("Audio Formats") + " (*.aac,*.ac3,*.ape,*.dts,*.flac,*.m4a,*.mka,*.mp3,*.mp4,*.ogg,*.w64,*.wav,*.wma)|*.aac;*.ac3;*.ape;*.dts;*.flac;*.m4a;*.mka;*.mp3;*.mp4;*.ogg;*.w64;*.wav;*.wma|"
|
||||
+ _("Video Formats") + " (*.asf,*.avi,*.avs,*.d2v,*.m2ts,*.mkv,*.mov,*.mp4,*.mpeg,*.mpg,*.ogm,*.wmv,*.ts)|*.asf;*.avi;*.avs;*.d2v;*.m2ts;*.mkv;*.mov;*.mp4;*.mpeg;*.mpg;*.ogm;*.wmv;*.ts|"
|
||||
+ _("All Files") + " (*.*)|*.*";
|
||||
|
|
|
@ -125,7 +125,7 @@ struct recent_video_entry : public Command {
|
|||
};
|
||||
|
||||
/// @class mru_wrapper
|
||||
/// @brief Wrapper class for mru commands to
|
||||
/// @brief Wrapper class for mru commands to
|
||||
template<class T>
|
||||
class mru_wrapper : public T {
|
||||
int id;
|
||||
|
|
|
@ -259,7 +259,7 @@ struct subtitle_open : public Command {
|
|||
STR_HELP("Opens a subtitles file")
|
||||
|
||||
void operator()(agi::Context *c) {
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Subtitles")->GetString());
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Subtitles")->GetString());
|
||||
wxString filename = wxFileSelector(_("Open subtitles file"),path,"","",AssFile::GetWildcardList(0),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
if (!filename.empty()) {
|
||||
wxGetApp().frame->LoadSubtitles(filename);
|
||||
|
|
|
@ -95,9 +95,9 @@ static ResolutionShortcut resolutions[] = {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param parent
|
||||
/// @param out_filename
|
||||
/// @return
|
||||
/// @param parent
|
||||
/// @param out_filename
|
||||
/// @return
|
||||
///
|
||||
bool DialogDummyVideo::CreateDummyVideo(wxWindow *parent, wxString &out_filename)
|
||||
{
|
||||
|
@ -156,7 +156,7 @@ bool DialogDummyVideo::CreateDummyVideo(wxWindow *parent, wxString &out_filename
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param parent
|
||||
/// @param parent
|
||||
///
|
||||
DialogDummyVideo::DialogDummyVideo(wxWindow *parent)
|
||||
: wxDialog(parent, -1, _("Dummy video options"),wxDefaultPosition,wxDefaultSize)
|
||||
|
@ -254,7 +254,7 @@ END_EVENT_TABLE()
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param evt
|
||||
/// @param evt
|
||||
///
|
||||
void DialogDummyVideo::OnResolutionShortcut(wxCommandEvent &)
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ void DialogDummyVideo::OnResolutionShortcut(wxCommandEvent &)
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param evt
|
||||
/// @param evt
|
||||
///
|
||||
void DialogDummyVideo::OnFpsChange(wxCommandEvent &)
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ void DialogDummyVideo::OnFpsChange(wxCommandEvent &)
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param evt
|
||||
/// @param evt
|
||||
///
|
||||
void DialogDummyVideo::OnLengthSpin(wxSpinEvent &)
|
||||
{
|
||||
|
@ -286,7 +286,7 @@ void DialogDummyVideo::OnLengthSpin(wxSpinEvent &)
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param evt
|
||||
/// @param evt
|
||||
///
|
||||
void DialogDummyVideo::OnLengthChange(wxCommandEvent &)
|
||||
{
|
||||
|
@ -317,7 +317,7 @@ void DialogDummyVideo::UpdateLengthDisplay()
|
|||
ok_button->Enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!valid) {
|
||||
length_display->SetLabel(_("Invalid fps or length value"));
|
||||
ok_button->Disable();
|
||||
|
|
|
@ -285,7 +285,7 @@ void KaraokeLineMatchDisplay::OnPaint(wxPaintEvent &)
|
|||
// Matched destination text
|
||||
{
|
||||
int adv = DrawBoxedText(dc, grp.dst, next_x, y_line2);
|
||||
|
||||
|
||||
// Adjust next_x here while we have the text_w
|
||||
if (syl_x > next_x + adv)
|
||||
next_x = syl_x;
|
||||
|
|
|
@ -56,7 +56,7 @@ DialogPasteOver::DialogPasteOver(wxWindow *parent)
|
|||
// Label and list sizer
|
||||
wxSizer *ListSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Fields"));
|
||||
ListSizer->Add(new wxStaticText(this, -1, _("Please select the fields that you want to paste over:")), wxSizerFlags());
|
||||
|
||||
|
||||
// List box
|
||||
wxArrayString choices;
|
||||
choices.Add(_("Layer"));
|
||||
|
|
|
@ -191,7 +191,7 @@ void DialogSearchReplace::FindReplace(int mode) {
|
|||
else Search.ReplaceAll();
|
||||
config::mru->Add("Replace", STD_STR(ReplaceWith));
|
||||
}
|
||||
|
||||
|
||||
// Add to history
|
||||
config::mru->Add("Find", STD_STR(LookFor));
|
||||
UpdateDropDowns();
|
||||
|
@ -223,13 +223,13 @@ void SearchReplaceEngine::FindNext() {
|
|||
}
|
||||
|
||||
|
||||
/// @brief Find & Replace next instance
|
||||
/// @brief Find & Replace next instance
|
||||
void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
|
||||
if (!CanContinue) {
|
||||
OpenDialog(DoReplace);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
wxArrayInt sels = context->subsGrid->GetSelection();
|
||||
int firstLine = 0;
|
||||
if (sels.Count() > 0) firstLine = sels[0];
|
||||
|
|
|
@ -175,7 +175,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
|
|||
// Encoding options
|
||||
wxArrayString encodingStrings;
|
||||
AssStyle::GetEncodings(encodingStrings);
|
||||
|
||||
|
||||
// Create sizers
|
||||
wxSizer *NameSizer = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Style Name"));
|
||||
wxSizer *FontSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Font"));
|
||||
|
@ -337,7 +337,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
|
|||
PreviewText = new wxTextCtrl(this, -1, lagi_wxString(OPT_GET("Tool/Style Editor/Preview Text")->GetString()));
|
||||
previewButton = new ColourButton(this, -1, wxSize(45, 16), lagi_wxColour(OPT_GET("Colour/Style Editor/Background/Preview")->GetColour()));
|
||||
SubsPreview = new SubtitlesPreview(this, -1, wxDefaultPosition, wxSize(100, 60), wxSUNKEN_BORDER, lagi_wxColour(OPT_GET("Colour/Style Editor/Background/Preview")->GetColour()));
|
||||
|
||||
|
||||
SubsPreview->SetToolTip(_("Preview of current style"));
|
||||
SubsPreview->SetStyle(*style);
|
||||
SubsPreview->SetText(PreviewText->GetValue());
|
||||
|
@ -388,7 +388,7 @@ DialogStyleEditor::DialogStyleEditor(wxWindow *parent, AssStyle *style, agi::Con
|
|||
persist.reset(new PersistLocation(this, "Tool/Style Editor"));
|
||||
|
||||
Bind(wxEVT_CHILD_FOCUS, &DialogStyleEditor::OnChildFocus, this);
|
||||
|
||||
|
||||
if (PreviewText) {
|
||||
Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &DialogStyleEditor::OnCommandPreviewUpdate, this);
|
||||
Bind(wxEVT_COMMAND_COMBOBOX_SELECTED, &DialogStyleEditor::OnCommandPreviewUpdate, this);
|
||||
|
@ -483,7 +483,7 @@ void DialogStyleEditor::Apply(bool apply, bool close) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Update work style
|
||||
/// @brief Update work style
|
||||
void DialogStyleEditor::UpdateWorkStyle() {
|
||||
work->font = FontName->GetValue();
|
||||
FontSize->GetValue().ToDouble(&(work->fontsize));
|
||||
|
@ -520,7 +520,7 @@ void DialogStyleEditor::UpdateWorkStyle() {
|
|||
work->strikeout = BoxStrikeout->IsChecked();
|
||||
}
|
||||
|
||||
/// @brief Sets color for one of the four color buttons
|
||||
/// @brief Sets color for one of the four color buttons
|
||||
/// @param n Colour to set
|
||||
void DialogStyleEditor::OnSetColor (int n, wxCommandEvent& evt) {
|
||||
ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData());
|
||||
|
@ -554,7 +554,7 @@ void DialogStyleEditor::OnPreviewTextChange (wxCommandEvent &event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
/// @brief Change colour of preview's background
|
||||
/// @brief Change colour of preview's background
|
||||
void DialogStyleEditor::OnPreviewColourChange (wxCommandEvent &evt) {
|
||||
ColourButton *btn = static_cast<ColourButton*>(evt.GetClientData());
|
||||
if (!btn)
|
||||
|
@ -565,7 +565,7 @@ void DialogStyleEditor::OnPreviewColourChange (wxCommandEvent &evt) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Command event to update preview
|
||||
/// @brief Command event to update preview
|
||||
void DialogStyleEditor::OnCommandPreviewUpdate (wxCommandEvent &event) {
|
||||
if (!IsShownOnScreen()) return;
|
||||
UpdateWorkStyle();
|
||||
|
@ -573,7 +573,7 @@ void DialogStyleEditor::OnCommandPreviewUpdate (wxCommandEvent &event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
/// @brief Converts control value to alignment
|
||||
/// @brief Converts control value to alignment
|
||||
int DialogStyleEditor::ControlToAlign (int n) {
|
||||
switch (n) {
|
||||
case 0: return 7;
|
||||
|
@ -589,7 +589,7 @@ int DialogStyleEditor::ControlToAlign (int n) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Converts alignment value to control
|
||||
/// @brief Converts alignment value to control
|
||||
int DialogStyleEditor::AlignToControl (int n) {
|
||||
switch (n) {
|
||||
case 7: return 0;
|
||||
|
|
|
@ -438,7 +438,7 @@ void DialogStyleManager::OnCopyToCurrent() {
|
|||
for (int i = 0; i < n; i++) {
|
||||
wxString styleName = StorageList->GetString(selections[i]);
|
||||
bool addStyle = true;
|
||||
|
||||
|
||||
for (std::vector<AssStyle *>::iterator style = styleMap.begin(); style != styleMap.end(); ++style) {
|
||||
if ((*style)->name.CmpNoCase(styleName) == 0) {
|
||||
addStyle = false;
|
||||
|
@ -581,7 +581,7 @@ void DialogStyleManager::OnCurrentDelete() {
|
|||
|
||||
void DialogStyleManager::OnCurrentImport() {
|
||||
// Get file name
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Subtitles")->GetString());
|
||||
wxString path = lagi_wxString(OPT_GET("Path/Last/Subtitles")->GetString());
|
||||
wxString filename = wxFileSelector(_("Open subtitles file"),path,"","",AssFile::GetWildcardList(0),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
if (!filename) return;
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class AegisubVersionCheckResultEvent : public wxEvent {
|
|||
|
||||
public:
|
||||
AegisubVersionCheckResultEvent(wxString message = wxString());
|
||||
|
||||
|
||||
|
||||
wxEvent *Clone() const
|
||||
{
|
||||
|
@ -394,10 +394,10 @@ void AegisubVersionCheckerThread::DoCheck()
|
|||
else
|
||||
{
|
||||
// maybe interesting, check revision
|
||||
|
||||
|
||||
long new_revision = 0;
|
||||
if (!line_revision.ToLong(&new_revision)) continue;
|
||||
if (new_revision <= GetSVNRevision())
|
||||
if (new_revision <= GetSVNRevision())
|
||||
{
|
||||
// too old, not interesting, skip
|
||||
continue;
|
||||
|
|
|
@ -84,7 +84,7 @@ wxMutex FFmpegSourceProvider::CleaningInProgress;
|
|||
/// @brief Callback function that updates the indexing progress dialog
|
||||
/// @param Current The current file positition in bytes
|
||||
/// @param Total The total file size in bytes
|
||||
/// @param Private A pointer to the progress sink to update
|
||||
/// @param Private A pointer to the progress sink to update
|
||||
/// @return Returns non-0 if indexing is cancelled, 0 otherwise.
|
||||
///
|
||||
static int FFMS_CC UpdateIndexingProgress(int64_t Current, int64_t Total, void *Private) {
|
||||
|
@ -107,7 +107,7 @@ static void DoIndexingWrapper(FFMS_Index **Ret, FFMS_Indexer *Indexer, int Index
|
|||
/// @return Returns the index object on success, NULL otherwise
|
||||
///
|
||||
FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, const wxString &CacheName, int Trackmask, FFMS_IndexErrorHandling IndexEH) {
|
||||
char FFMSErrMsg[1024];
|
||||
char FFMSErrMsg[1024];
|
||||
FFMS_ErrorInfo ErrInfo;
|
||||
ErrInfo.Buffer = FFMSErrMsg;
|
||||
ErrInfo.BufferSize = sizeof(FFMSErrMsg);
|
||||
|
@ -139,7 +139,7 @@ FFMS_Index *FFmpegSourceProvider::DoIndexing(FFMS_Indexer *Indexer, const wxStri
|
|||
return Index;
|
||||
}
|
||||
|
||||
/// @brief Finds all tracks of the given type and return their track numbers and respective codec names
|
||||
/// @brief Finds all tracks of the given type and return their track numbers and respective codec names
|
||||
/// @param Indexer The indexer object representing the source file
|
||||
/// @param Type The track type to look for
|
||||
/// @return Returns a std::map with the track numbers as keys and the codec names as values.
|
||||
|
@ -156,19 +156,19 @@ std::map<int,wxString> FFmpegSourceProvider::GetTracksOfType(FFMS_Indexer *Index
|
|||
return TrackList;
|
||||
}
|
||||
|
||||
/// @brief Ask user for which track he wants to load
|
||||
/// @brief Ask user for which track he wants to load
|
||||
/// @param TrackList A std::map with the track numbers as keys and codec names as values
|
||||
/// @param Type The track type to ask about
|
||||
/// @return Returns the track number chosen (an integer >= 0) on success, or a negative integer if the user cancelled.
|
||||
int FFmpegSourceProvider::AskForTrackSelection(const std::map<int,wxString> &TrackList, FFMS_TrackType Type) {
|
||||
std::vector<int> TrackNumbers;
|
||||
wxArrayString Choices;
|
||||
|
||||
|
||||
for (std::map<int,wxString>::const_iterator i = TrackList.begin(); i != TrackList.end(); i++) {
|
||||
Choices.Add(wxString::Format(_("Track %02d: %s"), i->first, i->second));
|
||||
TrackNumbers.push_back(i->first);
|
||||
}
|
||||
|
||||
|
||||
int Choice = wxGetSingleChoiceIndex(
|
||||
Type == FFMS_TYPE_VIDEO ? _("Multiple video tracks detected, please choose the one you wish to load:") : _("Multiple audio tracks detected, please choose the one you wish to load:"),
|
||||
Type == FFMS_TYPE_VIDEO ? _("Choose video track") : _("Choose audio track"),
|
||||
|
@ -182,7 +182,7 @@ int FFmpegSourceProvider::AskForTrackSelection(const std::map<int,wxString> &Tra
|
|||
|
||||
|
||||
|
||||
/// @brief Set ffms2 log level according to setting in config.dat
|
||||
/// @brief Set ffms2 log level according to setting in config.dat
|
||||
void FFmpegSourceProvider::SetLogLevel() {
|
||||
wxString LogLevel = lagi_wxString(OPT_GET("Provider/FFmpegSource/Log Level")->GetString());
|
||||
|
||||
|
@ -221,7 +221,7 @@ FFMS_IndexErrorHandling FFmpegSourceProvider::GetErrorHandlingMode() {
|
|||
}
|
||||
|
||||
#include <inttypes.h>
|
||||
/// @brief Generates an unique name for the ffms2 index file and prepares the cache folder if it doesn't exist
|
||||
/// @brief Generates an unique name for the ffms2 index file and prepares the cache folder if it doesn't exist
|
||||
/// @param filename The name of the source file
|
||||
/// @return Returns the generated filename.
|
||||
wxString FFmpegSourceProvider::GetCacheFilename(const wxString& _filename)
|
||||
|
@ -290,7 +290,7 @@ bool FFmpegSourceProvider::CleanCache() {
|
|||
|
||||
|
||||
|
||||
/// @brief constructor
|
||||
/// @brief constructor
|
||||
/// @param par the parent provider
|
||||
FFmpegSourceCacheCleaner::FFmpegSourceCacheCleaner(FFmpegSourceProvider *par) : wxThread(wxTHREAD_DETACHED) {
|
||||
parent = par;
|
||||
|
@ -326,7 +326,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() {
|
|||
LOG_D("provider/ffmpegsource/cache") << "no index files in cache folder, exiting";
|
||||
return (wxThread::ExitCode)0;
|
||||
}
|
||||
|
||||
|
||||
int deleted = 0;
|
||||
int numfiles = 0;
|
||||
std::multimap<int64_t,wxFileName> cachefiles;
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
};
|
||||
|
||||
/// @class FFmpegSourceCacheCleaner
|
||||
/// @brief Implements index cache cleaning functionality for the FFMS2 providers
|
||||
/// @brief Implements index cache cleaning functionality for the FFMS2 providers
|
||||
class FFmpegSourceCacheCleaner : public wxThread {
|
||||
FFmpegSourceProvider *parent;
|
||||
|
||||
|
|
|
@ -48,12 +48,12 @@
|
|||
#include "fft.h"
|
||||
|
||||
|
||||
/// @brief Transform
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
/// @param inverse
|
||||
/// @brief Transform
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
/// @param inverse
|
||||
///
|
||||
void FFT::DoTransform (size_t n_samples,float *input,float *output_r,float *output_i,bool inverse) {
|
||||
// Check if it's power of two
|
||||
|
@ -136,11 +136,11 @@ void FFT::DoTransform (size_t n_samples,float *input,float *output_r,float *outp
|
|||
|
||||
|
||||
|
||||
/// @brief Transform wrappers
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
/// @brief Transform wrappers
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
///
|
||||
void FFT::Transform(size_t n_samples,float *input,float *output_r,float *output_i) {
|
||||
DoTransform(n_samples,input,output_r,output_i,false);
|
||||
|
@ -148,10 +148,10 @@ void FFT::Transform(size_t n_samples,float *input,float *output_r,float *output_
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
/// @param n_samples
|
||||
/// @param input
|
||||
/// @param output_r
|
||||
/// @param output_i
|
||||
///
|
||||
void FFT::InverseTransform(size_t n_samples,float *input,float *output_r,float *output_i) {
|
||||
DoTransform(n_samples,input,output_r,output_i,true);
|
||||
|
@ -159,9 +159,9 @@ void FFT::InverseTransform(size_t n_samples,float *input,float *output_r,float *
|
|||
|
||||
|
||||
|
||||
/// @brief Checks if number is a power of two
|
||||
/// @param x
|
||||
/// @return
|
||||
/// @brief Checks if number is a power of two
|
||||
/// @param x
|
||||
/// @return
|
||||
///
|
||||
bool FFT::IsPowerOfTwo (unsigned int x) {
|
||||
if (x < 2) return false;
|
||||
|
@ -171,9 +171,9 @@ bool FFT::IsPowerOfTwo (unsigned int x) {
|
|||
|
||||
|
||||
|
||||
/// @brief Bits needed by the FFT
|
||||
/// @param n_samples
|
||||
/// @return
|
||||
/// @brief Bits needed by the FFT
|
||||
/// @param n_samples
|
||||
/// @return
|
||||
///
|
||||
unsigned int FFT::NumberOfBitsNeeded (unsigned int n_samples) {
|
||||
int i;
|
||||
|
@ -189,10 +189,10 @@ unsigned int FFT::NumberOfBitsNeeded (unsigned int n_samples) {
|
|||
|
||||
|
||||
|
||||
/// @brief Get reversed bit position
|
||||
/// @param index
|
||||
/// @param bits
|
||||
/// @return
|
||||
/// @brief Get reversed bit position
|
||||
/// @param index
|
||||
/// @param bits
|
||||
/// @return
|
||||
///
|
||||
unsigned int FFT::ReverseBits (unsigned int index, unsigned int bits) {
|
||||
unsigned int i, rev;
|
||||
|
@ -207,10 +207,10 @@ unsigned int FFT::ReverseBits (unsigned int index, unsigned int bits) {
|
|||
|
||||
|
||||
|
||||
/// @brief Get frequency at index
|
||||
/// @param baseFreq
|
||||
/// @param n_samples
|
||||
/// @param index
|
||||
/// @brief Get frequency at index
|
||||
/// @param baseFreq
|
||||
/// @param n_samples
|
||||
/// @param index
|
||||
///
|
||||
float FFT::FrequencyAtIndex (unsigned int baseFreq, unsigned int n_samples, unsigned int index) {
|
||||
if (index >= n_samples) return 0.0;
|
||||
|
|
|
@ -169,7 +169,7 @@ FrameMain::FrameMain (wxArrayString args)
|
|||
|
||||
StartupLog("Initialize menu bar");
|
||||
menu::GetMenuBar("main", this, context.get());
|
||||
|
||||
|
||||
StartupLog("Create status bar");
|
||||
CreateStatusBar(2);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ extern "C" {
|
|||
|
||||
/*
|
||||
** Copyright (c) 2007-2010 The Khronos Group Inc.
|
||||
**
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
|
@ -15,10 +15,10 @@ extern "C" {
|
|||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
|
|
|
@ -241,9 +241,9 @@ OpenGLTextGlyph const& OpenGLText::CreateGlyph(int n) {
|
|||
return glyph;
|
||||
}
|
||||
|
||||
/// @brief Texture constructor
|
||||
/// @param w
|
||||
/// @param h
|
||||
/// @brief Texture constructor
|
||||
/// @param w
|
||||
/// @param h
|
||||
OpenGLTextTexture::OpenGLTextTexture(OpenGLTextGlyph &glyph) {
|
||||
x = y = nextY = 0;
|
||||
width = std::max(SmallestPowerOf2(glyph.w), 64);
|
||||
|
@ -272,9 +272,9 @@ OpenGLTextTexture::~OpenGLTextTexture() {
|
|||
if (tex) glDeleteTextures(1, &tex);
|
||||
}
|
||||
|
||||
/// @brief Can fit a glyph in it?
|
||||
/// @param glyph
|
||||
/// @return
|
||||
/// @brief Can fit a glyph in it?
|
||||
/// @param glyph
|
||||
/// @return
|
||||
bool OpenGLTextTexture::TryToInsert(OpenGLTextGlyph &glyph) {
|
||||
int w = glyph.w;
|
||||
int h = glyph.h;
|
||||
|
@ -301,8 +301,8 @@ bool OpenGLTextTexture::TryToInsert(OpenGLTextGlyph &glyph) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Insert
|
||||
/// @param glyph
|
||||
/// @brief Insert
|
||||
/// @param glyph
|
||||
void OpenGLTextTexture::Insert(OpenGLTextGlyph &glyph) {
|
||||
int w = glyph.w;
|
||||
int h = glyph.h;
|
||||
|
|
|
@ -178,7 +178,7 @@ void OpenGLWrapper::DrawRing(Vector2D center, float r1, float r2, float ar, floa
|
|||
|
||||
// Arc range
|
||||
bool needs_end_caps = arc_start != arc_end;
|
||||
|
||||
|
||||
arc_end *= deg2rad;
|
||||
arc_start *= deg2rad;
|
||||
if (arc_end <= arc_start)
|
||||
|
|
|
@ -54,14 +54,14 @@ public:
|
|||
virtual ~SpellChecker() {}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param word
|
||||
/// @return
|
||||
/// @param word
|
||||
/// @return
|
||||
///
|
||||
virtual void AddWord(wxString word) {}
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param word
|
||||
/// @return
|
||||
/// @param word
|
||||
/// @return
|
||||
///
|
||||
virtual bool CanAddWord(wxString word) { return false; }
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ public:
|
|||
virtual void LoadSubtitles(AssFile *subs)=0;
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param dst
|
||||
/// @param time
|
||||
/// @param dst
|
||||
/// @param time
|
||||
///
|
||||
virtual void DrawSubtitles(AegiVideoFrame &dst,double time)=0;
|
||||
};
|
||||
|
|
|
@ -282,8 +282,8 @@ bool AegisubApp::OnInit() {
|
|||
|
||||
|
||||
|
||||
/// @brief Exit
|
||||
/// @return
|
||||
/// @brief Exit
|
||||
/// @return
|
||||
///
|
||||
int AegisubApp::OnExit() {
|
||||
if (wxTheClipboard->Open()) {
|
||||
|
@ -456,8 +456,8 @@ StackWalker::~StackWalker() {
|
|||
#endif
|
||||
|
||||
|
||||
/// @brief Call main loop
|
||||
/// @return
|
||||
/// @brief Call main loop
|
||||
/// @return
|
||||
///
|
||||
int AegisubApp::OnRun() {
|
||||
wxString error;
|
||||
|
@ -513,7 +513,7 @@ int AegisubApp::FilterEvent(wxEvent& event) {
|
|||
#ifdef __WXMAC__
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param filename
|
||||
/// @param filename
|
||||
///
|
||||
void AegisubApp::MacOpenFile(const wxString &filename) {
|
||||
if (frame != NULL && !filename.empty()) {
|
||||
|
|
|
@ -71,7 +71,7 @@ typedef struct md5_state_s {
|
|||
} md5_state_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ void MatroskaWrapper::GetSubtitles(wxString const& filename, AssFile *target) {
|
|||
wxString CodecID = wxString(trackInfo->CodecID,*wxConvCurrent);
|
||||
wxString TrackName = wxString(trackInfo->Name,*wxConvCurrent);
|
||||
wxString TrackLanguage = wxString(trackInfo->Language,*wxConvCurrent);
|
||||
|
||||
|
||||
// Known subtitle format
|
||||
if (CodecID == "S_TEXT/SSA" || CodecID == "S_TEXT/ASS" || CodecID == "S_TEXT/UTF8") {
|
||||
tracksFound.push_back(track);
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006 Alexander Chemeris
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||
//
|
||||
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are met:
|
||||
//
|
||||
//
|
||||
// 1. Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
//
|
||||
//
|
||||
// 2. Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
//
|
||||
// 3. The name of the author may be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MSC_VER // [
|
||||
|
@ -47,7 +47,7 @@
|
|||
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
extern "C++" {
|
||||
#endif
|
||||
#endif
|
||||
# include <wchar.h>
|
||||
#if (_MSC_VER < 1300) && defined(__cplusplus)
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ PluginManager::PluginManager() {
|
|||
#ifdef WITH_AUTO4_LUA
|
||||
lua = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
PluginManager::~PluginManager() {
|
||||
|
@ -68,7 +68,7 @@ PluginManager::~PluginManager() {
|
|||
#endif
|
||||
}
|
||||
|
||||
/// @brief Registers all built-in plugins
|
||||
/// @brief Registers all built-in plugins
|
||||
void PluginManager::RegisterBuiltInPlugins() {
|
||||
if (!init) {
|
||||
// Managers
|
||||
|
|
|
@ -45,12 +45,12 @@ ScintillaTextCtrl::ScintillaTextCtrl(wxWindow* parent, wxWindowID id, const wxSt
|
|||
Bind(wxEVT_MOUSEWHEEL, &ScintillaTextCtrl::OnMouseWheel, this);
|
||||
}
|
||||
|
||||
/// @brief Get unicode-compatible position
|
||||
/// @brief Get unicode-compatible position
|
||||
int ScintillaTextCtrl::GetUnicodePosition(int pos) {
|
||||
return GetText().Left(pos).utf8_str().length();
|
||||
}
|
||||
|
||||
/// @brief Reverse unicode-compatible position
|
||||
/// @brief Reverse unicode-compatible position
|
||||
int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) {
|
||||
wxCharBuffer buffer = GetText().utf8_str();
|
||||
|
||||
|
@ -68,14 +68,14 @@ int ScintillaTextCtrl::GetReverseUnicodePosition(int pos) {
|
|||
return buf3.Length();
|
||||
}
|
||||
|
||||
/// @brief Start unicode-safe styling
|
||||
/// @brief Start unicode-safe styling
|
||||
void ScintillaTextCtrl::StartUnicodeStyling(int start,int mask) {
|
||||
StartStyling(GetUnicodePosition(start),mask);
|
||||
// Cache the text for styling as GetText is hideously slow
|
||||
text = GetText();
|
||||
}
|
||||
|
||||
/// @brief Unicode-safe styling
|
||||
/// @brief Unicode-safe styling
|
||||
void ScintillaTextCtrl::SetUnicodeStyling(int start,int length,int style) {
|
||||
// Get the real length
|
||||
int len = text.Mid(start, length).utf8_str().length();
|
||||
|
@ -84,7 +84,7 @@ void ScintillaTextCtrl::SetUnicodeStyling(int start,int length,int style) {
|
|||
SetStyling(len,style);
|
||||
}
|
||||
|
||||
/// @brief Get boundaries of word at position
|
||||
/// @brief Get boundaries of word at position
|
||||
void ScintillaTextCtrl::GetBoundsOfWordAtPosition(int pos,int &start,int &end) {
|
||||
IntPairVector results;
|
||||
GetWordBoundaries(GetText(), results);
|
||||
|
@ -103,14 +103,14 @@ void ScintillaTextCtrl::GetBoundsOfWordAtPosition(int pos,int &start,int &end) {
|
|||
end = 0;
|
||||
}
|
||||
|
||||
/// @brief Get word at specified position
|
||||
/// @brief Get word at specified position
|
||||
wxString ScintillaTextCtrl::GetWordAtPosition(int pos) {
|
||||
int start,end;
|
||||
GetBoundsOfWordAtPosition(pos, start, end);
|
||||
return GetText().Mid(start, end - start);
|
||||
}
|
||||
|
||||
/// @brief Set selection, unicode-aware
|
||||
/// @brief Set selection, unicode-aware
|
||||
void ScintillaTextCtrl::SetSelectionU(int start, int end) {
|
||||
SetSelection(GetUnicodePosition(start),GetUnicodePosition(end));
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
///
|
||||
/// This method must not affect the selected set.
|
||||
virtual void SetActiveLine(ItemDataType *new_line) = 0;
|
||||
|
||||
|
||||
/// @brief Obtain the active line
|
||||
/// @return The active line or NULL if there is none
|
||||
virtual ItemDataType * GetActiveLine() const = 0;
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
#include "include/aegisub/spellchecker.h"
|
||||
#include "main.h"
|
||||
|
||||
/// @brief Get spell checker
|
||||
/// @return
|
||||
/// @brief Get spell checker
|
||||
/// @return
|
||||
///
|
||||
SpellChecker *SpellCheckerFactory::GetSpellChecker() {
|
||||
// List of providers
|
||||
|
@ -68,7 +68,7 @@ SpellChecker *SpellCheckerFactory::GetSpellChecker() {
|
|||
throw error;
|
||||
}
|
||||
|
||||
/// @brief Register all providers
|
||||
/// @brief Register all providers
|
||||
///
|
||||
void SpellCheckerFactory::RegisterProviders() {
|
||||
#ifdef WITH_HUNSPELL
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
///
|
||||
/// DOCME
|
||||
class SplineCurve {
|
||||
/// Closest t in segment p1-p2 to point p3
|
||||
/// Closest t in segment p1-p2 to point p3
|
||||
float GetClosestSegmentPart(Vector2D p1, Vector2D p2, Vector2D p3) const;
|
||||
|
||||
/// Closest distance between p3 and segment p1-p2
|
||||
|
|
|
@ -42,8 +42,8 @@
|
|||
#include "string_codec.h"
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param input
|
||||
/// @return
|
||||
/// @param input
|
||||
/// @return
|
||||
///
|
||||
wxString inline_string_encode(const wxString &input)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ wxString inline_string_encode(const wxString &input)
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param input
|
||||
/// @param input
|
||||
///
|
||||
wxString inline_string_decode(const wxString &input)
|
||||
{
|
||||
|
|
|
@ -434,7 +434,7 @@ void SubsTextEditCtrl::UpdateStyle() {
|
|||
StyleSpellCheck();
|
||||
}
|
||||
|
||||
/// @brief Update call tip
|
||||
/// @brief Update call tip
|
||||
void SubsTextEditCtrl::UpdateCallTip(wxStyledTextEvent &) {
|
||||
UpdateStyle();
|
||||
|
||||
|
@ -473,7 +473,7 @@ void SubsTextEditCtrl::UpdateCallTip(wxStyledTextEvent &) {
|
|||
if (i == pos) break;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Inside overrides
|
||||
if (depth == 1) {
|
||||
// Inner depth
|
||||
|
@ -547,7 +547,7 @@ void SubsTextEditCtrl::UpdateCallTip(wxStyledTextEvent &) {
|
|||
|
||||
// Tag name
|
||||
if (parN == 1 && !gotName) {
|
||||
tagName = tag.Left(i);
|
||||
tagName = tag.Left(i);
|
||||
gotName = true;
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@ void SubsTextEditCtrl::UpdateCallTip(wxStyledTextEvent &) {
|
|||
div = proto[i].Find('(');
|
||||
protoName = proto[i].Left(div);
|
||||
}
|
||||
|
||||
|
||||
// Fix name
|
||||
semiProto = false;
|
||||
cleanProto = proto[i];
|
||||
|
@ -669,7 +669,7 @@ void SubsTextEditCtrl::StyleSpellCheck() {
|
|||
SetUnicodeStyling(s,e-s,32);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// It seems like wxStyledTextCtrl wants you to finish styling at the end of the text.
|
||||
// I don't really understand why, it's not documented anywhere I can find, but this fixes bug #595.
|
||||
StartUnicodeStyling(text.Length(), 0);
|
||||
|
|
|
@ -74,7 +74,7 @@ static void expand_times(AssDialogue *src, AssDialogue *dst) {
|
|||
dst->End = std::max(dst->End, src->End);
|
||||
}
|
||||
|
||||
/// @brief Recombine
|
||||
/// @brief Recombine
|
||||
void SubtitlesGrid::RecombineLines() {
|
||||
using namespace std;
|
||||
|
||||
|
@ -158,11 +158,11 @@ void SubtitlesGrid::RecombineLines() {
|
|||
context->ass->Commit(_("combining"), AssFile::COMMIT_DIAG_ADDREM | AssFile::COMMIT_DIAG_FULL);
|
||||
}
|
||||
|
||||
/// @brief Insert a line
|
||||
/// @param line
|
||||
/// @param n
|
||||
/// @param after
|
||||
/// @param update
|
||||
/// @brief Insert a line
|
||||
/// @param line
|
||||
/// @param n
|
||||
/// @param after
|
||||
/// @param update
|
||||
void SubtitlesGrid::InsertLine(AssDialogue *line,int n,bool after,bool update) {
|
||||
AssDialogue *rel_line = GetDialogue(n);
|
||||
entryIter pos = std::find(context->ass->Line.begin(), context->ass->Line.end(), rel_line);
|
||||
|
@ -207,8 +207,8 @@ void SubtitlesGrid::CutLines(wxArrayInt target) {
|
|||
}
|
||||
|
||||
/// @brief Paste lines from clipboard
|
||||
/// @param n
|
||||
/// @param pasteOver
|
||||
/// @param n
|
||||
/// @param pasteOver
|
||||
void SubtitlesGrid::PasteLines(int n,bool pasteOver) {
|
||||
BeginBatch();
|
||||
|
||||
|
@ -237,7 +237,7 @@ void SubtitlesGrid::PasteLines(int n,bool pasteOver) {
|
|||
curdata.Trim(true);
|
||||
curdata.Trim(false);
|
||||
AssDialogue *curdiag;
|
||||
try {
|
||||
try {
|
||||
// Try to interpret the line as an ASS line
|
||||
curdiag = new AssDialogue(curdata);
|
||||
}
|
||||
|
@ -375,7 +375,7 @@ void SubtitlesGrid::AdjoinLines(int n1,int n2,bool setStart) {
|
|||
}
|
||||
|
||||
/// @brief Retrieve a list of selected lines in the actual ASS file (ie. not as displayed in the grid but as represented in the file)
|
||||
/// @return
|
||||
/// @return
|
||||
///
|
||||
std::vector<int> SubtitlesGrid::GetAbsoluteSelection() const {
|
||||
Selection sel = GetSelectedSet();
|
||||
|
@ -393,7 +393,7 @@ std::vector<int> SubtitlesGrid::GetAbsoluteSelection() const {
|
|||
}
|
||||
|
||||
/// @brief Update list of selected lines from absolute selection
|
||||
/// @param selection
|
||||
/// @param selection
|
||||
///
|
||||
void SubtitlesGrid::SetSelectionFromAbsolute(std::vector<int> &selection) {
|
||||
Selection newsel;
|
||||
|
@ -402,7 +402,7 @@ void SubtitlesGrid::SetSelectionFromAbsolute(std::vector<int> &selection) {
|
|||
|
||||
int i = 0;
|
||||
std::list<AssEntry*>::iterator j = context->ass->Line.begin();
|
||||
|
||||
|
||||
for (size_t selveci = 0; selveci < selection.size(); ++selveci) {
|
||||
while (i != selection[selveci] && j != context->ass->Line.end()) ++i, ++j;
|
||||
if (j == context->ass->Line.end()) break; /// @todo Report error somehow
|
||||
|
|
|
@ -51,13 +51,13 @@
|
|||
#include "video_provider_dummy.h"
|
||||
|
||||
|
||||
/// @brief Constructor
|
||||
/// @param parent
|
||||
/// @param id
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param winStyle
|
||||
/// @param col
|
||||
/// @brief Constructor
|
||||
/// @param parent
|
||||
/// @param id
|
||||
/// @param pos
|
||||
/// @param size
|
||||
/// @param winStyle
|
||||
/// @param col
|
||||
///
|
||||
SubtitlesPreview::SubtitlesPreview(wxWindow *parent,int id,wxPoint pos,wxSize size,int winStyle,wxColour col)
|
||||
: wxWindow(parent,id,pos,size,winStyle)
|
||||
|
|
|
@ -75,11 +75,11 @@ bool SubtitleFormat::CanWriteFile(wxString const& filename) const {
|
|||
return GetWriteWildcards().Index(filename.AfterLast('.'), false) != wxNOT_FOUND;
|
||||
}
|
||||
|
||||
/// @brief Ask the user to enter the FPS
|
||||
/// @brief Ask the user to enter the FPS
|
||||
FractionalTime SubtitleFormat::AskForFPS(bool showSMPTE) const {
|
||||
wxArrayString choices;
|
||||
bool drop = false;
|
||||
|
||||
|
||||
// Video FPS
|
||||
VideoContext *context = VideoContext::Get();
|
||||
bool vidLoaded = context->TimecodesLoaded();
|
||||
|
@ -91,7 +91,7 @@ FractionalTime SubtitleFormat::AskForFPS(bool showSMPTE) const {
|
|||
vidFPS = wxString::Format("%.3f", context->FPS().FPS());
|
||||
choices.Add(wxString::Format(_("From video (%s)"), vidFPS));
|
||||
}
|
||||
|
||||
|
||||
// Standard FPS values
|
||||
choices.Add(_("15.000 FPS"));
|
||||
choices.Add(_("23.976 FPS (Decimated NTSC)"));
|
||||
|
@ -187,7 +187,7 @@ static bool dialog_start_lt(AssEntry *pos, AssDialogue *to_insert) {
|
|||
return diag && diag->Start > to_insert->Start;
|
||||
}
|
||||
|
||||
/// @brief Split and merge lines so there are no overlapping lines
|
||||
/// @brief Split and merge lines so there are no overlapping lines
|
||||
///
|
||||
/// Algorithm described at http://devel.aegisub.org/wiki/Technical/SplitMerge
|
||||
void SubtitleFormat::RecombineOverlaps(LineList &lines) const {
|
||||
|
@ -261,20 +261,20 @@ void SubtitleFormat::RecombineOverlaps(LineList &lines) const {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Merge identical lines that follow each other
|
||||
/// @brief Merge identical lines that follow each other
|
||||
void SubtitleFormat::MergeIdentical(LineList &lines) const {
|
||||
LineList::iterator cur, next = lines.begin();
|
||||
cur = next++;
|
||||
|
||||
|
||||
for (; next != lines.end(); cur = next++) {
|
||||
AssDialogue *curdlg = dynamic_cast<AssDialogue*>(*cur);
|
||||
AssDialogue *nextdlg = dynamic_cast<AssDialogue*>(*next);
|
||||
|
||||
|
||||
if (curdlg && nextdlg && curdlg->End == nextdlg->Start && curdlg->Text == nextdlg->Text) {
|
||||
// Merge timing
|
||||
nextdlg->Start = std::min(nextdlg->Start, curdlg->Start);
|
||||
nextdlg->End = std::max(nextdlg->End, curdlg->End);
|
||||
|
||||
|
||||
// Remove duplicate line
|
||||
delete *cur;
|
||||
lines.erase(cur);
|
||||
|
|
|
@ -61,7 +61,7 @@ class SrtTagParser {
|
|||
};
|
||||
|
||||
enum TagType {
|
||||
// leave 0 unused so indexing an unknown tag in the map won't clash
|
||||
// leave 0 unused so indexing an unknown tag in the map won't clash
|
||||
TAG_BOLD_OPEN = 1,
|
||||
TAG_BOLD_CLOSE,
|
||||
TAG_ITALICS_OPEN,
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
#include "include/aegisub/subtitles_provider.h"
|
||||
#endif
|
||||
|
||||
/// @brief Get provider
|
||||
/// @return
|
||||
/// @brief Get provider
|
||||
/// @return
|
||||
///
|
||||
SubtitlesProvider* SubtitlesProviderFactory::GetProvider() {
|
||||
std::vector<std::string> list = GetClasses(OPT_GET("Subtitle/Provider")->GetString());
|
||||
|
@ -74,7 +74,7 @@ SubtitlesProvider* SubtitlesProviderFactory::GetProvider() {
|
|||
throw error;
|
||||
}
|
||||
|
||||
/// @brief Register providers
|
||||
/// @brief Register providers
|
||||
///
|
||||
void SubtitlesProviderFactory::RegisterProviders() {
|
||||
#ifdef WITH_CSRI
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param filename
|
||||
/// @param encoding
|
||||
/// @param filename
|
||||
/// @param encoding
|
||||
///
|
||||
TextFileWriter::TextFileWriter(wxString const& filename, wxString encoding)
|
||||
: file(new agi::io::Save(STD_STR(filename), true))
|
||||
|
@ -77,8 +77,8 @@ TextFileWriter::~TextFileWriter() {
|
|||
|
||||
|
||||
/// @brief DOCME
|
||||
/// @param line
|
||||
/// @param addLineBreak
|
||||
/// @param line
|
||||
/// @param addLineBreak
|
||||
void TextFileWriter::WriteLineToFile(wxString line, bool addLineBreak) {
|
||||
#ifdef _WIN32
|
||||
if (addLineBreak) line += "\r\n";
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include "main.h"
|
||||
#include "video_context.h"
|
||||
|
||||
#define TimeEditWindowStyle
|
||||
#define TimeEditWindowStyle
|
||||
|
||||
enum {
|
||||
Time_Edit_Copy = 1320,
|
||||
|
|
|
@ -64,9 +64,9 @@
|
|||
|
||||
#ifndef __LINUX__
|
||||
|
||||
/// @brief Absolute of 64 bit int
|
||||
/// @param input
|
||||
/// @return
|
||||
/// @brief Absolute of 64 bit int
|
||||
/// @param input
|
||||
/// @return
|
||||
///
|
||||
int64_t abs64(int64_t input) {
|
||||
if (input < 0) return -input;
|
||||
|
@ -76,10 +76,10 @@ int64_t abs64(int64_t input) {
|
|||
|
||||
|
||||
|
||||
/// @brief Count number of matches of a substr
|
||||
/// @param parent
|
||||
/// @param child
|
||||
/// @return
|
||||
/// @brief Count number of matches of a substr
|
||||
/// @param parent
|
||||
/// @param child
|
||||
/// @return
|
||||
///
|
||||
int CountMatches(wxString parent,wxString child) {
|
||||
size_t pos = wxString::npos;
|
||||
|
@ -90,10 +90,10 @@ int CountMatches(wxString parent,wxString child) {
|
|||
|
||||
|
||||
|
||||
/// @brief Make a path relative to reference
|
||||
/// @param _path
|
||||
/// @param reference
|
||||
/// @return
|
||||
/// @brief Make a path relative to reference
|
||||
/// @param _path
|
||||
/// @param reference
|
||||
/// @return
|
||||
///
|
||||
wxString MakeRelativePath(wxString _path,wxString reference) {
|
||||
if (_path.IsEmpty()) return "";
|
||||
|
@ -106,10 +106,10 @@ wxString MakeRelativePath(wxString _path,wxString reference) {
|
|||
|
||||
|
||||
|
||||
/// @brief Extract original path from relative
|
||||
/// @param _path
|
||||
/// @param reference
|
||||
/// @return
|
||||
/// @brief Extract original path from relative
|
||||
/// @param _path
|
||||
/// @param reference
|
||||
/// @return
|
||||
///
|
||||
wxString DecodeRelativePath(wxString _path,wxString reference) {
|
||||
if (_path.IsEmpty()) return "";
|
||||
|
@ -125,25 +125,25 @@ wxString DecodeRelativePath(wxString _path,wxString reference) {
|
|||
#endif
|
||||
}
|
||||
|
||||
/// @brief Float to string
|
||||
/// @param value
|
||||
/// @return
|
||||
/// @brief Float to string
|
||||
/// @param value
|
||||
/// @return
|
||||
///
|
||||
wxString AegiFloatToString(double value) {
|
||||
return wxString::Format("%g",value);
|
||||
}
|
||||
|
||||
/// @brief Int to string
|
||||
/// @param value
|
||||
/// @return
|
||||
/// @brief Int to string
|
||||
/// @param value
|
||||
/// @return
|
||||
///
|
||||
wxString AegiIntegerToString(int value) {
|
||||
return wxString::Format("%i",value);
|
||||
}
|
||||
|
||||
/// @brief There shall be no kiB, MiB stuff here Pretty reading of size
|
||||
/// @param bytes
|
||||
/// @return
|
||||
/// @brief There shall be no kiB, MiB stuff here Pretty reading of size
|
||||
/// @param bytes
|
||||
/// @return
|
||||
///
|
||||
wxString PrettySize(int bytes) {
|
||||
// Suffixes
|
||||
|
@ -166,7 +166,7 @@ wxString PrettySize(int bytes) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Set number of decimal places
|
||||
wxString final;
|
||||
if (size < 10) final = wxString::Format("%.2f",size);
|
||||
|
@ -177,9 +177,9 @@ wxString PrettySize(int bytes) {
|
|||
|
||||
|
||||
|
||||
/// @brief Code from http://bob.allegronetwork.com/prog/tricks.html Get the smallest power of two that is greater or equal to x
|
||||
/// @param x
|
||||
/// @return
|
||||
/// @brief Code from http://bob.allegronetwork.com/prog/tricks.html Get the smallest power of two that is greater or equal to x
|
||||
/// @param x
|
||||
/// @return
|
||||
///
|
||||
int SmallestPowerOf2(int x) {
|
||||
x--;
|
||||
|
@ -267,9 +267,9 @@ void GetWordBoundaries(const wxString text, IntPairVector &results, int start, i
|
|||
|
||||
|
||||
|
||||
/// @brief Determine whether wchar 'c' is a whitespace character
|
||||
/// @param c
|
||||
/// @return
|
||||
/// @brief Determine whether wchar 'c' is a whitespace character
|
||||
/// @param c
|
||||
/// @return
|
||||
///
|
||||
bool IsWhitespace(wchar_t c)
|
||||
{
|
||||
|
@ -291,9 +291,9 @@ bool IsWhitespace(wchar_t c)
|
|||
|
||||
|
||||
|
||||
/// @brief Returns true if str is empty of consists of only whitespace
|
||||
/// @param str
|
||||
/// @return
|
||||
/// @brief Returns true if str is empty of consists of only whitespace
|
||||
/// @param str
|
||||
/// @return
|
||||
///
|
||||
bool StringEmptyOrWhitespace(const wxString &str)
|
||||
{
|
||||
|
@ -306,11 +306,11 @@ bool StringEmptyOrWhitespace(const wxString &str)
|
|||
|
||||
|
||||
|
||||
/// @brief wxString::ToLong() is slow and not as flexible String to integer
|
||||
/// @param str
|
||||
/// @param start
|
||||
/// @param end
|
||||
/// @return
|
||||
/// @brief wxString::ToLong() is slow and not as flexible String to integer
|
||||
/// @param str
|
||||
/// @param start
|
||||
/// @param end
|
||||
/// @return
|
||||
///
|
||||
int AegiStringToInt(const wxString &str,int start,int end) {
|
||||
// Initialize to zero and get length if end set to -1
|
||||
|
@ -335,12 +335,12 @@ int AegiStringToInt(const wxString &str,int start,int end) {
|
|||
|
||||
|
||||
|
||||
/// @brief String to fixed point
|
||||
/// @param str
|
||||
/// @param decimalPlaces
|
||||
/// @param start
|
||||
/// @param end
|
||||
/// @return
|
||||
/// @brief String to fixed point
|
||||
/// @param str
|
||||
/// @param decimalPlaces
|
||||
/// @param start
|
||||
/// @param end
|
||||
/// @return
|
||||
///
|
||||
int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start,int end) {
|
||||
// Parts of the number
|
||||
|
@ -388,9 +388,9 @@ int AegiStringToFix(const wxString &str,size_t decimalPlaces,int start,int end)
|
|||
|
||||
|
||||
|
||||
/// @brief This is needed because wxIcon has to be 16x16 to work properly on win32 Convert a wxBitmap to wxIcon
|
||||
/// @param iconBmp
|
||||
/// @return
|
||||
/// @brief This is needed because wxIcon has to be 16x16 to work properly on win32 Convert a wxBitmap to wxIcon
|
||||
/// @param iconBmp
|
||||
/// @return
|
||||
///
|
||||
wxIcon BitmapToIcon(wxBitmap iconBmp) {
|
||||
// Create the icon and background bmp
|
||||
|
@ -414,7 +414,7 @@ wxIcon BitmapToIcon(wxBitmap iconBmp) {
|
|||
}
|
||||
|
||||
|
||||
/// @brief just before this is called. It is assumed that something has prepared closing the current instance Start Aegisub again
|
||||
/// @brief just before this is called. It is assumed that something has prepared closing the current instance Start Aegisub again
|
||||
///
|
||||
void RestartAegisub() {
|
||||
#if defined(__WXMSW__)
|
||||
|
|
|
@ -42,19 +42,19 @@
|
|||
#include "utils.h"
|
||||
#include "variable_data.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
VariableData::VariableData() {
|
||||
type = VARDATA_NONE;
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
/// @brief Destructor
|
||||
/// @brief Destructor
|
||||
VariableData::~VariableData() {
|
||||
DeleteValue ();
|
||||
}
|
||||
|
||||
/// @brief Deletes the stored value
|
||||
/// @return
|
||||
/// @brief Deletes the stored value
|
||||
/// @return
|
||||
void VariableData::DeleteValue () {
|
||||
if (!value) return;
|
||||
if (type == VARDATA_NONE) return;
|
||||
|
@ -109,8 +109,8 @@ template void VariableData::Set(wxString param);
|
|||
template void VariableData::Set<wxColour>(wxColour param);
|
||||
template void VariableData::Set<AssDialogueBlockOverride *>(AssDialogueBlockOverride * param);
|
||||
|
||||
/// @brief Resets a value with a string, preserving current type
|
||||
/// @param value
|
||||
/// @brief Resets a value with a string, preserving current type
|
||||
/// @param value
|
||||
void VariableData::ResetWith(wxString value) {
|
||||
switch (type) {
|
||||
case VARDATA_INT: {
|
||||
|
@ -143,8 +143,8 @@ void VariableData::ResetWith(wxString value) {
|
|||
}
|
||||
}
|
||||
|
||||
/// @brief Reads as an int
|
||||
/// @return
|
||||
/// @brief Reads as an int
|
||||
/// @return
|
||||
template<> int VariableData::Get<int>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
if (type == VARDATA_BOOL) return !!(*value_bool);
|
||||
|
@ -154,7 +154,7 @@ template<> int VariableData::Get<int>() const {
|
|||
throw "Wrong parameter type, should be int";
|
||||
}
|
||||
|
||||
/// @brief Reads as a float
|
||||
/// @brief Reads as a float
|
||||
/// @return
|
||||
template<> float VariableData::Get<float>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
|
@ -171,8 +171,8 @@ template<> double VariableData::Get<double>() const {
|
|||
throw "Wrong parameter type, should be float";
|
||||
}
|
||||
|
||||
/// @brief Reads as a bool
|
||||
/// @return
|
||||
/// @brief Reads as a bool
|
||||
/// @return
|
||||
template<> bool VariableData::Get<bool>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
if (type == VARDATA_BOOL) return *value_bool;
|
||||
|
@ -182,8 +182,8 @@ template<> bool VariableData::Get<bool>() const {
|
|||
throw "Wrong parameter type, should be bool";
|
||||
}
|
||||
|
||||
/// @brief Reads as a colour
|
||||
/// @return
|
||||
/// @brief Reads as a colour
|
||||
/// @return
|
||||
template<> wxColour VariableData::Get<wxColour>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
if (type == VARDATA_COLOUR) return *value_colour;
|
||||
|
@ -195,16 +195,16 @@ template<> wxColour VariableData::Get<wxColour>() const {
|
|||
else throw "Wrong parameter type, should be colour";
|
||||
}
|
||||
|
||||
/// @brief Reads as a block
|
||||
/// @return
|
||||
/// @brief Reads as a block
|
||||
/// @return
|
||||
template<> AssDialogueBlockOverride *VariableData::Get<AssDialogueBlockOverride *>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
if (type != VARDATA_BLOCK) throw "Wrong parameter type, should be block";
|
||||
return *value_block;
|
||||
}
|
||||
|
||||
/// @brief Reads as a string
|
||||
/// @return
|
||||
/// @brief Reads as a string
|
||||
/// @return
|
||||
template<> wxString VariableData::Get<wxString>() const {
|
||||
if (!value) throw "Null parameter";
|
||||
if (type != VARDATA_TEXT) {
|
||||
|
@ -218,14 +218,14 @@ template<> wxString VariableData::Get<wxString>() const {
|
|||
return *value_text;
|
||||
}
|
||||
|
||||
/// @brief Gets type
|
||||
/// @return
|
||||
/// @brief Gets type
|
||||
/// @return
|
||||
VariableDataType VariableData::GetType() const {
|
||||
return type;
|
||||
}
|
||||
|
||||
/// @brief Copy
|
||||
/// @param param
|
||||
/// @brief Copy
|
||||
/// @param param
|
||||
void VariableData::operator= (const VariableData ¶m) {
|
||||
switch(param.GetType()) {
|
||||
case VARDATA_INT: Set(param.Get<int>()); break;
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
#include "video_context.h"
|
||||
#include "video_frame.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
///
|
||||
VideoContext::VideoContext()
|
||||
: playback(this)
|
||||
|
|
|
@ -58,8 +58,8 @@ AegiVideoFrame::AegiVideoFrame() {
|
|||
}
|
||||
|
||||
/// @brief Create a solid black frame of the request size and format
|
||||
/// @param width
|
||||
/// @param height
|
||||
/// @param width
|
||||
/// @param height
|
||||
AegiVideoFrame::AegiVideoFrame(unsigned int width, unsigned int height) {
|
||||
assert(width > 0 && width < 10000);
|
||||
assert(height > 0 && height < 10000);
|
||||
|
|
|
@ -75,7 +75,7 @@ AvisynthVideoProvider::AvisynthVideoProvider(wxString filename)
|
|||
AVIFileInit();
|
||||
|
||||
PAVIFILE pfile;
|
||||
long hr = AVIFileOpen(&pfile, filename.wc_str(), OF_SHARE_DENY_WRITE, 0);
|
||||
long hr = AVIFileOpen(&pfile, filename.wc_str(), OF_SHARE_DENY_WRITE, 0);
|
||||
if (hr) {
|
||||
warning = "Unable to open AVI file for reading keyframes:\n";
|
||||
switch (hr) {
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
#include "video_context.h"
|
||||
#include "video_provider_ffmpegsource.h"
|
||||
|
||||
/// @brief Constructor
|
||||
/// @brief Constructor
|
||||
/// @param filename The filename to open
|
||||
FFmpegSourceVideoProvider::FFmpegSourceVideoProvider(wxString filename) try
|
||||
: VideoSource(NULL, FFMS_DestroyVideoSource)
|
||||
|
@ -83,10 +83,10 @@ catch (const char * err) {
|
|||
throw VideoOpenError(err);
|
||||
}
|
||||
|
||||
/// @brief Opens video
|
||||
/// @brief Opens video
|
||||
/// @param filename The filename to open
|
||||
void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
|
||||
wxString FileNameShort = wxFileName(filename).GetShortPath();
|
||||
wxString FileNameShort = wxFileName(filename).GetShortPath();
|
||||
|
||||
FFMS_Indexer *Indexer = FFMS_CreateIndexer(FileNameShort.utf8_str(), &ErrInfo);
|
||||
if (!Indexer)
|
||||
|
@ -124,7 +124,7 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
|
|||
if (FFMS_GetNumFrames(TempTrackData) <= 0)
|
||||
Index = NULL;
|
||||
}
|
||||
|
||||
|
||||
// moment of truth
|
||||
if (!Index) {
|
||||
int TrackMask = FFMS_TRACKMASK_NONE;
|
||||
|
@ -133,7 +133,7 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
|
|||
// ignore audio decoding errors here, we don't care right now
|
||||
Index = DoIndexing(Indexer, CacheName, TrackMask, FFMS_IEH_IGNORE);
|
||||
}
|
||||
|
||||
|
||||
// update access time of index file so it won't get cleaned away
|
||||
wxFileName(CacheName).Touch();
|
||||
|
||||
|
@ -158,7 +158,7 @@ void FFmpegSourceVideoProvider::LoadVideo(wxString filename) {
|
|||
int SeekMode;
|
||||
if (OPT_GET("Provider/Video/FFmpegSource/Unsafe Seeking")->GetBool())
|
||||
SeekMode = FFMS_SEEK_UNSAFE;
|
||||
else
|
||||
else
|
||||
SeekMode = FFMS_SEEK_NORMAL;
|
||||
|
||||
VideoSource = FFMS_CreateVideoSource(FileNameShort.utf8_str(), TrackNumber, Index, Threads, SeekMode, &ErrInfo);
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
#include "video_provider_yuv4mpeg.h"
|
||||
|
||||
|
||||
/// @brief Get provider
|
||||
/// @param video
|
||||
/// @return
|
||||
/// @brief Get provider
|
||||
/// @param video
|
||||
/// @return
|
||||
///
|
||||
VideoProvider *VideoProviderFactory::GetProvider(wxString video) {
|
||||
std::vector<std::string> list = GetClasses(OPT_GET("Video/Provider")->GetString());
|
||||
|
@ -107,7 +107,7 @@ VideoProvider *VideoProviderFactory::GetProvider(wxString video) {
|
|||
throw VideoOpenError(msg);
|
||||
}
|
||||
|
||||
/// @brief Register all providers
|
||||
/// @brief Register all providers
|
||||
///
|
||||
void VideoProviderFactory::RegisterProviders() {
|
||||
#ifdef WITH_AVISYNTH
|
||||
|
|
|
@ -311,7 +311,7 @@ int YUV4MPEGVideoProvider::IndexFile() {
|
|||
int64_t curpos = ftello(sf);
|
||||
|
||||
// the ParseFileHeader() call in LoadVideo() will already have read
|
||||
// the file header for us and set the seek position correctly
|
||||
// the file header for us and set the seek position correctly
|
||||
while (true) {
|
||||
curpos = ftello(sf); // update position
|
||||
// continue reading headers until no more are found
|
||||
|
|
|
@ -56,7 +56,7 @@ class YUV4MPEGVideoProvider : public VideoProvider {
|
|||
|
||||
/// 4:2:0 sampling variants.
|
||||
/// afaict the only difference between these three
|
||||
/// is the chroma sample location, and nobody cares about that.
|
||||
/// is the chroma sample location, and nobody cares about that.
|
||||
Y4M_PIXFMT_420JPEG, /// 4:2:0, H/V centered, for JPEG/MPEG-1
|
||||
Y4M_PIXFMT_420MPEG2, /// 4:2:0, H cosited, for MPEG-2
|
||||
Y4M_PIXFMT_420PALDV, /// 4:2:0, alternating Cb/Cr, for PAL-DV
|
||||
|
@ -115,7 +115,7 @@ class YUV4MPEGVideoProvider : public VideoProvider {
|
|||
int num_frames; /// length of file in frames
|
||||
int frame_sz; /// size of each frame in bytes
|
||||
int luma_sz; /// size of the luma plane of each frame, in bytes
|
||||
int chroma_sz; /// size of one of the two chroma planes of each frame, in bytes
|
||||
int chroma_sz; /// size of one of the two chroma planes of each frame, in bytes
|
||||
int cur_fn; /// current frame number
|
||||
|
||||
Y4M_PixelFormat pixfmt; /// colorspace/pixel format
|
||||
|
|
|
@ -148,7 +148,7 @@ void VisualToolVectorClip::Draw() {
|
|||
gl.DrawDashedLine(mouse_pos, c1->EndPoint(), 6);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Draw preview of insert point
|
||||
if (mode == 4)
|
||||
gl.DrawCircle(pt, 4);
|
||||
|
|
Loading…
Reference in New Issue