Tide 0.1.0
|
00001 /* Tide 00002 * 00003 * Header for the SegmentInfo element. 00004 * 00005 * Copyright 2011 Geoffrey Biggs geoffrey.biggs@aist.go.jp 00006 * RT-Synthesis Research Group 00007 * Intelligent Systems Research Institute, 00008 * National Institute of Advanced Industrial Science and Technology (AIST), 00009 * Japan 00010 * All rights reserved. 00011 * 00012 * This file is part of Tide. 00013 * 00014 * Tide is free software; you can redistribute it and/or modify it under 00015 * the terms of the GNU Lesser General Public License as published by 00016 * the Free Software Foundation; either version 2.1 of the License, or 00017 * (at your option) any later version. 00018 * 00019 * Tide is distributed in the hope that it will be useful, but WITHOUT 00020 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00021 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00022 * License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public 00025 * License along with Tide. If not, see <http://www.gnu.org/licenses/>. 00026 */ 00027 00028 #if !defined(TIDE_SEGMENT_INFO_H_) 00029 #define TIDE_SEGMENT_INFO_H_ 00030 00031 #include <tide/binary_element.h> 00032 #include <tide/date_element.h> 00033 #include <tide/el_ids.h> 00034 #include <tide/float_element.h> 00035 #include <tide/master_element.h> 00036 #include <tide/string_element.h> 00037 #include <tide/uint_element.h> 00038 #include <tide/win_dll.h> 00039 #include <vector> 00040 00043 00044 namespace tide 00045 { 00070 class TIDE_EXPORT SegmentInfo : public MasterElement 00071 { 00072 public: 00074 SegmentInfo(); 00075 00077 virtual ~SegmentInfo() {} 00078 00085 std::vector<char> uid() const { return uid_.value(); } 00091 void uid(std::vector<char> const& uid); 00092 00094 std::string filename() const { return seg_fn_.value(); } 00101 void filename(std::string const& filename); 00102 00114 std::vector<char> prev_uid() const { return prev_uid_.value(); } 00116 void prev_uid(std::vector<char> const& uid); 00122 std::string prev_filename() const { return prev_fn_.value(); } 00128 void prev_filename(std::string const& filename); 00129 00141 std::vector<char> next_uid() const { return next_uid_.value(); } 00147 void next_uid(std::vector<char> const& uid); 00149 std::string next_filename() const { return next_fn_.value(); } 00155 void next_filename(std::string const& filename); 00156 00158 std::vector<char> segment_family() const 00159 { return seg_fam_.value(); } 00165 void segment_family(std::vector<char> const& segment_family); 00166 00176 uint64_t timecode_scale() const { return tc_scale_.value(); } 00178 void timecode_scale(uint64_t scale); 00179 00190 double duration() const { return duration_.value(); } 00192 void duration(double duration); 00193 00200 int64_t date() const { return date_.value(); } 00202 void date(int64_t date); 00203 00209 std::string title() const { return title_.value(); } 00215 void title(std::string const& title); 00216 00218 std::string muxing_app() const { return muxer_.value(); } 00224 void muxing_app(std::string const& muxing_app); 00225 00227 std::string writing_app() const { return writer_.value(); } 00233 void writing_app(std::string const& writing_app); 00234 00236 virtual std::streamsize write_body(std::ostream& output); 00237 00238 protected: 00239 BinaryElement uid_; 00240 bool have_uid_; 00241 StringElement seg_fn_; 00242 bool have_seg_fn_; 00243 BinaryElement prev_uid_; 00244 bool have_prev_uid_; 00245 StringElement prev_fn_; 00246 bool have_prev_fn_; 00247 BinaryElement next_uid_; 00248 bool have_next_uid_; 00249 StringElement next_fn_; 00250 bool have_next_fn_; 00251 BinaryElement seg_fam_; 00252 bool have_seg_fam_; 00253 // TimecodeScale is a mandatory element, so no boolean is needed 00254 UIntElement tc_scale_; 00255 FloatElement duration_; 00256 bool have_duration_; 00257 DateElement date_; 00258 bool have_date_; 00259 StringElement title_; 00260 bool have_title_; 00261 StringElement muxer_; 00262 bool have_muxer_; 00263 StringElement writer_; 00264 bool have_writer_; 00265 00267 virtual std::streamsize body_size() const; 00268 00270 virtual std::streamsize read_body(std::istream& input, 00271 std::streamsize size); 00272 00274 void reset(); 00275 }; // class SegmentInfo 00276 }; // namespace tide 00277 00279 00280 #endif // TIDE_SEGMENT_INFO_H_ 00281