void calculate_iqa(GtkWidget* widget) { IQA_T iqa_t; IQA_W_T iqa_w_t; IQAIndex idx; double result; char result_text[10]; iqa_t.O2 = get_entry_value_d(&gEntryOD); iqa_t.CF = get_entry_value_d(&gEntryCF); iqa_t.PH = get_entry_value_d(&gEntryPH); iqa_t.DBO = get_entry_value_d(&gEntryDBO); iqa_t.DT = get_entry_value_d(&gEntryDT); iqa_t.NT = get_entry_value_d(&gEntryNT); iqa_t.FT = get_entry_value_d(&gEntryFT); iqa_t.TU = get_entry_value_d(&gEntryTU); iqa_t.ST = get_entry_value_d(&gEntryST); if ( ! validate_t(iqa_t)) { return 0; } iqa_w_t.O2 = get_spin_btn_value(&gSpinOD); iqa_w_t.CF = get_spin_btn_value(&gSpinCF); iqa_w_t.PH = get_spin_btn_value(&gSpinPH); iqa_w_t.DBO = get_spin_btn_value(&gSpinDBO); iqa_w_t.DT = get_spin_btn_value(&gSpinDT); iqa_w_t.NT = get_spin_btn_value(&gSpinNT); iqa_w_t.FT = get_spin_btn_value(&gSpinFT); iqa_w_t.TU = get_spin_btn_value(&gSpinTU); iqa_w_t.ST = get_spin_btn_value(&gSpinST); result = iqa_c(iqa_t, iqa_w_t); g_print("Nova Medicao\n\n"); g_print("\tValores do IQA:\n"); print_iqa_t(&iqa_t); g_print("\n\tPesos da Medição:\n"); print_iqa_w_t(&iqa_w_t); g_printf("Resultado: %lf\n", result); sprintf(result_text, "%lf", result); idx = iqa_conama_index(result); set_entry_value(&gEntryIQA, result_text); set_entry_value(&gEntryIQAIndex, iqa_index_string(idx)); }
LOCAL_CACHE_TEMPLATE void LOCAL_CACHE_CLASS::put(const KeyT& key, const ValueT& val) { if (capacity < 1) { return ; } // lock tbsys::CThreadGuard guard(&mutex); entry_cache_iterator iter = cache.find(&key); internal_entry *entry = NULL; if (iter == cache.end()) { // not found // evict entry while (cache.size() >= capacity) { assert(capacity >= 1); const internal_entry *evict = evict_one(); assert(evict != NULL); // free entry drop_entry(evict); } // insert new one // allocate internal_entry, relase after evict or in clear() entry = make_entry(key, val); if (entry == NULL) { return ; } lru.push_front(entry); } else { // found, already exists // adjust lru list lru.splice(lru.begin(), lru, iter->second); // update entry value and utime // update first, some meta info cache.erase(iter); entry_list_iterator elem = lru.begin(); set_entry_key(elem, key); set_entry_value(elem, val); set_entry_utime_now(elem); entry = *elem; } cache[&(entry->key)] = lru.begin(); }
void Snes9xPreferences::move_settings_to_dialog (void) { set_check ("full_screen_on_open", config->full_screen_on_open); set_check ("show_frame_rate", Settings.DisplayFrameRate); set_check ("change_display_resolution", config->change_display_resolution); set_check ("scale_to_fit", config->scale_to_fit); set_check ("overscan", config->overscan); set_check ("multithreading", config->multithreading); set_combo ("hires_effect", config->hires_effect); set_check ("maintain_aspect_ratio", config->maintain_aspect_ratio); set_combo ("aspect_ratio", config->aspect_ratio); if (config->sram_directory[0] == '\0') set_entry_text ("sram_directory", SAME_GAME); else set_entry_text ("sram_directory", config->sram_directory); if (config->savestate_directory[0] == '\0') set_entry_text ("savestate_directory", SAME_GAME); else set_entry_text ("savestate_directory", config->savestate_directory); if (config->patch_directory[0] == '\0') set_entry_text ("patch_directory", SAME_GAME); else set_entry_text ("patch_directory", config->patch_directory); if (config->cheat_directory[0] == '\0') set_entry_text ("cheat_directory", SAME_GAME); else set_entry_text ("cheat_directory", config->cheat_directory); if (config->export_directory[0] == '\0') set_entry_text ("export_directory", SAME_GAME); else set_entry_text ("export_directory", config->export_directory); set_combo ("resolution_combo", config->xrr_index); set_combo ("scale_method_combo", config->scale_method); set_entry_value ("save_sram_after_sec", Settings.AutoSaveDelay); set_check ("block_invalid_vram_access", Settings.BlockInvalidVRAMAccessMaster); set_check ("upanddown", Settings.UpAndDown); set_combo ("default_esc_behavior", config->default_esc_behavior); set_check ("prevent_screensaver", config->prevent_screensaver); set_check ("force_inverted_byte_order", config->force_inverted_byte_order); set_check ("stereo_check", Settings.Stereo); set_combo ("playback_combo", 7 - config->sound_playback_rate); set_combo ("hw_accel", combo_value (config->hw_accel)); set_check ("pause_emulation_on_switch", config->pause_emulation_on_switch); set_spin ("num_threads", config->num_threads); set_check ("mute_sound_check", config->mute_sound); set_check ("mute_sound_turbo_check", config->mute_sound_turbo); set_spin ("sound_buffer_size", config->sound_buffer_size); set_slider ("sound_input_rate", config->sound_input_rate); set_check ("sync_sound", Settings.SoundSync); set_spin ("rewind_buffer_size", config->rewind_buffer_size); set_spin ("rewind_granularity", config->rewind_granularity); int num_sound_drivers = 0; #ifdef USE_PORTAUDIO num_sound_drivers++; #endif #ifdef USE_OSS num_sound_drivers++; #endif #ifdef USE_JOYSTICK num_sound_drivers++; #endif #ifdef USE_ALSA num_sound_drivers++; #endif #ifdef USE_PULSEAUDIO num_sound_drivers++; #endif if (config->sound_driver >= num_sound_drivers) config->sound_driver = 0; set_combo ("sound_driver", config->sound_driver); if (config->scale_method == FILTER_NTSC) { gtk_widget_show (get_widget ("ntsc_frame")); } else { gtk_widget_hide (get_widget ("ntsc_frame")); } if (config->scale_method == FILTER_SCANLINES) { gtk_widget_show (get_widget ("scanline_filter_frame")); } else { gtk_widget_hide (get_widget ("scanline_filter_frame")); } load_ntsc_settings (); set_combo ("ntsc_scanline_intensity", config->ntsc_scanline_intensity); set_combo ("scanline_filter_intensity", config->scanline_filter_intensity); set_combo ("frameskip_combo", Settings.SkipFrames == AUTO_FRAMERATE ? 0 : Settings.SkipFrames + 1); set_check ("bilinear_filter", config->bilinear_filter); #ifdef USE_OPENGL set_check ("sync_to_vblank", config->sync_to_vblank); set_check ("sync_every_frame", config->sync_every_frame); set_check ("use_pbos", config->use_pbos); set_combo ("pixel_format", config->pbo_format); set_check ("npot_textures", config->npot_textures); set_check ("use_shaders", config->use_shaders); set_entry_text ("fragment_shader", config->fragment_shader); #endif #ifdef USE_JOYSTICK set_spin ("joystick_threshold", config->joystick_threshold); #else gtk_widget_set_sensitive (get_widget ("joystick_box"), FALSE); #endif /* Control bindings */ memcpy (pad, config->pad, (sizeof (JoypadBinding)) * NUM_JOYPADS); memcpy (shortcut, config->shortcut, (sizeof (Binding)) * NUM_EMU_LINKS); bindings_to_dialog (0); set_combo ("joypad_to_swap_with", 0); return; }
void gth_edit_iptc_page_real_set_file_list (GthEditCommentPage *base, GList *file_data_list) { GthEditIptcPage *self; GList *scan; GthMetadata *metadata; self = GTH_EDIT_IPTC_PAGE (base); self->priv->supported = TRUE; for (scan = file_data_list; self->priv->supported && scan; scan = scan->next) { GthFileData *file_data = scan->data; self->priv->supported = exiv2_supports_writes (gth_file_data_get_mime_type (file_data)); } if (! self->priv->supported) { gtk_widget_hide (GTK_WIDGET (base)); return; } _g_object_unref (self->priv->info); self->priv->info = gth_file_data_list_get_common_info (file_data_list, "Iptc::Application2::Copyright,Iptc::Application2::Credit,Iptc::Application2::Byline,Iptc::Application2::BylineTitle,Iptc::Application2::CountryName,Iptc::Application2::CountryCode,Iptc::Application2::City,Iptc::Application2::Language,Iptc::Application2::ObjectName,Iptc::Application2::Source,Iptc::Envelope::Destination,Iptc::Application2::Urgency,Iptc::Application2:ProvinceState"); set_entry_value (self, self->priv->info, "Iptc::Application2::Copyright", "copyright_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::Credit", "credit_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::Byline", "byline_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::BylineTitle", "byline_title_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::CountryName", "country_name_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::CountryCode", "country_code_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::ProvinceState", "state_name_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::City", "city_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::Language", "language_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::ObjectName", "object_name_entry"); set_entry_value (self, self->priv->info, "Iptc::Application2::Source", "source_entry"); set_entry_value (self, self->priv->info, "Iptc::Envelope::Destination", "destination_entry"); metadata = (GthMetadata *) g_file_info_get_attribute_object (self->priv->info, "Iptc::Application2::Urgency"); if (metadata != NULL) { float v; if (sscanf (gth_metadata_get_formatted (metadata), "%f", &v) == 1) gtk_adjustment_set_value (GTK_ADJUSTMENT (GET_WIDGET ("urgency_adjustment")), (double) v); else gtk_adjustment_set_value (GTK_ADJUSTMENT (GET_WIDGET ("urgency_adjustment")), 0.0); } else gtk_adjustment_set_value (GTK_ADJUSTMENT (GET_WIDGET ("urgency_adjustment")), 0.0); gtk_widget_show (GTK_WIDGET (base)); }