?? config.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_UTIL_CONFIG_H#define DXR3PLAYER_UTIL_CONFIG_H//------------------------------------------------------------------------------#include "config.h"#include "dvd/demux/DSI.h"#include "JoystickConfig.h"#include "enums.h"#include "types.h"#include <cstdlib>//------------------------------------------------------------------------------/** * Class to hold all configuration information. */class Config{public: /** * The default SCR frequency. */ static const unsigned defaultSCRFrequency = 90000000; /** * The default reader buffer size */ static const size_t defaultReaderBufferSize = 1024; /** * Get the only instance of the configuration. */ static const Config& get(); /** * Initialize the configuration. * * @return if the initialization was successful */ static bool initialize(int argc, char* argv[]);private: /** * Get the reference to the only configuration instance. */ static Config& getInstance(); /** * Print a usage message. */ static void usage(bool iserror);public: /** * Indicate if TV output standard should be kept the same as set * on the board, regardless of what the DV says. */ bool keepStandard; /** * Indicate if the aspect ratio should be kept the same as set * on the board, regardless of what the DV says. */ bool keepAspectRatio; /** * The DVD path. */ const char* dvdPath; /** * Indicate if the DVD should be ejected on startup. */ bool ejectDVD; /** * Indicate if microcode should be uploaded to the DXR3 board. */ bool uploadMicrocode; /** * The path to the microcode file. */ const char* microcodeFileName; /** * The SCR frequency of the DXR3. It is in milliHertzs, relative * to the system's clock. */ unsigned scrFrequency; /** * The reader buffer size (in 2K sectors). */ size_t readerBufferSize; /** * The default language code. */ unsigned defaultLanguageCode; /** * The audio output mode. */ audioMode_t audioMode; /** * Indicate if logging should be verbose. */ bool verboseLogging; /** * The name of the log file, if any. */ const char* logFileName; /** * The name of the directory containing data files (informational * sequences, icons, etc.) */ const char* dataDirectory; /** * The forced display format. */ displayFormat_t forcedDisplayFormat; /** * The audio PTS delay. */ ptsdiff_t audioOffset;#ifdef USE_JOYSTICK /** * The joystick device file. */ const char* js; /** * The joystick config. */ JoystickConfig joystick;#endif /** * The audio stream number to force. */ unsigned forcedAudioStream; /** * The audio language to force, if exists. Defaults to none. */ unsigned forcedAudioLanguage; /** * The subpicture stream number to force. */ unsigned forcedSPUStream; /** * The subpicture language to force, if exists. Defaults to none. */ unsigned forcedSPULanguage; /** * The region to use. If 0 all regions are enabled. */ unsigned region; /** * Indicate if we should quit when an EXIT instruction is hit. */ bool quitOnExit; /** * The default AC-3 volume to set on startup */ unsigned defaultVolume; /** * The default brightness to set on startup */ unsigned defaultBrightness; /** * The default contrast to set on startup */ unsigned defaultContrast; /** * The default saturation to set on startup */ unsigned defaultSaturation; /** * The initial width of the SDL window. */ size_t initialWindowWidth; /** * The initial height of the SDL window. */ size_t initialWindowHeight; /** * The directory for saved states. */ const char* saveDirectory; /** * Indicate if an OSS sound card should be used for DXR3-based * playback */ bool useOSSSoundcard; /** * The number of seconds that has to elapse from the current * program, so that the PREVIOUS_CHAPTER commands goes back to the * start of the program. */ size_t repeatProgramThreshold; /** * The time offset for the 2nd speed of fast forward/backward. */ dvd::demux::DSI::timeOffset_t fast2Offset; /** * The time offset for the 3rd speed of fast forward/backward. */ dvd::demux::DSI::timeOffset_t fast3Offset; private: /** * Construct the configuration with default values. */ Config(); /** * Destroy the configuration. */ ~Config(); /** * Setup the configuration from command-line arguments. * All options not present on the command-line are left unchanged. */ bool setupFromCommandLine(int argc, char* argv[]); /** * Setup the configuration from a file. All options not present * in the file are left unchanged. */ bool setupFromFile(); /** * Print the configuration. */ void print() const;};//------------------------------------------------------------------------------// Inline definitions//------------------------------------------------------------------------------inline Config& Config::getInstance(){ static Config config; return config;}//------------------------------------------------------------------------------inline const Config& Config::get(){ return getInstance();}//------------------------------------------------------------------------------#endif // DXR3PLAYER_UTIL_CONFIG_H// Local variables:// mode: c++// End:
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -