}
static void zoom_value_changed_cb(GtkWidget *widget, gpointer data) {
-g_print("zoom_value_changed_cb\n");
g_mutex_lock(&pan_zoom_mutex);
g_mutex_lock(&active_receiver->display_mutex);
#ifdef CLIENT_SERVER
}
void set_zoom(int rx,double value) {
-g_print("set_zoom: %f\n",value);
receiver[rx]->zoom=value;
+ receiver_change_zoom(receiver[rx],value);
if(display_zoompan) {
+ g_signal_handler_block(G_OBJECT(zoom_scale),zoom_signal_id);
gtk_range_set_value (GTK_RANGE(zoom_scale),receiver[rx]->zoom);
+ g_signal_handler_unblock(G_OBJECT(zoom_scale),zoom_signal_id);
+ g_signal_handler_block(G_OBJECT(pan_scale),pan_signal_id);
+ gtk_range_set_range(GTK_RANGE(pan_scale),0.0,(double)(active_receiver->zoom==1?active_receiver->pixels:active_receiver->pixels-active_receiver->width));
+ gtk_range_set_value (GTK_RANGE(pan_scale),active_receiver->pan);
+ g_signal_handler_unblock(G_OBJECT(pan_scale),pan_signal_id);
+ if(active_receiver->zoom==1) {
+ gtk_widget_set_sensitive(pan_scale, FALSE);
+ } else {
+ gtk_widget_set_sensitive(pan_scale, TRUE);
+ }
} else {
if(scale_status!=ZOOM || scale_rx!=rx) {
if(scale_status!=NO_FUNCTION) {
}
void remote_set_zoom(int rx,double value) {
-g_print("remote_set_zoom: rx=%d zoom=%f\n",rx,value);
g_mutex_lock(&pan_zoom_mutex);
g_signal_handler_block(G_OBJECT(zoom_scale),zoom_signal_id);
g_signal_handler_block(G_OBJECT(pan_scale),pan_signal_id);
g_signal_handler_unblock(G_OBJECT(pan_scale),pan_signal_id);
g_signal_handler_unblock(G_OBJECT(zoom_scale),zoom_signal_id);
g_mutex_unlock(&pan_zoom_mutex);
-g_print("remote_set_zoom: EXIT\n");
}
void update_zoom(double zoom) {
-g_print("update_zoom: %f\n",zoom);
int z=active_receiver->zoom+(int)zoom;
if(z>MAX_ZOOM) z=MAX_ZOOM;
if(z<1) z=1;
}
static void pan_value_changed_cb(GtkWidget *widget, gpointer data) {
-g_print("pan_value_changed_cb\n");
g_mutex_lock(&pan_zoom_mutex);
#ifdef CLIENT_SERVER
if(radio_is_remote) {
}
void set_pan(int rx,double value) {
-g_print("set_pan: %f\n",value);
receiver[rx]->pan=(int)value;
if(display_zoompan) {
+ g_signal_handler_block(G_OBJECT(pan_scale),pan_signal_id);
gtk_range_set_value (GTK_RANGE(pan_scale),receiver[rx]->pan);
+ g_signal_handler_unblock(G_OBJECT(pan_scale),pan_signal_id);
} else {
if(scale_status!=PAN || scale_rx!=rx) {
if(scale_status!=NO_FUNCTION) {
}
void remote_set_pan(int rx,double value) {
-g_print("remote_set_pan: rx=%d pan=%f\n",rx,value);
g_mutex_lock(&pan_zoom_mutex);
g_signal_handler_block(G_OBJECT(pan_scale),pan_signal_id);
gtk_range_set_range(GTK_RANGE(pan_scale),0.0,(double)(receiver[rx]->zoom==1?receiver[rx]->pixels:receiver[rx]->pixels-receiver[rx]->width));
set_pan(rx,value);
g_signal_handler_unblock(G_OBJECT(pan_scale),pan_signal_id);
g_mutex_unlock(&pan_zoom_mutex);
-g_print("remote_set_pan: EXIT\n");
}
void update_pan(double pan) {
- g_mutex_lock(&pan_zoom_mutex);
if(active_receiver->zoom>1) {
int p=active_receiver->pan+(int)pan;
if(p<0) p=0;
if(p>(active_receiver->pixels-active_receiver->width)) p=active_receiver->pixels-active_receiver->width;
set_pan(active_receiver->id,(double)p);
}
- g_mutex_lock(&pan_zoom_mutex);
}
GtkWidget *zoompan_init(int my_width, int my_height) {
width=my_width;
height=my_height;
-fprintf(stderr,"zoompan_init: width=%d height=%d\n", width,height);
+g_print("%s: width=%d height=%d\n",__FUNCTION__,width,height);
zoompan=gtk_grid_new();
gtk_widget_set_size_request (zoompan, width, height);