18 #define GET_TIME(val) if (gettimeofday(val, 0) != 0) cout << "Output: Error reading current time" << endl;
19 #define SUB_TIMES(t1, t2) (((t1->tv_sec - t2->tv_sec) * 1000000) + (t1->tv_usec - t2->tv_usec))
66 Controller(
string remote_net_addr,
unsigned short remote_port):
67 glove_state(
kOpen), foreign_port(remote_port), foreign_net_address(remote_net_addr) { };
73 void get_position(
CPoint &p);
74 void * remote_read_func(
void *
data);
75 void start_reader_thread();
76 void get_remote_data();
97 void calculate_absolute_position(
CPoint &new_position);
98 void calculate_new_position_in_orbit();
102 #define MAX_TRACE_LENGTH (100 * 15) // 100 positions per second for max 15 seconds
117 void set_position(
CPoint &P );
119 void update_position();
126 void push_trace(
CPoint &pos );
129 void set_bounce_distance(
float bd);
145 void update_grabbed_position(
CPoint &p);
146 bool check_for_grabbed_source(
CPoint &p );
152 void manage_sources();
155 static void * management_func(
void *
data);
156 void start_management_thread();
157 void stop_management_thread() ;
159 PME(
string remote_net_addr,
unsigned short remote_port);