Help - Search - Members - Calendar
Full Version: album art msn dp changer.
Hydrogenaudio Forums > Hosted Forums > foobar2000 > 3rd Party Plugins - (fb2k)
Pages: 1, 2, 3
bojo
hi,

i found this on the internet for winamp

CODE
private void mainThread()
{
  int WinampWindow;
  int WinampStatus;
  int OldSongPosition;
  int i;

  MessengerAPI.MessengerClass MSN = new MessengerAPI.MessengerClass();

  try
  {
   while (true)
   {
    WinampWindow = FindWindow("Winamp v1.x", null);

    //if winamp is running
    if (WinampWindow != 0)
    {
     //write playlist
     SendMessage(WinampWindow, 1024, 0, WM_WRITEPLAYLIST);
     //get winampstatus
     WinampStatus = SendMessage(WinampWindow, WM_USER, 0, WM_GETSTATUS);
     switch (WinampStatus)
     {
      case 1:
       lblWinampState.Text = "Playing";
       groupBox2.Visible = true;
       break;
      case 3:
       lblWinampState.Text = "Paused";
       groupBox2.Visible = true;
       break;
      default:
       groupBox2.Visible = false;
       lblWinampState.Text = "Stopped";
       break;
     }
     //get old song position
     OldSongPosition = CurrentSongPosition;
     //get new song position
     CurrentSongPosition = SendMessage(WinampWindow, 1024, 0, WM_PLAYLISTPOSITION);

     //if new song isnt the old song (new track)
     if (OldSongPosition != CurrentSongPosition)
     {
      StreamReader streamread = new StreamReader("C:\\Program Files\\Winamp\\Winamp.m3u");
      string curLine;
      i = 0;
      while ((curLine = streamread.ReadLine()) != null)
      {
       //prevent line which start with # to be counted
       if (curLine.StartsWith("#"))
        continue;
       //if we reached the current file
       if (i == CurrentSongPosition)
       {
        //getting fileinfo of current song
        FileInfo fileinfo = new FileInfo(curLine);

        if (pictureBox1.Image != null)
         pictureBox1.Image.Dispose();
      
        //getting MP3 tags
        MP3File mp3File = ShellID3TagReader.ReadID3Tags(curLine);
        txtFilename.Text = curLine;
        txtArtist.Text = mp3File.ArtistName;
        txtAlbum.Text = mp3File.AlbumName;
        txtTitle.Text = mp3File.SongTitle;

        //if there is a folder.jpg in the directory of the current playing song
        if (File.Exists(fileinfo.Directory + "\\folder.jpg"))
        {
         pictureBox1.Visible = true;
         pictureBox1.Image = new Bitmap(Image.FromFile(fileinfo.Directory + "\\folder.jpg"), 100, 100);
         //setting the folder.jpg as the MSN DP
         MSN.set_MyProperty((MessengerAPI.MCONTACTPROPERTY)2, fileinfo.Directory + "\\folder.jpg");
        }
        else
         pictureBox1.Visible = false;

        break;
       }
       i++;
      }
      streamread.Close();
     }
    }
    else
    {
     groupBox2.Visible = false;
     lblWinampState.Text = "Closed";
    }

    Thread.Sleep(500);
   }
  }
  catch (Exception E)
  {
  
  }
}


Link to original page

the site where it is meant to be hosted is down.

i think with winamp spam, and this i would be able to have my dp change to the album art?. i just dont know how to compile the source, if it is even all there.
tool++
Whoa, that would be incredible. If a coder could look into getting this working for foo it would be fairly amazing :]
Acropolis
just made it.
http://www.hydrogenaudio.org/forums/index....ic=39924&st=509
bojo
was this in any way based on the code i supplied?... i can kinda read it, i sorted understand C++ and C is very similar.

i just had no idea on how to compile it, once u get into the correct formatting it gets confusing etc.

can sum1 recommend a decent site for learning C++?. I want to re-learn how to do it all, hopefully based around using the Visual C++ express edition, as most tutorials dont tell you how to compile properly using it.

cheers acropolis trying it out now biggrin.gif

hmm it changes my first msn pic to the album, but each subsequent song changes it stays the same as the first song.

the window inside foobar changes its picture, but it doesnt change the one on msn.
PredUK
A nice way to fix that would be to add a button/command to perform the task of changing the MSN DP. Then it could be pressed in the fb2k main window or by using a hotkey.
Acropolis
QUOTE(PredUK @ Jun 19 2006, 22:29) *

A nice way to fix that would be to add a button/command to perform the task of changing the MSN DP. Then it could be pressed in the fb2k main window or by using a hotkey.


I don't like the way that, for each plugin related to pictures, it will have its own format string to locate the pictures, it is very annoying.
At first I attempted to add this "changing dp" feature in foo_msnalt, but I have no idea how to hook the foo_uie_albumart for the picture location (and the event to change picture) so I just simply modify the albumart plugin.
bojo
acropolis? does it actively change your display picture?, like when it changes song does it change with it?

