I'm working with the pictureflow plugin and I'm trying to get the slide being displayed (center_index) to be the stopped track. I've written some code (with help) to stop audio and save the path, and then load the id3 information of that track. The function returns the album name since pictureflow really runs off an album index.
/*
Load id3 info for the stopped track and return the album name
*/
char goto_slide(void)
{
int fd;
char current_track[MAX_PATH];
struct mp3entry id3;
fd = rb->open(TEMP_PATH, O_RDONLY);
rb->read_line(fd, current_track, MAX_PATH);
rb->close(fd);
fd = rb->open(current_track, O_RDONLY);
#if (CONFIG_CODEC == SWCODEC)
if (fd >= 0 && rb->get_metadata(&id3, fd, current_track))
#else
if (!rb->mp3info(&id3, current_track));
#endif
rb->close(fd);
rb->remove(TEMP_PATH); /* Get rid of the temp file */
return id3.album;
}
the center_index is an int so i need to get the number in the album index of the album I have id3 info for. This is where I have my problem. Here is what I am doing:
int seek_ci(void)
{
center_index = 1;
while ( (rb->strcmp(goto_slide, album_names[center_index])) != 0 )
center_index++;
return center_index;
}
The album_names array is just a character array that stores the names of all the albums. I figured that when these were equal I would have a match and I could set the center_index to that number- however this is not the case. I get the start screen for pictureflow and then nothing happens..
If someone who knows the plugin could help out it would be greatly appreciated. Thanks.