FFmpegfs Fuse Multi Media Filesystem 2.16
vcdentries.h
Go to the documentation of this file.
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 3 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
15 */
16
28#ifndef VCDENTRIES_H
29#define VCDENTRIES_H
30
31#pragma once
32
33#include "vcdchapter.h"
34
35#include <vector>
36#include <array>
37
41{
42public:
46 enum class SEEKRES
47 {
48 NOTFOUND,
49 FOUND,
50 ERROR
51 };
52 typedef SEEKRES *LPSEEKRES;
53 typedef const SEEKRES *LPCSEEKRES;
55public:
59 explicit VcdEntries();
63 virtual ~VcdEntries() = default;
64
68 void clear();
74 int load_file(const std::string & path);
75
80 time_t get_file_date() const;
85 const std::string & get_id() const;
90 VCDTYPE get_type() const;
95 std::string get_type_str() const;
105 std::string get_profile_tag_str() const;
110 int get_number_of_chapters() const;
117 const VcdChapter * get_chapter(int chapter_idx) const;
122 int64_t get_duration() const;
127 uint64_t get_size() const;
131 const std::string & get_disk_path() const;
132
133protected:
138 int scan_chapters();
145 SEEKRES seek_sync(FILE *fpi, const std::array<char, 12> & sync) const;
146
147protected:
148 // Common data
149 time_t m_file_date;
150 std::string m_id;
153 // ENTRIES.XXX data
154 std::vector<VcdChapter> m_chapters;
155 int64_t m_duration;
157 // misc.
158 std::string m_disk_path;
159};
160
161#endif // VCDENTRIES_H
Video CD chapter.
Definition: vcdchapter.h:62
Video CD entries.
Definition: vcdentries.h:41
VcdEntries()
Construct VcdEntries object.
Definition: vcdentries.cc:54
time_t m_file_date
File date.
Definition: vcdentries.h:149
std::string m_disk_path
Path to this disk.
Definition: vcdentries.h:158
virtual ~VcdEntries()=default
Destroy VcdEntries object.
VCDTYPE get_type() const
Get disk type.
Definition: vcdentries.cc:364
SEEKRES seek_sync(FILE *fpi, const std::array< char, 12 > &sync) const
Seek for sync bytes.
Definition: vcdentries.cc:315
uint64_t get_size() const
Get disk size (DAT/MPEG only).
Definition: vcdentries.cc:403
std::string m_id
ID of CD.
Definition: vcdentries.h:150
int get_number_of_chapters() const
Get number of chapters on this disk.
Definition: vcdentries.cc:384
void clear()
Reset this object.
Definition: vcdentries.cc:59
time_t get_file_date() const
Get date of disk (taken from INFO.VCD or SVD).
Definition: vcdentries.cc:354
const std::string & get_disk_path() const
Get disk directory.
Definition: vcdentries.cc:415
VCDPROFILETAG m_profile_tag
System profile tag.
Definition: vcdentries.h:152
SEEKRES * LPSEEKRES
Pointer to SEEKRES.
Definition: vcdentries.h:52
VCDTYPE m_type
Type of CD.
Definition: vcdentries.h:151
int scan_chapters()
Scan the disk for chapters.
Definition: vcdentries.cc:160
std::vector< VcdChapter > m_chapters
VCD chapters.
Definition: vcdentries.h:154
int load_file(const std::string &path)
Load VCD from path.
Definition: vcdentries.cc:70
const VcdChapter * get_chapter(int chapter_idx) const
Get chapter object.
Definition: vcdentries.cc:389
int64_t m_duration
Total disk duration, in AV_TIME_BASE fractional seconds.
Definition: vcdentries.h:155
std::string get_type_str() const
Get disk type as string.
Definition: vcdentries.cc:369
const SEEKRES * LPCSEEKRES
Const pointer to SEEKRES.
Definition: vcdentries.h:53
std::string get_profile_tag_str() const
Get disk profile tag as string.
Definition: vcdentries.cc:379
int64_t get_duration() const
Get the total disk duration in AV_TIME_BASE fractional seconds.
Definition: vcdentries.cc:398
const std::string & get_id() const
Get disk ID.
Definition: vcdentries.cc:359
VCDPROFILETAG get_profile_tag() const
Get disk profile tag.
Definition: vcdentries.cc:374
S/VCD VcdChapter class.
VCDTYPE
Definition: vcdchapter.h:40
VCDPROFILETAG
Definition: vcdchapter.h:50