Help - Search - Members - Calendar
Full Version: Looking For A Plugin
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
blert
It's been a long time since I've been around here but I am in need of a plugin.

I am looking for something that is much like foo_Text, but, instead of saving the data to a text file, I need something that saves the data to a structure in shared memory. The reason I am looking for a plugin like this is because I would very much like to create a CoolMon2 plugin that gathers this data from shared memory instead of reading the data from disk.

If you know of such a plugin would you please point me to it.

If one does not exist at this time would there be someone willing to whip one up for me? I know absolutely nothing of C++ so there is no way I can do it myself. The shared structure would need to be static (I mean that the structure itself can never change). Therefore, there would be no need for any configuration, just send all data concerning the currently playing file (title, artist, position, yada, yada, etc...) into the shared structure.

Thanks for your time.
-blert
CrazyCoder
I can try to add this feature to AMIP.

Please provide more details how the structure should look like and a sample application that can read and show it (preferably with sources).
blert
Sounds great, thanks. I have to do a bit of cleaning up and painting for a few hours today, but I will try to cook up a test app this evening. Once I get the time it won't take long at all to make the test app and I will link the package in this thread when it is done. Hopefully, Delphi source will be ok?

edit:
I pm'd you with a link to the test app w/ Delphi source.
CrazyCoder
Thanks, I think this feature will appear in the next AMIP version, I'll notify you when the first working beta is ready.
CrazyCoder
Great news, AMIP now has the simple Shared Memory API.

You need the latest AMIP 2.53 beta or the new upcoming release.

Sample Delphi application with sources is available here.

You may need the new AMIP Configurator with the Timer Callback Setting.

Configure AMIP as displayed on the above and this screenshot. The test application displays something like this:

user posted image

when AMIP is running and when you press Recieve button.



Some technical details for those who are interested.

The following command was added: /shmem(file,type,action) where file is the name of memory mapped file (e.g. amip_api);
type can be 'delphi' (without quotes) for pascal/delphi style TStrings and anything else for C style strings;
action is either 'update' or 'clear', update updates the memory mapped file, clear clears it.

Examples that can be placed into the Timer Callback and Exit Callback:

CODE
/shmem(fb2k_cm2,delphi,update)
/shmem(fb2k_cm2,delphi,clear)



Delphi shared structure:

CODE
 TSong = record
   Title: ShortString;
   Artist: ShortString;
   Album: ShortString;
   Year: ShortString;
   Genre: ShortString;
   Filename: ShortString;
   BitRate: ShortString;
   SamplingRate: ShortString;
   ChannelMode: ShortString;
   SongLength: ShortString;
   CurrentTime: ShortString;
   Status: ShortString;


C structure:

CODE
struct CSong {
 char Title[256];
 char Artist[256];
 char Album[256];
 char Year[256];
 char Genre[256];
 char Filename[256];
 char BitRate[256];
 char SamplingRate[256];
 char ChannelMode[256];  
 char SongLength[256];
 char CurrentTime[256];
 char Status[256];
};


API used to access these structures is Memory Mapped files, see the following API functions for reference:

CODE
CreateFileMapping
OpenFileMapping
MapViewOfFile
UnmapViewOfFile

blert
Many thanks to you. biggrin.gif I will start on the CM2 plugin right away! Thanks again.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.