View Issue Details

IDProjectCategoryView StatusLast Update
0000117MMW v4Playerpublic2010-10-25 14:30
Reporterrusty Assigned To 
PriorityurgentSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Fixed in Version3.0 
Summary0000117: Player: crossfade between songs
DescriptionIt would be nice to either have crossfade/gap removal functionality build in, or to include a plug-in that provides this function.
Additional InformationFrom: http://members.tripod.com/files_saivert/files/dsoundipc.html

Shows how to communicate directly with the directsound output plugin

dsound_ipc


directsound output plug-in ipc

this is something i figured out from using spy++, and a little intelligence.
no docs available at that moment.
please read through all 5 (five) steps...

1st, locate the handle of the "dsound_ipc" window:

  /* in c/c++: */
    hwnd hds_ipc=findwindowex(hwndwinamp, 0, "dsound_ipc", null);

  { in borland delphi: }
    var hds_ipc;
    begin
      hds_ipc := findwindowex(hwndwinamp, 0, 'dsound_ipc', nil);
    end;
2nd, to turn crossfade (fade at end) on or off:
  sendmessage(hds_ipc, wm_user, state, xfade_state);
  // where state is 0 = off, or 1 = on
3rd, to set the crossfade duration:
  sendmessage(hds_ipc, wm_user, duartioninms, xfade_duration);
  // where duartioninms = milliseconds
4th, to intercept changes in state and/or duration:
  // set up a subclass
  wndproc olddsoundproc;
  olddsoundproc = (wndproc) setwindowlong(hds_ipc, gwl_wndproc, (int) newdsoundproc);

  // the newdsoundproc subclass window procedure
  lresult newdsoundproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam)
  {
      if (msg==wm_user && wparam==0 && lparam==0)
      {
        int duration, state;
        duration=sendmessage(hwnd, wm_user, 0, xfade_getduration);
        state=sendmessage(hwnd, wm_user, 0, xfade_getstate);
      }
  }

// remeber to remove subclass in quit procedure of your plugin, like this:
  setwindowlong(hds_ipc, gwl_wndproc, (int) olddsoundproc);
here is the delphi (pascal) version
var
  olddsoundproc: tfnwndproc;

{ the subclass procedure }
function newdsoundproc(wnd: hwnd; msg: uint; wparam:
  wparam; lparam: lparam): lresult; stdcall;
var
  duration, state: integer;
begin
  if (msg=wm_user) and (wparam=0) and (lparam=0) then
  begin
    duration := sendmessage(hwnd, wm_user, 0, xfade_getduration);
    state := sendmessage(hwnd, wm_user, 0, xfade_getstate);
  end;
end;
5th, here is the constants:
#define xfade_state 0x64
#define xfade_duration 0x66

#define xfade_getduration 0x67
#define xfade_getstate 0x65

// useful macro, use if you wish
#define send_dsoundipc(wnd, msg, val) sendmessage(wnd, wm_user, val, msg)
also got one for delphi (pascal) users:
const
  xfade_state = $64;
  xfade_duration = $66;

  xfade_getduration = $67;
  xfade_getstate = $65;

function senddsoundipc(wnd, msg, val): integer;
begin
  result := sendmessage(wnd, wm_user, val, msg)
end;
that's it for now!
TagsNo tags attached.
Fixed in build1012

Relationships

related to 0002545 resolvedjiri New output plugin 
related to 0002678 resolvedLudek Remember playback position 
related to 0002718 resolvedjiri Play mp3 tracks gaplessly 

Activities

jiri

2003-02-20 12:27

administrator   ~0000239

There are several plug-ins at WinAmp's site for this purpose. I'm not sure if I have checked them, but they should work. Some good and tested plug-ins can be added to the recommended plug-ins on the Songs-DB web.

rusty

2003-02-24 04:36

administrator   ~0000273

Last edited: 2003-02-24 04:39

I did a bit of investigation and found the following plug-ins to be highly rated by users and meet a need:

-XFout http://classic.winamp.com/plugins/detail.jhtml?componentId=175 : Crossfading output plug-in works well in WA2, but doesn't work in SongsDB (end of song is cut rather than faded) (note: other cross fading plug-ins were for two instances of WA and/or weren't highly rated).

DSP Plug-ins (Note: these plug-ins have nothing to do with cross-fading, however, I did the research at the same time, and figured it would be worth noting here).
The following plugins worked well in WA2, but I couldn't figure out how to use them with Song--DB.
-Dee2 http://classic.winamp.com/plugins/detail.jhtml?componentId=127352
or Wow Thing http://classic.winamp.com/plugins/detail.jhtml?componentId=1724 Either of this sound enhancing DSP plugins work well in WA2, but both cost and the shareware version isn't redistributable.
-Defx http://classic.winamp.com/plugins/detail.jhtml?componentId=6295 : DSP plug-in cuts out voice for karaoke purposes. Works quite well in WA2.
-Chronotron II http://classic.winamp.com/plugins/detail.jhtml?componentId=97797 : Changes song tempo without modifying pitch

This pretty much leaves us with nothing that I'd want to bundle for now, aside from some of those that are already on your 'plug-ins' www page. Re-assigning to Jiri for feedback.

edited on: 02-23 23:39

jiri

2003-02-26 14:33

administrator   ~0000304

Output plug-ins:
  I will try to find out if anything can be corrected for XFout.

DSP Plug-ins:
  They are currently not supported, but I think it shouldn't be too hard to implement it. I will review it.

