View Issue Details

IDProjectCategoryView StatusLast Update
0000090JEDI VCL00 JVCL Componentspublic2002-06-05 09:22
ReporterkayAssigned Touser81 
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000090: Default value for TTimeStamp in unit JvWinampApi wrong
DescriptionIf one use the component JvWinampApi in a form, one will get an error message 'not valid TimeStamp' (sorry I got a german message). This happens twice, once for 'SongLength' and once for 'SongPosition'. The message will repeated several times (on redraw). One can not delete the component.

The reason is, that the default value for 'Date' in TTimeStamp should be one not zerro.
Additional InformationThe following code should be changed as follows (I have tested it, see also upload):

function TJvWinampApi.GetLength: TTime;
var
  h: THandle;
  i: Integer;
  tstamp: TTimeStamp;
begin
  h := FindWindow(PChar(RC_WinampWindow), nil);
  tstamp.Time := 0;
// tstamp.Date := 0; //wrong format has to start with one
  tstamp.Date := 1;
  if h <> 0 then
  begin
    i := SendMessage(h, WM_WA_IPC, 1, IPC_GETOUTPUTTime);
    if i <> -1 then
      tstamp.Time := i * 1000;
  end;
  Result := TimeStampToDateTime(tstamp);
end;

{**************************************************}

function TJvWinampApi.GetTime: TTime;
var
  h: THandle;
  i: Integer;
  tstamp: TTimeStamp;
begin
  h := FindWindow(PChar(RC_WinampWindow), nil);
  tstamp.Time := 0;
// tstamp.Date := 0; / has to start with one
  tstamp.Date := 1;
  if h <> 0 then
  begin
    i := SendMessage(h, WM_WA_IPC, 0, IPC_GETOUTPUTTime);
    if i <> -1 then
      tstamp.Time := i;
  end;
  Result := TimeStampToDateTime(tstamp);
end;
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change