The problem was the Timer, every time the processor is overloaded the timer reloads. That was a fault in my source i noticed. I put it all together and followed Chris his idea. I focused to much on Timer calls. Thank you. See here some results: ( Just left only for view )
{==============================================================================}
{== ChannelSetSync of the type BASS_SYNC_POS (SyncHandle PlayerLeft) ==========}
{==============================================================================}
procedure LeftFadeTimeStart(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
aSyncBoolLeft.hSyncFadeTimeStart := True;
frmJukebox.LeftFadeTimeStartProc;
end;
procedure LeftStartFadeIn(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
aSyncBoolLeft.hSyncStartFadeIn := True;
frmJukebox.LeftStartFadeInProc;
end;
procedure LeftStartFadeOut(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
aSyncBoolLeft.hSyncStartFadeOut := True;
frmJukebox.LeftStartFadeOutProc;
end;
procedure LeftAutoCue(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
aSyncBoolLeft.hSyncAutoCue := True;
frmJukebox.LeftAutoCueProc;
end;
procedure LeftEndStream(SyncHandle: HSYNC; Channel, data, user: DWORD); stdcall;
begin
aSyncBoolLeft.hSyncEndStream := True;
frmJukebox.LeftEndStreamProc;
end;
And with a little bit help from WndProc:
procedure TfrmJukebox.WndProc(var Msg: TMessage);
begin
inherited;
if Msg.Msg = WM_INFO_UPDATE then
case msg.WParam of
EJB_MSG_INIT_PLAYER_LEFT: InitPlayerLeft;
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_INIT_PLAYER_LEFT, 0);
EJB_MSG_INIT_PLAYER_RIGHT: InitPlayerRight;
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_INIT_PLAYER_RIGHT, 0);
EJB_MSG_NOTIFY_NACK_LEFT: MessagePlayerNotifyNack(PlayerLeft, msg.LParam);
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_NOTIFY_NACK_LEFT, ErrorGetCode);
EJB_MSG_NOTIFY_NACK_RIGHT: MessagePlayerNotifyNack(PlayerRight, msg.LParam);
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_NOTIFY_NACK_RIGHT, ErrorGetCode);
EJB_MSG_UPDATE_STATUS_PANELS: UpdateStatusPanels;
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_UPDATE_STATUS_PANELS, 0);
EJB_MSG_MARGUEE_INFO_LEFT: MargueeInfoLinks.Items[0].Text := CreateMargueeInfo(LeftPlayerInfo.MusicInfo);
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_MARGUEE_INFO_LEFT, 0);
EJB_MSG_MARGUEE_INFO_RIGHT: MargueeInfoRechts.Items[0].Text := CreateMargueeInfo(RightPlayerInfo.MusicInfo);
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_MARGUEE_INFO_RIGHT, 0);
EJB_MSG_UPDATE_INFO_BLOCK: UpdateInfoBlok;
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_CLEAR_PLAYER_LEFT, BoolToInt(ClearInfo));
EJB_MSG_CLEAR_PLAYER_LEFT: ClearPlayerLeft(IntToBool(msg.LParam));
// SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_CLEAR_PLAYER_RIGHT, BoolToInt(ClearInfo));
EJB_MSG_CLEAR_PLAYER_RIGHT: ClearPlayerRight(IntToBool(msg.LParam));
end;
end;
Must do the trick to get it all right without failures.
Question: I have some problems to call ShowMessage if in the fade moment a file does not exists? I am very certain that i call this within a Message. But i know that the procedure that i am calling to select the next song is not in the SendMessage WndProc. Like this:
procedure TfrmJukebox.PlayerLeftNotifyNack(ErrorGetCode: Integer); { < Called
begin
ArtistLeft.Caption := PlayerLeft.PlayBuffer.Filename;
TitleLeft.Caption := BASSErCodes[ErrorGetCode];
{MessagePlayerNotifyNack(PlayerLeft, ErrorGetCode); = now Sendmessage}
SendMessage(Handle, WM_INFO_UPDATE, EJB_MSG_NOTIFY_NACK_LEFT, ErrorGetCode); { Here is Sendmessage }
end;
System hangs after notify.
Question II: I use only streams to play music. Is the flag 'BASS_SAMPLE_FLOAT' obsolete? I don't use DECODED channels.
Regards.