2007-04-04 06:12:38 +02:00
|
|
|
// Copyright (c) 2006-2007, Rodrigo Braz Monteiro, Evgeniy Stepanov
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// * Redistributions of source code must retain the above copyright notice,
|
|
|
|
// this list of conditions and the following disclaimer.
|
|
|
|
// * 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.
|
|
|
|
// * Neither the name of the Aegisub Group nor the names of its contributors
|
|
|
|
// may be used to endorse or promote products derived from this software
|
|
|
|
// without specific prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT OWNER OR CONTRIBUTORS 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.
|
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
2007-04-04 06:12:38 +02:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// $Id$
|
|
|
|
|
|
|
|
/// @file subtitles_provider_libass.cpp
|
|
|
|
/// @brief libass-based subtitle renderer
|
|
|
|
/// @ingroup subtitle_rendering
|
|
|
|
///
|
2007-04-04 06:12:38 +02:00
|
|
|
|
2009-01-04 07:31:48 +01:00
|
|
|
#include "config.h"
|
|
|
|
|
2007-12-31 07:46:22 +01:00
|
|
|
#ifdef WITH_LIBASS
|
|
|
|
|
2009-09-10 15:06:40 +02:00
|
|
|
#ifndef AGI_PRE
|
2008-11-20 23:08:34 +01:00
|
|
|
#include <wx/filefn.h>
|
2010-09-01 08:50:35 +02:00
|
|
|
#include <wx/utils.h>
|
2009-09-10 15:06:40 +02:00
|
|
|
#endif
|
2007-04-04 06:12:38 +02:00
|
|
|
|
2009-07-12 22:10:25 +02:00
|
|
|
#ifdef __APPLE__
|
2009-07-11 19:28:27 +02:00
|
|
|
#include <sys/param.h>
|
2010-08-14 19:42:37 +02:00
|
|
|
#include <libaegisub/util_osx.h>
|
2009-07-14 00:38:43 +02:00
|
|
|
#endif
|
2007-04-04 06:12:38 +02:00
|
|
|
|
2010-06-01 10:21:30 +02:00
|
|
|
#include <libaegisub/log.h>
|
|
|
|
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "ass_file.h"
|
2010-09-01 08:50:35 +02:00
|
|
|
#include "dialog_progress.h"
|
|
|
|
#include "frame_main.h"
|
|
|
|
#include "main.h"
|
2009-09-10 15:06:40 +02:00
|
|
|
#include "standard_paths.h"
|
|
|
|
#include "subtitles_provider_libass.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "video_context.h"
|
2010-08-02 09:21:02 +02:00
|
|
|
#include "video_frame.h"
|
2009-09-10 15:06:40 +02:00
|
|
|
|
|
|
|
|
2010-05-24 05:41:06 +02:00
|
|
|
/// @brief Handle libass messages
|
|
|
|
///
|
2010-10-17 04:36:28 +02:00
|
|
|
static void msg_callback(int level, const char *fmt, va_list args, void *) {
|
2010-10-11 22:48:29 +02:00
|
|
|
if (level >= 7) return;
|
2010-10-08 08:06:50 +02:00
|
|
|
char buf[1024];
|
2010-08-10 07:50:14 +02:00
|
|
|
#ifdef _WIN32
|
|
|
|
vsprintf_s(buf, sizeof(buf), fmt, args);
|
|
|
|
#else
|
|
|
|
vsnprintf(buf, sizeof(buf), fmt, args);
|
|
|
|
#endif
|
2010-06-01 10:21:30 +02:00
|
|
|
|
2010-05-24 05:41:06 +02:00
|
|
|
if (level < 2) // warning/error
|
2010-06-01 10:21:30 +02:00
|
|
|
LOG_I("subtitle/provider/libass") << buf;
|
2010-10-11 22:48:29 +02:00
|
|
|
else // verbose
|
2010-06-01 10:21:30 +02:00
|
|
|
LOG_D("subtitle/provider/libass") << buf;
|
2010-05-24 05:41:06 +02:00
|
|
|
}
|
|
|
|
|
2010-10-17 04:36:28 +02:00
|
|
|
class FontConfigCacheThread : public wxThread {
|
|
|
|
ASS_Library *ass_library;
|
|
|
|
ASS_Renderer *ass_renderer;
|
|
|
|
FontConfigCacheThread** thisPtr;
|
|
|
|
ExitCode Entry() {
|
2009-07-12 22:10:25 +02:00
|
|
|
#ifdef __APPLE__
|
2010-10-17 04:36:28 +02:00
|
|
|
char config_path[MAXPATHLEN];
|
|
|
|
char *config_dir;
|
2009-07-11 19:28:27 +02:00
|
|
|
|
2010-10-17 04:36:28 +02:00
|
|
|
config_dir = agi::util::OSX_GetBundleResourcesDirectory();
|
|
|
|
snprintf(config_path, MAXPATHLEN, "%s/etc/fonts/fonts.conf", config_dir);
|
|
|
|
free(config_dir);
|
2009-07-11 19:28:27 +02:00
|
|
|
#else
|
2010-10-17 04:36:28 +02:00
|
|
|
const char *config_path = NULL;
|
2009-07-11 19:28:27 +02:00
|
|
|
#endif
|
|
|
|
|
2010-10-17 04:36:28 +02:00
|
|
|
if (ass_library) ass_renderer = ass_renderer_init(ass_library);
|
|
|
|
ass_set_fonts(ass_renderer, NULL, "Sans", 1, config_path, true);
|
|
|
|
if (ass_library) ass_renderer_done(ass_renderer);
|
|
|
|
*thisPtr = NULL;
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
public:
|
|
|
|
FontConfigCacheThread(ASS_Library *ass_library, FontConfigCacheThread **thisPtr)
|
|
|
|
: ass_library(ass_library)
|
|
|
|
, ass_renderer(NULL)
|
|
|
|
, thisPtr(thisPtr)
|
|
|
|
{
|
|
|
|
*thisPtr = this;
|
|
|
|
Create();
|
|
|
|
Run();
|
|
|
|
}
|
|
|
|
FontConfigCacheThread(ASS_Renderer *ass_renderer, FontConfigCacheThread **thisPtr)
|
|
|
|
: ass_library(NULL)
|
|
|
|
, ass_renderer(ass_renderer)
|
|
|
|
, thisPtr(thisPtr)
|
|
|
|
{
|
|
|
|
*thisPtr = this;
|
|
|
|
Create();
|
|
|
|
Run();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-09-28 21:47:40 +02:00
|
|
|
static void do_wait(agi::ProgressSink *ps, FontConfigCacheThread const * const * const cache_worker) {
|
|
|
|
ps->SetIndeterminate();
|
|
|
|
while (*cache_worker && !ps->IsCancelled())
|
|
|
|
wxMilliSleep(100);
|
|
|
|
}
|
|
|
|
|
2010-11-11 06:29:13 +01:00
|
|
|
static void wait_for_cache_thread(FontConfigCacheThread const * const * const cache_worker) {
|
|
|
|
if (!*cache_worker) return;
|
2010-10-17 04:36:28 +02:00
|
|
|
|
2011-12-22 22:17:30 +01:00
|
|
|
DialogProgress progress(wxGetApp().frame, "Updating font index", "This may take several minutes");
|
2011-09-28 21:47:40 +02:00
|
|
|
progress.Run(bind(do_wait, std::tr1::placeholders::_1, cache_worker));
|
2010-09-01 08:50:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/// @brief Constructor
|
|
|
|
///
|
|
|
|
LibassSubtitlesProvider::LibassSubtitlesProvider(std::string) {
|
2010-11-11 06:29:13 +01:00
|
|
|
wait_for_cache_thread(&cache_worker);
|
2010-09-01 08:50:35 +02:00
|
|
|
|
|
|
|
// Initialize renderer
|
|
|
|
ass_track = NULL;
|
|
|
|
ass_renderer = ass_renderer_init(ass_library);
|
2011-09-28 21:43:11 +02:00
|
|
|
if (!ass_renderer) throw "ass_renderer_init failed";
|
2010-09-01 08:50:35 +02:00
|
|
|
ass_set_font_scale(ass_renderer, 1.);
|
2010-10-17 04:36:28 +02:00
|
|
|
new FontConfigCacheThread(ass_renderer, &cache_worker);
|
2010-11-11 06:29:13 +01:00
|
|
|
wait_for_cache_thread(&cache_worker);
|
2007-04-04 06:12:38 +02:00
|
|
|
}
|
|
|
|
|
2009-09-02 03:23:51 +02:00
|
|
|
/// @brief Destructor
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2007-04-04 06:12:38 +02:00
|
|
|
LibassSubtitlesProvider::~LibassSubtitlesProvider() {
|
2010-10-20 02:28:28 +02:00
|
|
|
if (ass_track) ass_free_track(ass_track);
|
|
|
|
if (ass_renderer) ass_renderer_done(ass_renderer);
|
2007-04-04 06:12:38 +02:00
|
|
|
}
|
|
|
|
|
2009-09-02 03:23:51 +02:00
|
|
|
/// @brief Load subtitles
|
|
|
|
/// @param subs
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2007-04-04 06:12:38 +02:00
|
|
|
void LibassSubtitlesProvider::LoadSubtitles(AssFile *subs) {
|
|
|
|
// Prepare subtitles
|
|
|
|
std::vector<char> data;
|
2012-01-08 02:33:19 +01:00
|
|
|
subs->SaveMemory(data);
|
2007-04-04 06:12:38 +02:00
|
|
|
|
|
|
|
// Load file
|
|
|
|
if (ass_track) ass_free_track(ass_track);
|
2009-09-02 10:06:51 +02:00
|
|
|
ass_track = ass_read_memory(ass_library, &data[0], data.size(),(char *)"UTF-8");
|
2011-09-28 21:43:11 +02:00
|
|
|
if (!ass_track) throw "libass failed to load subtitles.";
|
2007-04-04 06:12:38 +02:00
|
|
|
}
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
2007-04-04 06:12:38 +02:00
|
|
|
#define _r(c) ((c)>>24)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// DOCME
|
2007-04-04 06:12:38 +02:00
|
|
|
#define _g(c) (((c)>>16)&0xFF)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// DOCME
|
2007-04-04 06:12:38 +02:00
|
|
|
#define _b(c) (((c)>>8)&0xFF)
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
|
|
|
/// DOCME
|
2007-04-04 06:12:38 +02:00
|
|
|
#define _a(c) ((c)&0xFF)
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
|
2009-09-02 03:23:51 +02:00
|
|
|
/// @brief Draw subtitles
|
|
|
|
/// @param frame
|
|
|
|
/// @param time
|
|
|
|
/// @return
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
///
|
2007-04-04 06:12:38 +02:00
|
|
|
void LibassSubtitlesProvider::DrawSubtitles(AegiVideoFrame &frame,double time) {
|
|
|
|
// Set size
|
|
|
|
ass_set_frame_size(ass_renderer, frame.w, frame.h);
|
|
|
|
|
|
|
|
// Get frame
|
2009-09-02 03:23:51 +02:00
|
|
|
ASS_Image* img = ass_render_frame(ass_renderer, ass_track, int(time * 1000), NULL);
|
2007-04-04 06:12:38 +02:00
|
|
|
|
|
|
|
// libass actually returns several alpha-masked monochrome images.
|
|
|
|
// Here, we loop through their linked list, get the colour of the current, and blend into the frame.
|
|
|
|
// This is repeated for all of them.
|
|
|
|
while (img) {
|
|
|
|
// Get colours
|
|
|
|
unsigned int opacity = 255 - ((unsigned int)_a(img->color));
|
|
|
|
unsigned int r = (unsigned int)_r(img->color);
|
|
|
|
unsigned int g = (unsigned int)_g(img->color);
|
|
|
|
unsigned int b = (unsigned int) _b(img->color);
|
|
|
|
|
|
|
|
// Prepare copy
|
|
|
|
int src_stride = img->stride;
|
2010-12-31 22:03:11 +01:00
|
|
|
int dst_stride = frame.pitch;
|
2007-04-04 06:12:38 +02:00
|
|
|
const unsigned char *src = img->bitmap;
|
2011-10-01 20:35:25 +02:00
|
|
|
|
|
|
|
unsigned char *dst = frame.data;
|
|
|
|
if (frame.flipped) {
|
|
|
|
dst += dst_stride * (frame.h - 1);
|
|
|
|
dst_stride *= -1;
|
|
|
|
}
|
|
|
|
dst += (img->dst_y * dst_stride + img->dst_x * 4);
|
2007-04-04 06:12:38 +02:00
|
|
|
|
|
|
|
// Copy image to destination frame
|
2011-10-01 20:35:25 +02:00
|
|
|
for (int y = 0; y < img->h; y++) {
|
|
|
|
unsigned char *dstp = dst;
|
|
|
|
|
2007-04-04 06:12:38 +02:00
|
|
|
for (int x = 0; x < img->w; ++x) {
|
2011-10-01 20:35:25 +02:00
|
|
|
unsigned int k = ((unsigned)src[x]) * opacity / 255;
|
|
|
|
unsigned int ck = 255 - k;
|
|
|
|
|
|
|
|
*dstp = (k * b + ck * *dstp) / 255;
|
|
|
|
++dstp;
|
|
|
|
|
|
|
|
*dstp = (k * g + ck * *dstp) / 255;
|
|
|
|
++dstp;
|
|
|
|
|
|
|
|
*dstp = (k * r + ck * *dstp) / 255;
|
|
|
|
++dstp;
|
|
|
|
|
|
|
|
++dstp;
|
2007-04-04 06:12:38 +02:00
|
|
|
}
|
|
|
|
|
2011-10-01 20:35:25 +02:00
|
|
|
dst += dst_stride;
|
2007-04-04 06:12:38 +02:00
|
|
|
src += src_stride;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Next image
|
|
|
|
img = img->next;
|
|
|
|
}
|
|
|
|
}
|
2007-12-31 07:46:22 +01:00
|
|
|
|
2010-09-01 08:50:35 +02:00
|
|
|
void LibassSubtitlesProvider::CacheFonts() {
|
|
|
|
ass_library = ass_library_init();
|
2010-10-17 04:36:28 +02:00
|
|
|
ass_set_message_cb(ass_library, msg_callback, NULL);
|
2010-09-01 08:50:35 +02:00
|
|
|
new FontConfigCacheThread(ass_library, &cache_worker);
|
|
|
|
}
|
|
|
|
|
Note: This was done using a script! it's far from perfect but 95% of the work has been done already formatting-wise.
Document all functions, class, struct, union, enum, macro, variable, typedefs. This isn't the actual document in itself but empty documentation using any old documentation if it was there.
This was done using exuberant ctags to get tag info, then a TCL script to parse/remove old comments and convert them into Doxygen-style.
Some notes:
* Anything labeled 'DOCME' needs to be documented, @param and @return have been left blank as it would be annoying to delete the 'DOCME' from every one of those.
* Some multiline comments may have been munged into single line comments
* Leave the /// comments above global variables with a space, if they're harder to read then we'll be less likey to use them.
* Enum comments can go after the enumeration itself '[value] /// comment'
* include/aegisub/*.h haven't been converted yet, this will be done in a later commit
* Some documentation blocks are in the wrong place, in the .h when it should be in the .cpp, or vice versa.
See http://devel.aegisub.org/wiki/Doxygen for some details on Doxygen and a 'style guide'.
Originally committed to SVN as r3312.
2009-07-30 00:59:22 +02:00
|
|
|
/// DOCME
|
2009-09-02 03:23:51 +02:00
|
|
|
ASS_Library* LibassSubtitlesProvider::ass_library;
|
2010-09-01 08:50:35 +02:00
|
|
|
FontConfigCacheThread* LibassSubtitlesProvider::cache_worker = NULL;
|
2008-03-05 04:46:29 +01:00
|
|
|
|
2007-12-31 07:46:22 +01:00
|
|
|
#endif // WITH_LIBASS
|