⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makesongword.frm

📁 vb 写的播放器 对新的开发者很有用。写的不错。非常实际
💻 FRM
字号:
VERSION 5.00
Begin VB.Form MakeSongWord 
   Caption         =   "歌词制作"
   ClientHeight    =   4695
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4695
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   3855
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   6
      Top             =   600
      Width           =   4455
   End
   Begin VB.CommandButton Command6 
      Caption         =   "向后5秒"
      Height          =   375
      Left            =   3720
      TabIndex        =   5
      Top             =   120
      Width           =   855
   End
   Begin VB.CommandButton Command5 
      Caption         =   "播放"
      Height          =   375
      Left            =   3000
      TabIndex        =   4
      Top             =   120
      Width           =   735
   End
   Begin VB.CommandButton Command4 
      Caption         =   "向前5秒"
      Height          =   375
      Left            =   2160
      TabIndex        =   3
      Top             =   120
      Width           =   855
   End
   Begin VB.CommandButton Command3 
      Caption         =   "编辑时间"
      Height          =   375
      Left            =   1320
      TabIndex        =   2
      Top             =   120
      Width           =   855
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Save"
      Height          =   375
      Left            =   720
      TabIndex        =   1
      Top             =   120
      Width           =   615
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Load"
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   615
   End
End
Attribute VB_Name = "MakeSongWord"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

' **********************************************************************
'  描  述:存vb代码写的winnap程序,非常酷
'  Play78.com : 网站导航,源码之家,绝对开源
'  海阔天空收集整理
'  主站地址:http://www.play78.com/
'  源码下载地址:http://www.play78.com/blog
'  图片下在地址:http://www.play78.com/pic
'  QQ:13355575
'  e-mail:hglai@eyou.com
'  编写日期:2005年08月30日
' **********************************************************************

Public SongWordFileName As String  '如:c:\歌词\ddd.txt
Dim Playing_Song '正在播放的歌曲去掉扩展名,如ddd
Dim Pause As Boolean
Private Sub Command1_Click()
On Error GoTo Cancel
ShowOpen "打开歌词文件:", "文本文件(*.TXT)" + vbNullChar + "*.TXT" + vbNullChar, Mainfrm.SongWordDir
Open FileName For Input As #1
Text1.Text = Text1.Text & StrConv(InputB(LOF(1), #1), vbUnicode)
Close #1
MakeSongWord.Caption = "歌词制作  " & FileName
SongWordFileName = FileName
Cancel:
End Sub

Private Sub Command2_Click()
On Error GoTo Cancel
Open SongWordFileName For Output As #1
Print #1, Text1.Text
Close #1
Cancel:
End Sub

Private Sub Command3_Click()
GetMciInfo
Clipboard.SetText MciPositionTime & "="
MakeSongWord.Text1.SelText = Clipboard.GetText
On Error GoTo Exit1
Dim txt As String
Dim a As Integer
Dim Selstart As Integer

Selstart = Text1.Selstart
txt = Mid(Text1, Selstart)
a = InStr(txt, Chr(13) & Chr(10))
Text1.Selstart = Selstart + a

Exit Sub
Exit1:

Selstart = 1
txt = Mid(Text1, Selstart)
a = InStr(txt, Chr(13) & Chr(10))
Text1.Selstart = Selstart + a
End Sub

Private Sub Command4_Click()
GetMciInfo
If MciPosition < 5200 Then
 mciExecute ("play Media1 from " & 0)
Else
 mciExecute ("play Media1 from " & MciPosition - 5000)
End If
End Sub

Private Sub Command5_Click()
If Command5.Caption = "播放" Then
 Command5.Caption = "暂停"
 Mci.Pause
Else
 Command5.Caption = "播放"
 mciExecute ("resume Media1")
End If
End Sub

Private Sub Command6_Click()
GetMciInfo
If MciPosition > MciLength - 5200 Then
 mciExecute ("play Media1 from " & MciLength - 200)
Else
 mciExecute ("play Media1 from " & MciPosition + 5000)
End If
End Sub

Private Sub Form_Load()
If PlayingSong = "" Then Exit Sub
TempFileName = PlayingSong
Do
 pos = InStr(TempFileName, "\")
 TempFileName = Mid(TempFileName, pos + 1)
Loop Until pos = 0
TempFileName = Left(TempFileName, InStr(TempFileName, ".") - 1)

MakeSongWord.Caption = "歌词制作  " & Mainfrm.SongWordDir & "\" & TempFileName & ".txt"
SongWordFileName = Mainfrm.SongWordDir & "\" & TempFileName & ".txt"
Playing_Song = TempFileName

If Dir(SongWordFileName) = "" Then  '如果不存在歌词文件
 MakeSongWord.Text1 = "[歌词DIY v1.0]" & Chr(13) & Chr(10) & "00:00=" & Playing_Song & Chr(13) & Chr(10)
 Exit Sub
Else '存在歌词文件
 Open SongWordFileName For Input As #1
 SongWordTxt = StrConv(InputB(LOF(1), #1), vbUnicode)
 MakeSongWord.Text1 = SongWordTxt
 Close #1
 
 On Error GoTo Exit1 '补充头部
 Open SongWordFileName For Input As #2
 Do
  Input #2, Txtline1
  Input #2, Txtline2
 Loop Until EOF(1)
 Close #2
 If Left(Txtline1, 12) <> "[歌词DIY v1.0]" Then MakeSongWord.Text1 = "[歌词DIY v1.0]" & Chr(13) & Chr(10)
 If Left(Txtline2, Len("00:00=" & Playing_Song)) <> "00:00=" & Playing_Song Then MakeSongWord.Text1 = MakeSongWord.Text1 & "00:00=" & Playing_Song & Chr(13) & Chr(10)
 MakeSongWord.Text1 = MakeSongWord.Text1 & SongWordTxt
 
Exit1:
 If Left(Txtline1, 12) <> "[歌词DIY v1.0]" Then MakeSongWord.Text1 = "[歌词DIY v1.0]" & Chr(13) & Chr(10)
 If Left(Txtline2, Len("00:00=" & Playing_Song)) <> "00:00=" & Playing_Song Then MakeSongWord.Text1 = MakeSongWord.Text1 & "00:00=" & Playing_Song & Chr(13) & Chr(10)
 MakeSongWord.Text1 = MakeSongWord.Text1 & SongWordTxt
 Close #2
End If

End Sub

Public Sub ShowSongWord()
Dim TempFileName As String
If PlayingSong = "" Then Exit Sub
TempFileName = PlayingSong
Do
 pos = InStr(TempFileName, "\")
 TempFileName = Mid(TempFileName, pos + 1)
Loop Until pos = 0
TempFileName = Left(TempFileName, InStr(TempFileName, ".") - 1)

Mainfrm.Text3 = Mainfrm.SongWordDir
Mainfrm.Text4 = Mainfrm.Text3 & "\" & TempFileName & ".txt"
SongWordFileName = Mainfrm.Text4

If Dir(SongWordFileName) = "" Then
 Mainfrm.Timer2.Enabled = True
 Exit Sub
Else
 Mainfrm.Timer2.Enabled = False
End If
Playing_Song = TempFileName
Dim sRet As String
sRet = String(255, " ")
songwords = Left(sRet, GetPrivateProfileString("歌词DIY v1.0", MciPositionTime, "0", sRet, Len(sRet), SongWordFileName))
If songwords = "0" Then Exit Sub
Mainfrm.Label1.Caption = songwords
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -