⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 xmms-1.2.10.tar.gz学习使用的就下吧
💻 C
📖 第 1 页 / 共 5 页
字号:
	cfg.enabled_gplugins = NULL;	cfg.mouse_change = 8;		cfg.gentitle_format = NULL;	filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL);	cfgfile = xmms_cfg_open_file(filename);	if (cfgfile)	{		xmms_cfg_read_boolean(cfgfile, "xmms", "allow_multiple_instances", &cfg.allow_multiple_instances);		xmms_cfg_read_boolean(cfgfile, "xmms", "use_realtime", &cfg.use_realtime);		xmms_cfg_read_boolean(cfgfile, "xmms", "always_show_cb", &cfg.always_show_cb);		xmms_cfg_read_boolean(cfgfile, "xmms", "convert_underscore", &cfg.convert_underscore);		xmms_cfg_read_boolean(cfgfile, "xmms", "convert_%20", &cfg.convert_twenty);		xmms_cfg_read_boolean(cfgfile, "xmms", "show_numbers_in_pl", &cfg.show_numbers_in_pl);		xmms_cfg_read_boolean(cfgfile, "xmms", "snap_windows", &cfg.snap_windows);		xmms_cfg_read_boolean(cfgfile, "xmms", "save_window_positions", &cfg.save_window_position);		xmms_cfg_read_boolean(cfgfile, "xmms", "dim_titlebar", &cfg.dim_titlebar);		xmms_cfg_read_boolean(cfgfile, "xmms", "get_info_on_load", &cfg.get_info_on_load);		xmms_cfg_read_boolean(cfgfile, "xmms", "get_info_on_demand", &cfg.get_info_on_demand);		xmms_cfg_read_boolean(cfgfile, "xmms", "eq_doublesize_linked", &cfg.eq_doublesize_linked);		xmms_cfg_read_boolean(cfgfile, "xmms", "no_playlist_advance", &cfg.no_playlist_advance);		xmms_cfg_read_boolean(cfgfile, "xmms", "sort_jump_to_file", &cfg.sort_jump_to_file);		xmms_cfg_read_boolean(cfgfile, "xmms", "use_pl_metadata", &cfg.use_pl_metadata);		xmms_cfg_read_boolean(cfgfile, "xmms", "smooth_title_scroll", &cfg.smooth_title_scroll);		xmms_cfg_read_boolean(cfgfile, "xmms", "use_backslash_as_dir_delimiter", &cfg.use_backslash_as_dir_delimiter);		xmms_cfg_read_int(cfgfile, "xmms", "player_x", &cfg.player_x);		xmms_cfg_read_int(cfgfile, "xmms", "player_y", &cfg.player_y);		xmms_cfg_read_boolean(cfgfile, "xmms", "player_shaded", &cfg.player_shaded);		xmms_cfg_read_boolean(cfgfile, "xmms", "player_visible", &cfg.player_visible);		xmms_cfg_read_boolean(cfgfile, "xmms", "shuffle", &cfg.shuffle);		xmms_cfg_read_boolean(cfgfile, "xmms", "repeat", &cfg.repeat);		xmms_cfg_read_boolean(cfgfile, "xmms", "doublesize", &cfg.doublesize);		xmms_cfg_read_boolean(cfgfile, "xmms", "autoscroll_songname", &cfg.autoscroll);		xmms_cfg_read_int(cfgfile, "xmms", "timer_mode", &cfg.timer_mode);		xmms_cfg_read_int(cfgfile, "xmms", "vis_type", &cfg.vis_type);		xmms_cfg_read_int(cfgfile, "xmms", "analyzer_mode", &cfg.analyzer_mode);		xmms_cfg_read_int(cfgfile, "xmms", "analyzer_type", &cfg.analyzer_type);		xmms_cfg_read_boolean(cfgfile, "xmms", "analyzer_peaks", &cfg.analyzer_peaks);		xmms_cfg_read_int(cfgfile, "xmms", "scope_mode", &cfg.scope_mode);		xmms_cfg_read_int(cfgfile, "xmms", "vu_mode", &cfg.vu_mode);		xmms_cfg_read_int(cfgfile, "xmms", "vis_refresh_rate", &cfg.vis_refresh);		xmms_cfg_read_int(cfgfile, "xmms", "analyzer_falloff", &cfg.analyzer_falloff);		xmms_cfg_read_int(cfgfile, "xmms", "peaks_falloff", &cfg.peaks_falloff);		xmms_cfg_read_int(cfgfile, "xmms", "playlist_x", &cfg.playlist_x);		xmms_cfg_read_int(cfgfile, "xmms", "playlist_y", &cfg.playlist_y);		xmms_cfg_read_int(cfgfile, "xmms", "playlist_width", &cfg.playlist_width);		xmms_cfg_read_int(cfgfile, "xmms", "playlist_height", &cfg.playlist_height);		xmms_cfg_read_boolean(cfgfile, "xmms", "playlist_shaded", &cfg.playlist_shaded);		xmms_cfg_read_boolean(cfgfile, "xmms", "playlist_visible", &cfg.playlist_visible);		xmms_cfg_read_boolean(cfgfile, "xmms", "playlist_transparent", &cfg.playlist_transparent);		xmms_cfg_read_string(cfgfile, "xmms", "playlist_font", &cfg.playlist_font);		xmms_cfg_read_boolean(cfgfile, "xmms", "use_fontsets", &cfg.use_fontsets);		xmms_cfg_read_boolean(cfgfile, "xmms", "mainwin_use_xfont", &cfg.mainwin_use_xfont);		xmms_cfg_read_string(cfgfile, "xmms", "mainwin_font", &cfg.mainwin_font);		xmms_cfg_read_int(cfgfile, "xmms", "playlist_position", &cfg.playlist_position);		xmms_cfg_read_int(cfgfile, "xmms", "equalizer_x", &cfg.equalizer_x);		xmms_cfg_read_int(cfgfile, "xmms", "equalizer_y", &cfg.equalizer_y);		xmms_cfg_read_int(cfgfile, "xmms", "snap_distance", &cfg.snap_distance);		xmms_cfg_read_boolean(cfgfile, "xmms", "equalizer_visible", &cfg.equalizer_visible);		xmms_cfg_read_boolean(cfgfile, "xmms", "equalizer_active", &cfg.equalizer_active);		xmms_cfg_read_boolean(cfgfile, "xmms", "equalizer_shaded", &cfg.equalizer_shaded);		xmms_cfg_read_boolean(cfgfile, "xmms", "equalizer_autoload", &cfg.equalizer_autoload);		xmms_cfg_read_boolean(cfgfile, "xmms", "easy_move", &cfg.easy_move);		xmms_cfg_read_float(cfgfile, "xmms", "equalizer_preamp", &cfg.equalizer_preamp);		for (i = 0; i < 10; i++)		{			gchar eqtext[18];						sprintf(eqtext, "equalizer_band%d", i);			xmms_cfg_read_float(cfgfile, "xmms", eqtext, &cfg.equalizer_bands[i]);		}  		xmms_cfg_read_string(cfgfile, "xmms", "eqpreset_default_file", &cfg.eqpreset_default_file);		xmms_cfg_read_string(cfgfile, "xmms", "eqpreset_extension", &cfg.eqpreset_extension);		xmms_cfg_read_string(cfgfile, "xmms", "skin", &cfg.skin);		xmms_cfg_read_string(cfgfile, "xmms", "output_plugin", &cfg.outputplugin);		xmms_cfg_read_string(cfgfile, "xmms", "enabled_gplugins", &cfg.enabled_gplugins);		xmms_cfg_read_string(cfgfile, "xmms", "enabled_vplugins", &cfg.enabled_vplugins);		xmms_cfg_read_string(cfgfile, "xmms", "enabled_eplugins", &cfg.enabled_eplugins);		xmms_cfg_read_string(cfgfile, "xmms", "filesel_path", &cfg.filesel_path);		xmms_cfg_read_string(cfgfile, "xmms", "playlist_path", &cfg.playlist_path);		xmms_cfg_read_string(cfgfile, "xmms", "disabled_iplugins", &cfg.disabled_iplugins);		xmms_cfg_read_boolean(cfgfile, "xmms", "use_eplugins", &cfg.use_eplugins);		xmms_cfg_read_boolean(cfgfile, "xmms", "always_on_top", &cfg.always_on_top);		xmms_cfg_read_boolean(cfgfile, "xmms", "sticky", &cfg.sticky);		xmms_cfg_read_boolean(cfgfile, "xmms", "random_skin_on_play", &cfg.random_skin_on_play);		xmms_cfg_read_boolean(cfgfile, "xmms", "pause_between_songs", &cfg.pause_between_songs);		xmms_cfg_read_int(cfgfile, "xmms", "pause_between_songs_time", &cfg.pause_between_songs_time);		xmms_cfg_read_int(cfgfile, "xmms", "mouse_wheel_change", &cfg.mouse_change);		xmms_cfg_read_boolean(cfgfile, "xmms", "show_wm_decorations", &cfg.show_wm_decorations);		if (xmms_cfg_read_int(cfgfile, "xmms", "url_history_length", &length))		{			for(i = 1; i <= length; i++)			{				gchar str[19], *temp;								sprintf(str, "url_history%d", i);				if (xmms_cfg_read_string(cfgfile, "xmms", str, &temp))					cfg.url_history = g_list_append(cfg.url_history, temp);			}		}		xmms_cfg_read_string(cfgfile, "xmms", "generic_title_format", &cfg.gentitle_format);				xmms_cfg_free(cfgfile);	}        	if (cfg.playlist_font && strlen(cfg.playlist_font) == 0)	{		g_free(cfg.playlist_font);		cfg.playlist_font = NULL;	}	if (cfg.mainwin_font && strlen(cfg.mainwin_font) == 0)	{		g_free(cfg.mainwin_font);		cfg.mainwin_font = NULL;	}	if (cfg.playlist_font == NULL)		cfg.playlist_font = g_strdup("-adobe-helvetica-bold-r-*-*-10-*");	if (cfg.mainwin_font == NULL)		cfg.mainwin_font = g_strdup("-adobe-helvetica-medium-r-*-*-8-*");	if (cfg.gentitle_format == NULL)		cfg.gentitle_format = g_strdup("%p - %t");	if (cfg.outputplugin == NULL)	{#ifdef HAVE_OSS		cfg.outputplugin = g_strdup_printf("%s/%s/libOSS.so", PLUGIN_DIR, plugin_dir_list[0]);#elif defined(sun)		cfg.outputplugin = g_strdup_printf("%s/%s/libSolaris.so", PLUGIN_DIR, plugin_dir_list[0]);#else		/*		 * FIXME: This implisitly means the output plugin that is first		 * in the alphabet will be used (usually the disk writer plugin)		 */		cfg.outputplugin = g_strdup("");#endif	}	if (cfg.eqpreset_default_file == NULL)		cfg.eqpreset_default_file = g_strdup("dir_default.preset");	if (cfg.eqpreset_extension == NULL)		cfg.eqpreset_extension = g_strdup("preset");	g_free(filename);}void save_config(void){	GList *d_iplist, *node;	gchar *temp;	gchar *filename, *str;	gint i;	ConfigFile *cfgfile;	if (cfg.disabled_iplugins)		g_free(cfg.disabled_iplugins);	if (disabled_iplugins && (g_list_length(disabled_iplugins) > 0))	{		d_iplist = disabled_iplugins;		cfg.disabled_iplugins = g_strdup(g_basename(((InputPlugin *) d_iplist->data)->filename));		d_iplist = d_iplist->next;		while (d_iplist != NULL)		{			temp = cfg.disabled_iplugins;			cfg.disabled_iplugins = g_strconcat(temp, ",", g_basename(((InputPlugin *) d_iplist->data)->filename), NULL);			g_free(temp);			d_iplist = d_iplist->next;		}	}	else		cfg.disabled_iplugins = g_strdup("");	filename = g_strconcat(g_get_home_dir(), "/.xmms/config", NULL);	cfgfile = xmms_cfg_open_file(filename);	if (!cfgfile)		cfgfile = xmms_cfg_new();	xmms_cfg_write_boolean(cfgfile, "xmms", "allow_multiple_instances", cfg.allow_multiple_instances);	xmms_cfg_write_boolean(cfgfile, "xmms", "use_realtime", cfg.use_realtime);	xmms_cfg_write_boolean(cfgfile, "xmms", "always_show_cb", cfg.always_show_cb);	xmms_cfg_write_boolean(cfgfile, "xmms", "convert_underscore", cfg.convert_underscore);	xmms_cfg_write_boolean(cfgfile, "xmms", "convert_%20", cfg.convert_twenty);	xmms_cfg_write_boolean(cfgfile, "xmms", "show_numbers_in_pl", cfg.show_numbers_in_pl);	xmms_cfg_write_boolean(cfgfile, "xmms", "snap_windows", cfg.snap_windows);	xmms_cfg_write_boolean(cfgfile, "xmms", "save_window_positions", cfg.save_window_position);	xmms_cfg_write_boolean(cfgfile, "xmms", "dim_titlebar", cfg.dim_titlebar);	xmms_cfg_write_boolean(cfgfile, "xmms", "use_pl_metadata", cfg.use_pl_metadata);	xmms_cfg_write_boolean(cfgfile, "xmms", "get_info_on_load", cfg.get_info_on_load);	xmms_cfg_write_boolean(cfgfile, "xmms", "get_info_on_demand", cfg.get_info_on_demand);	xmms_cfg_write_boolean(cfgfile, "xmms", "eq_doublesize_linked", cfg.eq_doublesize_linked);	xmms_cfg_write_boolean(cfgfile, "xmms", "no_playlist_advance", cfg.no_playlist_advance);	xmms_cfg_write_boolean(cfgfile, "xmms", "sort_jump_to_file", cfg.sort_jump_to_file);	xmms_cfg_write_boolean(cfgfile, "xmms", "smooth_title_scroll", cfg.smooth_title_scroll);	xmms_cfg_write_boolean(cfgfile, "xmms", "use_backslash_as_dir_delimiter", cfg.use_backslash_as_dir_delimiter);	/*  dock_get_widget_pos(mainwin, &cfg.player_x, &cfg.player_y); */	xmms_cfg_write_int(cfgfile, "xmms", "player_x", cfg.player_x);	xmms_cfg_write_int(cfgfile, "xmms", "player_y", cfg.player_y);	xmms_cfg_write_boolean(cfgfile, "xmms", "player_shaded", cfg.player_shaded);	xmms_cfg_write_boolean(cfgfile, "xmms", "player_visible", cfg.player_visible);	xmms_cfg_write_boolean(cfgfile, "xmms", "shuffle", mainwin_shuffle->tb_selected);	xmms_cfg_write_boolean(cfgfile, "xmms", "repeat", mainwin_repeat->tb_selected);	xmms_cfg_write_boolean(cfgfile, "xmms", "doublesize", cfg.doublesize);	xmms_cfg_write_boolean(cfgfile, "xmms", "autoscroll_songname", cfg.autoscroll);	xmms_cfg_write_int(cfgfile, "xmms", "timer_mode", cfg.timer_mode);	xmms_cfg_write_int(cfgfile, "xmms", "vis_type", cfg.vis_type);	xmms_cfg_write_int(cfgfile, "xmms", "analyzer_mode", cfg.analyzer_mode);	xmms_cfg_write_int(cfgfile, "xmms", "analyzer_type", cfg.analyzer_type);	xmms_cfg_write_boolean(cfgfile, "xmms", "analyzer_peaks", cfg.analyzer_peaks);	xmms_cfg_write_int(cfgfile, "xmms", "scope_mode", cfg.scope_mode);	xmms_cfg_write_int(cfgfile, "xmms", "vu_mode", cfg.vu_mode);	xmms_cfg_write_int(cfgfile, "xmms", "vis_refresh_rate", cfg.vis_refresh);	xmms_cfg_write_int(cfgfile, "xmms", "analyzer_falloff", cfg.analyzer_falloff);	xmms_cfg_write_int(cfgfile, "xmms", "peaks_falloff", cfg.peaks_falloff);	/*  dock_get_widget_pos(playlistwin, &cfg.playlist_x, &cfg.playlist_y); */	xmms_cfg_write_int(cfgfile, "xmms", "playlist_x", cfg.playlist_x);	xmms_cfg_write_int(cfgfile, "xmms", "playlist_y", cfg.playlist_y);	xmms_cfg_write_int(cfgfile, "xmms", "playlist_width", cfg.playlist_width);	xmms_cfg_write_int(cfgfile, "xmms", "playlist_height", cfg.playlist_height);	xmms_cfg_write_boolean(cfgfile, "xmms", "playlist_shaded", cfg.playlist_shaded);	xmms_cfg_write_boolean(cfgfile, "xmms", "playlist_visible", cfg.playlist_visible);	xmms_cfg_write_boolean(cfgfile, "xmms", "playlist_transparent", cfg.playlist_transparent);	xmms_cfg_write_string(cfgfile, "xmms", "playlist_font", cfg.playlist_font);	xmms_cfg_write_boolean(cfgfile, "xmms", "use_fontsets", cfg.use_fontsets);	xmms_cfg_write_boolean(cfgfile, "xmms", "mainwin_use_xfont", cfg.mainwin_use_xfont);	xmms_cfg_write_string(cfgfile, "xmms", "mainwin_font", cfg.mainwin_font);	xmms_cfg_write_int(cfgfile, "xmms", "playlist_position", get_playlist_position());	/*  dock_get_widget_pos(equalizerwin, &cfg.equalizer_x, &cfg.equalizer_y); */	xmms_cfg_write_int(cfgfile, "xmms", "equalizer_x", cfg.equalizer_x);	xmms_cfg_write_int(cfgfile, "xmms", "equalizer_y", cfg.equalizer_y);	xmms_cfg_write_int(cfgfile, "xmms", "snap_distance", cfg.snap_distance);	xmms_cfg_write_boolean(cfgfile, "xmms", "equalizer_visible", cfg.equalizer_visible);	xmms_cfg_write_boolean(cfgfile, "xmms", "equalizer_shaded", cfg.equalizer_shaded);	xmms_cfg_write_boolean(cfgfile, "xmms", "equalizer_active", cfg.equalizer_active);	xmms_cfg_write_boolean(cfgfile, "xmms", "equalizer_autoload", cfg.equalizer_autoload);	xmms_cfg_write_boolean(cfgfile, "xmms", "easy_move", cfg.easy_move);	xmms_cfg_write_boolean(cfgfile, "xmms", "use_eplugins", cfg.use_eplugins);	xmms_cfg_write_boolean(cfgfile, "xmms", "always_on_top", cfg.always_on_top);	xmms_cfg_write_boolean(cfgfile, "xmms", "sticky", cfg.sticky);	xmms_cfg_write_float(cfgfile, "xmms", "equalizer_preamp", cfg.equalizer_preamp);	xmms_cfg_write_boolean(cfgfile, "xmms", "random_skin_on_play", cfg.random_skin_on_play);	xmms_cfg_write_boolean(cfgfile, "xmms", "pause_between_songs", cfg.pause_between_songs);	xmms_cfg_write_int(cfgfile, "xmms", "pause_between_songs_time", cfg.pause_between_songs_time);	xmms_cfg_write_int(cfgfile, "xmms", "mouse_wheel_change", cfg.mouse_change);	xmms_cfg_write_boolean(cfgfile, "xmms", "show_wm_decorations", cfg.show_wm_decorations); 	xmms_cfg_write_string(cfgfile, "xmms", "eqpreset_default_file", cfg.eqpreset_default_file); 	xmms_cfg_write_string(cfgfile, "xmms", "eqpreset_extension", cfg.eqpreset_extension);	for (i = 0; i < 10; i++)	{		str = g_strdup_printf("equalizer_band%d", i);		xmms_cfg_write_float(cfgfile, "xmms", str, cfg.equalizer_bands[i]);		g_free(str);	}	if (skin->path)		xmms_cfg_write_string(cfgfile, "xmms", "skin", skin->path);	else		xmms_cfg_remove_key(cfgfile, "xmms", "skin");	if (get_current_output_plugin())		xmms_cfg_write_string(cfgfile, "xmms", "output_plugin", get_current_output_plugin()->filename);	else		xmms_cfg_remove_key(cfgfile, "xmms", "output_plugin");	str = general_stringify_enabled_list();	if (str)	{		xmms_cfg_write_string(cfgfile, "xmms", "enabled_gplugins", str);		g_free(str);	}	else		xmms_cfg_remove_key(cfgfile, "xmms", "enabled_gplugins");	str = vis_stringify_enabled_list();	if (str)	{		xmms_cfg_write_string(cfgfile, "xmms", "enabled_vplugins", str);		g_free(str);	}	else		xmms_cfg_remove_key(cfgfile, "xmms", "enabled_vplugins");	str = effect_stringify_enabled_list();	if (str)	{		xmms_cfg_write_string(cfgfile, "xmms", "enabled_eplugins", str);		g_free(str);	}	else		xmms_cfg_remove_key(cfgfile, "xmms", "enabled_eplugins");		xmms_cfg_write_string(cfgfile, "xmms", "disabled_iplugins", cfg.disabled_iplugins);	if (cfg.filesel_path)		xmms_cfg_write_string(cfgfile, "xmms", "filesel_path", cfg.filesel_path);	if (cfg.playlist_path)		xmms_cfg_write_string(cfgfile, "xmms", "playlist_path", cfg.playlist_path);	xmms_cfg_write_int(cfgfile, "xmms", "url_history_length", g_list_length(cfg.url_history));	for (node = cfg.url_history, i = 1; node; node = g_list_next(node), i++)	{		str = g_strdup_printf("url_history%d", i);		xmms_cfg_write_string(cfgfile, "xmms", str, node->data);		g_free(str);	}	xmms_cfg_write_string(cfgfile, "xmms", "generic_title_format", cfg.gentitle_format);		xmms_cfg_write_file(cfgfile, filename);	xmms_cfg_free(cfgfile);	g_free(filename);	filename = g_strconcat(g_get_home_dir(), "/.xmms/xmms.m3u", NULL);	playlist_save(filename, FALSE);	g_free(filename);}gchar *xmms_get_gentitle_format(void){	return cfg.gentitle_format;}void mainwin_set_always_on_top(gboolean always){	GtkWidget *widget = gtk_item_factory_get_widget(mainwin_options_menu, "/Always On Top");	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), mainwin_menurow->mr_always_selected);}void mainwin_set_shape_mask(void){	if (!cfg.player_visible || cfg.show_wm_decorations)		return;			gtk_widget_shape_combine_mask(mainwin, skin_get_mask(SKIN_MASK_MAIN, cfg.doublesize, cfg.player_shaded), 0, 0);}	void set_doublesize(gboolean ds){	gint height;	cfg.doublesize = ds;	if (cfg.player_shaded)		height = 14;	else		height = 116;	mainwin_set_shape_mask();	if (cfg.doublesize)	{		dock_resize(dock_window_list, mainwin, 550, height * 2);		gdk_window_set_back_pixmap(mainwin->window, mainwin_bg_dblsize, 0);	}	else	{		dock_resize(dock_window_list, mainwin, 275, height);				gdk_window_set_back_pixmap(mainwin->window, mainwin_bg, 0);	}	draw_main_window(TRUE);	vis_set_doublesize(mainwin_vis, ds);	if (cfg.eq_doublesize_linked)		equalizerwin_set_doublesize(ds);}void mainwin_set_shade(gboolean shaded){	GtkWidget *widget;	widget = gtk_item_factory_get_widget(mainwin_options_menu,					     "/WindowShade Mode");	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), shaded);}void mainwin_set_shade_menu_cb(gboolean shaded){	cfg.player_shaded = shaded;	mainwin_set_shape_mask();	if (shaded)	{		dock_shade(dock_window_list, mainwin, 14 * (cfg.doublesize + 1));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -