+#ifdef USE_MUSIC
+
+static void load_music_prefs(void)
+{
+ int i, j, num;
+ char tmp[1024];
+ char ini_path[1024];
+ char wav_path[1024];
+ char *zz[SAMPLE_MAX];
+ char key[80];
+
+ /* Access the music.cfg */
+
+ path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music.cfg");
+
+ GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+
+ for (i = 0; i < MUSIC_BASIC_MAX; i++)
+ {
+ GetPrivateProfileString("Basic", angband_music_basic_name[i], "", tmp, 1024, ini_path);
+
+ num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
+
+ for (j = 0; j < num; j++)
+ {
+ /* Access the sound */
+ path_build(wav_path, 1024, ANGBAND_DIR_XTRA_MUSIC, zz[j]);
+
+ /* Save the sound filename, if it exists */
+ if (check_file(wav_path))
+ music_file[i][j] = string_make(zz[j]);
+ }
+ }
+
+ for (i = 0; i < max_d_idx; i++)
+ {
+ sprintf(key, "dungeon%03d", i);
+ GetPrivateProfileString("Dungeon", key, "", tmp, 1024, ini_path);
+
+ num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
+
+ for (j = 0; j < num; j++)
+ {
+ /* Access the sound */
+ path_build(wav_path, 1024, ANGBAND_DIR_XTRA_MUSIC, zz[j]);
+
+ /* Save the sound filename, if it exists */
+ if (check_file(wav_path))
+ dungeon_music_file[i][j] = string_make(zz[j]);
+ }
+ }
+
+ for (i = 0; i < max_q_idx; i++)
+ {
+ sprintf(key, "quest%03d", i);
+ GetPrivateProfileString("Quest", key, "", tmp, 1024, ini_path);
+
+ num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
+
+ for (j = 0; j < num; j++)
+ {
+ /* Access the sound */
+ path_build(wav_path, 1024, ANGBAND_DIR_XTRA_MUSIC, zz[j]);
+
+ /* Save the sound filename, if it exists */
+ if (check_file(wav_path))
+ quest_music_file[i][j] = string_make(zz[j]);
+ }
+ }
+
+ for (i = 0; i < 1000; i++) /*!< @todo 町最大数指定 */
+ {
+ sprintf(key, "town%03d", i);
+ GetPrivateProfileString("Town", key, "", tmp, 1024, ini_path);
+
+ num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
+
+ for (j = 0; j < num; j++)
+ {
+ /* Access the sound */
+ path_build(wav_path, 1024, ANGBAND_DIR_XTRA_MUSIC, zz[j]);
+
+ /* Save the sound filename, if it exists */
+ if (check_file(wav_path))
+ town_music_file[i][j] = string_make(zz[j]);
+ }
+ }
+
+
+}
+
+#endif /* USE_MUSIC */
+