Old 5th March 2011, 14:03   #1
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
API: jump to file -> queue selected

Hi,

I'm looking for a SendCommand function that tells Winamp to play the selected playlist track right after the current playing track. Practically you do this by right clicking on a playlist item -> jump to file -> queue selected. With
code:
SendMessage(plugin.hwndParent,WM_WA_IPC,position,IPC_SETPLAYLISTPOS);

a specific track is selected in the playlist but how can I emulate the right click -> jump to file -> queue selected command now?

SendInput does not work when the playlist is not focussed...maybe you can focus it somehow?

I hope for some hints
Thanks,
Martin
inspire is offline   Reply With Quote
Old 5th March 2011, 15:03   #2
DrO
 
Join Date: Sep 2003
Posts: 27,873
there isn't a formal SendMessage(..) api to do that, the only way is via the wasabi api_queue service (assuming there's a valid version of the jtfe plug-in present - which should be anything going back to 2008 if i remember correctly).

-daz
DrO is offline   Reply With Quote
Old 5th March 2011, 20:02   #3
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
alright, I've made an own queue, thanks!
inspire is offline   Reply With Quote
Old 5th March 2011, 20:04   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
i'm so glad i spent time implementing access to the playback queue for no one to use it *shrugs*

-daz
DrO is offline   Reply With Quote
Old 6th March 2011, 20:52   #5
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
ah I thougt the plugin wouldn't be included in the free winamp versions, sorry! I'm going to have a look at it because my implementation is just a work around and your plugin looks really nice!
inspire is offline   Reply With Quote
Old 10th March 2011, 23:56   #6
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
good job by the way!
inspire is offline   Reply With Quote
Old 24th March 2011, 16:44   #7
alesnik
Junior Member
 
Join Date: Mar 2011
Posts: 2
Hi, I have problem to get service QueueManagerApi.
Here is part of my code:
code:

WASABI_API_SVC = (api_service *)SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_GET_API_SERVICE);
waServiceFactory *factory = WASABI_API_SVC->service_getServiceByGuid(QueueManagerApiGUID);
if (factory)
{
QueueApi = (api_queue *)factory->getInterface();
}



service_getServiceByGuid method return zero to factory. Does anybody know what i do wrong?
alesnik is offline   Reply With Quote
Old 24th March 2011, 19:57   #8
DrO
 
