|
================== ''''设置声道 ''''====================================================== Public Function SetAudioSource(sAudioSource As AudioSource) As Boolean Dim RefInt As Long Dim strSource As String Select Case sAudioSource Case 1: strSource = "left" Case 2: strSource = "right" Case 0: strSource = "stereo" End Select SetAudioSource = False RefInt = mciSendString("setaudio NOWMUSIC source to " & strSource, vbNull, 0, 0) If RefInt = 0 Then SetAudioSource = True End Function
''''====================================================== ''''全屏播放 ''''====================================================== Public Function PlayFullScreen() As Boolean Dim RefInt As Long PlayFullScreen = False RefInt = mciSendString("play NOWMUSIC fullscreen", vbNull, 0, 0) If RefInt = 0 Then PlayFullScreen = True End Function
''''===================================================== ''''设置声音大小 ''''===================================================== Public Function SetVolume(Volume As Long) As Boolean Dim RefInt As Long SetVolume = False RefInt = mciSendString("setaudio NOWMUSIC volume to " & Volume, vbNull, 0, 0) If RefInt = 0 Then SetVolume = True End Function
''''===================================================== ''''设置播放速度 ''''===================================================== Public Function SetSpeed(Speed As Long) As Boolean Dim RefInt As Long SetSpeed = False RefInt = mciSendString("set NOWMUSIC speed " & Speed, vbNull, 0, 0) If RefInt = 0 Then SetSpeed = True End Function
''''==================================================== ''''静音True为静音,FALSE为取消静音 ''''==================================================== Public Function SetAudioOnOff(AudioOff As Boolean) As Boolean Dim RefInt As Long Dim OnOff As String SetAudioOff = False If AudioOff Then OnOff = "off" Else OnOff = "on" RefInt = mciSendString("setaudio NOWMUSIC " & OnOff, vbNull, 0, 0) If RefInt = 0 Then SetAudioOff = True End Function
''''==================================================== ''''是否有画面True为有,FALSE为取消 ''''==================================================== Public Function SetWindowShow(WindowOff As Boolean) As Boolean Dim RefInt As Long Dim OnOff As String SetWindowShow = False If WindowOff Then OnOff = "show" Else OnOff = "hide" RefInt = mciSendString("window NOWMUSIC state " & OnOff, vbNull, 0, 0) If RefInt = 0 Then SetWindowShow = True End Function
''''==================================================== ''''获得当前媒体的状态是不是在播放 ''''==================================================== Public Function IsPlaying() As Boolean Dim sl As String * 255 mciSendString "status NOWMUSIC mode", sl, Len(sl), 0 If Left(sl, 7) = "playing" Or Left(sl, 2) = "播放" Then IsPlaying = True Else IsPlaying = False End If End Function
''''==================================================== ''''获得播放窗口的handle ''''==================================================== Public Function GetWindowHandle() As Long Dim RefStr As String * 160 mciSendString "status NOWMUSIC window handle", RefStr, 80, 0 GetWindowHandle = Val(RefStr) End Function
''''==================================================== ''''获取DeviceID ''''==================================================== Public Function GetDeviceID() As Long GetDeviceID = mciGetDeviceID("NOWMUSIC") End Function
上一页 [1] [2] [VB.NET程序]VB.NET中实现IEnumerator接口 [VB.NET程序]在VB中实现PickList功能 [Delphi程序]用API函数在DELPHI中实现“非典型”窗体 [Delphi程序]在Delphi中实现StringTokenizer功能模块 [网页制作]DW中实现flash的透明背景 [网页制作]Dreamweaver中实现flash的透明背景 [Web开发]ASP.NET 中实现 MD5_HMAC(C#) [Web开发]在ASP 中实现ASP.Net 的DataGrid 功能(转载) [Web开发]在ASP.NET中实现MVC模式(五) [Web开发]在ASP.NET中实现MVC模式(四)
|