![]() |
#1 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
When does a song start?
Hi,
I'm a Winamp 2 DSP plugin and I would like to be noticed when Winamp starts to play a file. I have subclassed the main Winamp window and tried some things to find out when playing starts: 1.Detecting when the filename of the currently played file changes - but then I overlook that the same file could be playing again. 2.Detecting when the Winamp title changes - but it changes three or four times every time playing starts so I can't really use that either - or don't know how I could use it without making mistakes. Does anybody have other suggestions? |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
Are you talking about the WM_USER message with id=100?
I thought this message can be sent to Winamp to make it start playing. I'm not trying to start playback, I'm trying to be noticed when playback started. Maybe I'm wrong but it does not seem to work. Thank you anyhow. |
![]() |
![]() |
![]() |
#4 |
Join Date: Sep 2003
Posts: 27,873
|
sorry about that, meant wm_user not wparam
what you need to do is check for that message to be received and that indicates that playback is starting so you can then do whatever you need to do. i'll check it out later on but above should be working ![]() -daz |
![]() |
![]() |
![]() |
#5 |
Join Date: Sep 2003
Posts: 27,873
|
try this example
it will show a messagebox when play starts (detected in two ways - see below) and when the user clicks on stop (just to show). it works by checking the ids of the timer messages in the wparam of wm_timer since when playing starts, a unique timer message is received (id == 42). however if you are using an autoplay plugin then depending on the load order your plugin may or may not have been loaded by that time so it will not detect playback starting. the fix is to look for an id of 38 with the wm_timer which is only used when playing and then set an internal flag to indicate it has been detected. also had a look at the dsp thing and if you're creating a dsp i don't think you need to know when playback starts since winamp will call the selected dsp when playback starts anyway. well that's how i've taken it from playing with the dsp example project here. |
![]() |
![]() |
![]() |
#6 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
daz, I appreciate your work very much. Checking the wm_timer messages did not come to my mind. I did not want to see them in spy++ because they flooded the screen immediately so I overlooked that they are changing while a song is played.
Thank you for the hint and for the example project! Having said that, I noticed a problem with your method of detecting when a file is played: wm_timer with id 42 is also sent twice when you minimize the winamp window to the smaller interface (the very thin one with everything in one line) I am currently trying to put the parts together, maybe I can get an error-proof method by combining them. Even though Winamp controls the DSP plugin I need to know when a file is played because I want to load a value from disk that determines the amplification level of the current song. -jochen |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
I think I got it! Now I'm using this code in the CALLBACK function:
code: It seems to work ![]() daz (or shall I call you DrO?)you will be credited if I finish and publish my plugin ![]() |
![]() |
![]() |
![]() |
#8 | |
Join Date: Sep 2003
Posts: 27,873
|
Quote:
![]() no problem about the help. i can understand not wanting to go through the spy++ method but if you know what you want then you can drop all of the other messages ![]() mmm, interesting thing that about the id 42 when the window is put into windowshade (hadn't done that when putting the code together) so i've learnt something new ![]() go for DrO (makes more sense in relation to the forums - though if you want you can go for anything you like ![]() hope the rest of it all goes well ![]() -daz |
|
![]() |
![]() |
![]() |
#9 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
Here it comes
I thougt you might be interested ... just finished another milestone and I think the plugin is usable now.
What it does is normalizing the volume of any audio file that is played (except wma where Winamp does not allow this) in two passes: first analyze then amplify. The name is YANA (Yet Another Normalization Attempt) -jochen |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Oct 2003
Posts: 9
|
now where is that file? next try ...
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|