Join Date: Sep 2003
Posts: 27,873
well it means either you're running a Winamp install with an older version of the jtfe plug-in (anything prior to v1.0 doesn't really support the wasabi system) or you're calling it before the jtfe plug-in has had a chance to load and so register the service with Winamp correctly - had thought i'd put in a note about that in the example plug-in source code (though i can't remember and would need to check that).

-daz
DrO is offline   Reply With Quote
Old 26th March 2011, 21:31   #9
alesnik
Junior Member
 
Join Date: Mar 2011
Posts: 2
Thanks a lott, problem solved.
alesnik is offline   Reply With Quote
Old 26th March 2011, 21:51   #10
DrO
 
Join Date: Sep 2003
Posts: 27,873
what was it in the end?

-daz
DrO is offline   Reply With Quote
Old 30th July 2011, 15:35   #11
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
Hi again,

the api_queue service is doing very well but now I tried to catch the api_queue::AddItemToQueue event in Winamp.

What I try to achieve: When a new file is enqueued in the queue (right click>jump to file>enqueue) the process shall be interrupted by an own method. Modifying the api_queue::AddItemToQueue method didn't work - it simply is not executed when enqueuing a track.

Can I catch this event somehow with the MainWndProc(HWND, UINT, WPARAM, LPARAM)?

Last edited by inspire; 30th July 2011 at 17:59.
inspire is offline   Reply With Quote
Old 31st July 2011, 19:23   #12
DrO
 
Join Date: Sep 2003
Posts: 27,873
you can't override a wasabi service in the way you're trying to do it (and i'm not happy you're trying to hack my api) as it is not like a SendMessage(..) based api so you can try to override it as much as you like but it won't work.

why do you need to know when something has been added to it or are you making an additional queue on top of the api_queue feature? if so then your only option is to poll api_queue to see when there's been a change though doing that too much will cripple the queue and Winamp functionality. otherwise you need to explain better what and why you're trying to do as there may be a better option i've just not publically documented or need to implement to save doing inane hacks that aren't appropriate.

-daz
DrO is offline   Reply With Quote
Old 1st August 2011, 23:49   #13
DrO
 
Join Date: Sep 2003
Posts: 27,873
am going to bump this as i only have the next few days to work on any changes needed to be made to the JTFE plug-in, otherwise it's not likely to be until 2012 i can get around to implementing any 'changes' so you're not trying to hack things. if i don't hear anything back via here or via email (address from my site link), i'll assume it's become a non-issue.

-daz
DrO is offline   Reply With Quote
Old 2nd August 2011, 10:42   #14
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
hi daz,
sorry for my late answer.
I'm not trying to hack your api the background is: I've made a remote app for Android (http://code.google.com/p/remotecontrol-for-winamp/) which controls and synchronizes the playback and playlist of Winamp. The Some users wished to have a "jump to file>enqueue" feature in the app which works perfectly. Enqueued tracks are displayed in the app. But the app doesn't notice when someone enqueues a track in winamp what is my purpose.
If this is not a big deal for you, me and lots of the app users would be very grateful

martin
inspire is offline   Reply With Quote
Old 2nd August 2011, 21:27   #15
DrO
 
Join Date: Sep 2003
Posts: 27,873
adding some sort of callback notification in should be simple to do. i had thought i'd already done something like that but would have to check the source code once the vm replacing my old XP box is sorted out.

-daz
DrO is offline   Reply With Quote
Old 3rd August 2011, 19:24   #16
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
ah alright, it's not that urgent, take your time
inspire is offline   Reply With Quote
Old 5th August 2011, 16:21   #17
DrO
 
Join Date: Sep 2003
Posts: 27,873
firstly, you'll need to add a version check to your plug-in to determine if the correct JTFE is present:
Quote:
** UINT ver = SendMessage(hwnd_winamp,WM_WA_IPC,0,IPC_GET_JTFE_VERSION);
** if(ver >= 0x1020040){
** // success
** }
That will return success if using v1.2.4 (which is what the next version will be).

From that, then the following will be available to work with to detect changes being made to the plug-in's queue:
Quote:
#define IPC_GET_JTFE_QUEUE_UPDATE(hwnd_winamp) \
SendMessage(hwnd_winamp,WM_WA_IPC,(WPARAM)&"genjtfe_queue",IPC_REGISTER_WINAMP_IPCMESSAGE);
#define QUEUE_ADD 0 // added item(s) to the queue
#define QUEUE_CLEAR 1 // full clearance of the queue
#define QUEUE_REMOVE 2 // removed item(s) from the queue
#define QUEUE_RANDOMISE 3 // contents of the queue were randomised
#define QUEUE_MOVE 4 // item(s) in the queue changed position
#define QUEUE_MISC 5 // possible multiple changes of the queue e.g. via drag and drop
/* (implemented in JTFE api 1.1.1+)
** This is sent when any change is made to the plug-in's queue where wParam indicates the
** action which caused the change to the queue. In some cases this message is not sent
** until the final action has happened e.g. when adding multiple items into the queue.
**
** UINT_PTR genjtfe_queue = IPC_GET_JTFE_QUEUE_UPDATE(hwnd_winamp);
**
** if(uMsg == WM_WA_IPC && lParam == genjtfe_queue){
** switch(wParam){
** case QUEUE_XXXXX:
** // do stuff
** break;
** }
** }
*/
It is likely some of these details will change, but am posting this now before everything is set in stone incase it's not going to fit with what you're looking for...

-daz
DrO is offline   Reply With Quote
Old 7th August 2011, 17:28   #18
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
aw great - thanks a lot! Can you predict when there will be a new Winamp version with JTFE 1.2.4?
inspire is offline   Reply With Quote
Old 7th August 2011, 17:59   #19
DrO
 
Join Date: Sep 2003
Posts: 27,873
no idea on an eta (as is always the case with Winamp releases until a week or so before it happens). though it's not that difficult to install the new jtfe (once done) on older clients going back to v5.5

-daz
DrO is offline   Reply With Quote
Old 7th August 2011, 18:15   #20
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
yes of course - I was just interested thanks
inspire is offline   Reply With Quote
Old 13th August 2011, 11:52   #21
inspire
Junior Member
 
Join Date: Jul 2007
Posts: 29
ah sry, everything is fine
inspire is offline   Reply With Quote
Old 6th September 2013, 20:25   #22
dexneutron23
Junior Member
 
Join Date: Sep 2013
Posts: 1
Hello, I just read the whole thread, and I have same problem with the "jump to file -> queue selected" case..

So, i try to search anything about Wasabi that DrO mentioned before but I can't find any library about Wasabi.

I know that this thread is started about 2 years ago. So. I hope there is any easier way to do this task without wasabi or any libraries.

Thanks.


Edit : I'm sorry. I just read that wasabi is already merged with Winamp 5.
So, I think the way to do this task would be simplier than before. But. I still have no idea how to do this thing...

How can I SendMessage to Winamp 5 to do a thing like :

SendMessage(hwnd_winamp, MESSAGE_TYPE, positionOfThePlayList, ADD_TOJTFQUEUE);

?

FYI : I need this thing to create a standalone desktop application service to handle remote request(s) from other computer in a Local Area Network)
dexneutron23 is offline   Reply With Quote
Old 24th February 2014, 09:07   #23
ToyTank
Junior Member
 
Join Date: Feb 2014
Posts: 4
I did alot of research and here is what I came to after hours of reading and programming

http://forums.winamp.com/showthread.php?t=375455

Take a look at my script if you still need to queue from external of winamp.
ToyTank is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump