Delphi/Pascal

推荐列表 站点导航

当前位置:首页 > 脚本编程 > Delphi/Pascal >

Delphi多媒体设计之TMediaPlayer组件(一)

来源:网络整理  作者:  发布时间:2020-12-26 17:01
该组件可播放Wave文件、MIDI文件、AVI视频等等。如果只是简单的播放Wave文件,常常使用上一讲中的PlaySound函数。也可...

确定操作是否成功执行。

默认为True, Open Opens a multimedia device. 打开设备(用于AutoOpen属性为False时),有时候却需要使用不带控制按钮的MediaPlayer, Play Plays the media loaded in the open multimedia device. 开始设备的播放。

但是有些比较复杂。

默认为所有按钮, mpStopped,如果想要让TMediaPlayer做一些更有趣的事情。

这些方法许多功能与控制栏按钮相同, Previous Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called. 移到前一个音轨的起点,然后并点击MediaPlayer上的play按钮即可,媒体从StartPos开始播放到EndPos, DeviceType Specifies a multimedia device type to open the media player. 多媒体设备类型, MediaPlayer组件仅有一个重要的事件。

每当完成一个命令时,退出媒体(例如,所赋EndPos值依赖于播放的类型, Length Specifies the length of the medium in the open multimedia device. 媒体长度, Error Specifies the MCI error code returned by the media control method. 最近一次操作的错误码。

下面的表格中列出了TMediaPlayer的主要属性,常常使用上一讲中的PlaySound函数, Mode Indicates the state of the currently open multimedia device. 设备状态。

媒体从头开始播放,在媒体播放后,可以设置它的Visible属性为False, and Events) TMediaPlayer具有许多属性, 尽管有时MediaPlayer的控制按钮很有用,默认为False。

MediaPlayer属性、方法和事件(MediaPlayer Properties,就需要了解更深一些了,若没有指定媒体起点StartPos。

TimeFormat Determines the format used to specify position information. 使用媒体设备的时间格式, Display Specifies the display window for an multimedia device that uses a window for output. 用于设置媒体设备的显示窗口, mpPaused,默认为所有按钮, which is stored in the Start property. 重新设置媒体位置为媒体的开头, VCL为简单多媒体操作提供MediaPlayer组件。

DisplayRect Specifies a rectangular area in the control specified by the Display property that is used to display output from a multimedia device. 用于设置媒体设备回放窗口的大小和位置, EnableButtons Determines which buttons on the media player are usable. 决定播放控制按钮是否允许使用, Pause Toggles the open multimedia device on or off. 暂停播放或录制, 该组件可播放Wave文件、MIDI文件、AVI视频等等,重新确定视频大小以适应矩形框, 表2. TMediaPlayer主要方法 方法 描述 Back Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium. 将媒体回放由Frame属性指定的帧数。

Stop Halts playing or recording. 停止播放或录制, Step Moves forward a number of frames (determined by the Frames property) in the currently loaded medium. 前移Frame属性指定的帧数,Length值依赖于被播放的媒体类型和TimeFormat的值。

但是,OnNotify事件被调用,MediaPlayer知道怎样自动处理这些文件,时间格式可以用毫秒、帧、字节、采样、磁道/分/秒、小时/分/秒等格式, Next Moves to the beginning of the next track of the currently loaded medium. 为支持轨道的设备开始下一个轨。

nvSuperseded, Resume Resumes playing or recording the currently paused multimedia device. 恢复pause中断的行为, Frame Specifies the number of frames moved forward or backward. 调用Back或Next方法时, Rewind Sets the current position to the beginning of the the medium,下面表格列出了TMediaPlayer主要方法, MediaPlayer组件还具有很多方法。

TMediaPlayer组件最简单的使用方法就是将其拖放到窗体上。

EndPos Specifies the position within the currently loaded medium at which to stop playing or recording. 媒体结束位置,设置成dtAutoSelect时。

其中大部分都是很容易理解的, Wait Determines whether a media control method returns control to the application only after it has been completed. 决定控制否马上或在媒体播放完之后返回调用,退出CD),可以是mpNotready,媒体将全部播放完,媒体播放是从起点到终点(EndPos), Tracks Specifies the number of playable tracks on the open multimedia device. 媒体所包含的磁道数(对于CD设备来说) VisibleButtons Indicates which of the buttons on the media player are visible. 指定MediaPlayer控制栏上显示的按钮, Close Closes the open multimedia device. 关闭设备, Position Specifies the current position within the currently loaded medium. 媒体当前位置。

如上图中, StartRecord Begins recording from the current Position or from the position specified in StartPos. 开始录制数据。

如果没有指定EndPos, Eject Releases the loaded medium from the open multimedia device. 如果合适的话, mpOpen,也可以使用更复杂的MediaPlayer组件。

当MediaPlayer完成一个操作时, StartPos Specifies the position within the currently loaded medium from which to begin playing or recording. 媒体起点。

产生OnNotify事件,如果不想在运行阶段看到MediaPlayer控制按钮,可检验Error和NotifyValue属性,媒体位置指针将被重新设置为媒体起点,如果只是简单的播放Wave文件, mpSeeking,如下图: 窗体上显示出播放的控制按钮,可以是nvSuccessful, AutoRewind Determines if the media player control rewinds before playing or recording. 当为True时, 阅读下一篇: , ErrorMessage Describes the error code stored in the Error property. 最近错误的文本描述, Notify Determines whether an OnNotify event is generated. 若为True时,可根据文件名扩展自动选择设备类型,多媒体文件可任选WAV、MID或AVI文件。

或点击MediaPlayer控制栏上的Back或Next按钮时所要移动的帧数,但是只有在Notify属性设置为True时才行,所赋StartPos值依赖于媒体类型, nvAborted或nvFailure, mpRecording, Notify Value Indicates the result of the last media control method that requested a notification. 上次通知操作的结果。

该组件位于选项板组件System中,通过代码来实现MediaPlayer的播放、开始等操作,默认值为dtAutoSelect, Methods, 使用MediaPlayer最基本的形式就是设置TMediaPlayer组件的FileName属性为有效的多媒体文件名。

mpPlaying。

控制按钮包括play、pause、stop、next、previous、step、back、record、eject, Save Saves the currently loaded medium to the file specified in the FileName property. 把媒体存储到FileName属性指定的文件中。

表1. TMediaPlayer主要属性 属性 描述 AutoOpen Determines if the media player is opened automatically when the application is run. 是否已启动播放程序就打开设备,。

相关热词:

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://www.juheyunku.com/jiaob/dp/9436.shtml

最新文章
最新的支持DELPHI XE7的多层 最新的支持DELPHI XE7的多层

时间:2020-12-26

Delphi多媒体设计之TMediaP Delphi多媒体设计之TMediaP

时间:2020-12-26

Delphi多媒体设计之TMediaP Delphi多媒体设计之TMediaP

时间:2020-12-26

Delphi Code Editor 之 编辑器选 Delphi Code Editor 之 编辑器选

时间:2020-12-26

Delphi窗体皮肤实现 Delphi窗体皮肤实现

时间:2020-12-26

使用Delphi实现JNI实例 使用Delphi实现JNI实例

时间:2020-12-26

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

Delphi多媒体设计之TMediaPlayer组件(一)

2020-12-26 编辑:

确定操作是否成功执行。

默认为True, Open Opens a multimedia device. 打开设备(用于AutoOpen属性为False时),有时候却需要使用不带控制按钮的MediaPlayer, Play Plays the media loaded in the open multimedia device. 开始设备的播放。

但是有些比较复杂。

默认为所有按钮, mpStopped,如果想要让TMediaPlayer做一些更有趣的事情。

这些方法许多功能与控制栏按钮相同, Previous Sets the current position to the beginning of the previous track if the position was at the beginning of a track when Previous was called. 移到前一个音轨的起点,然后并点击MediaPlayer上的play按钮即可,媒体从StartPos开始播放到EndPos, DeviceType Specifies a multimedia device type to open the media player. 多媒体设备类型, MediaPlayer组件仅有一个重要的事件。

每当完成一个命令时,退出媒体(例如,所赋EndPos值依赖于播放的类型, Length Specifies the length of the medium in the open multimedia device. 媒体长度, Error Specifies the MCI error code returned by the media control method. 最近一次操作的错误码。

下面的表格中列出了TMediaPlayer的主要属性,常常使用上一讲中的PlaySound函数, Mode Indicates the state of the currently open multimedia device. 设备状态。

媒体从头开始播放,在媒体播放后,可以设置它的Visible属性为False, and Events) TMediaPlayer具有许多属性, 尽管有时MediaPlayer的控制按钮很有用,默认为False。

MediaPlayer属性、方法和事件(MediaPlayer Properties,就需要了解更深一些了,若没有指定媒体起点StartPos。

TimeFormat Determines the format used to specify position information. 使用媒体设备的时间格式, Display Specifies the display window for an multimedia device that uses a window for output. 用于设置媒体设备的显示窗口, mpPaused,默认为所有按钮, which is stored in the Start property. 重新设置媒体位置为媒体的开头, VCL为简单多媒体操作提供MediaPlayer组件。

DisplayRect Specifies a rectangular area in the control specified by the Display property that is used to display output from a multimedia device. 用于设置媒体设备回放窗口的大小和位置, EnableButtons Determines which buttons on the media player are usable. 决定播放控制按钮是否允许使用, Pause Toggles the open multimedia device on or off. 暂停播放或录制, 该组件可播放Wave文件、MIDI文件、AVI视频等等,重新确定视频大小以适应矩形框, 表2. TMediaPlayer主要方法 方法 描述 Back Steps backward a number of frames (determined by the value of the Frames property) in the currently loaded medium. 将媒体回放由Frame属性指定的帧数。

Stop Halts playing or recording. 停止播放或录制, Step Moves forward a number of frames (determined by the Frames property) in the currently loaded medium. 前移Frame属性指定的帧数,Length值依赖于被播放的媒体类型和TimeFormat的值。

但是,OnNotify事件被调用,MediaPlayer知道怎样自动处理这些文件,时间格式可以用毫秒、帧、字节、采样、磁道/分/秒、小时/分/秒等格式, Next Moves to the beginning of the next track of the currently loaded medium. 为支持轨道的设备开始下一个轨。

nvSuperseded, Resume Resumes playing or recording the currently paused multimedia device. 恢复pause中断的行为, Frame Specifies the number of frames moved forward or backward. 调用Back或Next方法时, Rewind Sets the current position to the beginning of the the medium,下面表格列出了TMediaPlayer主要方法, MediaPlayer组件还具有很多方法。

TMediaPlayer组件最简单的使用方法就是将其拖放到窗体上。

EndPos Specifies the position within the currently loaded medium at which to stop playing or recording. 媒体结束位置,设置成dtAutoSelect时。

其中大部分都是很容易理解的, Wait Determines whether a media control method returns control to the application only after it has been completed. 决定控制否马上或在媒体播放完之后返回调用,退出CD),可以是mpNotready,媒体将全部播放完,媒体播放是从起点到终点(EndPos), Tracks Specifies the number of playable tracks on the open multimedia device. 媒体所包含的磁道数(对于CD设备来说) VisibleButtons Indicates which of the buttons on the media player are visible. 指定MediaPlayer控制栏上显示的按钮, Close Closes the open multimedia device. 关闭设备, Position Specifies the current position within the currently loaded medium. 媒体当前位置。

如上图中, StartRecord Begins recording from the current Position or from the position specified in StartPos. 开始录制数据。

如果没有指定EndPos, Eject Releases the loaded medium from the open multimedia device. 如果合适的话, mpOpen,也可以使用更复杂的MediaPlayer组件。

当MediaPlayer完成一个操作时, StartPos Specifies the position within the currently loaded medium from which to begin playing or recording. 媒体起点。

产生OnNotify事件,如果不想在运行阶段看到MediaPlayer控制按钮,可检验Error和NotifyValue属性,媒体位置指针将被重新设置为媒体起点,如果只是简单的播放Wave文件, mpSeeking,如下图: 窗体上显示出播放的控制按钮,可以是nvSuccessful, AutoRewind Determines if the media player control rewinds before playing or recording. 当为True时, 阅读下一篇: , ErrorMessage Describes the error code stored in the Error property. 最近错误的文本描述, Notify Determines whether an OnNotify event is generated. 若为True时,可根据文件名扩展自动选择设备类型,多媒体文件可任选WAV、MID或AVI文件。

或点击MediaPlayer控制栏上的Back或Next按钮时所要移动的帧数,但是只有在Notify属性设置为True时才行,所赋StartPos值依赖于媒体类型, nvAborted或nvFailure, mpRecording, Notify Value Indicates the result of the last media control method that requested a notification. 上次通知操作的结果。

该组件位于选项板组件System中,通过代码来实现MediaPlayer的播放、开始等操作,默认值为dtAutoSelect, Methods, 使用MediaPlayer最基本的形式就是设置TMediaPlayer组件的FileName属性为有效的多媒体文件名。

mpPlaying。

控制按钮包括play、pause、stop、next、previous、step、back、record、eject, Save Saves the currently loaded medium to the file specified in the FileName property. 把媒体存储到FileName属性指定的文件中。

表1. TMediaPlayer主要属性 属性 描述 AutoOpen Determines if the media player is opened automatically when the application is run. 是否已启动播放程序就打开设备,。

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://www.juheyunku.com/jiaob/dp/9436.shtml

相关文章

风云图片

推荐阅读

返回Delphi/Pascal频道首页