HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: LRN on 2007-10-07 01:18:03

Title: foo_listeningto
Post by: LRN on 2007-10-07 01:18:03
foo_listeningto_v0.1.3_beta_src_bin.7z (http://lrn.no-ip.info/other/foo_listeningto/foo_listeningto_v0.1.3_beta_src_bin.7z)

Plugin sends NowPlaying information to Miranda IM (http://www.miranda-im.org/).

Only works with ListeningTo (http://forums.miranda-im.org/showthread.php?t=10912) Miranda IM plugin.

Works best with ListeningTo v0.1.1.8.

To receive information in Miranda, enable Options->Status->Listening info->Players->Other players.

Compiled against foobar2000 SDK v0.9.4.

Options page contains only Enable/Disable checkbox and custom title formatting field (not functional at the moment).
Title: foo_listeningto
Post by: pirlouy on 2007-10-07 11:30:37
Impossible to load plugin: error detected by foobar2000 which prevents plugin to work.
Title: foo_listeningto
Post by: LRN on 2007-10-07 11:36:09
Please, tell me exact error message. And foobar2000 version (if it is not 0.9.4.4).
Title: foo_listeningto
Post by: pirlouy on 2007-10-07 14:24:39
Quote
Failed to load DLL: foo_listeningto.dll
Reason: Cette application n'a pas pu démarrer car la configuration de l'application est incorrecte. Réinstaller l'application pourrait résoudre ce problème.

Translation:
Quote
Failed to load DLL: foo_listeningto.dll
Reason: this app can't start because application configuration is incorrect. Reinstall application might solve this problem.


I'm using 0.9.4.4, winxp SP2 up to date.
Title: foo_listeningto
Post by: LRN on 2007-10-07 14:41:19
Ah, this is, probably, because you don't have some fu***n MSVC dlls on your PC. Must be MSVCR80.dll. Try this (http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en)
Title: foo_listeningto
Post by: pirlouy on 2007-10-08 18:50:02
After installing what you said, it works.
Just for info,after installation, I had no MSVCR80.dll in system32 so it depends on another dll.

ps: what are the differences between your plugin and foo_msn_alt ?
Title: foo_listeningto
Post by: LRN on 2007-10-08 19:02:16
foo_listeningto is for Miranda IM, while foo_msn_alt is, as i presume, for MSN Messenger. Other than that they are pretty similar, i think.
Title: foo_listeningto
Post by: Zao on 2007-10-08 20:13:00
Just for info,after installation, I had no MSVCR80.dll in system32 so it depends on another dll.


That's because the DLLs are nowadays in the WinSxS directory, in neatly named side-by-side folders.
This conveniently avoids the DLL hell.
Title: foo_listeningto
Post by: jarsonic on 2007-10-08 20:24:07
Ah, this is, probably, because you don't have some fu***n MSVC dlls on your PC. Must be MSVCR80.dll. Try this (http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en)


It might be easier for users if you utilize static linking of the .dll at runtime, rather than dynamic linking when you compile your plugin.
Title: foo_listeningto
Post by: foosion on 2007-10-08 21:15:37
Your plugin contains a serious bug in the part that extracts the filename from a track's path.

Offending code (DO NOT COPY THIS):
Code: [Select]
    char *filename = (char*)strrchr(p_track->get_path(),'\\');
    if (filename == NULL) filename = (char*)strrchr(p_track->get_path(),'/'); // ***UNSAFE*** removing const modifier
    if (filename == NULL) filename = "";
    else
    {
      filename++;
      char *tmp2 = strrchr(filename,'.');
      if (tmp2 != NULL) tmp2[0] = 0; // ***BUG*** write access to constant string
    }


Use pfc::string_filename to extract the filename instead:
Code: [Select]
pfc::string_filename filename(p_track->get_path());


Please fix your plugin as soon as possible, or we will have to ban it for corrupting the core's data structures.
Title: foo_listeningto
Post by: pirlouy on 2007-10-08 23:16:31
foo_listeningto is for Miranda IM, while foo_msn_alt is, as i presume, for MSN Messenger. Other than that they are pretty similar, i think.

But like Pescuma's plugin allows to make believe Miranda IM is WLM, foo_msn_alt works too.
But if I can, I prefer to use a plugin especially for Miranda IM, so I'll use yours.

You're a bit rude, foosion...

ps: thanks Zao for information.
Title: foo_listeningto
Post by: LRN on 2007-10-08 23:40:43
Quote
This conveniently avoids the DLL hell.

Yeah, maybe they did it AT LAST! (http://www.lohnet.org/~hornlo/mutterings/wdjef/)

Quote
It might be easier for users if you utilize static linking of the .dll at runtime, rather than dynamic linking when you compile your plugin.
I'll try.

Quote
Use pfc::string_filename to extract the filename instead:

Thanks.

----EDIT

Updated link in the first post to version 0.1.2.
Compiles with /MT (that is right, jarsonic?)
Extracts filename via pfc::string_filename class. I hope i did not messed up with object destruction. As you can see, i am not really fond of objects...

Quote
for corrupting the core's data structures.

Oops. Looks like i forgot why i created a strdup from ptrack->get_path()  Well, i'll stick with pfc::string_filename now, since i used it already.

----EDIT

Updated link in the first post to version 0.1.3.
*sigh* Looks like i will never learn to write bug-free code. This time it is miscalculated estimated buffer length.