📄 pgc.h
字号:
//// Copyright (c) 2003 by Istv醤 V醨adi//// This file is part of dxr3Player, a DVD player written specifically // for the DXR3 (aka Hollywood+) decoder card.// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA#ifndef DXR3PLAYER_DVD_PGC_H#define DXR3PLAYER_DVD_PGC_H//------------------------------------------------------------------------------#include <libmpdvdkit/ifo_types.h>#include "dvd/UserOperations.h"#include "types.h"#include "enums.h"#include <cassert>//------------------------------------------------------------------------------namespace dvd {namespace vm {class Instruction;}//------------------------------------------------------------------------------/** * Convert a dvd_time_t structure into a frame number/FPS pair. * * @param fps it should contain either 0, or the result from previous * conversions, this result will be used together with. In the latter * case, it must be equal to the FPS value of this time structure. */unsigned long long dvdTime2Frames(const dvd_time_t& dvd_time, unsigned& fps);//------------------------------------------------------------------------------/** * Cell Playback Information */class CellPlaybackInfo{private: /** * The low-level structure */ const cell_playback_t* cell_playback;public: /** * Construct an cell playback info object. */ explicit CellPlaybackInfo(const cell_playback_t* cell_playback); /** * Determine if the cell is in an angle block. */ bool isInAngleBlock() const; /** * Determine if the cell is the first in an angle block. */ bool isFirstInAngleBlock() const; /** * Get the first sector of the cell. */ unsigned getFirstSector() const; /** * Get the first sector of the cell's last VOBU */ unsigned getLastVOBUFirstSector() const; /** * Get the number of the cell command */ unsigned getCellCommandNumber() const; /** * Get the still time of the cell. */ unsigned getStillTime() const; /** * Get the playback time in frames and the FPS of the cell. */ unsigned long long getPlaybackTime(unsigned& fps) const;};//------------------------------------------------------------------------------/** * Command table. */class CommandTable{private: /** * The low-level structure. */ const pgc_command_tbl_t* pgc_command_tbl;public: /** * Construct the command table. */ explicit CommandTable(const pgc_command_tbl_t* pgc_command_tbl); /** * Check if the command table is valid or not. */ operator bool() const; /** * Get the number of pre-commands. */ unsigned getNumberOfPreCommands() const; /** * Get the pre-commands. */ const dvd::vm::Instruction* getPreCommands() const; /** * Get the number of post-commands. */ unsigned getNumberOfPostCommands() const; /** * Get the post-commands. */ const dvd::vm::Instruction* getPostCommands() const; /** * Get the number of cell commands. */ unsigned getNumberOfCellCommands() const; /** * Get the cell commands. */ const dvd::vm::Instruction* getCellCommands() const;};//------------------------------------------------------------------------------/** * Program Chain. */class PGC{public: /** * The infinite still time. */ static const unsigned infiniteStillTime = 255; /** * Invalid stream number. * FIXME: move it to a header with common constants */ static const unsigned INVALID_STREAM_NUMBER = 0xff;private: /** * The low-level structure */ const pgc_t* pgc;public: /** * Construct the PGC object */ explicit PGC(const pgc_t* pgc); /** * Check if the PGC is valid. */ operator bool() const; /** * Get the next PGC number */ unsigned getNextPGCNumber() const; /** * Get the previous PGC number */ unsigned getPreviousPGCNumber() const; /** * Get the go-up PGC number */ unsigned getGoUpPGCNumber() const; /** * Get the number of programs. */ unsigned getNumberOfPrograms() const; /** * Get the entry cell number for the given program. */ unsigned getEntryCellNumber(unsigned programNo) const; /** * Get the number of cells. */ unsigned getNumberOfCells() const; /** * Check if the PGC is empty, i.e. it has no cells (and no * programs therefore). */ bool isEmpty() const; /** * Get the cell playback information object for the given, 1-based * cell number. */ CellPlaybackInfo getCellPlaybackInfo(unsigned cellNo) const; /** * Get the command table. */ CommandTable getCommandTable() const; /** * Find a "base" cell. A base cell is one that is either a normal * cell, or the first cell of an angle block. * * @param cellNo the initial cell number * @param ascending indicate if the search should be done in * ascending order * * @return the cell number found. If the search fails, then it is * either 0 or the number of cells + 1, depending on the search order. */ unsigned findBaseCell(unsigned cellNo, bool ascending) const; /** * Find a "base" cell in ascending order. */ unsigned findNextBaseCell(unsigned cellNo) const; /** * Find a "base" cell in descending order. */ unsigned findPreviousBaseCell(unsigned cellNo) const; /** * Get the program number for the given cell number. * * @return the program number or 0 if not found */ unsigned getProgramNumber(unsigned cellNo) const; /** * Get the prohibited user operations. */ UserOperations getProhibitedOperations() const; /** * Get the SPU palette. */ void getSPUPalette(palette_t palette) const; /** * Get the audio stream number for the given logical stream * number based on the control data. If no stream exists, * INVALID_STREAM_NUMBER is returned. */ unsigned getAudioStreamNumber(unsigned streamNo) const; /** * Get the logical audio stream number for the given physical * stream. */ unsigned getLogicalAudioStreamNumber(unsigned streamNo) const; /** * Get the SPU stream number for the given logicam stream * number and aspect ratio. */ unsigned getSPUStreamNumber(unsigned streamNo, aspectRatio_t aspectRatio, displayFormat_t displayFormat) const; /** * Get the logical SPU stream number for the given physical * stream. */ unsigned getLogicalSPUStreamNumber(unsigned streamNo, aspectRatio_t aspectRatio, displayFormat_t displayFormat) const; /** * Get the still time of the PGC. */ unsigned getStillTime() const; /** * Get the playback time of the PGC. */ unsigned long long getPlaybackTime(unsigned& fps) const; /** * Get the starting playback time of the cell with the given * number. */ unsigned long long getCellStartingTime(unsigned cellNo, unsigned& fps) const;};//------------------------------------------------------------------------------/** * Program Chain Information */class PGCInfo{public: /** * Menu ID constant: title menu */ static const unsigned MENUID_TITLE = 2; /** * Menu ID constant: root menu */ static const unsigned MENUID_ROOT = 3; /** * Menu ID constant: subpicture menu */ static const unsigned MENUID_SUBPICTURE = 4; /** * Menu ID constant: audio menu */ static const unsigned MENUID_AUDIO = 5; /** * Menu ID constant: angle menu */ static const unsigned MENUID_ANGLE = 6; /** * Menu ID constant: part menu */ static const unsigned MENUID_PART = 7;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -