小程序:LRC歌词展开
来源:互联网 发布:淘宝网店货物拍照 编辑:程序博客网 时间:2024/04/28 12:28
LRC大家都知道吧(不知道?就是那个带时间标签的文本歌词格式嘛~),很好用的东东~所以最近很多MP3Player也开始支持它了。笔者手上就有一个联想F520的MP3支持,不过有点小麻烦,这个MP3只支持一行一个时间标签,但是笔者手头上的LRC一行都有好些时间标签,像这样,MP3就会把后面的时间标签全部显示出来(晕~)
看来只能修改修改了~既然我们没办法修改MP3的固件,那就在LRC上动手脚吧~把他展开为每行一个时间标签不就得了~说干就干!
不过我懒得再作界面,所以直接从命令行参数中获取,此外这个纠错机制不是很完善(毕竟才一个过程),大家也可以帮忙修改~
代码如下:
Sub Main()
Dim sCommand() As String
Dim bTmp As Byte
Dim sTmp As String
Dim cFile As Collection
Dim iNum As Integer
Dim sTmp2 As String
Dim i As Integer
Dim j As Integer
Dim sTmp3 As String
Dim bIsAdd As Boolean
Set cFile = New Collection
sCommand = Split(Command, "*") '用*作分隔符,很简单,文件名不能带*,用?也可以
Open sCommand(0) For Input As #1
Do Until EOF(1)
Input #1, sTmp
iNum = 0
Do While ((Mid(sTmp, iNum * 9 + 1, 1) = "[") And (Mid(sTmp, (iNum + 1) * 9, 1) = "]"))
iNum = iNum + 1
Loop
sTmp2 = Right(sTmp, Len(sTmp) - 9 * iNum)
For i = 0 To iNum - 1
sTmp3 = Mid(sTmp, i * 9 + 2, 7)
If cFile.Count = 0 Then
cFile.Add "[" & sTmp3 & "]" & sTmp2
Else
bIsAdd = False
For j = 1 To cFile.Count
If Mid(cFile(j), 2, 7) > Mid(sTmp, i * 9 + 2, 7) Then
cFile.Add "[" & sTmp3 & "]" & sTmp2, , j
bIsAdd = True
Exit For
End If
Next j
If Not bIsAdd Then cFile.Add "[" & sTmp3 & "]" & sTmp2
End If
Next i
Loop
Close #1
Open sCommand(1) For Output As #1
For i = 1 To cFile.Count
Print #1, cFile(i)
Next i
Close #1
End Sub
大家应该还能看的懂吧~这个经过试验还是不错的~
最终通过环境:VB6+Win2000
- 小程序:LRC歌词展开
- LRC歌词
- LRC歌词制作LRC歌词制作
- lrc歌词动态显示
- LRC歌词分析函数
- LRC歌词分析函数
- lrc 歌词解析项目
- lrc歌词文件
- Lrc歌词-开发标准
- LRC 歌词同步
- 实现 LRC歌词滚动
- LRC歌词格式简介
- 歌词格式LRC
- LRC歌词读取
- 播放器歌词LRC
- LRC歌词解析
- 不解释Lrc歌词
- LRC歌词格式简介
- VC编程规范-程序员们都应该这样写代码(wl3000wlnew)
- Job Description For OES Testing
- IT从业人员必看的10个论坛
- 还不知道,如何自己修改界面
- 第一次用,看看效果如何!
- 小程序:LRC歌词展开
- Every woman is beautiful
- How do I make my ASP pages more efficient?
- 把货币金额转换成大写的SQL自定义函数(SQL Server版)
- 移动通信设备中J2ME开发的现状和前景展望
- 用Groovy Template 生成代码 2nd
- 25+ ASP Tips to Improve Performance and Style
- java.security.GuardedObject翻译
- 第一贴!哈哈