Jump to content
Tuts 4 You

X-88's Blog

Sign in to follow this  
  • entries
    2
  • comments
    10
  • views
    30,587

Played 6 File [*. Xm] with Delphi.

Sign in to follow this  
X-88

5,093 views

B) Not for the Expert, just for amateur programmers. B)

~~~~~~~~~~~~~~~~~~~~~~~~~~BeGiN~~~~~~~~~~~~~~~~~~~~~~~~~~~

unit Unit1;

interface

uses

Forms, uFMOD, Sfx, Sfx2, Sfx3, Sfx4, Sfx5, Sfx6, Classes, Controls, StdCtrls;

type

TForm1 = class(TForm)

Label1: TLabel;

procedure FormActivate(Sender: TObject);

procedure FormDestroy(Sender: TObject);

procedure FormKeyPress(Sender: TObject; var Key: Char);

procedure FormCreate(Sender: TObject);

private

{ By : X-88 }

public

{ hmm.... }

end;

var

Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);

begin

uFMOD_SetVolume(256);

uFMOD_PlaySong(@SfxData, SfxSize, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end;

procedure TForm1.FormDestroy(Sender: TObject);

begin

uFMOD_StopSong;

end;

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);

begin

if (Key = '1') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@SfxData, SfxSize, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '2') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx2Data, Sfx2Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '3') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx3Data, Sfx3Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '4') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx4Data, Sfx4Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '5') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx5Data, Sfx5Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '6') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx6Data, Sfx6Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '7') then

begin

uFMOD_StopSong;

Label1.Caption := 'Press 1-6 to Change Sfx' +#13#10+ '7 = Stop';

end;

end;

procedure TForm1.FormCreate(Sender: TObject);

begin

Application.Title := 'Test';

end;

end.

~~~~~~~~~~~~~~~~~~~~~~~~~~EnD~~~~~~~~~~~~~~~~~~~~~~~~~~

NB :

Uses Sfx, Sfx2, Sfx3, Sfx4, Sfx5, Sfx6

if (Key = '1') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@SfxData, SfxSize, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '2') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx2Data, Sfx2Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '3') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx3Data, Sfx3Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '4') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx4Data, Sfx4Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '5') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx5Data, Sfx5Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

else

if (Key = '6') then

begin

uFMOD_StopSong;

uFMOD_PlaySong(@Sfx6Data, Sfx6Size, XM_MEMORY);

Label1.Caption := 'Title : '+uFMOD.uFMOD_GetTitle;

end

---------------------------------------------------------------->

Unit Sfx2;

Interface

Const

Sfx2Size = 268215;

Sfx2Data : Array[1..Sfx2Size] of Byte = (

69,120,116,101,110,100,101,100,32,77,111,

.., .., .., .., .., .., .., .., .., .., .., .., .., .., .., .., .., Etc Done.

  • Like 3
Sign in to follow this  


1 Comment


Recommended Comments

One of the best resorce that i ever saw


Deep Thanx


Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×