求用medialplayer编的简单的CD播放器(源码)(200分)

  • 主题发起人 主题发起人 jzg
  • 开始时间 开始时间
J

jzg

Unregistered / Unconfirmed
GUEST, unregistred user!
要求:
能用button实现上一曲,下一曲,用trackbar跟随每一曲进度前进,一曲播完如果没有
其它抄作,自动下一曲目.
希望各位高手发个简单的例子,千万不要很复杂.(我是新手)
 
看一看我用"超級解霸"放MP3的矢口否程序(系統必須裝超級解霸5.5):

HANDLE HWndCalculator
HWndCalculator = FindWindow(NULL, "超級解霸-MMX 5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
HWndCalculator = FindWindow(NULL, "超級解霸5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);

HWndCalculator = FindWindow(NULL, "超級解霸5.5");
// close the exist Calculator
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);
HWndCalculator = FindWindow(NULL,"Sthado");
if (HWndCalculator !=0 )
SendMessage(HWndCalculator, WM_CLOSE, 0, 0);

CGauge1->Progress=0;
FMain->FileName=StrToDateTime(CD->QGet->FieldByName("BTIME")->AsString).FormatString("yyyy-mm-dd hhnnss");
if(rbContinue->Checked)
{
tNext->Interval=CD->QGet->FieldByName("TIMESUB")->AsInteger*1000+4*1000;
tNext->Enabled=true;
}
else
tNext->Enabled=false;
if(FileExists(FMain->DataPath+"//"+FMain->FileName+".mp3"))
{
iProgress=CD->QGet->FieldByName("TIMESUB")->AsInteger+4;
iTemp=iProgress;
tProgress->Enabled=true;
String sTemp=FMain->FileName+".mp3";
ShellExecute(Handle,"open",sTemp.c_str(),0,FMain->DataPath.c_str(),SW_HIDE);
}
else

{
tNext->Interval=1000;
if(rbContinue->Checked)
tNext->Enabled=true;
else

tNext->Enabled=true;
}
 
谢谢goddy你的例子,但我真的看不懂,更别说用了
 
我又源代码,不过等我找找,好长时间了,都成古董了
 
求您快点帮我找一下,这几百分都是您的了
 
你好多ID哦!
 
type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
TrackBar1: TTrackBar;
OpenDialog1: TOpenDialog;
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure MediaPlayer1Notify(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;


var
Form1: TForm1;
count:integer;
i:integer;
str:tstrings;
len:integer;
falg:boolean;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin


if opendialog1.Execute then

STR:=OPENDIALOG1.FILES;
begin

if mediaplayer1.Enabled=false then
mediaplayer1.Enabled:=true;
i:=1;
count:=STR.Count;
mediaplayer1.FileName:=STR[0];
mediaplayer1.Open;

mediaplayer1.Play;
falg:=true;
len:=mediaplayer1.length;
end;


end;


procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin

falg:=false;
if count=1 then
mediaplayer1.Enabled:=false;
while count>1do
begin

count:=count-1;
i:=i+1;
mediaplayer1.FileName:=STR[i-1];
mediaplayer1.open;
mediaplayer1.Play;
falg:=true;
exit;
end;

end;


procedure TForm1.Timer1Timer(Sender: TObject);
begin

if falg then

begin

trackbar1.SelStart:=mediaplayer1.StartPos;
trackbar1.Max:=mediaplayer1.Length;
trackbar1.Position:=mediaplayer1.Position;
end;


end;


end.
 
陈晨,你的源码我用过了,并不能使trackbar跟随每一曲进度前进,你还有别的源码吗
 
多人接受答案了。
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部