if its working fine for you, can u please tell me your msn version?. it changed once for me, and then decided not to do it anymore, weird :S
Acropolis
QUOTE(bojo @ Jun 19 2006, 23:16) *

acropolis? does it actively change your display picture?, like when it changes song does it change with it?

if its working fine for you, can u please tell me your msn version?. it changed once for me, and then decided not to do it anymore, weird :S


I'm using live messenger 8.0 beta, yes, it changes picture for every song.
bojo
im using live beta aswell, strange cause i thort that would be the problem, ill see if ive got something in sources set wrong?. dunno if thats the cause, the panel shows that a picture is loaded, it just doesnt like changing it.

on a unrelated topic, can i look at the source code of your plugin?, i was aiming to try and make one myself, but i dont know how to program foobar plugins, and i dont know much about the msn api. figured if i had a look at what u did i mite be able to fill in the gaps?.

if im asking to much, just say so biggrin.gif
Acropolis
QUOTE(bojo @ Jun 20 2006, 00:11) *

im using live beta aswell, strange cause i thort that would be the problem, ill see if ive got something in sources set wrong?. dunno if thats the cause, the panel shows that a picture is loaded, it just doesnt like changing it.

on a unrelated topic, can i look at the source code of your plugin?, i was aiming to try and make one myself, but i dont know how to program foobar plugins, and i dont know much about the msn api. figured if i had a look at what u did i mite be able to fill in the gaps?.

if im asking to much, just say so biggrin.gif


it seems the msn api use the old messenger executable's COM interface, propably you don't have it in:
"C:\Program Files\Messenger\msmsgs.exe"

I think you better take a look at the source of foo_msnalt, because it's pretty simple, the source of the albumart involve with ui columns. Also, my code is not really based on what you provided previously, if you insists, I can provide it.
uberkrieg
hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?
Acropolis
QUOTE(uberkrieg @ Jun 20 2006, 04:16) *

hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?


I'm not sure, only tested with 8.0 beta.
what do u mean by doesn't work? the plugin is working but not changing the msn avator or something else?
uberkrieg
QUOTE(Acropolis @ Jun 19 2006, 14:22) *

QUOTE(uberkrieg @ Jun 20 2006, 04:16) *

hello. nice feature.
one question, does this only work with live messenger 8.0 beta?
Im using msn messenger 7.5 and it doesnt work. am Im missing something?


I'm not sure, only tested with 8.0 beta.
what do u mean by doesn't work? the plugin is working but not changing the msn avator or something else?


hey, that was a fast reply biggrin.gif
exactly. the panel shows the album art within fb2k without problems. but It doesnt do anything to the msn messenger DP. do I need another pluggin or something?
Acropolis
ok, let me see what I can do, I have another computer running msn 7.5.
will be back with you soon.
uberkrieg
QUOTE(Acropolis @ Jun 19 2006, 14:31) *

ok, let me see what I can do, I have another computer running msn 7.5.
will be back with you soon.


thank you so much.

/me waits

biggrin.gif
SOS
Thanks for the plugin. smile.gif

I'm Windows Live Messenger 8.0.0689.00_Branches and it isn't working. The cover shows up in the panel but my display picture doesn't change.
Acropolis
@uberkrieg:
tried, it works fine, no problems.

@uberkrieg, @SOS:
do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.
anyway, I've just uploaded a new one, it will print messges to the foobar console for any activities that involves the msn avator, tell me about any error messages.

0.2.1_1
Andreasvb
Hi.

I'm having the same problem, here's what the console said:
foo_uie_albumart_msn: failed to create an instance of messenger (set_msn_dp)


I guess it's cause you use "Program Files". I'm on Swedish XP and we use "Program"

But I think you could use environment variables, like %PROGRAMFILES% which will use your Windows version's path for the "Program Files" path.

Great plugin otherwise =)

PS. I'ts called "Avatar" wink.gif
uberkrieg
this is what I get from console
"foo_uie_albumart_msn: failed to create an instance of messenger (set_msn_dp)"

and yeah, my installation path for msn messenger is different from
"C:\Program Files\Messenger\msmsgs.exe"

let my reinstall using that path.
Acropolis
@Andreasvb, @uberkrieg
The code doesn't actually use the fixed path: "C:\Program Files\Messenger\msmsgs.exe", it is the default path on my XP.

It uses COM interface, that mean it uses GUID to find the file, probably your msmsgs.exe is not registered in the system?
I suggest you to use any typelib viewers, e.g. oleview, to check if there's a typelib called: "Messenger API Type Library (Version 1.0)".

btw, thanks Andreasvb for the correction of the "avatar" smile.gif
Andreasvb
Maybe it's because I use WLM 8 Beta?

