return para_munmap(afd->map.data, afd->map.size);
}
-#if 0
-static void play_loop(enum play_mode current_play_mode)
-{
- int i, ret;
- struct audio_file_data afd;
-
- afd.current_play_mode = current_play_mode;
- for (i = 0; i < 0; i++) {
- ret = open_next_audio_file(&afd);
- if (ret < 0) {
- PARA_ERROR_LOG("failed to open next audio file: %d\n", ret);
- return;
- }
- PARA_NOTICE_LOG("next audio file: %s, score: %li\n", afd.path, afd.score);
- sleep(1);
- close_audio_file(&afd);
- }
-}
-#endif
-
-
static enum play_mode init_admissible_files(void)
{
int ret;
- char *given_mood, *given_playlist;
-
- given_mood = "mood_that_was_given_at_the_command_line";
- given_playlist = "given_playlist";
- if (given_mood) {
- ret = change_current_mood(given_mood);
+ if (conf.mood_given) {
+ ret = change_current_mood(conf.mood_arg);
if (ret >= 0) {
- if (given_playlist)
+ if (conf.playlist_given)
PARA_WARNING_LOG("ignoring playlist %s\n",
- given_playlist);
+ conf.playlist_arg);
return PLAY_MODE_MOOD;
}
}
- if (given_playlist) {
- ret = playlist_open(given_playlist);
+ if (conf.playlist_given) {
+ ret = playlist_open(conf.playlist_arg);
if (ret >= 0)
return PLAY_MODE_PLAYLIST;
}