So, recently i installed the qmmp media player on my linux.
I was looking for a decent replacement for xmms, since my
good old player is a GTK 1 based player, and it’s no more
included in debian 5. Off course I can install it anyways,
if I get it elsewhere then the default repository.
Anyways, I found this qmmp player. Another ‘Winamp clone’
for linux. But it’s Qt based, and I don’t like Qt much.
Anyways, when setting up the last.fm I noticed it offered
an option to scrobble to libre.fm too. So I was curious and
checked this site out. So, it’s an open source reimplementation
of last.fm. signed up and all. Libre.FM reimplements the
AudioScrobbler protocol, so exsisting plugins could be used
if they’re set to the correct server.
For this purpose, I did a quick patch on the AudioScrobbler
classic plugins, so they scrobble to libre.fm in stead of last.fm.
I also changed the check for double plugins, so it’s possible to
have the modern plugin scrobble to last.fm at the same time
as this classic plugin scrobbles to libre.fm
Leave feedback on BlaatSchaap or Last.FM
So, after this quick patch, I decided looking into writing a
new application, that will allow multi scrobbling in a nicer
way. I wish to write an application a la the modern last.fm
scrobbler. For this purpose I decided to try the lazarus IDE.
I thought it would be a good opertunity to try how well this
IDE works. For those who don’t know lazarus, it’s an open
source Delphi clone, using the FreePascal compiler. So, it’s
pascal programming with a RAD (Rapid Application Development)
Rapid Application Development, programming with the mouse,
as I like to call it. Just point and click, create a form, place a button,
click it and add code to it. The lazy way of programming,
but well… I do like to concentrate on the functionality of the
code. The GUI, well… it’s there to show what the program
is going, but not the main part, so, RAD is fine.
Anyways, so, I was thinking to write a scrobbler, so, what do
I need to scrobble? Networking, right? So, this time, I am
programming in pascal in stead of C, and for windows in
stead of posix. The pascal wrappers for the sockets API
don’t feel nice at all, and the WinSock implementation of
the socket API is just… annoying, incomplete and stuff…
So, I decided to do some coding in C++ in stead. For this
I used the Microsoft Visual Studio 2008, hoping this
version of the compiler does include the headers for
IPv6 sockets.
As I wish to write a modern application, I would like it to
support IPv6, right? So, I have done this on linux before,
resolving a hostname to an IPv6, under linux, or *BSD
for that matter, I would use
gethostbyname(hostname, AF_INET6);
right? Well… not on Windows, oh noes! Not supported
by uncle gates’ winsock. So, how to resolve it then?
After googleling a bit on this issue, i found the getaddrinfo
is supported by windows.
Well… having the hostname resolved, I want to show the IP
address to the user, right? So, we call the inet_ntop function
for this, right?
And so it seemed, the compiler compiled the code without
complaining, but as I tried to start it, an error message
showed up, complaining about missing symbol inet_ntop in ws2_32.dll
Missing symbol… right? so it’s not implemented. Looking
at MSDN, it seems they’ve only added this symbol in
since Vista.
All this stuff pisses me off at Windows, and I want to return
to Linux for developing, where stuff at least compiles and
works the way I want it. I am thinking about using cygwin
for this, so get rid of the windows-api-annoyance and work
with a clean posix-sockets-api.
Thanks for the write up of Libre.fm.
We have some interesting developments in the works. Be sure to add your code, under a free license if you can, to http://bugs.libre.fm/wiki
Cheers,
Matt Lee
Founder, Libre.fm
Nice work, thanks.