📄 pgc.h
字号:
private: const pgci_srp_t* pgci_srp;public: /** * Construct the PGC information object */ explicit PGCInfo(const pgci_srp_t* pgci_srp); /** * Get the entry ID. */ unsigned getEntryID() const; /** * Get the PGC. */ PGC getPGC() const;};//------------------------------------------------------------------------------/** * Program Chain table */class PGCTable{private: /** * The low-level structure */ const pgcit_t* pgcit;public: /** * Construct the PGC table object. */ explicit PGCTable(const pgcit_t* pgcit); /** * Check if the PGC table is valid. */ operator bool() const; /** * Get the number of PGCs */ unsigned getNumberOfPGCs() const; /** * Get the PGC Information object for the given, 1-based PGC * number. */ PGCInfo getPGCInfo(unsigned pgcNo) const; /** * Get the PGC for the given, 1-based PGC number. */ PGC getPGC(unsigned pgcNo) const;};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------inline CellPlaybackInfo::CellPlaybackInfo(const cell_playback_t* cell_playback) : cell_playback(cell_playback){}//------------------------------------------------------------------------------inline bool CellPlaybackInfo::isInAngleBlock() const{ return cell_playback->block_type == 1; // FIXME: use constants}//------------------------------------------------------------------------------inline bool CellPlaybackInfo::isFirstInAngleBlock() const{ return cell_playback->block_mode == 1; // FIXME: use constants}//------------------------------------------------------------------------------inline unsigned CellPlaybackInfo::getFirstSector() const{ return cell_playback->first_sector;}//------------------------------------------------------------------------------inline unsigned CellPlaybackInfo::getLastVOBUFirstSector() const{ return cell_playback->last_vobu_start_sector;}//------------------------------------------------------------------------------inline unsigned CellPlaybackInfo::getCellCommandNumber() const{ return cell_playback->cell_cmd_nr;}//------------------------------------------------------------------------------inline unsigned CellPlaybackInfo::getStillTime() const{ return cell_playback->still_time;}//------------------------------------------------------------------------------inline unsigned long long CellPlaybackInfo::getPlaybackTime(unsigned& fps) const{ return dvdTime2Frames(cell_playback->playback_time, fps);}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline CommandTable::CommandTable(const pgc_command_tbl_t* pgc_command_tbl) : pgc_command_tbl(pgc_command_tbl){}//------------------------------------------------------------------------------inline CommandTable::operator bool() const{ return pgc_command_tbl!=0;}//------------------------------------------------------------------------------inline unsigned CommandTable::getNumberOfPreCommands() const{ return pgc_command_tbl->nr_of_pre;}//------------------------------------------------------------------------------inline const dvd::vm::Instruction* CommandTable::getPreCommands() const{ return reinterpret_cast<const dvd::vm::Instruction*>(pgc_command_tbl->pre_cmds);}//------------------------------------------------------------------------------inline unsigned CommandTable::getNumberOfPostCommands() const{ return pgc_command_tbl->nr_of_post;}//------------------------------------------------------------------------------inline const dvd::vm::Instruction* CommandTable::getPostCommands() const{ return reinterpret_cast<const dvd::vm::Instruction*>(pgc_command_tbl->post_cmds);}//------------------------------------------------------------------------------inline unsigned CommandTable::getNumberOfCellCommands() const{ return pgc_command_tbl->nr_of_cell;}//------------------------------------------------------------------------------inline const dvd::vm::Instruction* CommandTable::getCellCommands() const{ return reinterpret_cast<const dvd::vm::Instruction*>(pgc_command_tbl->cell_cmds);}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline PGC::PGC(const pgc_t* pgc) : pgc(pgc){}//------------------------------------------------------------------------------inline PGC::operator bool() const{ return pgc!=0;}//------------------------------------------------------------------------------inline unsigned PGC::getNextPGCNumber() const{ return pgc->next_pgc_nr;}//------------------------------------------------------------------------------inline unsigned PGC::getPreviousPGCNumber() const{ return pgc->prev_pgc_nr;}//------------------------------------------------------------------------------inline unsigned PGC::getGoUpPGCNumber() const{ return pgc->goup_pgc_nr;}//------------------------------------------------------------------------------inline unsigned PGC::getNumberOfPrograms() const{ return pgc->nr_of_programs;}//------------------------------------------------------------------------------inline unsigned PGC::getEntryCellNumber(unsigned programNo) const{ assert(programNo>=1 && programNo<=getNumberOfPrograms()); return pgc->program_map[programNo-1];}//------------------------------------------------------------------------------inline unsigned PGC::getNumberOfCells() const{ return pgc->nr_of_cells;}//------------------------------------------------------------------------------inline bool PGC::isEmpty() const{ return getNumberOfCells()==0;}//------------------------------------------------------------------------------inline CellPlaybackInfo PGC::getCellPlaybackInfo(unsigned cellNo) const{ assert(cellNo>=1 && cellNo<=getNumberOfCells()); return CellPlaybackInfo(pgc->cell_playback + cellNo - 1);}//------------------------------------------------------------------------------inline CommandTable PGC::getCommandTable() const{ return CommandTable(pgc->command_tbl);}//------------------------------------------------------------------------------inline unsigned PGC::findNextBaseCell(unsigned cellNo) const{ return findBaseCell(cellNo, true);}//------------------------------------------------------------------------------inline unsigned PGC::findPreviousBaseCell(unsigned cellNo) const{ return findBaseCell(cellNo, false);}//------------------------------------------------------------------------------inline UserOperations PGC::getProhibitedOperations() const{ return UserOperations(pgc->prohibited_ops);}//------------------------------------------------------------------------------inline void PGC::getSPUPalette(palette_t palette) const{ for(size_t i = 0; i<16; ++i) { palette[i] = (unsigned)pgc->palette[i]; }}//------------------------------------------------------------------------------inline unsigned PGC::getStillTime() const{ return pgc->still_time;}//------------------------------------------------------------------------------inline unsigned long long PGC::getPlaybackTime(unsigned& fps) const{ return dvdTime2Frames(pgc->playback_time, fps);}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline PGCInfo::PGCInfo(const pgci_srp_t* pgci_srp) : pgci_srp(pgci_srp){}//------------------------------------------------------------------------------inline unsigned PGCInfo::getEntryID() const{ return pgci_srp->entry_id;}//------------------------------------------------------------------------------inline PGC PGCInfo::getPGC() const{ return PGC(pgci_srp->pgc);}//------------------------------------------------------------------------------//------------------------------------------------------------------------------inline PGCTable::PGCTable(const pgcit_t* pgcit) : pgcit(pgcit){}//------------------------------------------------------------------------------inline PGCTable::operator bool() const{ return pgcit != 0;}//------------------------------------------------------------------------------inline unsigned PGCTable::getNumberOfPGCs() const{ return pgcit->nr_of_pgci_srp;}//------------------------------------------------------------------------------inline PGCInfo PGCTable::getPGCInfo(unsigned pgcNo) const{ assert(pgcNo>=1 && pgcNo<=getNumberOfPGCs()); return PGCInfo(pgcit->pgci_srp + pgcNo - 1);}//------------------------------------------------------------------------------inline PGC PGCTable::getPGC(unsigned pgcNo) const{ return getPGCInfo(pgcNo).getPGC();}//------------------------------------------------------------------------------} /* namespace dvd *///------------------------------------------------------------------------------#endif // DXR3PLAYER_DVD_PGC_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -