23 May '13 - 08:26 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 [2] 3 4 ... 9
  Print  
Author Topic: Old:Winamp Visualisations in XMPlay (0.9.11) (plus album art with auto download)  (Read 77897 times)
Ian @ un4seen
Administrator
Posts: 15269


« Reply #20 on: 27 Feb '08 - 15:25 »

Here's an (untested Smiley) update that should allow vis updating while XMPlay is minimized...

   www.un4seen.com/stuff/xmplay.exe

It's a plugin controlled setting (rather than a user setting), to avoid unnecessary updating for plugins that don't need it. Again, it's a QueryInt option ("xmplay:minupdate"), but instead of XMPlay returning a value, it reads a value from the plugin. You would use it like this...

// enable minimized updating
int minupdate=1;
sonface->QueryInt("xmplay:minupdate", &minupdate);

// disable minimized updating
int minupdate=0;
sonface->QueryInt("xmplay:minupdate", &minupdate);

The setting is reset (disabled) each time a new plugin is loaded, and a plugin shouldn't set it after it has been closed (eg. SaveSettings has been called).

Btw, I forgot to mention last time that you need to free the texts that you receive from XMPlay (unless it's defined as "const"), using the "Free" miscellaneous function.
Logged
Barna
Posts: 103


« Reply #21 on: 28 Feb '08 - 05:58 »

Thanks Ian, minupdate works fine as far as I can see.

But...

I was almost ready to make a release when I encountered some weird behaviour.
When a thread started by the vis plugin uses XMPFUNC_MISC::PerformShortcut( 80 ) to play a track it works fine, until that thread stops. Then XMPlay's sound playing thread kind of freezes and doesn't continue until it's started again (by pressing pause/play twice for instance).

Here's the code of some mini sample plugin which reproduces the behaviour (source/binary download):

#include <windows.h>
#include <stdio.h>
#include "vis.h"
#include "xmpfunc.h"

void initialize(void);
BOOL render(unsigned long* Video, int width, int height, int pitch, VisData* pVD);
BOOL savesettings(char* FileName) { return TRUE; }
BOOL opensettings(char* FileName) { return TRUE; }
BOOL receivequeryinterface(QueryInterface* Interface);
BOOL deinit();
BOOL clicked(int x, int y, int buttons);

VisInfo plugin = { 1, "XMPFunc Test", 0, &initialize, &render, &savesettings, &opensettings, &deinit, &clicked, &receivequeryinterface };
DLLEXPORT VisInfo* QueryModule(void) { return &plugin; }

int sentpause = 0;
int sentplay = 0;
int threadalive = 0;
XMPFUNC_MISC* XMPlay_Misc = NULL;
BOOL receivequeryinterface(QueryInterface* queryinterface)
{
QueryInterface* XMPlay_QueryInterface = queryinterface;
InterfaceProc xmpface = NULL;
if (queryinterface->QueryInt("xmplay:interface", (int*)&xmpface) && xmpface)
XMPlay_Misc = (XMPFUNC_MISC*)xmpface(XMPFUNC_MISC_FACE);
return TRUE;
}

DWORD WINAPI ThreadProc(LPVOID lpParam)
{
threadalive = 1;
Sleep(2000);
sentpause = 1;
if (XMPlay_Misc) XMPlay_Misc->PerformShortcut(80);
Sleep(2000);
sentplay = 1;
if (XMPlay_Misc) XMPlay_Misc->PerformShortcut(80);
Sleep(2000);
threadalive = 0;
return 1;
}

HANDLE hThread = NULL;
void initialize(void)
{
hThread = CreateThread(NULL, 0, ThreadProc, NULL, 0, NULL);
}

BOOL clicked(int x, int y, int buttons)
{
if (!threadalive) initialize();
return TRUE;
}

BOOL deinit()
{
if (WaitForSingleObject(hThread, 500))
{
TerminateThread(hThread, 0);
}
CloseHandle(hThread);
return TRUE;
}

BOOL render(unsigned long* Video, int width, int height, int pitch, VisData* pVD)
{
char szText[4][128];
BITMAPINFO m_bmpInfo;
HDC m_dcPaint;
long *m_pPaintBuffer;
HBITMAP hDibSection;
HDC hDC;
HGDIOBJ OldObject;
int y;
memset(&m_bmpInfo.bmiHeader, 0, sizeof(m_bmpInfo.bmiHeader));
m_bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
m_bmpInfo.bmiHeader.biWidth = width+(width%4?4:0)-(width%4);
m_bmpInfo.bmiHeader.biHeight = 0-(height+(height%4?4:0)-(height%4));
m_bmpInfo.bmiHeader.biPlanes = 1;
m_bmpInfo.bmiHeader.biBitCount = 32;
hDC = GetDC(NULL);
hDibSection = CreateDIBSection(hDC, (BITMAPINFO *) &m_bmpInfo, DIB_RGB_COLORS, (void**)&m_pPaintBuffer, NULL, 0);
m_dcPaint = CreateCompatibleDC(hDC);
SetMapMode(m_dcPaint, GetMapMode(hDC));   
OldObject = SelectObject(m_dcPaint, hDibSection);
PatBlt(m_dcPaint,0,0,m_bmpInfo.bmiHeader.biWidth,m_bmpInfo.bmiHeader.biHeight,RGB(0,0,0));
sprintf( szText[0], "Thread active: %d", threadalive);
sprintf( szText[1], "");
sprintf( szText[2], "sentpause (shortcut 80): %d", sentpause);
sprintf( szText[3], "sentplay (shortcut 80): %d", sentplay);
SetBkMode(m_dcPaint,RGB(255,255,255));
SetTextColor(m_dcPaint,RGB(255,200,0));
for (y = 0; y < 4; y++) TextOut( m_dcPaint, 6, 5+y*15, szText[y], strlen( szText[y] ) );
for (y = 0; y < height; y++) memcpy(&Video[y*pitch], &m_pPaintBuffer[y*m_bmpInfo.bmiHeader.biWidth], width*sizeof(long));
DeleteObject(OldObject);
DeleteDC(m_dcPaint);
DeleteDC(hDC);
DeleteObject(hDibSection);
return TRUE;
}

I deleted the previous 3.4.2.27 version already so I'm unsure if that was added due to the last update.

It works fine if the PerformShortcut calls are in the render function (even if the thread does the first 80-shortcut (pause) and then the render function does the second (play) later).
So yeah, I'm a bit struck by that whole thing... It could probably be worked around by using some queue from the vis thread so only the render function does the XMPFUNC_MISC commands. But I wanted to ask back maybe you have an idea (talk about abusing your attention now >_<).

Thanks already :-)
Logged
piovrauz
Posts: 473


« Reply #22 on: 28 Feb '08 - 15:30 »

@Barna: talking about stuff that pops up when using your plugin: the bubbles indicating volume that appears when changing volume, is possible to remove them? Maybe letting the wa plugin managing that "info"? just an idea. I'll test the svp in the attachment too, tonite Wink
Logged
Ian @ un4seen
Administrator
Posts: 15269


« Reply #23 on: 28 Feb '08 - 15:44 »

I was almost ready to make a release when I encountered some weird behaviour.
When a thread started by the vis plugin uses XMPFUNC_MISC::PerformShortcut( 80 ) to play a track it works fine, until that thread stops. Then XMPlay's sound playing thread kind of freezes and doesn't continue until it's started again (by pressing pause/play twice for instance).

Do you happen to be using DirectSound output? DirectSound will kill the playback if the thread that started it dies.
Logged
Barna
Posts: 103


« Reply #24 on: 28 Feb '08 - 18:27 »

Do you happen to be using DirectSound output? DirectSound will kill the playback if the thread that started it dies.
Ah great I'm an idiot...
I installed the DirectSound plugin once out of boredom while looking through all the downloads and just trying everything out :-)
It all makes more sense now. Even though it does only happen with shortcut 80, and not with 372 (List - Play) or 128 (Change track - Next). But I guess that is just how it works internal.
Well in a straight-forward-one-INT-solution I just now let the main thread do the 80 commands :-)

@Barna: talking about stuff that pops up when using your plugin: the bubbles indicating volume that appears when changing volume, is possible to remove them? Maybe letting the wa plugin managing that "info"? just an idea. I'll test the svp in the attachment too, tonite Wink
Well I tried to hide the bubbles but apparently XMPlay still displays a very small bubble when being asked to show an empty (String "") bubble. Anyway it doesn't matter that much anymore as these are only shown while XMPlay is not minimized. Now the visualisation does minimize XMPlay automatically (when asked by the Winamp plugin on fullscreen, configurable for MilkDrop for instance) and can be minimized manually without losing the visualisation input.

Download: http://www.nukular.ch/winamp_svp_0.5.zip
« Last Edit: 28 Feb '08 - 20:25 by Barna » Logged
piovrauz
Posts: 473


« Reply #25 on: 29 Feb '08 - 11:00 »

Nice, all works fine here Smiley)), gotta test it at home too.
I'm very grateful to you!!! This was the only thing I missed, the vis done by Geiss/Milkdrop dev.
Logged
Frosty
Posts: 4


« Reply #26 on: 29 Feb '08 - 13:38 »

a perfect addition to xmplay. really missed the milkdrop, thnx for makin it happen without winamp!!
Logged
Cosworth
Posts: 99


« Reply #27 on: 29 Feb '08 - 14:02 »

Something wrong after these update XMPlay(3.4.2.27). When i listen musc-set with length 125:00, XMPlay shows 7:15 Sad 
Logged
Pike84
Posts: 1398


« Reply #28 on: 29 Feb '08 - 14:18 »

I tested the plugin, and it seems to work nicely Smiley.

I was wondering how the album art option picks the file that it shows, and if it was possible to choose another one from the GUI. It would be nice to be able to view back covers, CD images etc. too.
Logged
Barna
Posts: 103


« Reply #29 on: 29 Feb '08 - 15:13 »

Thanks guys, I'm glad it works for you and you like it.

Something wrong after these update XMPlay(3.4.2.27). When i listen musc-set with length 125:00, XMPlay shows 7:15 :(
Is it wrong only while/after using this plugin or also without? I had some very bad memory leaks/overflow bugs caused by me which resulted in the weirdest behavior in XMPlay, so I hope there isn't one left now :-)

Edit: hmm, seems to be the same bug Pike84 reported in the 3.4 queries thread, will post my comment there.

I was wondering how the album art option picks the file that it shows, and if it was possible to choose another one from the GUI. It would be nice to be able to view back covers, CD images etc. too.

The complete lookup order for the covers is the following:
- The first image inside the ID3v2 tag of the current file (almost only in MP3 files).
- A file named Cover.jpg/png/jpeg in the same directory of the current song.
- Try same above with name Folder, then Front, then Album.
- A .jpg/.png/.jpeg file in the same directory containing the string Cover.
- Try same above with name Folder, then Front, then Album.
- A .jpg/.png/.jpeg file with the same file base name as the current playing song.
- Any jpg/png/jpeg in the same directory as the song

I am aware that this plugin doesn't support all kinds of file storing tags in the ID3 file. For instance afaik ID3v2 allows compression and encryption for the tags, but I doubt it's actually used anywhere. Also covers can be in more than the JPEG or PNG formats (I guess GIF would be used, as the third web format). Oh, and I've also seen programs which store these binary images into text only tagging systems (like Vorbis Text). I doubt many use either.
If anyone has an MP3 or even another file with included images not showing, I'd like to add support for it :-)

But yeah, I like your idea of having the option to show other images if found (either inside the file or in the directory).
I was almost running out of ideas for this project, so this suggestion is more than welcome :-)
« Last Edit: 29 Feb '08 - 15:55 by Barna » Logged
x0r
Guest
« Reply #30 on: 1 Mar '08 - 08:19 »

R2 (http://www.rabidhamster.org/R2/download.php) doesn't work with this wrapper.
Logged
Barna
Posts: 103


« Reply #31 on: 1 Mar '08 - 12:14 »

1.65 unregistered (free version) works pretty well here.
Except the play control but thats a bit weird as it seems to control it through it's own Winamp controlling functions and not by going through the plugin interface. You can even control Winamp while running R2 in XMPlay.
Logged
Auren
Posts: 144


« Reply #32 on: 1 Mar '08 - 15:30 »

Barna
Couldn't you somehow integrate MaresWEB's Amazon Cover Downloader with your Album Cover Viewer? For example, you can parse the Album name with XMPlay and then send it to ACD through command line parameters. After that, ACD saves the image to the folder where the playing song resides and the ACV shows the image as an album cover...
Don't waste your time if it's too difficult — I can do that manually. Smiley
Logged
piovrauz
Posts: 473


« Reply #33 on: 3 Mar '08 - 08:15 »

mmmm, I noticed some slow down in loading plugins (milkdrop, geiss2) with this last build, is this the price I have to pay for new mods? not a big problem, but if it's not the case, I got like 4/5 sec of wait before the wa plugin get draw... Is it possible to speedup this?

apart from this, this wrapper is nearly perfect, works great Smiley
« Last Edit: 3 Mar '08 - 13:51 by piovrauz » Logged
Barna
Posts: 103


« Reply #34 on: 4 Mar '08 - 01:44 »

mmmm, I noticed some slow down in loading plugins (milkdrop, geiss2) with this last build
Hmm, I can't confirm this here. At least I can't really feel a difference with older versions of the plugin to the current one on my machine (Athlon 64 3200+). Can someone else have a comment on this?
While MilkDrop 2 always took it's loading time (window comes up fast, but visualisation only starts after a few seconds) Geiss2 comes up very fast.
I mostly concentrated on getting it as stable as possible, so maybe I can have a look if some optimization is possible (and maybe check the older loading process' code to try to get back to it's speed :-))

