00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CLIENTDIALDEVICE_H
00016 #define CLIENTDIALDEVICE_H
00017
00018 #include "pandabase.h"
00019
00020 #include "clientDevice.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class EXPCL_PANDA_DEVICE ClientDialDevice : public ClientDevice {
00036 protected:
00037 INLINE ClientDialDevice(ClientBase *client, const string &device_name);
00038
00039 public:
00040 INLINE int get_num_dials() const;
00041
00042 INLINE void push_dial(int index, double offset);
00043 INLINE double read_dial(int index);
00044 INLINE bool is_dial_known(int index) const;
00045
00046 private:
00047 void ensure_dial_index(int index);
00048
00049 protected:
00050 class DialState {
00051 public:
00052 INLINE DialState();
00053
00054 double _offset;
00055 bool _known;
00056 };
00057
00058 typedef pvector<DialState> Dials;
00059 Dials _dials;
00060
00061
00062 public:
00063 static TypeHandle get_class_type() {
00064 return _type_handle;
00065 }
00066 static void init_type() {
00067 ClientDevice::init_type();
00068 register_type(_type_handle, "ClientDialDevice",
00069 ClientDevice::get_class_type());
00070 }
00071 virtual TypeHandle get_type() const {
00072 return get_class_type();
00073 }
00074 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00075
00076 private:
00077 static TypeHandle _type_handle;
00078 };
00079
00080 #include "clientDialDevice.I"
00081
00082 #endif