It uses this name, msnmsgr.exe and not msmsgs.exe

And my path is C:\Program\MSN Messenger\msnmsgr.exe
Acropolis
QUOTE(Andreasvb @ Jun 20 2006, 05:44) *

Maybe it's because I use WLM 8 Beta?

It uses this name, msnmsgr.exe and not msmsgs.exe

And my path is C:\Program\MSN Messenger\msnmsgr.exe


no, I'm using 8 as well. the interface to change the avatar is only provided with msmsgs.exe.

Also, I think you should have another error message: "foo_uie_albumart_msn: failed to create an instance of messenger (get_msn_dp)", if so, I'm quite sure you are missing the typelib interface.
if you only have the set_msn_dp one, propably my coding problem then, your picture path has non english characters? because I can't test for non english words other than chinese.
Andreasvb
I found this with oleview

CODE
TypeLib
{218CB45F-20B6-11D2-8E17-0000F803A446}

1.0 = Messenger Type Library
0
win32 = C:\Program\Messenger\msmsgs.exe

FLAGS = 0
HELPDIR =
Acropolis
your one is not for the plugin, this is the correct one:

CODE
TypeLib
{E02AD29E-80F5-46C6-B416-9B3EBDDF057E}

1.0 = Messenger API Type Library
0
win32 = C:\Program\Messenger\msmsgs.exe\3
FLAGS = 0
HELPDIR =C:\WINDOWS\help


your second codebox has nothing to do with the plugin issue, IVIEWERS.DLL is just for oleview.
SOS
QUOTE(Acropolis @ Jun 19 2006, 14:19) *

do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.

No, I didn't have Windows Messenger installed.
Andreasvb
Ok, I had the API first, but thought it was the wrong, I have both.
Only difference is the HELPDIR, mine is blank.

I have the old MSN here: C:\Program\Messenger\msmsgs.exe

The version of my old MSN is 5.1 (did it got avatars? tongue.gif)

