IS_LEVELCLASS_USER(n) ? 7 : \
9)
-#define TOKEN_VALUE_POSITION 30
+#define TOKEN_VALUE_POSITION 40
+#define TOKEN_COMMENT_POSITION 60
#define MAX_COOKIE_LEN 256
return NULL; /* cannot find image file */
}
+char *getCustomSoundConfigFilename()
+{
+ return getCustomSoundFilename(SOUNDSINFO_FILENAME);
+}
+
+char *getCustomMusicDirectory(void)
+{
+ static char *directory = NULL;
+
+ if (directory != NULL)
+ free(directory);
+
+ /* 1st try: look for special artwork in current level series directory */
+ directory = getPath2(getCurrentLevelDir(), MUSIC_DIRECTORY);
+ if (fileExists(directory))
+ return directory;
+
+ /* 2nd try: look for special artwork in private artwork directory */
+ directory = getStringCopy(getUserMusicDir());
+ if (fileExists(directory))
+ return directory;
+
+ /* 3rd try: look for special artwork in configured artwork directory */
+ directory = getStringCopy(getSetupArtworkDir(artwork.mus_current));
+ if (fileExists(directory))
+ return directory;
+
+ /* 4th try: look for default artwork in new default artwork directory */
+ directory = getStringCopy(getDefaultMusicDir(MUSIC_SUBDIR));
+ if (fileExists(directory))
+ return directory;
+
+ /* 5th try: look for default artwork in old default artwork directory */
+ directory = getStringCopy(options.music_directory);
+ if (fileExists(directory))
+ return directory;
+
+ return NULL; /* cannot find image file */
+}
+
void InitTapeDirectory(char *level_subdir)
{
createDirectory(getUserDataDir(), "user data", PERMS_PRIVATE);
if (node_parent == NULL) /* top level group */
{
- artwork_new->basepath = base_directory;
- artwork_new->fullpath = artwork_new->filename;
+ artwork_new->basepath = getStringCopy(base_directory);
+ artwork_new->fullpath = getStringCopy(artwork_new->filename);
}
else /* sub level group */
{
- artwork_new->basepath = node_parent->basepath;
+ artwork_new->basepath = getStringCopy(node_parent->basepath);
artwork_new->fullpath = getPath2(node_parent->fullpath, directory_name);
}
if (strcmp(keyname, "(undefined)") != 0 &&
strcmp(keyname, "(unknown)") != 0)
{
- for (i=strlen(entry); i<50; i++)
+ /* add at least one whitespace */
+ strcat(entry, " ");
+ for (i=strlen(entry); i<TOKEN_COMMENT_POSITION; i++)
strcat(entry, " ");
strcat(entry, "# ");