jiri

2003-03-02 21:28

administrator   ~0000349

Re. XFout - quite strange, I wouldn't like to include to anyway (strange display, behaviour, ...). It will be probably best to try to implement some kind of crossfading internally, regardless of the output plug-in. I will do it later.

It doesn't work in Songs-DB, because it uses messages I don't know. Songs-DB emulates WinAmp in order to use its plug-ins, but 100% compatibility is 1. improssible, 2. problematic because of some undocumented features. Most of plug-ins should work well, however few things could be still improved.

DSP Plug-ins - I implement them now, it is quite easy, will be done soon.

jiri

2003-03-03 22:11

administrator   ~0000350

Ok, I have implemented DSP plug-ins (even more than one can run) - build 466. This bug is open for crossfading.

rusty

2003-03-09 22:22

administrator   ~0000422

I've been experimenting with the direct sound output plugin. It has crossfading built in, and it seems to work quite well. Would it make sense to use this plugin by default? Are there any downsides to it?

jiri

2003-03-10 08:21

administrator   ~0000427

No, the plug-in is good, it is supposed to be used for this purpose. I should also discuss with the developer if he could provide sources or some support, as he left the development and does WinAmp3 plug-ins only now. Maybe it will be necessary to create own plug-in in the future.

rusty

2003-05-06 03:34

administrator   ~0001078

Note: I tried another gapless playback plug-in called MP3-splice, and this one also failed to work in SDB...

rusty

2003-06-12 15:43

administrator   ~0001477

Re-assigned to Rusty since SQR-soft now works--it's now a question of getting permission to include a plug-in.

rusty

2003-06-22 11:56

administrator   ~0001539

Sent e-mails on June 18, 22 to: cecilia@sqrsoft.com.ar and mariano@sqrsoft.com.ar . Awaiting feedback.

rusty

2004-05-13 03:39

administrator   ~0004066

Last edited: 2004-07-05 18:57

At this point it seems that our best bet would be to use the out_ds plugin, and preconfigure it as necessary. The only downside to this is that we would probably want to enable it selectively: i.e. use out_wave on W9x/ME and out_ds on NT/W2K/XP.

We should use settings along the following lines for the out_ds plugin so that inobtrusive crossfading is enabled by default, along with gapless playback:
-Buffering settings - Default
-Fading
--default fade length - 333ms (=default)
--old style fade - disabled (=default)
--don't abort fadeout when Winamp is shutting down - enabled (=default)
--fading on start, on first start, on end - disabled (=default, I think)
--fading on pause/stop - 1500ms
--fading on seek - default (333ms)
-Other: Remove Silence at beginning end of track: enabled (40db)

Any settings not explicitly mentioned should be left at the plugins default.

edited on: 07-05-04 14:57

rusty

2005-06-17 15:40

administrator   ~0005611

Note: according to Nicolai, XFade plugin doesn't work because:

(12:27:00) Nicolai: I'm actually working on XFade now, but not to improve compatibility with MM. I'm just making a new version which will turn off the XFade for songs shorter than x seconds.
(12:27:32) Nicolai: I might then make it MM compatible. But the best thing would be if MM mimiced Winamp 5's EMbed Window IPC.
(12:28:09) Nicolai: If MM wants to act like Winamp, it should support all of Winamp's different IPC messages.
(12:28:25) Nicolai: Including the newer video api's and skinning interfaces.
(12:31:02) Nicolai: Controlling Nullsoft's DirectSound ouput plug-in isn't actually hard at all. You just need to subclass a window with the class "DSound_IPC" and then send it some messages. This is what Winamp's modern skin does when you pop out the Equalizer drawer. There you can set the crossfade duration and turn crossfade on/off.

jiri

2006-10-14 13:30

administrator   ~0008011

Implemented as part of 0002545 in build 1008.

rusty

2006-10-18 20:50

administrator   ~0008027

Verified. Open issues tracked in 2545.

jiri

2006-10-26 19:24

administrator   ~0008079

There was one thing we hadn't implemented yet: Set exceptions for tracks that shouldn't crossfade at all.

Technically I implemented it in build 1010 (out_MMDS.dll is needed). There are hardcoded genres that don't crossfade as: 'Book;Podcast'. (or anything containing these).

We just need to decide where to give user option to configure this, something like:

 [x] Crossfade track
    Except tracks where genre contains:
         _Book;Podcast__________________________________

Assigning to Rusty to specify this.

rusty

2006-10-27 16:19

administrator   ~0008088

Last edited: 2006-10-27 16:21

I'd suggest that it should appear in the output plugin as follows:

[x] Crossfade tracks (x s)
     <----------------->
    [ ] Fade in new tracks
    [x] Do not crossfade tracks with genre containing: _book, podcast________

[x] Smooth x...


rusty

2006-10-27 16:56

administrator   ~0008089

Last edited: 2006-10-27 17:07

If we don't want to have this in the output plugin, then a possible approach would be to have the following in the player config:

Never crossfade tracks with genre containing: _book, podcast________

Obviously, this is a bit confusing, but there's no way around it if we're forced to have crossfading configuration split between 2 locations.

jiri

2006-10-28 18:08

administrator   ~0008092

2 Ludek: Please implement the configuration (for variable PlayerDontCrossfadeGenre from GlobVars.pas) as described - together with configuration of 0002678.

Ludek

2006-11-28 22:18

developer   ~0008204

Fixed in build 1012.

The part of UI appears on Player | Auto-DJ / Now Playing option panel.