Couldn't you somehow integrate MaresWEB's Amazon Cover Downloader with your Album Cover Viewer? For example, you can parse the Album name with XMPlay and then send it to ACD through command line parameters. After that, ACD saves the image to the folder where the playing song resides and the ACV shows the image as an album cover...
Yeah sounds like a cool idea.
I looked at the tool just today and noticed one thing... It's not unicode compatible at all :-) Something I'd really depend on for such a utility. But I took all my Visual Basic knowledge to get that feature into ACV and sent the source code changes to the author.
I hope a new version gets released soon.
I'll add support for it anyway I guess.
Logged
piovrauz
Posts: 473


« Reply #35 on: 4 Mar '08 - 09:09 »

mmm, tested @home (athlon64x2 6000+), and work (athlon64 3500+), and I confirm it lags on loading plugins (now). Like you said, milkdrop is slower than geiss, but the bigger wait-time is on drawing the plugin window, like 4/5 sec, not on showing the "animation" in it. v3 didn't lag so much, not sure about v4. I'll try later with a clean xmplay setup (not that I have that much stuff "installed"), just to be sure it's not some plugin.
Logged
piovrauz
Posts: 473


« Reply #36 on: 6 Mar '08 - 09:18 »

update to previous post: on my home pc (the dualcore) the slowdown is gone, doing nothing... good for me since it's the one I care the most, but still strange...

plugin request: I have a plugin that loads with the wrapper, but doesn't get feeded by audio. can you look in it please, just to see if it's easy to fix it? thanks.

I attached the plugin, the full installer is available at wa site.

* vis-tx3.7z (444.03 KB - downloaded 11 times.)
Logged
Barna
Posts: 103


« Reply #37 on: 7 Mar '08 - 21:28 »

I was wondering how the album art option picks the file that it shows, and if it was possible to choose another one from the GUI. It would be nice to be able to view back covers, CD images etc. too.

Couldn't you somehow integrate MaresWEB's Amazon Cover Downloader with your Album Cover Viewer?

Both features are now in 0.6.
The automatic cover finding through ACD works better than I had expected. It even kinda works with radio streams. But most of the time radio stations send Artist - Title in their stream title, so it doesn't find the album covers most of the time. Still, it's nice :-)

update to previous post: on my home pc (the dualcore) the slowdown is gone, doing nothing... good for me since it's the one I care the most, but still strange...

plugin request: I have a plugin that loads with the wrapper, but doesn't get feeded by audio. can you look in it please, just to see if it's easy to fix it? thanks.
I think I fixed all problems with Tripex3, please test it again with the new version.
I also think these fixes could fix any slowness you experienced since once of the recent versions, as the new one goes back to just one thread for the plugin wrapping as it was before, not two anymore. Seems to be just as stable (and faster), I hope.

Download: http://www.nukular.ch/winamp_svp_0.6.zip

Also here's the unicode capable version of MaresWEB's Amazon Cover Downloader compiled by me, as it's not yet up on maresweb.de. Sourcecode and License included of course. Just copy the contents of this archive over an existing ACD installation: http://www.nukular.ch/ACD_Unicode.zip
Logged
Lesmo16
Posts: 19


« Reply #38 on: 7 Mar '08 - 21:29 »

Barna, thanks for this great plugin! Smiley
I don't need any visualization ... BUT the cover feature is something I was waiting for.

It would be fantastic, if your plugin would cycle through all valid images in the playing folder.
The cycle time should be user definable.

I hope you'll like this feature.
Logged
Auren
Posts: 144


« Reply #39 on: 7 Mar '08 - 22:25 »

Barna, thanks a lot! It works perfect!

Literally, 100 kb of pure happiness...
« Last Edit: 7 Mar '08 - 22:28 by Auren » Logged
Pages: 1 [2] 3 4 ... 9
  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines