MÜZİK DİNLEMEK İÇİN YAPMAYA ÇALIŞTIĞIM BİR ÇALIŞMA VAR..HERŞEY TAMAMDA ARDI ARDINA ŞARKI ÇALMAYI YAPAMADIK,,DAHA ÖNCEDE BU SORUN VARDI FORUMADA SORMUŞTUM O KODU BU KEZ ÇALIŞTIRAMADIM DDEĞİŞİK ŞEKİLDEDE DENESEMDE OLMADI.PROGRAMIN KODLARI ŞÖLE
KULLANDIĞIM BİLEŞEN VE ÖZELLİKLERİ
prev: TsuiButton;
next: TsuiButton;
mp3: TMediaPlayer;
paths: TRzListBox;
second: TTimer;
parametr: TTimer;
placepos: TTimer;
time: TRzPanel;
total: TRzPanel;
liste: TsuiListBox;
Kod: Tümünü seç
procedure TForm1.FormCreate(Sender: TObject);
var
vol:word;
a:string;
f:file;
begin
a:=extractfilepath(application.ExeName);
close;
audio1.Player.GetVolume(vol,vol);
volume.Position:=round(100/65535*(65535-vol));
if paramcount<>0 then
if pos('.',paramstr(1))<>0 then
begin
parametre(paramstr(1));
end;
if not fileexists(a+'mp3liste.dll') then
begin
assignfile(f,a+'mp3liste.dll');
rewrite(f);
closefile(f);
end;
if not fileexists(a+'path.dll') then
begin
assignfile(f,a+'path.dll');
rewrite(f);
closefile(f);
end;
liste.Items.LoadFromFile(a+'mp3liste.dll');
paths.Items.LoadFromFile(a+'path.dll');
end;
Kod: Tümünü seç
procedure TForm1.listeDblClick(Sender: TObject);
begin
if paths.Items.strings[liste.ItemIndex]<>mp3.FileName then
begin
placebar.Enabled:=false;
prev.Enabled:=false;
next.Enabled:=false;
liste.Enabled:=false;
second.Enabled:=false;
close;
fillinfo(paths.Items.Strings[liste.itemindex],paths.Items.Strings[liste.itemindex]);
mp3.Close;
mp3.FileName:=paths.Items.Strings[liste.itemindex];
mp3.Open;
placebar.Max:=mp3.Length;
mp3.Play;
second.Enabled:=true;
end;
end;
Kod: Tümünü seç
procedure TForm1.playClick(Sender: TObject);
begin
if mp3.FileName<>'' then
begin
mp3.Play;
placebar.Max:=mp3.Length;
placepos.Enabled:=true;
end
else
if liste.count=1 then
begin
liste.ItemIndex:=0;
songok;
END
else
if liste.ItemIndex<0 then
liste.ItemIndex:=0;
songok;
end;
Kod: Tümünü seç
procedure TForm1.songok;
begin
if paths.Items.strings[liste.ItemIndex]<>mp3.FileName then
begin
placebar.Enabled:=false;
second.Enabled:=false;
close;
fillinfo(paths.Items.Strings[liste.itemindex],paths.Items.Strings[liste.itemindex]);
mp3.Close;
mp3.FileName:=paths.Items.Strings[liste.itemindex];
mp3.Open;
placebar.Max:=form1.mp3.Length;
mp3.Play;
second.Enabled:=true;
end;
end;
Kod: Tümünü seç
procedure TForm1.shuffClick(Sender: TObject);
begin
if shuf=true then
begin
shuff.Caption:='Shuff';
shuf:=false
end
else
begin
shuff.Caption:='* Shuff';
shuf:=true;
end;
end;
Kod: Tümünü seç
procedure TForm1.mp3Notify(Sender: TObject);
begin
with mp3 do
begin
if mode=mpstopped then
if time.Caption=total.Caption then
begin
form1.nextClick(sender);
end;
notify:=true;
end;
end;
HERKESE KOLAY GELSİN İYİ ÇALIŞMALAR ..
var
Form1: TForm1;
cretids,volu,repe,shuf:boolean;
secondplace:word;
songname,songadres:string;
mo,tut:boolean;
tikla:integer;
posa:Tpoint;