• 按键公众号 :
按键精灵电脑版
立即下载

软件版本:2014.06
软件大小:22.9M
更新时间:2021-12-03

按键精灵安卓版
立即下载

软件版本:3.7.2
软件大小:46.2M
更新时间:2023-05-10

按键精灵iOS版
立即下载

软件版本:1.8.0
软件大小:29.2M
更新时间:2023-03-21

按键手机助手
立即下载

软件版本:3.8.0
软件大小:262M
更新时间:2023-05-30

快捷导航

登录 后使用快捷导航
没有帐号? 注册

发新话题 回复该主题

[插件下载] 【一只鱼】●『音频播放』『VB插件源码下载』(适用6.60 以上版本... [复制链接]

1#
【一只鱼】●『音频播放』[支持变量赋值]『VB插件源代码』(适用6.60 以上版本)

这里贴个 所有命令函数代码::


'--------------------------------------------------------------------------
' 您可以在这里添加自己的插件函数,插件的制作和使用方法如下:
' 第一步:在下面添加插件函数,一个插件可以添加多个函数。
' 第二步:请修改下面的Get_Plugin_Description函数,加入插件和插件函数的说明信息,帮助信息会显示在按键精灵里方便使用
' 第三步:请修改Class Module(类模块)的名字,尽量用一些独特的名字避免和别人的插件名字冲突(默认是MyPluginName)
' 第四步:生成插件DLL!将DLL文件放到按键精灵的PLUGIN目录下,然后启动按键精灵测试您制作的插件功能是否正常
' 对插件有任何问题请发邮件给我们: hi@vrbrothers.com
'--------------------------------------------------------------------------

'=======================================================
'打开MCI设备,urlStr为网址,传值代表成功与否
'=======================================================
'Public Function MCI_OpenURL(urlStr As String, Optional hwnd As Long) As Boolean
Public Function MCI_OpenURL(urlStr As Variant, Optional hwnd As Variant) As Boolean
On Error GoTo Err
MCI_OpenURL = OpenURL(CStr(urlStr), CLng(hwnd))
Exit Function
Err:
End Function
'=======================================================
'打开MCI设备,FILENAME为文件名,传值代表成功与否
'=======================================================
'Public Function MCI_OpenMusic(FileName As String, Optional hwnd As Long) As Boolean
Public Function MCI_OpenMusic(FileName As Variant, Optional hwnd As Variant) As Boolean
On Error GoTo Err
MCI_OpenMusic = OpenMusic(CStr(FileName), CLng(hwnd))
Exit Function
Err:
End Function
'======================================================
'播放文件
'======================================================
Public Function MCI_PlayMusic() As Boolean
Call MCI_StopMusic
MCI_PlayMusic = PlayMusic
End Function
'======================================================
'暂停播放
'======================================================
Public Function MCI_PauseMusic() As Boolean
MCI_PauseMusic = PauseMusic
End Function
'======================================================
'暂停后继续播放
'======================================================
Public Function MCI_ResumeMusic() As Boolean
MCI_ResumeMusic = ResumeMusic
End Function
'======================================================
'停止播放
'======================================================
Public Function MCI_StopMusic() As Boolean
MCI_StopMusic = StopMusic
End Function
'======================================================
'关闭媒体
'======================================================
Public Function MCI_CloseMusic() As Boolean
MCI_CloseMusic = CloseMusic
End Function
'======================================================
'获取媒体的长度
'======================================================
Public Function MCI_GetMusicLength() As Long
MCI_GetMusicLength = GetMusicLength
End Function
'======================================================
'获取当前播放进度
'======================================================
Public Function MCI_GetMusicPos() As Long
MCI_GetMusicPos = GetMusicPos
End Function
'======================================================
'设置声道( 0立体声,1左声道,2右声道)
'======================================================
'Public Function MCI_SetAudioSource(sAudioSource As Long) As Boolean 'sAudioSource As AudioSourc
Public Function MCI_SetAudioSource(sAudioSource As Variant) As Boolean 'sAudioSource As AudioSource
On Error GoTo Err
MCI_SetAudioSource = SetAudioSource(CLng(sAudioSource))
Exit Function
Err:
End Function
'=====================================================
'设置声音大小
'=====================================================
'Public Function MCI_SetVolume(Volume As Long) As Boolean
Public Function MCI_SetVolume(Volume As Variant) As Boolean
On Error GoTo Err
MCI_SetVolume = SetVolume(CLng(Volume))
Exit Function
Err:
End Function
'====================================================
'静音True为静音,FALSE为取消静音
'====================================================
'Public Function MCI_SetAudioOnOff(AudioOff As Boolean) As Boolean
Public Function MCI_SetAudioOnOff(AudioOff As Variant) As Boolean
On Error GoTo Err
MCI_SetAudioOnOff = SetAudioOnOff(CBool(AudioOff))
Exit Function
Err:
End Function
'====================================================
'获得当前媒体的状态是不是在播放
'====================================================
Public Function MCI_IsPlaying() As Boolean
MCI_IsPlaying = IsPlaying
End Function
'=====================================================
'设置播放速度
'=====================================================
'Public Function MCI_SetSpeed(Speed As Long) As Boolean
Public Function MCI_SetSpeed(Speed As Variant) As Boolean
On Error GoTo Err
MCI_SetSpeed = SetSpeed(CLng(Speed))
Exit Function
Err:
End Function
'======================================================
'全屏播放
'======================================================
Public Function MCI_PlayFullScreen() As Boolean
MCI_PlayFullScreen = PlayFullScreen
End Function
'====================================================
'是否有画面True为有,FALSE为取消
'====================================================
'Public Function MCI_SetWindowShow(WindowOff As Boolean) As Boolean
Public Function MCI_SetWindowShow(WindowOff As Variant) As Boolean
On Error GoTo Err
MCI_SetWindowShow = SetWindowShow(CBool(WindowOff))
Exit Function
Err:
End Function
'=======================================================
'根据文件名,确定设备
'=======================================================
'Public Function MCI_GetDriverID(ff As String) As String
Public Function MCI_GetDriverID(ff As Variant) As String
On Error GoTo Err
MCI_GetDriverID = GetDriverID(CStr(ff))
Exit Function
Err:
End Function
'====================================================
'获得播放窗口的handle
'====================================================
Public Function MCI_GetWindowHandle() As Long
MCI_GetWindowHandle = GetWindowHandle
End Function
'====================================================
'获取DeviceID
'====================================================
Public Function MCI_GetDeviceID() As Long
MCI_GetDeviceID = GetDeviceID
End Function






'下面这个函数为您的插件提供帮助信息,请只修改和添加里面的描述信息,而不要修改函数本身

Public Function Get_Plugin_Description(ItemName As String) As String
Dim Description_Text As String
Description_Text = ""
Select Case ItemName
Case ""
Description_Text = "【一只鱼】●『音频播放』"
Case "MCI_OpenURL"
Description_Text = "打开网络音乐网址,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_OpenURL(参数1:输入网络音乐网址,参数2:可选参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_OpenURL(参数1:输入网络音乐网址,参数2:可选参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_OpenURL(" & Chr(34) & "http://www.nhlib.com.cn/file/5/zzh.mp3" & Chr(34) & ")" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_OpenURL(" & Chr(34) & "http://www.nhlib.com.cn/file/5/zzh.mp3" & Chr(34) & ")" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "打开网络音乐成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_OpenMusic"
Description_Text = "打开本地音乐文件,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_OpenMusic(参数1:输入音乐文件路径,参数2:可选参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_OpenMusic(参数1:输入音乐文件路径,参数2:可选参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_OpenMusic(" & Chr(34) & "C:\WINDOWS\Media\ding.wav" & Chr(34) & ")" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_OpenMusic(" & Chr(34) & "C:\WINDOWS\Media\ding.wav" & Chr(34) & ")" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "打开音乐文件成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_PlayMusic"
Description_Text = "音乐开始播放,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_PlayMusic(无参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_PlayMusic(无参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_PlayMusic()" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_PlayMusic()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "开始播放!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_PauseMusic"
Description_Text = "音乐暂停播放,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_PauseMusic(无参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_PauseMusic(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
"例子2:Plugin MCI=MCI.MCI_PauseMusic()" & vbCrLf & _
" Plugin MCI=MCI.MCI_PauseMusic()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "暂停播放!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_ResumeMusic"
Description_Text = "音乐继续播放,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_ResumeMusic(无参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_ResumeMusic(无参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_ResumeMusic()" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_ResumeMusic()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "继续播放!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_StopMusic"
Description_Text = "音乐停止播放,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_StopMusic(无参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_StopMusic(无参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_StopMusic()" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_StopMusic()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "停止播放!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_CloseMusic"
Description_Text = "关闭音乐文件,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_CloseMusic(无参数)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_CloseMusic(无参数)" & vbCrLf & _
"例子1:Plugin MCI.MCI_CloseMusic()" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_CloseMusic()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "关闭音乐文件成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_GetMusicLength"
Description_Text = "获取当前音乐播放时间长度,返回[Long型]时间长度。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_GetMusicLength(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_GetMusicLength()" & vbCrLf & _
" MessageBox " & Chr(34) & "当前音乐播放时间长度为:" & Chr(34) & Chr(38) & "MCI"
Case "MCI_GetMusicPos"
Description_Text = "获取当前音乐播放时间进度,返回[Long型]时间进度。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_GetMusicPos(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_GetMusicPos()" & vbCrLf & _
" MessageBox " & Chr(34) & "当前音乐播放时间进度为:" & Chr(34) & Chr(38) & "MCI"
Case "MCI_SetAudioSource"
Description_Text = "设置音乐声道[0立体声,1左声道,2右声道],返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_SetAudioSource(声道)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_SetAudioSource(声道)" & vbCrLf & _
"例子1:Plugin MCI.MCI_SetAudioSource(1)" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_SetAudioSource(1)" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "设置声道成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_SetVolume"
Description_Text = "设置声音音量,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_SetVolume(音量)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_SetVolume(音量)" & vbCrLf & _
"例子1:Plugin MCI.MCI_SetVolume(50)" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_SetVolume(50)" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "设置音量成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_SetAudioOnOff"
Description_Text = "设置声音状态[True为静音,FALSE为取消静音],返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_SetAudioOnOff(声音状态)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_SetAudioOnOff(声音状态)" & vbCrLf & _
"例子1:Plugin MCI.MCI_SetAudioOnOff(True)" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_SetAudioOnOff(True)" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "设置静音成功!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_IsPlaying"
Description_Text = "获得当前音乐是不是在播放状态,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_IsPlaying(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_IsPlaying()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "音乐在播放状态!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_SetSpeed"
Description_Text = "设置音乐播放速度,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_SetSpeed(音乐播放速度)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_SetSpeed(音乐播放速度)" & vbCrLf & _
"例子1:Plugin MCI.MCI_SetSpeed(200)" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_SetSpeed(200)" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "当前音乐播放速度为:" & Chr(34) & Chr(38) & "MCI" & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_PlayFullScreen"
Description_Text = "视频音乐文件全屏播放,返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_PlayFullScreen(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_PlayFullScreen()" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "视频音乐全屏播放!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_SetWindowShow"
Description_Text = "设置是否有视频画面[True为有,FALSE为取消],返回[True]成功与[False]失败。" & vbCrLf & _
"命令1:Plugin MCI.MCI_SetWindowShow(显示状态)" & vbCrLf & _
"命令2:Plugin MCI=MCI.MCI_SetWindowShow(显示状态)" & vbCrLf & _
"例子1:Plugin MCI.MCI_SetWindowShow(True)" & vbCrLf & _
"例子2:" & vbCrLf & _
" Plugin MCI=MCI.MCI_SetWindowShow(True)" & vbCrLf & _
" If MCI=True" & vbCrLf & _
" MessageBox " & Chr(34) & "出现视频画面!!" & Chr(34) & vbCrLf & _
" Else" & vbCrLf & _
" MessageBox " & Chr(34) & "失败!!" & Chr(34) & vbCrLf & _
" EndIf"
Case "MCI_GetDriverID"
Description_Text = "根据音乐文件名确定设备,返回[String型]设备类型。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_GetDriverID(音乐文件名)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_GetDriverID(" & Chr(34) & "C:\WINDOWS\Media\ding.wav" & Chr(34) & ")" & vbCrLf & _
" MessageBox " & Chr(34) & "播放设备类型为:" & Chr(34) & Chr(38) & "MCI"
Case "MCI_GetWindowHandle"
Description_Text = "获得当前视频播放窗口的handle,返回[Long型]handle数字。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_GetWindowHandle(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_GetWindowHandle()" & vbCrLf & _
" MessageBox " & Chr(34) & "当前视频播放窗口的handle为:" & Chr(34) & Chr(38) & "MCI"
Case "MCI_GetDeviceID"
Description_Text = "获取DeviceID,返回[Long型]DeviceID数字。" & vbCrLf & _
"命令1:Plugin MCI=MCI.MCI_GetDeviceID(无参数)" & vbCrLf & _
"例子1:" & vbCrLf & _
" Plugin MCI=MCI.MCI_GetDeviceID()" & vbCrLf & _
" MessageBox " & Chr(34) & "获取到DeviceID为:" & Chr(34) & Chr(38) & "MCI"
'------------------------------------------------
'为您的每个插件函数建立一个Case,就可以在按键精灵里显示插件的使用说明
'------------------------------------------------
End Select
Get_Plugin_Description = Translate_Description(Description_Text)
End Function









需要下载模块的 权限要大于30阅读权限才能下载

[ 本帖最后由 一只鱼 于 2008-7-12 10:13 PM 编辑 ]

附件:您需要登录才可以下载或查看附件。没有帐号? 注册

    已有1评分我要评分查看所有评分

    2#

    看看

    3#

    1351

    4#

    sfssddfdsd

    5#

    111111225

    6#

    来学习,看看

    7#

    546465466666666

    8#

    顶个学习下!谢谢!

    9#

    】●『音频播放』『VB插件源码下载』(适用

    10#

    nice,get了

    11#

    完美262

    12#

    回复 1楼一只鱼的帖子

    616315656

    13#

    感谢分享

    14#

    频播放』『VB插件源码下载』(适用6.60 以上版本

    15#

    很好很好

    16#

    新手看不懂也要看啊

    17#

    5555555555

    18#

    看看怎么操作

    19#

    1111111111111

    20#

    11333333333333333333333

    发新话题 回复该主题