📄 processorhandler.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_READER_PROCESSORHANDLER_H#define DXR3PLAYER_DVD_READER_PROCESSORHANDLER_H//------------------------------------------------------------------------------#include "dvd/vm/Processor.h"#include "dvd/vm/SimpleProcessorCommand.h"//------------------------------------------------------------------------------namespace dvd { namespace demux {class DemultiplexerParameters;} }//------------------------------------------------------------------------------namespace dvd { namespace vm {class ProcessorCommandQueue;class State;} }//------------------------------------------------------------------------------namespace output {class AVAttributes;}//------------------------------------------------------------------------------namespace dvd { namespace reader {//------------------------------------------------------------------------------/** * The processor handler. It encapsulates some functions of the * processor and helps to keep track of certain things. */class ProcessorHandler{private: /** * The processor. */ dvd::vm::Processor processor; /** * The processor command queue. */ dvd::vm::ProcessorCommandQueue& commandQueue; /** * The ID of the last command put into the command queue. */ size_t lastCommandID; public: /** * Construct the processor handler. */ ProcessorHandler(dvd::vm::ProcessorCommandQueue& commandQueue, dvd::DVD* dvd); /** * Reset the handler. */ void reset(); /** * Get the position. */ const dvd::vm::Position& getPosition() const; /** * Get the state. */ const dvd::vm::State& getState() const; /** * Get the system parameter register file */ const dvd::vm::SPRM& getSPRM() const; /** * Set the processor's state. */ void setState(const dvd::vm::State& state); /** * Get and reset the last command ID. */ size_t getLastCommandID(); /** * Get the stream attributes into the given structure. */ void getStreamAttributes(output::AVAttributes& attributes) const; /** * Get the SPU palette into the given array. */ void getSPUPalette(palette_t palette) const; /** * Get the parameters for the demultiplexer. */ void getDemultiplexerParameters(dvd::demux::DemultiplexerParameters& parameters) const; /** * Reset the processor and go to the first play PGC. */ void resetProcessor(); /** * Branch the processor according to the given state. * FIXME: rename to setState */ void branch(const dvd::vm::State& state); /** * Set the sector number of the processor. */ void setSectorNumber(size_t sectorNo); /** * Set the highlighted button number. */ void setHighlightedButtonNumber(size_t buttonNo); /** * Instruct the processor to go to the next cell. * * @param stillTime will contain the length of the still time * after the cell. * * @return if there was a next cell or not */ bool nextCell(unsigned& stillTime); /** * Instruct the processor to go to the previous cell. * * @return if there was a previous cell or not */ bool previousCell(); private: /** * Enqeue the given command */ void enqueueCommand(dvd::vm::SimpleProcessorCommand::command_t cmd); /** * Enqeue the given command */ void enqueueCommand(dvd::vm::ProcessorCommand* command);};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------inline const dvd::vm::Position& ProcessorHandler::getPosition() const{ return processor.getPosition();}//------------------------------------------------------------------------------inline const dvd::vm::State& ProcessorHandler::getState() const{ return processor.getState();}//------------------------------------------------------------------------------inline const dvd::vm::SPRM& ProcessorHandler::getSPRM() const{ return processor.getSPRM();}//------------------------------------------------------------------------------} /* namespace dvd::reader */ } /* namespace dvd *///------------------------------------------------------------------------------#endif // DVD_READER_PROCESSORHANDLER_H// Local variables:// mode: c++// End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -