by koro » Fri Oct 17, 2008 11:25 am
Hi all,
After my mails with Berny i found someone at my job who editted this wonderfull script.
When using the script now, the dot is not anymore in the tag.
When the BPM is 124.76 it becomes 125, and when its 124.35 it becomes 124
Code: Select all
Option Explicit
'1. Save this text as 'MixMeisterImport.vbs' in the Scripts-folder of MediaMonkey
'2. Add this Section to Scripts.ini
'[MixMeisterImport]
'FileName=MixMeisterImport.vbs
'ProcName=MixMeisterImport
'DisplayName=MixMeisterImport
'Language=VBScript
'ScriptType=0
'3. Edit the path to your MixMeister-BPM-file in the code below.
'4. Restart MediaMonkey
'5. You'll find "MixMeisterImport" under Tools/Scripts
Public Const path = "c:\bpm.txt" 'PUT THE PATH TO YOUR MIXMEISTER-BPM-FILE HERE
Sub MixMeisterImport
Dim str, arr, fil, sit
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(path) then
Dim txt : Set txt = fso.OpenTextFile(path,1,False)
SDB.Database.BeginTransaction
Do While Not txt.AtEndOfStream
str = Trim(txt.ReadLine)
arr = Split(str,Chr(9))
fil = Mid(arr(0),2)
Set sit = SDB.Database.QuerySongs("AND (Songs.SongPath = '"&Replace(fil,"'","''")&"')")
If Not (sit.EOF) Then
Dim itm : Set itm = sit.Item
if ((Mid(arr(3),(InStr(arr(3),".") + 1), 1)) >=5) then
itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)) + 1)
else
itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)))
end if
itm.UpdateDB
End If
Loop
Set sit = Nothing
SDB.Database.Commit
else
SDB.MessageBox "The file `"&path&"` unfortunately doesn't exist."& vbCrLf &"Please modify the path to the MixMeister-BPM-file in the Scriptcode.", mtError, Array(mbOk)
end if
End sub
Hi all,
After my mails with Berny i found someone at my job who editted this wonderfull script.
When using the script now, the dot is not anymore in the tag.
When the BPM is 124.76 it becomes 125, and when its 124.35 it becomes 124
[code]Option Explicit
'1. Save this text as 'MixMeisterImport.vbs' in the Scripts-folder of MediaMonkey
'2. Add this Section to Scripts.ini
'[MixMeisterImport]
'FileName=MixMeisterImport.vbs
'ProcName=MixMeisterImport
'DisplayName=MixMeisterImport
'Language=VBScript
'ScriptType=0
'3. Edit the path to your MixMeister-BPM-file in the code below.
'4. Restart MediaMonkey
'5. You'll find "MixMeisterImport" under Tools/Scripts
Public Const path = "c:\bpm.txt" 'PUT THE PATH TO YOUR MIXMEISTER-BPM-FILE HERE
Sub MixMeisterImport
Dim str, arr, fil, sit
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(path) then
Dim txt : Set txt = fso.OpenTextFile(path,1,False)
SDB.Database.BeginTransaction
Do While Not txt.AtEndOfStream
str = Trim(txt.ReadLine)
arr = Split(str,Chr(9))
fil = Mid(arr(0),2)
Set sit = SDB.Database.QuerySongs("AND (Songs.SongPath = '"&Replace(fil,"'","''")&"')")
If Not (sit.EOF) Then
Dim itm : Set itm = sit.Item
if ((Mid(arr(3),(InStr(arr(3),".") + 1), 1)) >=5) then
itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)) + 1)
else
itm.BPM = (Left(arr(3),(InStr(arr(3),".") - 1)))
end if
itm.UpdateDB
End If
Loop
Set sit = Nothing
SDB.Database.Commit
else
SDB.MessageBox "The file `"&path&"` unfortunately doesn't exist."& vbCrLf &"Please modify the path to the MixMeister-BPM-file in the Scriptcode.", mtError, Array(mbOk)
end if
End sub[/code]