2014-04-29 18:33:22 +02:00
|
|
|
// Copyright (c) 2014, Thomas Goyne <plorkyeran@aegisub.org>
|
2006-02-27 01:06:46 +01:00
|
|
|
//
|
2014-04-29 18:33:22 +02:00
|
|
|
// Permission to use, copy, modify, and distribute this software for any
|
|
|
|
// purpose with or without fee is hereby granted, provided that the above
|
|
|
|
// copyright notice and this permission notice appear in all copies.
|
2006-02-27 01:06:46 +01:00
|
|
|
//
|
2014-04-29 18:33:22 +02:00
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
2006-02-27 01:06:46 +01:00
|
|
|
//
|
2009-07-29 07:43:02 +02:00
|
|
|
// Aegisub Project http://www.aegisub.org/
|
|
|
|
|
2006-02-27 22:57:10 +01:00
|
|
|
#include "subtitle_format.h"
|
2006-02-27 01:06:46 +01:00
|
|
|
|
2014-03-13 02:39:07 +01:00
|
|
|
class AssSubtitleFormat final : public SubtitleFormat {
|
2006-02-27 01:06:46 +01:00
|
|
|
public:
|
2014-04-29 18:33:22 +02:00
|
|
|
AssSubtitleFormat() : SubtitleFormat("Advanced SubStation Alpha") { }
|
2006-12-26 19:26:13 +01:00
|
|
|
|
2014-04-29 18:33:22 +02:00
|
|
|
std::vector<std::string> GetReadWildcards() const override { return {"ass", "ssa"}; }
|
|
|
|
std::vector<std::string> GetWriteWildcards() const override { return {"ass"}; }
|
2006-02-27 22:57:10 +01:00
|
|
|
|
2014-04-29 18:33:22 +02:00
|
|
|
// Naturally the ASS subtitle format can save all ASS files
|
2012-12-29 04:49:48 +01:00
|
|
|
bool CanSave(const AssFile*) const override { return true; }
|
2012-03-29 01:58:40 +02:00
|
|
|
|
2014-03-26 16:14:08 +01:00
|
|
|
void ReadFile(AssFile *target, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const& forceEncoding) const override;
|
|
|
|
void WriteFile(const AssFile *src, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const& encoding) const override;
|
2014-09-19 20:47:34 +02:00
|
|
|
|
|
|
|
// Does not write [Aegisub Project Garbage] and [Aegisub Extradata] sections when exporting
|
|
|
|
void ExportFile(const AssFile *src, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const& encoding) const override;
|
2006-02-27 01:06:46 +01:00
|
|
|
};
|