00001 /*************************************************************************** 00002 l1394_deviceregister.h - description 00003 ------------------- 00004 begin : Fri Nov 24 2000 00005 copyright : (C) 2000-2004 by Michael Repplinger 00006 email : repplinger@cs.uni-sb.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef DEVICEREGISTER_H 00019 #define DEVICEREGISTER_H 00020 00021 #include "l1394_qarray.h" 00022 namespace L1394 00023 { 00024 00025 /*! \class DeviceRegister 00026 * \ingroup L1394_Register 00027 * \brief This class defines the interface of an L1394 Register for most common devices. 00028 * 00029 * If you access a feature of a device a so called L1394 Register object is returned. 00030 * The L1394 Register object provides functions to define how to execute the feature. 00031 * 00032 * The functions of this class define the minimum interface for all devices (except DccCameras). 00033 * 00034 * If you store a pointer to a L1394 Register object remember, that the functions of 00035 * this class are only valid for the last feature called by the device. 00036 * 00037 * Illegal combinations are ignored. 00038 * 00039 * In the actual version of the library this class provides only three functions : <BR> 00040 * 00041 * Function send() : <BR> 00042 * This function executes a command and returns the response_code of the device. 00043 * The response code, defined in AV/C Digital Interface Command Set General 00044 * Specification (Version 3.0), is used.(see the description of function send() for 00045 * the return values.) 00046 * 00047 * Function hasFeature() : <BR> 00048 * This function tests, if a feature is supported by a device. 00049 * It returns true, if a feature is supported, false if not. 00050 * 00051 * Function status() : <BR> 00052 * This function can be used, to get the actual status of a command. 00053 * The response code, defined in AV/C Digital Interface Command Set General 00054 * Specification (Version 3.0), is used.(see the description of function status() for 00055 * the return values.) 00056 * 00057 * 00058 * @author Michael Repplinger 00059 */ 00060 00061 class DeviceRegister 00062 { 00063 public: 00064 /*! \name DccCamera constructor 00065 * These functions creates the Register objects for Devices. 00066 */ 00067 //@{ 00068 /*! \fn ~DeviceRegister() 00069 * \brief destructor 00070 */ 00071 virtual ~DeviceRegister() {} 00072 //@} 00073 /*! \name Register interface for all devices 00074 * These functions define the minimal register interface for all devices (except DccCameras) 00075 */ 00076 //@{ 00077 /*! \fn send() const 00078 * \brief This function sends a command to the device and returns the response code. 00079 * 00080 * \return int : The following response codes are defined: <BR> 00081 * NOT_IMPLEMENTED (0x08) : Feature not implemented. <BR> 00082 * ACCEPTED (0x09) : Feature is accepted and will be executed <BR> 00083 * REJECTED (0x0A) : The Feature is supported, but the target state does not 00084 * permit the execution of this command(You get this value, if you try to 00085 * execute the play control command and no cassette is inserted in the device.) <BR> 00086 * INTERIM (0x0f) : returned, if the device couldn't send a ACCEPTED or REJECTED 00087 * fast enough <BR> 00088 * 00089 */ 00090 virtual int send() const =0; 00091 00092 00093 /*! \fn hasFeature() const 00094 * \brief This function tests, if a command is supported by a node, false if not. 00095 * 00096 * For this function the general inquiry command is used. 00097 * \return bool : return true, if node report an IMPLEMENTED for this feature, false if not. 00098 */ 00099 virtual bool hasFeature() const =0; 00100 00101 00102 /*! \fn status() const 00103 * \brief This function returns the actual status of command. 00104 * \return int : The following status commands are implemented <BR> 00105 * NOT_IMPLEMENTED : The feature is not implemented. <BR> 00106 * REJECTED : The device implements the status command, but device state doesn't 00107 * permit a status of the command. <BR> 00108 * IN_TRANSITION : The device is already in transition with the status command <BR> 00109 * STABLE : status command was executed successful<BR> 00110 */ 00111 virtual L1394::QArray status() const =0; 00112 //@} 00113 }; 00114 } 00115 #endif