摘要载入中…    请稍等…












内容载入中…    请稍等…

如长时间看不到内容,请关闭浏览器,重新打开此页!

芯友首页 应用软件 编程开发 网络硬件 资源下载 动漫音乐 精美图库 芯友论坛 视频教程 电脑技术QQ群:72845454
 ★★photoshop学友-史上最强播放器★★
 位置:编程开发>Deiphi>Deiphi多媒体编程
◎→ 本类最新
在delphi中使用flash控件
在Delphi中实现动态字幕
在Delphi下用Direct Sound 实现混
在Delphi里播放Flash
用Delphi 5.0编写在线播放器
◎→相关资源
C语言入门视频教程
C#编程WinForm入门视频
Asp.net入门视频教程下载
VC++编程视频教程下载
VB窗体文章
HTML入门教程
Deiphi实例教程
Deiphi窗体文章
Deiphi数据库编程
Deiphi网络编程
Deiphi图形图象文章
Deiphi系统文件
◎→ 热门资源
通过实例看VCL组件开发全过程(三
通过实例看VCL组件开发全过程(四
通过实例看VCL组件开发全过程(一
通过鼠标右击选择TListBox中的选
图像的消隐效果
拖动无标题栏窗体的方法
玩转Windows桌面图标

循环播放音乐


日期:2008-10-20 21:44:39    来源:互联网
   
 ·用Delphi设计循环播放声音文件程序 ·实现avi全屏播放
 ·用Delphi 3.0编制MP3音乐点歌台
循环播放音乐


unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
MPlayer, StdCtrls;

type
TForm1 = class(TForm)
MediaPlayer1: TMediaPlayer;
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure MediaPlayer1Notify(Sender: TObject);
procedure MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
var DoDefault: Boolean);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
    with MediaPlayer1    do
    begin
    if Notify and //接受信息
        (mode=mpStopped) then//已经停止
        begin
        ReWind;
    play;
    end;
    notify:=true;//开始接受信息
end;

end;

procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
var DoDefault: Boolean);
begin
    if (Button=btStop) or (Button=btPause) then
    MediaPlayer1.Notify:=false
else
    MediaPlayer1.Notify:=true;  
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
    if OpenDialog1.Execute then
    with MediaPlayer1    do
    begin
    fileName:=OpenDialog1.FileName;
notify:=true;
try
    open;
    play;
except
    raise exception.Create('打开文件时出错');
end;
caption:='循环播放演示-->'+fileName;
end;
end;

end.
窗体As text代码  
object Form1: TForm1
Left = 195
Top = 107
Width = 378
Height = 182
Caption = '循环播放演示'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object MediaPlayer1: TMediaPlayer
Left = 24
Top = 16
Width = 298
Height = 33
TabOrder = 0
OnClick = MediaPlayer1Click
OnNotify = MediaPlayer1Notify
end
object Button1: TButton
Left = 193
Top = 104
Width = 129
Height = 33
Caption = '打开...'
Default = True
TabOrder = 1
OnClick = Button1Click
end
object OpenDialog1: TOpenDialog
Title = '打开音乐文件'
Left = 294
Top = 32
end
end
////////////////////////////////////////////////////

if FileExists(ExtractFilePath(Application.Exename)+'RunLib\T01.AVI') then
  begin
   MediaPlayer1.FileName:=(ExtractFilePath(Application.Exename)+'RunLib\T01.AVI');
   MediaPlayer1.Open;
   MediaPlayer1.Notify:=true;
   MediaPlayer1.Display:=Form2;
   MediaPlayer1.DisplayRect:=Form2.ClientRect;
   MediaPlayer1.Play;
  end;

然后如下让它循环
procedure TForm2.MediaPlayer1Notify(Sender: TObject);
begin
  if MCIStop=1 then Exit;
  if MediaPlayer1.Mode=mpStopped then
  begin
    MediaPlayer1.Rewind;
    MediaPlayer1.Play;
  end;
  MediaPlayer1.Notify:=true;
end;

 [1]

诊断卡从C0到50循环故障的排除

利用Mpegplayer控件编写简单的mp3播放程序

从百度MP3下载音乐

--->CoCsoft Stream Down(媒体下载大师) v5.8 汉化版(在线播放媒体下载)
--->WellGet(边下载边播放) V1.26 Build 0310 简体中文版
--->MPlayer V1.0┊播放AVI、RMVB、MP3、MP4、3GP、WMA
--->VeryCD发布Storm Player - 影音风暴播放器 特点:美
--->Evil Player 1.20 官方简体中文(200k的MP3播放器)
Tags:  循环 播放 音乐
{$enumber$}
芯友网版权所有 1999-2006 | 著作权与商标声明 | 法律声明 | 服务条款 | 隐私声明 | 联系我们