Module to jump to a point in audio track Thread last updated on 2007-11-29 13:18:16

Posted by member 256241 on 2007-11-22 16:27:58

Hello,

Having got tired with transparancy issues with umSlider in win2k, I made my own slider with some scripting and xlabel, using tvol to set the volume. This works perfectly.

I decided to make a track position bar with similar code, however I hit a stumbling block in that I do not know how to jump to a specified number of seconds through the current track.

I've looked at dynamp, geekamp etc. and these all seem to have a jump forward/backward, but not a "jump to this position". I need someting like !ampjumptoposition %{position}.

I am using command lines to control foobar anyway, so I'll look into using those to do that, but I'm trying to keep my theme compatible with both winamp and foobar2000.

Am I just missing something? How can I achieve this?


Thanks for reading.

Posted by member 212670 on 2007-11-22 17:12:50 link

I bet it could somehow be done with the sendmessage module, and winamp messages. I don't have time to look in to it right now, but google "Winamp Messages."

Posted by member 256241 on 2007-11-22 18:29:53 link

Thanks for the response.

From what I've read, there is no commandline command for foobar to do this. Also, foobar people state that sendmessage is not supported or recommended (which makes me think it's possible). I've googled foobar messages, although I haven't found anything relevent yet. What I need is a list of messages for foobar or something. (I'm not immediately interested in support for winamp atm, just want it working with what I use ;) )

Posted by member 256241 on 2007-11-24 13:19:57 link

Okay, I've made a little progress. It seems there is a component for foobar2000 (otherwise jumptoposition is impossible) called foo_winamp_ipc. It appears as if (I'm new to this) it's functions can be called via SendMessage.

Here are the commands:
IPC_JUMPTOTIME Set the position of the current song.
IPC_SETVOLUME Get or Set the volume of Winamp.

Now... Here's where I get confused: How can I send that message? (never used sendmessage before). The sendmessage docs say it needs to be a decimal value? What exactly are "WPARAM" and "LPARAM".

something like: !SendMessage "{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1" "" "IPC_JUMPTOTIME" "30"
doesn't work, is it close? (that's my foobars classname btw :/ )

Sorry if any of these questions are stupid, and thanks for reading.


[edit] Looking in the Winamp5 SDK, I've found:

#define IPC_JUMPTOTIME 106
/* (requires Winamp 1.60+)
** SendMessage(hwnd_winamp,WM_WA_IPC,ms,IPC_JUMPTOTIME);
** IPC_JUMPTOTIME sets the position in milliseconds of the
** current song (approximately).
** Returns -1 if not playing, 1 on eof, or 0 if successful
*/


and:

/* message used to sent many messages to winamp's main window.
** most all of the IPC_* messages involve sending the message in the form of:
** result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);


Could anyone please help me formulate a valid sendmessage?


tried
!Message "{DA7CD0DE-1602-45e6-89A1-C2CA151E008E}/1" "" (1000) 106
and many other variations.

Posted by member 1 on 2007-11-24 17:12:56 link

Search the code section for the Windows Media Player SendMessages.

Posted by member 256241 on 2007-11-28 18:46:50 link

Okay, I've been mulling this over and asked on winamp and foobar forums, but still haven't got it working.

Someone on the winamp forum said (the IPC foobar module emulates Winamp IPC calls - apparently) that this should be good:

// WM_WA_IPC 1024
// 150 time to move the trackposition
// 160 IPC_JUMPTOTIME
!SendMessage "Winamp 1.x" "" 1024 150 106

but that doesn't work. Can anyone see any mistakes or ommissions or anything?

Also, the guy who made the foobar IPC plug in said:

result = SendMessage(hwnd_winamp,WM_WA_IPC,(parameter),IPC_*);

So i think you should try

!SendMessage "Winamp v1.x" "" "WM_WA_IPC" "30" "IPC_JUMPTOTIME"

but alas, this isn't working. Can anyone see what's going on here?

I also had a look at other foobar components, one called foo_remote looked like maybe it could help, but it's unsupported on all recentish versions.

devilboi, I had a look at that, wmdman seems to just be for managing windows, and I can't find remote-1.02 anywhere, is it a litestep module? Also I dont think any of those commands sent a command with a parameter, like setvolume x or setposition x. Maybe I should try using spy++ or whatever to get some info on how to access foobar.

Posted by member 31 on 2007-11-29 13:18:16 link

!SendMessage "Winamp v1.x" "" "WM_WA_IPC" "30" "IPC_JUMPTOTIME"
is meaningless. You need to use the number value, not the "name".

Your original use is correct syntax (afaik) although I don't know whether the values you passed are correct.

Be sure you aren't mixing hexadecimal and decimal.