414
425
* @param device the Cheese.CameraDevice for which to enumerate resolutions
427
static Block1Data* block1_data_ref (Block1Data* _data1_) {
428
g_atomic_int_inc (&_data1_->_ref_count_);
433
static void block1_data_unref (Block1Data* _data1_) {
434
if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
435
_g_object_unref0 (_data1_->self);
436
_g_object_unref0 (_data1_->resolution_model);
437
g_slice_free (Block1Data, _data1_);
442
static void __lambda0_ (Block1Data* _data1_, CheeseVideoFormat* format) {
443
CheesePreferencesDialog * self;
444
GtkTreeIter iter = {0};
445
GtkListStore* _tmp0_;
446
GtkTreeIter _tmp1_ = {0};
447
GtkListStore* _tmp2_;
449
CheeseVideoFormat* _tmp4_;
451
gchar* _tmp6_ = NULL;
455
CheeseVideoFormat* _tmp10_;
457
gchar* _tmp12_ = NULL;
461
CheeseVideoFormat* _tmp16_;
462
gboolean _tmp17_ = FALSE;
463
CheeseCamera* _tmp18_;
464
CheeseVideoFormat* _tmp19_ = NULL;
466
CheeseVideoFormat* _tmp21_;
469
gboolean _tmp37_ = FALSE;
472
CheeseVideoFormat* _tmp40_;
475
self = _data1_->self;
476
g_return_if_fail (format != NULL);
477
_tmp0_ = _data1_->resolution_model;
478
gtk_list_store_append (_tmp0_, &_tmp1_);
480
_tmp2_ = _data1_->resolution_model;
483
_tmp5_ = _tmp4_->width;
484
_tmp6_ = g_strdup_printf ("%i", _tmp5_);
486
_tmp8_ = g_strconcat (_tmp7_, " Ć ", NULL);
489
_tmp11_ = _tmp10_->height;
490
_tmp12_ = g_strdup_printf ("%i", _tmp11_);
492
_tmp14_ = g_strconcat (_tmp9_, _tmp13_, NULL);
495
gtk_list_store_set (_tmp2_, &_tmp3_, 0, _tmp15_, 1, _tmp16_, -1);
500
_tmp18_ = self->priv->camera;
501
_tmp19_ = cheese_camera_get_current_video_format (_tmp18_);
502
_tmp20_ = _tmp19_->width;
504
_tmp22_ = _tmp21_->width;
505
if (_tmp20_ == _tmp22_) {
506
CheeseCamera* _tmp23_;
507
CheeseVideoFormat* _tmp24_ = NULL;
509
CheeseVideoFormat* _tmp26_;
511
_tmp23_ = self->priv->camera;
512
_tmp24_ = cheese_camera_get_current_video_format (_tmp23_);
513
_tmp25_ = _tmp24_->height;
515
_tmp27_ = _tmp26_->height;
516
_tmp17_ = _tmp25_ == _tmp27_;
522
GtkComboBox* _tmp29_;
525
CheeseVideoFormat* _tmp32_;
528
CheeseVideoFormat* _tmp35_;
530
_tmp29_ = self->priv->photo_resolution_combo;
532
gtk_combo_box_set_active_iter (_tmp29_, &_tmp30_);
533
_tmp31_ = self->priv->settings;
535
_tmp33_ = _tmp32_->width;
536
g_settings_set_int (_tmp31_, "photo-x-resolution", _tmp33_);
537
_tmp34_ = self->priv->settings;
539
_tmp36_ = _tmp35_->height;
540
g_settings_set_int (_tmp34_, "photo-y-resolution", _tmp36_);
542
_tmp38_ = self->priv->settings;
543
_tmp39_ = g_settings_get_int (_tmp38_, "video-x-resolution");
545
_tmp41_ = _tmp40_->width;
546
if (_tmp39_ == _tmp41_) {
549
CheeseVideoFormat* _tmp44_;
551
_tmp42_ = self->priv->settings;
552
_tmp43_ = g_settings_get_int (_tmp42_, "video-y-resolution");
554
_tmp45_ = _tmp44_->height;
555
_tmp37_ = _tmp43_ == _tmp45_;
561
GtkComboBox* _tmp47_;
563
_tmp47_ = self->priv->video_resolution_combo;
565
gtk_combo_box_set_active_iter (_tmp47_, &_tmp48_);
570
static void ___lambda0__gfunc (gconstpointer data, gpointer self) {
571
__lambda0_ (self, data);
416
575
static void cheese_preferences_dialog_setup_resolutions_for_device (CheesePreferencesDialog* self, CheeseCameraDevice* device) {
417
577
CheeseCameraDevice* _tmp0_;
418
578
GList* _tmp1_ = NULL;
420
CheeseVideoFormat* format = NULL;
421
580
GtkListStore* _tmp2_;
422
GtkListStore* resolution_model;
423
581
GtkComboBox* _tmp3_;
424
582
GtkListStore* _tmp4_;
425
583
GtkComboBox* _tmp5_;
426
584
GtkListStore* _tmp6_;
427
GtkComboBox* _tmp66_;
429
588
g_return_if_fail (self != NULL);
430
589
g_return_if_fail (device != NULL);
590
_data1_ = g_slice_new0 (Block1Data);
591
_data1_->_ref_count_ = 1;
592
_data1_->self = g_object_ref (self);
432
594
_tmp1_ = cheese_camera_device_get_format_list (_tmp0_);
433
595
formats = _tmp1_;
434
596
_tmp2_ = gtk_list_store_new (2, G_TYPE_STRING, CHEESE_TYPE_VIDEO_FORMAT);
435
resolution_model = _tmp2_;
597
_data1_->resolution_model = _tmp2_;
436
598
_tmp3_ = self->priv->photo_resolution_combo;
437
_tmp4_ = resolution_model;
599
_tmp4_ = _data1_->resolution_model;
438
600
gtk_combo_box_set_model (_tmp3_, (GtkTreeModel*) _tmp4_);
439
601
_tmp5_ = self->priv->video_resolution_combo;
440
_tmp6_ = resolution_model;
602
_tmp6_ = _data1_->resolution_model;
441
603
gtk_combo_box_set_model (_tmp5_, (GtkTreeModel*) _tmp6_);
453
GtkTreeIter iter = {0};
456
GList* _tmp15_ = NULL;
457
gconstpointer _tmp16_;
458
GtkListStore* _tmp17_;
459
GtkTreeIter _tmp18_ = {0};
460
GtkListStore* _tmp19_;
462
CheeseVideoFormat* _tmp21_;
464
gchar* _tmp23_ = NULL;
468
CheeseVideoFormat* _tmp27_;
470
gchar* _tmp29_ = NULL;
474
CheeseVideoFormat* _tmp33_;
475
gboolean _tmp34_ = FALSE;
476
CheeseCamera* _tmp35_;
477
CheeseVideoFormat* _tmp36_ = NULL;
479
CheeseVideoFormat* _tmp38_;
482
gboolean _tmp54_ = FALSE;
485
CheeseVideoFormat* _tmp57_;
497
_tmp12_ = g_list_length (_tmp11_);
498
if (!(((guint) _tmp10_) < _tmp12_)) {
503
_tmp15_ = g_list_nth (_tmp13_, (guint) _tmp14_);
504
_tmp16_ = _tmp15_->data;
505
format = (CheeseVideoFormat*) _tmp16_;
506
_tmp17_ = resolution_model;
507
gtk_list_store_append (_tmp17_, &_tmp18_);
509
_tmp19_ = resolution_model;
512
_tmp22_ = _tmp21_->width;
513
_tmp23_ = g_strdup_printf ("%i", _tmp22_);
515
_tmp25_ = g_strconcat (_tmp24_, " x ", NULL);
518
_tmp28_ = _tmp27_->height;
519
_tmp29_ = g_strdup_printf ("%i", _tmp28_);
521
_tmp31_ = g_strconcat (_tmp26_, _tmp30_, NULL);
524
gtk_list_store_set (_tmp19_, &_tmp20_, 0, _tmp32_, 1, _tmp33_, -1);
529
_tmp35_ = self->priv->camera;
530
_tmp36_ = cheese_camera_get_current_video_format (_tmp35_);
531
_tmp37_ = _tmp36_->width;
533
_tmp39_ = _tmp38_->width;
534
if (_tmp37_ == _tmp39_) {
535
CheeseCamera* _tmp40_;
536
CheeseVideoFormat* _tmp41_ = NULL;
538
CheeseVideoFormat* _tmp43_;
540
_tmp40_ = self->priv->camera;
541
_tmp41_ = cheese_camera_get_current_video_format (_tmp40_);
542
_tmp42_ = _tmp41_->height;
544
_tmp44_ = _tmp43_->height;
545
_tmp34_ = _tmp42_ == _tmp44_;
551
GtkComboBox* _tmp46_;
554
CheeseVideoFormat* _tmp49_;
557
CheeseVideoFormat* _tmp52_;
559
_tmp46_ = self->priv->photo_resolution_combo;
561
gtk_combo_box_set_active_iter (_tmp46_, &_tmp47_);
562
_tmp48_ = self->priv->settings;
564
_tmp50_ = _tmp49_->width;
565
g_settings_set_int (_tmp48_, "photo-x-resolution", _tmp50_);
566
_tmp51_ = self->priv->settings;
568
_tmp53_ = _tmp52_->height;
569
g_settings_set_int (_tmp51_, "photo-y-resolution", _tmp53_);
571
_tmp55_ = self->priv->settings;
572
_tmp56_ = g_settings_get_int (_tmp55_, "video-x-resolution");
574
_tmp58_ = _tmp57_->width;
575
if (_tmp56_ == _tmp58_) {
578
CheeseVideoFormat* _tmp61_;
580
_tmp59_ = self->priv->settings;
581
_tmp60_ = g_settings_get_int (_tmp59_, "video-y-resolution");
583
_tmp62_ = _tmp61_->height;
584
_tmp54_ = _tmp60_ == _tmp62_;
590
GtkComboBox* _tmp64_;
592
_tmp64_ = self->priv->video_resolution_combo;
594
gtk_combo_box_set_active_iter (_tmp64_, &_tmp65_);
599
_tmp66_ = self->priv->video_resolution_combo;
600
_tmp67_ = gtk_combo_box_get_active (_tmp66_);
601
if (_tmp67_ == (-1)) {
602
GtkComboBox* _tmp68_;
603
GtkComboBox* _tmp69_;
611
_tmp68_ = self->priv->video_resolution_combo;
612
_tmp69_ = self->priv->photo_resolution_combo;
613
_tmp70_ = gtk_combo_box_get_active (_tmp69_);
614
gtk_combo_box_set_active (_tmp68_, _tmp70_);
615
_tmp71_ = self->priv->settings;
616
_tmp72_ = self->priv->settings;
617
_tmp73_ = g_settings_get_int (_tmp72_, "photo-x-resolution");
618
g_settings_set_int (_tmp71_, "video-x-resolution", _tmp73_);
619
_tmp74_ = self->priv->settings;
620
_tmp75_ = self->priv->settings;
621
_tmp76_ = g_settings_get_int (_tmp75_, "photo-y-resolution");
622
g_settings_set_int (_tmp74_, "video-y-resolution", _tmp76_);
624
_g_object_unref0 (resolution_model);
605
g_list_foreach (_tmp7_, ___lambda0__gfunc, _data1_);
606
_tmp8_ = self->priv->video_resolution_combo;
607
_tmp9_ = gtk_combo_box_get_active (_tmp8_);
608
if (_tmp9_ == (-1)) {
609
GtkComboBox* _tmp10_;
610
GtkComboBox* _tmp11_;
618
_tmp10_ = self->priv->video_resolution_combo;
619
_tmp11_ = self->priv->photo_resolution_combo;
620
_tmp12_ = gtk_combo_box_get_active (_tmp11_);
621
gtk_combo_box_set_active (_tmp10_, _tmp12_);
622
_tmp13_ = self->priv->settings;
623
_tmp14_ = self->priv->settings;
624
_tmp15_ = g_settings_get_int (_tmp14_, "photo-x-resolution");
625
g_settings_set_int (_tmp13_, "video-x-resolution", _tmp15_);
626
_tmp16_ = self->priv->settings;
627
_tmp17_ = self->priv->settings;
628
_tmp18_ = g_settings_get_int (_tmp17_, "photo-y-resolution");
629
g_settings_set_int (_tmp16_, "video-y-resolution", _tmp18_);
631
block1_data_unref (_data1_);