/* * Updates the page to reflect the current configuration of * the display device. */ void ctk_image_sliders_setup(CtkImageSliders *ctk_image_sliders) { if (!ctk_image_sliders) return; /* Update sliders */ /* NV_CTRL_DIGITAL_VIBRANCE */ setup_scale(ctk_image_sliders, NV_CTRL_DIGITAL_VIBRANCE, ctk_image_sliders->digital_vibrance); /* NV_CTRL_IMAGE_SHARPENING */ setup_scale(ctk_image_sliders, NV_CTRL_IMAGE_SHARPENING, ctk_image_sliders->image_sharpening); setup_reset_button(ctk_image_sliders); } /* ctk_image_sliders_setup() */
static void scale_value_received(GObject *object, CtrlEvent *event, gpointer user_data) { CtkImageSliders *ctk_image_sliders = CTK_IMAGE_SLIDERS(user_data); GtkAdjustment *adj; GtkWidget *scale; gint val; if (event->type != CTRL_EVENT_TYPE_INTEGER_ATTRIBUTE) { return; } switch (event->int_attr.attribute) { case NV_CTRL_DIGITAL_VIBRANCE: scale = ctk_image_sliders->digital_vibrance; break; case NV_CTRL_IMAGE_SHARPENING: scale = ctk_image_sliders->image_sharpening; break; default: return; } if (event->int_attr.is_availability_changed) { setup_scale(ctk_image_sliders, event->int_attr.attribute, scale); } adj = CTK_SCALE(scale)->gtk_adjustment; val = gtk_adjustment_get_value(GTK_ADJUSTMENT(adj)); if (val != event->int_attr.value) { val = event->int_attr.value; g_signal_handlers_block_by_func(adj, scale_value_changed, ctk_image_sliders); gtk_adjustment_set_value(GTK_ADJUSTMENT(adj), val); post_scale_value_changed(GTK_ADJUSTMENT(adj), ctk_image_sliders, val); g_signal_handlers_unblock_by_func(adj, scale_value_changed, ctk_image_sliders); } } /* scale_value_received() */
/* * Updates the display device TV page to reflect the current * configuration of the display device. */ static void ctk_display_device_tv_setup(CtkDisplayDeviceTv *ctk_display_device_tv) { /* Disable the reset button here and allow the controls below to (re)enable * it if need be,. */ gtk_widget_set_sensitive(ctk_display_device_tv->reset_button, FALSE); /* Update info */ tv_info_setup(ctk_display_device_tv); /* update acquire EDID button */ ctk_edid_setup(CTK_EDID(ctk_display_device_tv->edid)); /* Update controls */ /* NV_CTRL_TV_OVERSCAN */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_OVERSCAN, ctk_display_device_tv->overscan); /* NV_CTRL_TV_FLICKER_FILTER */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_FLICKER_FILTER, ctk_display_device_tv->flicker_filter); /* NV_CTRL_TV_BRIGHTNESS */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_BRIGHTNESS, ctk_display_device_tv->brightness); /* NV_CTRL_TV_HUE */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_HUE, ctk_display_device_tv->hue); /* NV_CTRL_TV_CONTRAST */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_CONTRAST, ctk_display_device_tv->contrast); /* NV_CTRL_TV_SATURATION */ setup_scale(ctk_display_device_tv, NV_CTRL_TV_SATURATION, ctk_display_device_tv->saturation); ctk_image_sliders_setup (CTK_IMAGE_SLIDERS(ctk_display_device_tv->image_sliders)); } /* ctk_display_device_tv_setup() */