I don't remember, but my unfinished cron project was going to insert liners at the top and bottom of the hour, and I know I referenced how it works in some thread here.
If you can locate the thread, that'd be grand.
So I should be talking to you, since somewhere I have code to do the same (though not for this item).
Yeah. Here's what I came up with:

int getFidFromRunningOrderIndex(int iIndex)
{
int iPlaylistLength=0;
int iRunningOrderLength=0;
unsigned long ulOffset; // location of playlist length
unsigned long ulFidTableIndex = 0;
unsigned int uiFid = 0;

if ((fpDynData = fopen("/dev/hda3", "ro")) != NULL)
{
ulOffset = 0x10;
fseek(fpDynData, ulOffset, SEEK_SET);
fread(&iPlaylistLength, sizeof(int), 1, fpDynData);
//printf("playlist length: %ld\n", iPlaylistLength);

ulOffset = 0x18;
fseek(fpDynData, ulOffset, SEEK_SET);
fread(&iRunningOrderLength, sizeof(int), 1, fpDynData);
//printf("running order length: %ld\n", iRunningOrderLength);

// 0x200 is the second sector, which contains playlist entries
// But we need to skip past these for now to get the running order
// indexes, which are after the 8-byte playlist entries
ulOffset = 0x200 + 8*iPlaylistLength + iIndex * 4;
fseek(fpDynData, ulOffset, SEEK_SET);
fread(&ulFidTableIndex, sizeof(unsigned long), 1, fpDynData);
//printf("fid table index: %ld\n", ulFidTableIndex);

// now we know the index into the fid table (which starts at 0x200
ulOffset = 0x200 + 8*ulFidTableIndex;
fseek(fpDynData, ulOffset, SEEK_SET);
fread(&uiFid, sizeof(unsigned int), 1, fpDynData);
printf("fid: %x\n", uiFid);

fclose(fpDynData);

return 1;
}
else
{
return -1;
}
}
.

To actually use it, you need the running order index, which is available from the 128-byte flash save area. This is incidentally why I asked Mark to fix Hijack to allow multiple readers on the flash save area. So if you're on the 0th track in your running order, you pass in 0 to this function and it gives you back the current FID. That's not very interesting, since that's available in /proc/empeg_notify. But if we're on the 47th track in the running order, we can pass in 48 to figure out what the next tune is. I originally wrote this for Now & Next, and figured that some point, I'd read and cache the ID3 information from 2 or 3 of the next tracks to improve speed in changing tracks, etc. This would be a good side benefit of such an animal.
_________________________
- Tony C
my empeg stuff