📄 pci.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_DEMUX_PCI_H#define DXR3PLAYER_DVD_DEMUX_PCI_H//------------------------------------------------------------------------------#include "dvd/UserOperations.h"#include "types.h"#include "enums.h"#include <libmpdvdkit/nav_types.h>#include <cassert>//------------------------------------------------------------------------------namespace dvd { namespace vm {class Instruction;} }//------------------------------------------------------------------------------namespace dvd {extern unsigned long long dvdTime2Frames(const dvd_time_t& dvd_time, unsigned& fps);}//------------------------------------------------------------------------------namespace dvd { namespace demux {//------------------------------------------------------------------------------class Sector;//------------------------------------------------------------------------------/** * Wrapper around the general highlight information */class GeneralHighlightInformation{public: /** * The highlight statuses. */ typedef enum status_t { NONE = 0, NEW = 1, USE_PREVIOUS = 2, ONLY_COMMANDS = 3 };private: /** * The low-level structure. */ const hl_gi_t* hl_gi; public: /** * Construct the class */ explicit GeneralHighlightInformation(const hl_gi_t* hl_gi); /** * Get the highlight status. */ status_t getStatus() const; /** * Get the number of button groups. */ unsigned getNumberOfButtonGroups() const; /** * Get the forced selected button number. */ unsigned getForcedSelectedButtonNumber() const; /** * Get the number of buttons. */ unsigned getNumberOfButtons() const; /** * Determine if the given button number is valid. */ bool isValidButton(unsigned buttonNo) const;};//------------------------------------------------------------------------------/** * Wrapper around the button colour information table. */class ButtonColourTable{public: /** * The number of colours. */ static const size_t numberOfColours = 3;private: /** * The low-level structure. */ const btn_colit_t* btn_colit;public: /** * Construct the structure. */ explicit ButtonColourTable(const btn_colit_t* btn_colit); /** * Get the selection palette with the given number. */ unsigned getSelectionPalette(size_t colourNumber); /** * Get the selection colour with the given number. */ unsigned getSelectionColour(size_t colourNumber); /** * Get the selection contrast with the given number. */ unsigned getSelectionContrast(size_t colourNumber);};//------------------------------------------------------------------------------/** * Wrapper around the button informations. */class ButtonInformation{private: /** * The low-level structure. */ const btni_t* btni;public: /** * Construct the structure */ explicit ButtonInformation(const btni_t* btni); /** * Get the colour number. */ size_t getColourNumber() const; /** * Get the starting X-coordinate of the button. */ unsigned getStartingX() const; /** * Get the ending X-coordinate of the button. */ unsigned getEndingX() const; /** * Get the starting Y-coordinate of the button. */ unsigned getStartingY() const; /** * Get the ending Y-coordinate of the button. */ unsigned getEndingY() const; /** * Get the "Up" button. */ unsigned getUpButton() const; /** * Get the "Down" button. */ unsigned getDownButton() const; /** * Get the "Left" button. */ unsigned getLeftButton() const; /** * Get the "Right" button. */ unsigned getRightButton() const; /** * Get the instruction associated with the button. */ const dvd::vm::Instruction* getInstruction() const; /** * Determine if the button has automatic activation enabled. */ bool isAutoAction() const;};//------------------------------------------------------------------------------/** * Wrapper around the highlight information. */class HighlightInformation{public: /** * The max. number of buttons. */ static const size_t maxNumberOfButtons = 36;private: /** * Check if the given display format equals the type denoted by * the given display type. */ static bool doesFormatMatch(unsigned displayType, displayFormat_t displayFormat);private: /** * The low-level structure. */ const hli_t* hli;public: /** * Construct the class */ explicit HighlightInformation(const hli_t* hli); /** * Get the general highlight info. */ GeneralHighlightInformation getGeneral() const; /** * Get the button colour information table. */ ButtonColourTable getButtonColourTable() const; /** * Get the button information for the button with the given * number. */ ButtonInformation getButtonInformation(size_t buttonNumber) const; /** * Get the button information for the button with the given * number. */ ButtonInformation getButtonInformation(size_t buttonNumber, displayFormat_t displayFormat) const;};//------------------------------------------------------------------------------/** * Wrapper around a PCI */class PCI{private: /** * The low level structure. */ pci_t pci; /** * Reference counter. */ size_t referenceCount;public: /** * Construct the DSI from the bytes starting at the given address, * if not 0. */ explicit PCI(const unsigned char* d = 0); /** * Construct the PCI from the given DVD sector. */ explicit PCI(const Sector& sector); /** * Get the sector number of this PCI */ size_t getSector() const; /** * Add a reference. */ void addReference(); /** * Remove a reference, and if all references are removed, * delete the object. */ void removeReference(); /** * Set the PCI from the given character array */ void set(const unsigned char* d); /** * Set the PCI from the given sector. */ void set(const Sector& sector); /** * Get the prohibited user operations. */ UserOperations getProhibitedOperations() const; /** * Get the start presentation time. */ pts_t getStartPresentation() const; /** * Set the start presentation time. */ void setStartPresentation(pts_t t); /** * Get the end presentation time. */ pts_t getEndPresentation() const;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -