/****************************************************************************** * Copyright (c) 2007 Hewlett-Packard Development Company, L.P. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE ********************************************************************************/ /******************************************************************************* * SVN MACROS * * $LastChangedDate: 2008-07-18 15:00:39 +0530 (Fri, 18 Jul 2008) $ * $Revision: 561 $ * $Author: sharmnid $ * *****************************************************************************/ /***************************************************************************** * FILE DESCR: Implementation of LTKCaptureDevice which holds the information * about the digitizer. * * CONTENTS: * getSampleRate * getLatency * getXDPI * getYDPI * isUniformSamplingRate * setXDPI * setYDPI * * AUTHOR: Balaji R. * * DATE: December 23, 2004 * CHANGE HISTORY: * Author Date Description of change *****************************************************************************/ #include "LTKCaptureDevice.h" #include "LTKErrorsList.h" #include "LTKLoggerUtil.h" #include "LTKMacros.h" #include "LTKException.h" #include "LTKErrors.h" /****************************************************************************** * AUTHOR : Balaji R. * DATE : 23-DEC-2004 * NAME : LTKCaptureDevice * DESCRIPTION : Default Constructor * ARGUMENTS : * RETURNS : * NOTES : * CHANGE HISTROY * Author Date Description of change * ****************************************************************************/ LTKCaptureDevice::LTKCaptureDevice(): m_samplingRate(DEFAULT_SAMPLING_RATE), m_xDpi(DEFAULT_X_DPI), m_yDpi(DEFAULT_Y_DPI), m_latency(DEFAULT_LATENCY), m_isUniformSamplingRate(true) { LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << "Enter: LTKCaptureDevice::LTKCaptureDevice()" << endl; LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << "Exit: LTKCaptureDevice::LTKCaptureDevice()" << endl; } /****************************************************************************** * AUTHOR : Balaji R. * DATE : 23-DEC-2004 * NAME : LTKCaptureDevice * DESCRIPTION : Initializes the members of the class * ARGUMENTS : sRate - sampling rate of the digitizer * uniform - type of the sampling * lValue - latency of the digitizer * xDpiVal - resolution in the x direction of the digitizer * (in dots per inch) * yDpiVal - resolution in the y direction of the digitizer (in dots per inch) * RETURNS : * NOTES : * CHANGE HISTROY * Author Date Description of change * ****************************************************************************/ LTKCaptureDevice::LTKCaptureDevice(int sRate, bool uniform, float lValue, int xDpiVal, int yDpiVal) : m_samplingRate(sRate), m_xDpi(xDpiVal), m_yDpi(yDpiVal), m_latency(lValue), m_isUniformSamplingRate(uniform) { LOG( LTKLogger::LTK_LOGLEVEL_DEBUG) << "Enter: LTKCaptureDevice::LTKCaptureDevice(int, bool, float, int, int)" << endl; if (m_samplingRate <= 0) { LOG( LTKLogger::LTK_LOGLEVEL_ERR) << "Error: "<