0
0

hi, how i convert this to FMODEX ?

procedure TfrmMain.btnLoadClick(Sender: TObject);
var
Index: Integer;
Module: PFMusicModule;
Stream: PFSoundStream;
SongCount: Integer;
begin
if dlgOpen.Execute then
begin
for Index := 0 to dlgOpen.Files.Count – 1 do
begin
SongCount := lbxFiles.Items.Count;

  if SongCount = MAX_SONGS then
  begin
    Application.MessageBox(PChar(Format('Limit of %d songs reached', [MAX_SONGS])), 'Load error', MB_OK or MB_ICONHAND);
    Exit;
  end;

  Stream := nil;
  Module := FMUSIC_LoadSong(PChar(dlgOpen.Files[Index]));
  if Module = nil then
  begin
    Stream := FSOUND_Stream_Open(PChar(dlgOpen.Files[Index]), FSOUND_NORMAL or FSOUND_LOOP_NORMAL, 0, 0);
  end;

  if (Module = nil) and (Stream = nil) then
  begin
    Application.MessageBox(FMOD_ErrorString(FSOUND_GetError), 'Load error', MB_OK or MB_ICONHAND);
    Continue;
  end;

  if Module <> nil then
  begin
    FMUSIC_SetMasterVolume(Module, 255);
    if (FMUSIC_GetType(Module) = FMUSIC_TYPE_MOD) or (FMUSIC_GetType(Module) = FMUSIC_TYPE_S3M) then
      FMUSIC_SetPanSeperation(Module, 0.15);  // 15% crossover
  end;

  FSongs[SongCount].Module := Module;
  FSongs[SongCount].Stream := Stream;
  FSongs[SongCount].Playing := False;

  lbxFiles.Items.Add(ExtractFileName(dlgOpen.Files[Index]));
  lbxFiles.ItemIndex := SongCount;
end;

end;
lbxFilesClick(nil);
end;

i can load in FMODex

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.