diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-04 16:48:08 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-05 14:34:43 +0100 |
| commit | 6c55e8d2c3b0129a19fc40dca344219021ad12ef (patch) | |
| tree | cf9c3244ed55fb1fa8db89ca87923f3b7a6d35a1 /src/subtitle_content.h | |
| parent | 2105caa32a12236d5b70a0cf8b9ac62fcf7f574e (diff) | |
Rename some stuff Content -> Asset.
Diffstat (limited to 'src/subtitle_content.h')
| -rw-r--r-- | src/subtitle_content.h | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/src/subtitle_content.h b/src/subtitle_content.h deleted file mode 100644 index d80d631c..00000000 --- a/src/subtitle_content.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef LIBDCP_SUBTITLE_CONTENT_H -#define LIBDCP_SUBTITLE_CONTENT_H - -#include "asset.h" -#include "dcp_time.h" -#include "subtitle_string.h" -#include <libcxml/cxml.h> - -namespace dcp -{ - -class SubtitleString; -class FontNode; -class TextNode; -class SubtitleNode; -class LoadFontNode; - -/** @class SubtitleContent - * @brief A parent for classes representing a file containing subtitles. - */ -class SubtitleContent : public Asset -{ -public: - SubtitleContent (); - SubtitleContent (boost::filesystem::path file); - - bool equals ( - boost::shared_ptr<const Asset>, - EqualityOptions, - NoteHandler note - ) const; - - std::string language () const { - return _language; - } - - std::list<SubtitleString> subtitles_during (Time from, Time to) const; - std::list<SubtitleString> const & subtitles () const { - return _subtitles; - } - - void add (SubtitleString); - - void write_xml (boost::filesystem::path) const; - virtual Glib::ustring xml_as_string () const { - /* XXX: this should be pure virtual when SMPTE writing is implemented */ - return ""; - } - - Time latest_subtitle_out () const; - - virtual std::list<boost::shared_ptr<LoadFontNode> > load_font_nodes () const = 0; - -protected: - void parse_common (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes); - - std::string pkl_type (Standard) const { - return "text/xml"; - } - - std::string asdcp_kind () const { - return "Subtitle"; - } - - /* strangely, this is sometimes a string */ - std::string _reel_number; - std::string _language; - - std::list<SubtitleString> _subtitles; - -private: - struct ParseState { - std::list<boost::shared_ptr<FontNode> > font_nodes; - std::list<boost::shared_ptr<TextNode> > text_nodes; - std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes; - }; - - void maybe_add_subtitle (std::string text, ParseState const & parse_state); - - void examine_font_nodes ( - boost::shared_ptr<const cxml::Node> xml, - std::list<boost::shared_ptr<FontNode> > const & font_nodes, - ParseState& parse_state - ); - - void examine_text_nodes ( - boost::shared_ptr<const cxml::Node> xml, - std::list<boost::shared_ptr<TextNode> > const & text_nodes, - ParseState& parse_state - ); -}; - -} - -#endif |
