GtkWidget *ly_3inf_create() { ly_3inf_pixbuf_bg=ly_sss_alloc_bg(NULL); ly_3inf_pixbuf_bg_copy=NULL; GtkWidget *widget; GtkWidget *event_box; GtkWidget *button; widget=gtk_vbox_new(FALSE, 0); event_box=gtk_event_box_new(); gtk_box_pack_start(GTK_BOX(widget), event_box, TRUE, TRUE, 0); gtk_widget_set_app_paintable(event_box, TRUE); g_signal_connect(G_OBJECT(event_box), "draw" ,G_CALLBACK (ly_3inf_on_expose_cb) , NULL); button=gtk_button_new_with_label(_("Download Cover")); gtk_box_pack_start(GTK_BOX(widget), button, FALSE, TRUE, 0); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(ly_3inf_on_get_button_clicked_cb), NULL); ly_mbs_bind("meta_changed", "core:pqm", ly_3inf_on_meta_changed_cb, NULL); ly_mbs_bind("meta_update", "", ly_3inf_on_meta_update_cb, NULL); ly_mbs_bind("reg_3inf_title_font_changed", "core:reg", ly_3inf_on_meta_update_cb, NULL); ly_mbs_bind("reg_3inf_normal_font_changed", "core:reg", ly_3inf_on_meta_update_cb, NULL); ly_3inf_widget=event_box; ly_3inf_cover_on_meta_changed(); return widget; }
void ly_3dnc_cov_init() { char server[128]="last.fm"; if(!ly_reg_get("3dnc_cov_server", "%[^\n]", server)) { ly_reg_set("3dnc_cov_server", "%s", server); } ly_3dnc_cov_mutex = g_mutex_new(); ly_mbs_bind("cov_missing", "", ly_3dnc_cov_check, NULL); }
void ly_3dnc_lrc_init() { char server[128]="qianqian"; if(!ly_reg_get("3dnc_lrc_server", "%[^\n]", server)) { ly_reg_set("3dnc_lrc_server", "%s", server); } ly_3dnc_lrc_mutex = g_mutex_new(); ly_mbs_bind("lrc_missing", "", ly_3dnc_lrc_check, NULL); }
/** * ly_aud_init: * * Initialize the aud module, it will be called by #ly_cox_init. */ void ly_aud_init() { /* * mode */ gint random=0; gint repeat=1; gint single=0; if(!ly_reg_get("aud_mode","%d:%d:%d", &random,&repeat,&single)) ly_reg_set("aud_mode","%d:%d:%d",random, repeat, single); /* * volume */ double vol=0.3; if(!ly_reg_get("aud_volume","%lf",&vol)) { ly_reg_set("aud_volume","%lf",vol); } GstElement *ele=ly_ppl_audio_get_element("volume"); if(ele) { g_object_set(G_OBJECT(ele), "volume", vol, NULL); } /* * autoplay */ int autoplay=0; if(!ly_reg_get("aud_autoplay", "%d", &autoplay)) ly_reg_set("aud_autoplay", "%d", autoplay); if(autoplay) { ly_aud_play(); } ly_mbs_put("meta_changed", "core:aud", NULL); ly_mbs_bind("ppl_eos", "core:ppl", ly_aud_on_ppl_eos_cb, NULL); }