I found the following notes from Sep 2007.  I don't want to lose them so I'm dumping them here with the rest of my random stuff.....   This is somewhat dated but it documents some of the makings of the ScrobRhapsody and ScrobRealplayer projects.  (I doubt if there ever will be a part 2 :/)

 

Although a Now Playing plugin for Rhapsody was the original plan, after more than a few stumbles along the way it now appears a more realistic plan may be to create a plugin for Realnetwork’s RealPlayer. The plugin will capture the meta information of the currently playing song and save the track, artist and if a properly tagged MP3 file is being played the album name too. If the current song is playing from one of the Realplayer radio streams it looks like we’re only going to see the artist and track. My stumblings include using the Realsystem SDK and various modules gleaned from browsing the Helix community website. The Helix Community is quite an interesting place in itself. It is geared towards the open source community and contains tons of information. I Googled “Realsystem SDK” to find the RealSystem G2 SDK. The SDK files named readme.txt, index.htm and build.htm (located in the samples directory) contain the documentation. I’m running Windows XP with VS C++ 6.o (standard) updated to the latest service pack and the last version of the Windows Platform SDK to work with VS 6.0. The “”Hello World sample looked to be a good place to start.

C:\Realplayer\rmasdk_6_0\samples\intro\hellowld\make>nmake win32-i386.mak

I had some bad luck. It didn’t compile.

error C2146: syntax error : missing ‘;’ before identifier ‘KSPIN_LOCK’ - looked to be caused by the SDK header file being a different vintage from the windows platform SDK I’m using. There may be a better solution but I elected to modify the following two typedef’s in the RealSystem G2 SDK to get around the compiler errors.

In file include\pnbastsd.h change line 118 from typedef long INT_PTR, *PINT_PTR;

to typedef long INT_PTR, *PINT_PTR, LONG_PTR;

and on line 119 change typedef unsigned long UINT_PTR, *PUINT_PTR;

to typedef unsigned long UINT_PTR, *PUINT_PTR, ULONG_PTR, DWORD_PTR. PULONG_PTR, PDWORD_PTR, HANDLE_PTR;

Much better luck, it compiled and linked this time. All that remains is to copy the hellowld.dll from the Rel32 directory and put it in a directory called c:\program files\common files\Real\Plugins and fire up Realplayer. An easy way to verify that the dll got loaded is to click “Help” from the menu and then click “About RealPlayer”, click “Copyrights”. Scroll down looking for one called “Example Hello World Plug-in”. These are the strings defined in the sample plugin source code.

Pretty cool, as this gets us into the memory space of the RealPlayer program. RealPlayer will load our single-load plugin at startup and hold it until RealPlayer is shutdown. Even cooler, a little experimenting showed this will work with the Rhapsody client too.

This entry was posted on Sunday, September 30th, 2007 at 1:12 am