Zdaje się, że w którymś numerze KŚ Eksperta było coś o kompie w oleju - taki komp
to wykląda zajefajnie!!
A skoro ma być śmiesznie, to:
http://translate.google.pl/translate?u=http%3A%2F%2Fwww.starepro.info&sl=pl&tl=en&hl=pl&ie=UTF-8
A tłumacz google fajnie tłumaczy kod w delphi ;)
ORGINAŁ:
unit player;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, owProgressbar, ModPlugPlayer, ComCtrls,
DSPack, owGradientProvider, owBitBtn, INetDetector, EasyFileSearch,
VUMeter, Menus, Buttons, ID3Engine, Knob, BASSPlayer, slider;
type
TForm1 = class(TForm)
Panel1: TPanel;
MainMenu1: TMainMenu;
Label1: TLabel;
pTAGS: TPanel;
Label3: TLabel;
pPLAYLIST: TPanel;
Label4: TLabel;
pREGS: TPanel;
Label2: TLabel;
playlist: TListBox;
Timer1: TTimer;
status: TLabel;
open: TOpenDialog;
owBitBtn7: TButton;
owBitBtn8: TButton;
owBitBtn9: TButton;
owBitBtn1: TBitBtn;
owBitBtn2: TBitBtn;
owBitBtn3: TBitBtn;
owBitBtn5: TBitBtn;
next: TBitBtn;
Plik1: TMenuItem;
Dodajiotwrz1: TMenuItem;
Usuwszystkie1: TMenuItem;
Usuzaznaczone1: TMenuItem;
adujplaylistzpliku1: TMenuItem;
Widok1: TMenuItem;
Playlista1: TMenuItem;
agi1: TMenuItem;
Regulatory1: TMenuItem;
Pomoc1: TMenuItem;
FreePlayerv011: TMenuItem;
playo: TOpenDialog;
plays: TSaveDialog;
Zapiszplaylistdopliku1: TMenuItem;
Koniec1: TMenuItem;
Opcje1: TMenuItem;
bass: TBASSPlayer;
Button2: TButton;
kn: TKnob;
Button1: TButton;
Button3: TButton;
czas: TLabel;
track: TSlider;
procedure Timer1Timer(Sender: TObject);
procedure playlistDblClick(Sender: TObject);
procedure owBitBtn1Click(Sender: TObject);
procedure owBitBtn2Click(Sender: TObject);
procedure owBitBtn3Click(Sender: TObject);
procedure owBitBtn5Click(Sender: TObject);
procedure nextClick(Sender: TObject);
procedure owBitBtn7Click(Sender: TObject);
procedure owBitBtn8Click(Sender: TObject);
procedure owBitBtn9Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Playlista1Click(Sender: TObject);
procedure agi1Click(Sender: TObject);
procedure Regulatory1Click(Sender: TObject);
procedure FreePlayerv011Click(Sender: TObject);
procedure Dodajiotwrz1Click(Sender: TObject);
procedure Usuwszystkie1Click(Sender: TObject);
procedure Usuzaznaczone1Click(Sender: TObject);
procedure adujplaylistzpliku1Click(Sender: TObject);
procedure Zapiszplaylistdopliku1Click(Sender: TObject);
procedure Koniec1Click(Sender: TObject);
procedure knChange(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure trackStartTracking(Sender: TObject);
procedure trackStopTracking(Sender: TObject);
private
{ Private declarations }
public
xau: String;
czacha : integer;
bom : boolean;
tracking : boolean;
Lista : TStringList;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, PluginCtrl, ioPlug;
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (track.Value = track.MaxValue) then nextClick(self);
if not tracking then begin
if bass.PlayLength > 0 then begin
track.Value := (bass.Position * track.MaxValue) div bass.PlayLength;
end;
end;
czas.Caption := FormatDateTime('nn:ss', bass.Position / (1000 * 24 * 60 * 60));
Application.ProcessMessages;
end;
procedure TForm1.playlistDblClick(Sender: TObject);
var
a : integer;
b : integer;
begin
track.Value := 0;
for a := 0 to playlist.Items.Count -1 do begin
if playlist.Selected[a] then b := a;
end;
xau := Lista;
czacha := b;
bass.Open(xau);
bass.Play;
track.MaxValue := bass.PlayLength;
status.Caption := bass.StreamInfo.Artist + '-' + bass.StreamInfo.Title;
end;
procedure TForm1.owBitBtn1Click(Sender: TObject);
begin
bass.Play;
end;
procedure TForm1.owBitBtn2Click(Sender: TObject);
begin
bass.Pause(bom);
if bom = true then bom := false else bom:= true;
end;
procedure TForm1.owBitBtn3Click(Sender: TObject);
begin
bass.Stop;
end;
procedure TForm1.owBitBtn5Click(Sender: TObject);
begin
track.Value := 0;
playlist.Selected[czacha] := false;
playlist.Selected[czacha -1] := true;
xau := Lista[czacha -1];
bass.Open(xau);
bass.Play;
track.MaxValue := bass.PlayLength;
status.Caption := bass.StreamInfo.Artist + '-' + bass.StreamInfo.Title;
end;
procedure TForm1.nextClick(Sender: TObject);
var
xai : integer;
tojestcos : integer;
super : boolean;
begin
track.Value := 0;
for xai:=0 to Lista.Count -1 do begin
super := Lista.Find(bass.StreamName, xai);
if super = true then begin
tojestcos := xai;
exit;
end;
end;
xau := Lista[tojestcos + 1];
bass.Open(xau);
bass.Play;
track.MaxValue := bass.PlayLength;
status.Caption := bass.StreamInfo.Artist + '-' + bass.StreamInfo.Title;
end;
procedure TForm1.owBitBtn7Click(Sender: TObject);
var
y : Integer;
begin
bass.Stop;
if( open.Execute() ) then begin
for y := 0 to open.Files.Count -1 do begin
lista.Add(open.Files.Strings[y]);
playlist.Items.Add(ExtractFileName(open.Files.Strings[y]));
end;
end;
end;
procedure TForm1.owBitBtn8Click(Sender: TObject);
begin
ShowMessage('ni ma funkcji...');
end;
procedure TForm1.owBitBtn9Click(Sender: TObject);
begin
playlist.Items.Clear;
Lista.Clear;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
bass.FileInfoBox(xau);
end;
procedure TForm1.Playlista1Click(Sender: TObject);
begin
if pPLAYLIST.Visible = true then pPLAYLIST.Visible := false else pPLAYLIST.Visible := true;
Playlista1.Checked := pPLAYLIST.Visible;
end;
procedure TForm1.agi1Click(Sender: TObject);
begin
if pTAGS.Visible = true then pTAGS.Visible := false else pTAGS.Visible := true;
Playlista1.Checked := pTAGS.Visible;
end;
procedure TForm1.Regulatory1Click(Sender: TObject);
begin
if pREGS.Visible = true then pREGS.Visible := false else pREGS.Visible := true;
Regulatory1.Checked := pREGS.Visible;
end;
procedure TForm1.FreePlayerv011Click(Sender: TObject);
begin
Form2.ShowModal;
end;
procedure TForm1.Dodajiotwrz1Click(Sender: TObject);
begin
owBitBtn7Click(self);
end;
procedure TForm1.Usuwszystkie1Click(Sender: TObject);
begin
owBitBtn9Click(self);
end;
procedure TForm1.Usuzaznaczone1Click(Sender: TObject);
begin
owBitBtn8Click(self);
end;
procedure TForm1.adujplaylistzpliku1Click(Sender: TObject);
var
zupa : integer;
begin
if playo.Execute then Lista.LoadFromFile(playo.FileName);
for zupa:=0 to Lista.Count -1 do begin
playlist.Items.Add(ExtractFileName(Lista[zupa]));
end;
end;
procedure TForm1.Zapiszplaylistdopliku1Click(Sender: TObject);
begin
if plays.Execute then Lista.SaveToFile(plays.FileName);
end;
procedure TForm1.Koniec1Click(Sender: TObject);
begin
Close;
end;
procedure TForm1.knChange(Sender: TObject);
begin
bass.Volume := kn.Position;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Lista.Free();
bass.Stop;
bass.Close;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
bass.RunVisPlugin( GetProgDir + '\vis_vsoscilloscope.dll', 0);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
bass.QuitVisPlugin;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Lista := TStringList.Create;
bom := true;
end;
procedure TForm1.trackStartTracking(Sender: TObject);
begin
tracking := true;
end;
procedure TForm1.trackStopTracking(Sender: TObject);
var
SongPos : DWORD;
begin
if bass.Seekable then
begin
SongPos := Trunc(track.Value * bass.PlayLength / track.MaxValue);
bass.Position := SongPos;
end;
tracking := false;
end;
end.
A tłumaczy google tak:
jednostki gracza;
Interfejs
zastosowań
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, owProgressbar, ModPlugPlayer, ComCtrls,
DSPack, owGradientProvider, owBitBtn, INetDetector, EasyFileSearch,
VUMeter, menu, przycisków ID3Engine, Gałka, BASSPlayer, suwak;
typ
TForm1 = class (TForm)
Panel1: TPanel;
MainMenu1: TMainMenu;
Label1: TLabel;
pTAGS: TPanel;
Label3: TLabel;
pPLAYLIST: TPanel;
Label4: TLabel;
pREGS: TPanel;
Label2: TLabel;
playlist: TListBox;
Timer1: TTimer;
Status: TLabel;
otwarte: TOpenDialog;
owBitBtn7: TButton;
owBitBtn8: TButton;
owBitBtn9: TButton;
owBitBtn1: TBitBtn;
owBitBtn2: TBitBtn;
owBitBtn3: TBitBtn;
owBitBtn5: TBitBtn;
następna: TBitBtn;
Plik1: TMenuItem;
Dodajiotwrz1: TMenuItem;
Usuwszystkie1: TMenuItem;
Usuzaznaczone1: TMenuItem;
adujplaylistzpliku1: TMenuItem;
Widok1: TMenuItem;
Playlista1: TMenuItem;
agi1: TMenuItem;
Regulatory1: TMenuItem;
Pomoc1: TMenuItem;
FreePlayerv011: TMenuItem;
playo: TOpenDialog;
gra: TSaveDialog;
Zapiszplaylistdopliku1: TMenuItem;
Koniec1: TMenuItem;
Opcje1: TMenuItem;
bas: TBASSPlayer;
Button2: TButton;
kn: TKnob;
Button1: TButton;
Button3: TButton;
czas: TLabel;
utwór: TSlider;
Procedura Timer1Timer (Sender: TObject);
Procedura playlistDblClick (Sender: TObject);
Procedura owBitBtn1Click (Sender: TObject);
Procedura owBitBtn2Click (Sender: TObject);
Procedura owBitBtn3Click (Sender: TObject);
Procedura owBitBtn5Click (Sender: TObject);
Procedura nextClick (Sender: TObject);
Procedura owBitBtn7Click (Sender: TObject);
Procedura owBitBtn8Click (Sender: TObject);
Procedura owBitBtn9Click (Sender: TObject);
Procedura Button2Click (Sender: TObject);
Procedura Playlista1Click (Sender: TObject);
Procedura agi1Click (Sender: TObject);
Procedura Regulatory1Click (Sender: TObject);
Procedura FreePlayerv011Click (Sender: TObject);
Procedura Dodajiotwrz1Click (Sender: TObject);
Procedura Usuwszystkie1Click (Sender: TObject);
Procedura Usuzaznaczone1Click (Sender: TObject);
Procedura adujplaylistzpliku1Click (Sender: TObject);
Procedura Zapiszplaylistdopliku1Click (Sender: TObject);
Procedura Koniec1Click (Sender: TObject);
Procedura knChange (Sender: TObject);
Procedura FormClose (Sender: TObject; var Action: TCloseAction);
Procedura Button3Click (Sender: TObject);
procedury Button1Click (Sender: TObject);
procedury FormCreate (Sender: TObject);
Procedura trackStartTracking (Sender: TObject);
Procedura trackStopTracking (Sender: TObject);
prywatnych
() Deklaracje prywatne
publicznych
XAU: String;
czacha: integer;
bom: boolean;
śledzenia: boolean;
Lista: TStringList;
() Publiczne deklaracje
end;
var
Form1: TForm1;
realizacji
używa Unit2, PluginCtrl, ioPlug;
($ R *. dfm)
Procedura TForm1.Timer1Timer (Sender: TObject);
zacząć
if (track.Value = track.MaxValue) następnie nextClick (samokontrola);
jeśli nie śledzi następnie rozpocząć
jeśli bass.PlayLength> 0 a następnie rozpocząć
track.Value: = (bass.Position * track.MaxValue) div bass.PlayLength;
end;
end;
czas.Caption: = FormatDateTime ( 'nn: ss ", bass.Position / (1000 * 24 * 60 * 60));
Application.ProcessMessages;
end;
Procedura TForm1.playlistDblClick (Sender: TObject);
var
a: integer;
b: integer;
zacząć
track.Value: = 0;
o: = 0 do -1 zrobić rozpocząć playlist.Items.Count
jeśli playlist.Selected [a] then b: =;
end;
XAU: = Lista ;
czacha: = b;
bass.Open (XAU);
bass.Play;
track.MaxValue: = bass.PlayLength;
status.Caption: bass.StreamInfo.Artist = + "-" + bass.StreamInfo.Title;
end;
Procedura TForm1.owBitBtn1Click (Sender: TObject);
zacząć
bass.Play;
end;
Procedura TForm1.owBitBtn2Click (Sender: TObject);
zacząć
bass.Pause (BOM);
jeśli bom bom następnie = true: = False else bom: = true;
end;
Procedura TForm1.owBitBtn3Click (Sender: TObject);
zacząć
bass.Stop;
end;
Procedura TForm1.owBitBtn5Click (Sender: TObject);
zacząć
track.Value: = 0;
playlist.Selected [czacha]: = False;
playlist.Selected [czacha -1]: = true;
XAU: = Lista [czacha -1];
bass.Open (XAU);
bass.Play;
track.MaxValue: = bass.PlayLength;
status.Caption: bass.StreamInfo.Artist = + "-" + bass.StreamInfo.Title;
end;
Procedura TForm1.nextClick (Sender: TObject);
var
xai: integer;
tojestcos: integer;
super: boolean;
zacząć
track.Value: = 0;
dla xai: = 0 do -1 zrobić rozpocząć Lista.Count
super: = Lista.Find (bass.StreamName, xai);
jeżeli super = true następnie rozpocząć
tojestcos: = xai;
exit;
end;
end;
XAU: = Lista [tojestcos + 1];
bass.Open (XAU);
bass.Play;
track.MaxValue: = bass.PlayLength;
status.Caption: bass.StreamInfo.Artist = + "-" + bass.StreamInfo.Title;
end;
Procedura TForm1.owBitBtn7Click (Sender: TObject);
var
y: Integer;
zacząć
bass.Stop;
if (open.Execute ()), a następnie rozpocząć
do y: = 0 do -1 zrobić rozpocząć open.Files.Count
lista.Add (open.Files.Strings [y]);
playlist.Items.Add (ExtractFileName (open.Files.Strings [y]));
end;
end;
end;
Procedura TForm1.owBitBtn8Click (Sender: TObject);
zacząć
ShowMessage ( "my z funkcji ...');
end;
Procedura TForm1.owBitBtn9Click (Sender: TObject);
zacząć
playlist.Items.Clear;
Lista.Clear;
end;
Procedura TForm1.Button2Click (Sender: TObject);
zacząć
bass.FileInfoBox (XAU);
end;
Procedura TForm1.Playlista1Click (Sender: TObject);
zacząć
jeśli pPLAYLIST.Visible = true następnie pPLAYLIST.Visible: = False else pPLAYLIST.Visible: = true;
Playlista1.Checked: = pPLAYLIST.Visible;
end;
Procedura TForm1.agi1Click (Sender: TObject);
zacząć
jeśli pTAGS.Visible = true następnie pTAGS.Visible: = False else pTAGS.Visible: = true;
Playlista1.Checked: = pTAGS.Visible;
end;
Procedura TForm1.Regulatory1Click (Sender: TObject);
zacząć
jeśli pREGS.Visible = true następnie pREGS.Visible: = False else pREGS.Visible: = true;
Regulatory1.Checked: = pREGS.Visible;
end;
Procedura TForm1.FreePlayerv011Click (Sender: TObject);
zacząć
Form2.ShowModal;
end;
Procedura TForm1.Dodajiotwrz1Click (Sender: TObject);
zacząć
owBitBtn7Click (samokontrola);
end;
Procedura TForm1.Usuwszystkie1Click (Sender: TObject);
zacząć
owBitBtn9Click (samokontrola);
end;
Procedura TForm1.Usuzaznaczone1Click (Sender: TObject);
zacząć
owBitBtn8Click (samokontrola);
end;
Procedura TForm1.adujplaylistzpliku1Click (Sender: TObject);
var
zupa: integer;
zacząć
jeśli playo.Execute następnie Lista.LoadFromFile (playo.FileName);
dla zupa: = 0 do -1 zrobić rozpocząć Lista.Count
playlist.Items.Add (ExtractFileName (Lista [zupa]));
end;
end;
Procedura TForm1.Zapiszplaylistdopliku1Click (Sender: TObject);
zacząć
jeśli plays.Execute następnie Lista.SaveToFile (plays.FileName);
end;
Procedura TForm1.Koniec1Click (Sender: TObject);
zacząć
Zamknij;
end;
Procedura TForm1.knChange (Sender: TObject);
zacząć
bass.Volume: = kn.Position;
end;
Procedura TForm1.FormClose (Sender: TObject; var Action: TCloseAction);
zacząć
Lista.Free ();
bass.Stop;
bass.Close;
end;
Procedura TForm1.Button3Click (Sender: TObject);
zacząć
bass.RunVisPlugin (GetProgDir + "\ vis_vsoscilloscope.dll ', 0);
end;
Procedura TForm1.Button1Click (Sender: TObject);
zacząć
bass.QuitVisPlugin;
end;
Procedura TForm1.FormCreate (Sender: TObject);
zacząć
Lista: = TStringList.Create;
bom: = true;
end;
Procedura TForm1.trackStartTracking (Sender: TObject);
zacząć
śledzenia: = true;
end;
Procedura TForm1.trackStopTracking (Sender: TObject);
var
SongPos: DWORD;
zacząć
jeżeli następnie bass.Seekable
zacząć
SongPos: = grupy (track.Value * bass.PlayLength / track.MaxValue);
bass.Position: = SongPos;
end;
śledzenia: = False;
end;
koniec.
A tak przy okazji to kod mojego odtwarzacza. Nie jest dokończony i nie zamierzam go kończyć ;)
チーズが好き。