(Oh, and it's Windows Messenger, not MSN)

Edit: It didn't had any avatars, guess that's why.
Acropolis
QUOTE(Andreasvb @ Jun 20 2006, 06:06) *

Ok, I had the API first, but thought it was the wrong, I have both.
Only difference is the HELPDIR, mine is blank.

I have the old MSN here: C:\Program\Messenger\msmsgs.exe

The version of my old MSN is 5.1 (did it got avatars? tongue.gif)

(Oh, and it's Windows Messenger, not MSN)

Edit: It didn't had any avatars, guess that's why.


no, it should support avatars. anyway, I've just written a small exe to test, seems I have the same problem now. digging on it.
uberkrieg
QUOTE(SOS @ Jun 19 2006, 16:06) *

QUOTE(Acropolis @ Jun 19 2006, 14:19) *

do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.

No, I didn't have Windows Messenger installed.


oh I see. I need to have WINDOWS messenger and not MSN messenger?
guess thats where the problem is. too bad I cant use windows messenger
sad.gif
Acropolis
QUOTE(uberkrieg @ Jun 20 2006, 06:19) *

QUOTE(SOS @ Jun 19 2006, 16:06) *

QUOTE(Acropolis @ Jun 19 2006, 14:19) *

do u have this file: "C:\Program Files\Messenger\msmsgs.exe" ? because it is the interface to ask msn to change the avator.

No, I didn't have Windows Messenger installed.


oh I see. I need to have WINDOWS messenger and not MSN messenger?
guess thats where the problem is. too bad I cant use windows messenger
sad.gif


no, that's wrong, it should work, currently I think it's a bug.
Andreasvb
I read that the first version supporting avatars is MSN 6.0
Acropolis
QUOTE(Andreasvb @ Jun 20 2006, 06:22) *

I read that the first version supporting avatars is MSN 6.0


I mean that msmsgs.exe doesn't really matter of what version, I have version 4.7. It will just ask the new messenger to change the avatar.

I've uploaded a zip file, can you do a test for me? I need you to extract the file to your directory, must be c:\test
then run test.exe to see if it changes your avatar.

test file
SOS
After installing Windows Messenger, my display picture changes now in WLM, but if I stop the current track the picture remains the album cover and doesn't revert back to the original. Also, if I stop and start a new track or forward to the next track, foobar crashes.
Andreasvb
QUOTE(Acropolis @ Jun 19 2006, 21:27) *

I've uploaded a zip file, can you do a test for me? I need you to extract the file to your directory, must be c:\test
then run test.exe to see if it changes your avatar.


It worked biggrin.gif

CODE
creating instance ... OK
Trying to get the current avatar ... OK
creating instance again ... OK
Trying to set the current avatar ... OK
Acropolis
ok, I think it's the problem of the picture location.
let me see how to fix, because it's a bit hard as I have no idea how to test non english characters smile.gif
uberkrieg


CODE
creating instance ... FAILED
Trying to get the current avatar ... FAILED


sad.gif
Xioze
Hi, just downloaded this and was really looking forward to using this but my console tells me that foobar was unable to load the plugin at foo startup?

Im using 0.8.3 and dont plan to upgrade, would this be the reason for it not working?
Acropolis
QUOTE(uberkrieg @ Jun 20 2006, 06:47) *

creating instance ... FAILED
Trying to get the current avatar ... FAILED


obviously you don't have the typelib interface to control the messenger.
btw, how can you get this result? because if failing to create the instance, it shouldn't try to get the avatar.

QUOTE(Xioze @ Jun 20 2006, 06:51) *

Hi, just downloaded this and was really looking forward to using this but my console tells me that foobar was unable to load the plugin at foo startup?

Im using 0.8.3 and dont plan to upgrade, would this be the reason for it not working?


you've just told the reason, this plugin is for 0.9.x.
Andreasvb
QUOTE(Acropolis @ Jun 19 2006, 21:43) *

ok, I think it's the problem of the picture location.
let me see how to fix, because it's a bit hard as I have no idea how to test non english characters smile.gif


Mine are english only, and spaces.

Maybe my strings can help you debug more.

$replace(%_path%,%_filename_ext%,)cover.*
$replace(%_path%,%_filename_ext%,)front.*

And this is what console says: foo_uie_albumart_msn: setting avator of file: C:\Download\Mp3\Album\\Front.jpg
uberkrieg
QUOTE(Acropolis @ Jun 19 2006, 16:56) *

QUOTE(uberkrieg @ Jun 20 2006, 06:47) *

creating instance ... FAILED
Trying to get the current avatar ... FAILED


obviously you don't have the typelib interface to control the messenger.
btw, how can you get this result? because if failing to create the instance, it shouldn't try to get the avatar.




is it something I have to download and /or install? I mean, that typelib thing you mention.
and for the other thing, well, that its what it says! :S
Xioze
QUOTE(Acropolis @ Jun 19 2006, 20:56) *

you've just told the reason, this plugin is for 0.9.x.



Well that wasn't mentioned anywhere in this thread, sorry for asking.

Acropolis
@Andreasvb
thanks, it is very useful.

@uberkrieg
you can try going to control panel -> add/remove programs to install the messenger again, I think.

@Xioze
my mistake, I should have mentioned it.
uberkrieg
QUOTE(Acropolis @ Jun 19 2006, 17:08) *


@uberkrieg
you can try going to control panel -> add/remove programs to install the messenger again, I think.



yeah, that was the 1st thing I tried, and nothing. I had messenger plus!! installed, removed that too and still cant get the pluggin (or the test program) to change the dp.
Ill keep trying diferent things and see.
thanks
Xioze
QUOTE(Acropolis @ Jun 19 2006, 21:08) *

@Xioze
my mistake, I should have mentioned it.


tongue.gif Is there no possibility of this ever being able to work with 0.8.3? Would love this plugin if it did.
Acropolis
QUOTE(Xioze @ Jun 20 2006, 07:14) *

QUOTE(Acropolis @ Jun 19 2006, 21:08) *

@Xioze
my mistake, I should have mentioned it.


tongue.gif Is there no possibility of this ever being able to work with 0.8.3? Would love this plugin if it did.


basically yes, because I have no more reasons to use 0.8.3, most of the things I need is already ported to the 0.9. I keep the old one is just for tagging wma.
Xioze
QUOTE(Acropolis @ Jun 19 2006, 21:08) *

basically yes, because I have no more reasons to use 0.8.3, most of the things I need is already ported to the 0.9. I keep the old one is just for tagging wma.


okay nevermind, cheers for replies.
Acropolis
Andreasvb, so now you are unable to create the instance with the dll or unable to set the avatar? I just remember the test.exe use the same way as the dll.

I've tried many times, I don't even have one time not able to change the avatar. even with your format string and the path.

anyway I've made some changes to the code, give it a try.
0.2.1_2
uberkrieg
well, I just installed messenger live Beta 8.0 and still nothing
:'(
hope someone comes up with a solution
Acropolis
QUOTE(uberkrieg @ Jun 20 2006, 07:48) *

well, I just installed messenger live Beta 8.0 and still nothing
:'(
hope someone comes up with a solution


new version of the messenger doesn't install the typelib interface for you, as I said before, you better use a typelib viewer to check if there's the typelib I mentioned previously.
zoidbergslo
ok I have tried this plugin and it doesn't work for me.

this error is writen in console
foo_uie_albumart_msn: failed to create an instance of messenger (set_msn_dp)

I'm using Msn Live Beta and it is instaled in C:/program Files/MSN Messenger
and I can't find that msmsgs.exe anywhere on my hard drive
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.