comparison src/adplug/adplug-xmms.cc @ 2124:b8da6a0b0da2

s/bmp_cfg_/aud_cfg_/g
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 24 Oct 2007 07:34:02 +0300
parents 932ebaba6eca
children 224ebe9caaac
comparison
equal deleted inserted replaced
2123:c349bd73af71 2124:b8da6a0b0da2
1034 1034
1035 static void 1035 static void
1036 adplug_init (void) 1036 adplug_init (void)
1037 { 1037 {
1038 dbg_printf ("adplug_init(): open, "); 1038 dbg_printf ("adplug_init(): open, ");
1039 ConfigDb *db = bmp_cfg_db_open (); 1039 ConfigDb *db = aud_cfg_db_open ();
1040 1040
1041 // Read configuration 1041 // Read configuration
1042 dbg_printf ("read, "); 1042 dbg_printf ("read, ");
1043 bmp_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & conf.bit16); 1043 aud_cfg_db_get_bool (db, CFG_VERSION, "16bit", (gboolean *) & conf.bit16);
1044 bmp_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & conf.stereo); 1044 aud_cfg_db_get_bool (db, CFG_VERSION, "Stereo", (gboolean *) & conf.stereo);
1045 bmp_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & conf.freq); 1045 aud_cfg_db_get_int (db, CFG_VERSION, "Frequency", (gint *) & conf.freq);
1046 bmp_cfg_db_get_bool (db, CFG_VERSION, "Endless", 1046 aud_cfg_db_get_bool (db, CFG_VERSION, "Endless",
1047 (gboolean *) & conf.endless); 1047 (gboolean *) & conf.endless);
1048 1048
1049 // Read file type exclusion list 1049 // Read file type exclusion list
1050 dbg_printf ("exclusion, "); 1050 dbg_printf ("exclusion, ");
1051 { 1051 {
1052 gchar *cfgstr = NULL, *exclude = NULL; 1052 gchar *cfgstr = NULL, *exclude = NULL;
1053 gboolean cfgread; 1053 gboolean cfgread;
1054 1054
1055 cfgread = bmp_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr); 1055 cfgread = aud_cfg_db_get_string (db, CFG_VERSION, "Exclude", &cfgstr);
1056 if (cfgread) { 1056 if (cfgread) {
1057 exclude = (char *) malloc (strlen (cfgstr) + 2); 1057 exclude = (char *) malloc (strlen (cfgstr) + 2);
1058 strcpy (exclude, cfgstr); 1058 strcpy (exclude, cfgstr);
1059 exclude[strlen (exclude) + 1] = '\0'; 1059 exclude[strlen (exclude) + 1] = '\0';
1060 g_strdelimit (exclude, ":", '\0'); 1060 g_strdelimit (exclude, ":", '\0');
1061 for (gchar * p = exclude; *p; p += strlen (p) + 1) 1061 for (gchar * p = exclude; *p; p += strlen (p) + 1)
1062 conf.players.remove (conf.players.lookup_filetype (p)); 1062 conf.players.remove (conf.players.lookup_filetype (p));
1063 free (exclude); free (cfgstr); 1063 free (exclude); free (cfgstr);
1064 } 1064 }
1065 } 1065 }
1066 bmp_cfg_db_close (db); 1066 aud_cfg_db_close (db);
1067 1067
1068 // Load database from disk and hand it to AdPlug 1068 // Load database from disk and hand it to AdPlug
1069 dbg_printf ("database"); 1069 dbg_printf ("database");
1070 plr.db = new CAdPlugDatabase; 1070 plr.db = new CAdPlugDatabase;
1071 1071
1086 1086
1087 static void 1087 static void
1088 adplug_quit (void) 1088 adplug_quit (void)
1089 { 1089 {
1090 dbg_printf ("adplug_quit(): open, "); 1090 dbg_printf ("adplug_quit(): open, ");
1091 ConfigDb *db = bmp_cfg_db_open (); 1091 ConfigDb *db = aud_cfg_db_open ();
1092 1092
1093 // Close database 1093 // Close database
1094 dbg_printf ("db, "); 1094 dbg_printf ("db, ");
1095 if (plr.db) 1095 if (plr.db)
1096 delete plr.db; 1096 delete plr.db;
1097 1097
1098 // Write configuration 1098 // Write configuration
1099 dbg_printf ("write, "); 1099 dbg_printf ("write, ");
1100 bmp_cfg_db_set_bool (db, CFG_VERSION, "16bit", conf.bit16); 1100 aud_cfg_db_set_bool (db, CFG_VERSION, "16bit", conf.bit16);
1101 bmp_cfg_db_set_bool (db, CFG_VERSION, "Stereo", conf.stereo); 1101 aud_cfg_db_set_bool (db, CFG_VERSION, "Stereo", conf.stereo);
1102 bmp_cfg_db_set_int (db, CFG_VERSION, "Frequency", conf.freq); 1102 aud_cfg_db_set_int (db, CFG_VERSION, "Frequency", conf.freq);
1103 bmp_cfg_db_set_bool (db, CFG_VERSION, "Endless", conf.endless); 1103 aud_cfg_db_set_bool (db, CFG_VERSION, "Endless", conf.endless);
1104 1104
1105 dbg_printf ("exclude, "); 1105 dbg_printf ("exclude, ");
1106 std::string exclude; 1106 std::string exclude;
1107 for (CPlayers::const_iterator i = CAdPlug::players.begin (); 1107 for (CPlayers::const_iterator i = CAdPlug::players.begin ();
1108 i != CAdPlug::players.end (); i++) 1108 i != CAdPlug::players.end (); i++)
1112 if (!exclude.empty ()) 1112 if (!exclude.empty ())
1113 exclude += ":"; 1113 exclude += ":";
1114 exclude += (*i)->filetype; 1114 exclude += (*i)->filetype;
1115 } 1115 }
1116 gchar *cfgval = g_strdup (exclude.c_str ()); 1116 gchar *cfgval = g_strdup (exclude.c_str ());
1117 bmp_cfg_db_set_string (db, CFG_VERSION, "Exclude", cfgval); 1117 aud_cfg_db_set_string (db, CFG_VERSION, "Exclude", cfgval);
1118 free (cfgval); 1118 free (cfgval);
1119 1119
1120 dbg_printf ("close"); 1120 dbg_printf ("close");
1121 bmp_cfg_db_close (db); 1121 aud_cfg_db_close (db);
1122 dbg_printf (".\n"); 1122 dbg_printf (".\n");
1123 } 1123 }
1124 1124
1125 /***** Plugin (exported) *****/ 1125 /***** Plugin (exported) *****/
1126 1126