songsdb slow

Discussion about anything that might be of interest to MediaMonkey users.

Moderator: Gurus

CountLudwig
Posts: 2
Joined: Mon Feb 17, 2003 2:47 pm

songsdb slow

Post by CountLudwig »

Hi,
I just installed the program on my win2k pro pc
pointed it at my mp3 list and 3 hours later it is still not done
building a song list!!

any idea whats going on?
or why it is so slow?
btw nothing else runs slow on the system
Athlon 900 256mb ram etc..

If this is how slow it is supposed to be, or because its on
win2k then I'll be uninstalling...

thanks

-Ron
jiri
Posts: 5419
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

Songs-DB is definitely not supposed to be that slow. Do you have so many songs? The first insert of a song is somewhat slower than in competing products (because of safer way of using database - data are safer in Songs-DB), but the difference should not be big. I would appreciate any detailed description, possibly to my e-mail (how much approximately one file took, ...).

Jiri
CountLudwig
Posts: 2
Joined: Mon Feb 17, 2003 2:47 pm

Post by CountLudwig »

[quote="jiri"]Songs-DB is definitely not supposed to be that slow. Do you have so many songs? The first insert of a song is somewhat slower than in competing products (because of safer way of using database - data are safer in Songs-DB), but the difference should not be big. I would appreciate any detailed description, possibly to my e-mail (how much approximately one file took, ...).

Jiri[/quote]

One file took approx. 2.5 to 3 minutes. I have about 500 mp3 files
so after a few hours I gave up, and uninstalled it.
I ended up writing my own in htmlvbscript, it's just about done
and works pretty good. It's a bit rough and needs the file handling
cleaned up a bit but It should do what I need it to.

It's fairly simple really, what it does is encapsulate the windows
mediaplayer into a web page and uses a playlist.
where it's just a text file, you can configure it any way
you want without a lot of hassle.


here is a copy of it. paste it to a text file and call it mymp3player.hta
you have to have the .hta file extention for it to run.
Also, be careful of the long lines word wrapping, you will probably
have to fix those, just edit it in notepad. (only tested on w2k pro)
'******* snip here ****************
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>MyMP3Player</TITLE>
<HTA:APPLICATION ID = "MyMP3PlayerApp"
APPLICATIONNAME = "MyMP3Player"
CAPTION = "yes"
SHOWINTASKBAR = "yes"
SINGLEINSTANCE = "Yes"
SELECTION = "No"
BORDER = "thin
BORDERSTYLE = "raised"
SYSMENU = "yes"
SCROLL = "no"
WINDOWSTATE = "normal"
VERSION = "0.1.0"
CONTEXTMENU = "No"
ICON="Calvinns.ico">
<style type="text/css">
<!--
.ButtonObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; font-size: xx-small; FONT-WEIGHT: bold; WIDTH: 100px; HEIGHT: 34px; BACKGROUND-COLOR: transparent}
.TitleObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; font-size: x-small; FONT-WEIGHT: bold; WIDTH: 460px; HEIGHT: 32px; TEXT-ALIGN: right; BACKGROUND-COLOR: #99ccff; hideFocus}
.StatusBarObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; FONT-SIZE: xx-small; FONT-WEIGHT: bold; WIDTH: 230px; HEIGHT: 22px; BACKGROUND-COLOR: #99ccff;
BORDER-TOP-STYLE: groove; BORDER-LEFT-STYLE: groove; BORDER-BOTTOM-STYLE: groove;}
.SBarObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; FONT-SIZE: xx-small; FONT-WEIGHT: bold; WIDTH: 230px; HEIGHT: 22px; TEXT-ALIGN: right; BACKGROUND-COLOR: #99ccff;
BORDER-TOP-STYLE: groove; BORDER-LEFT-STYLE: groove; BORDER-BOTTOM-STYLE: groove;}
.PLabelObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; FONT-SIZE: x-small; FONT-WEIGHT: bold; WIDTH: 362px; HEIGHT: 22px; TEXT-ALIGN: right;
BORDER-BOTTOM-STYLE: inset; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #99ccff; hideFocus}
.PickStyleObj {font-family: Verdana,Tahoma,Arial,Helvetica,sans-serif; font-size: x-small; WIDTH: 362px; ; HEIGHT: 106px;}
-->
</style>

</HEAD>
<BODY bgColor=#99ccff OnLoad="PageLoader()" UnLoadOff="DoExit()" text=black dir=ltr aLink=teal background=""><!-- Buttons -->
<BUTTON id=Dir_button Class=ButtonObj style="Z-INDEX: 100; LEFT: 3px; POSITION: absolute; TOP: 54px" size="45" name=Dir_button >
Set Folder
</BUTTON>
<BUTTON id=Open_button Class=ButtonObj style="Z-INDEX: 101; LEFT: 3px; POSITION: absolute; TOP: 90px" size="45" name=Open_button >
Open Play List
</BUTTON>
<BUTTON id=Save_button Class=ButtonObj style="Z-INDEX: 102; LEFT: 3px; POSITION: absolute; TOP: 126px" size="45" name=Save_button >
Save Play List
</BUTTON>
<BUTTON id=Play_button Class=ButtonObj style="Z-INDEX: 105; LEFT: 3px; POSITION: absolute; TOP: 162px" size="45" name=Play_button >
Play
</BUTTON>
<BUTTON id=Help_button Class=ButtonObj style="Z-INDEX: 106; LEFT: 3px; POSITION: absolute; TOP: 198px" size="45" name=Help_button >
HelpAbout
</BUTTON>
<BUTTON id=Stop_button Class=ButtonObj style="Z-INDEX: 107; LEFT: 3px; POSITION: absolute; TOP: 234px" size="45" name=Stop_button >
Stop
</BUTTON>
<BUTTON id=Exit_button Class=ButtonObj style="Z-INDEX: 108; LEFT: 3px; POSITION: absolute; TOP: 272px" size="42" name=Exit_button >
Exit
</BUTTON>
<!-- Buttons -->

<SPAN id=MyTitle>

</SPAN>

<INPUT id=Cur_Path style="LEFT: 108px; WIDTH: 362px; POSITION: absolute; TOP: 54px; HEIGHT: 22px" size=52 value="[No MP3 Folder Selected]" name=Cur_Path>
<SELECT id=FListBox Class=PickStyleObj style="LEFT: 108px; POSITION: absolute; TOP: 78px" size=2 name=FListBox>
</SELECT>


<INPUT id=PList_Label Class=PLabelObj style="LEFT: 108px; POSITION: absolute; TOP: 186px" size=52 value="Play List" Disabled name=PList_Label>
<SELECT id=PlistBox Class=PickStyleObj style="LEFT: 108px; POSITION: absolute; TOP: 210px" size=2 name=PlistBox>
</SELECT>


<HR style="LEFT: 3px; POSITION: absolute; TOP: 315px">

<OBJECT id=MediaPlayer1
style="LEFT: 3px; WIDTH: 472px; FONT-FAMILY: serif; POSITION: absolute; TOP: 320px; HEIGHT: 89px"
codeBase=http://activex.microsoft.com/activex/co ... =6,4,5,715
classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 align=left width=475
height=89 type=application/x-oleobject VIEWASTEXT
standby="Loading Microsoftź Windowsź Media Player components...">
<PARAM NAME="AudioStream" VALUE="-1">
<PARAM NAME="AutoSize" VALUE="-1">
<PARAM NAME="AutoStart" VALUE="0">
<PARAM NAME="AnimationAtStart" VALUE="-1">
<PARAM NAME="AllowScan" VALUE="-1">
<PARAM NAME="AllowChangeDisplaySize" VALUE="-1">
<PARAM NAME="AutoRewind" VALUE="0">
<PARAM NAME="Balance" VALUE="0">
<PARAM NAME="BaseURL" VALUE="">
<PARAM NAME="BufferingTime" VALUE="5">
<PARAM NAME="CaptioningID" VALUE="">
<PARAM NAME="ClickToPlay" VALUE="0">
<PARAM NAME="CursorType" VALUE="0">
<PARAM NAME="CurrentPosition" VALUE="-1">
<PARAM NAME="CurrentMarker" VALUE="0">
<PARAM NAME="DefaultFrame" VALUE="">
<PARAM NAME="DisplayBackColor" VALUE="12582912">
<PARAM NAME="DisplayForeColor" VALUE="16777215">
<PARAM NAME="DisplayMode" VALUE="0">
<PARAM NAME="DisplaySize" VALUE="0">
<PARAM NAME="Enabled" VALUE="-1">
<PARAM NAME="EnableContextMenu" VALUE="-1">
<PARAM NAME="EnablePositionControls" VALUE="-1">
<PARAM NAME="EnableFullScreenControls" VALUE="0">
<PARAM NAME="EnableTracker" VALUE="-1">
<PARAM NAME="Filename" VALUE="<I>http://server/path/your-file.mp3</I>">
<PARAM NAME="InvokeURLs" VALUE="-1">
<PARAM NAME="Language" VALUE="-1">
<PARAM NAME="PlayCount" VALUE="1">
<PARAM NAME="PreviewMode" VALUE="0">
<PARAM NAME="Rate" VALUE="1">
<PARAM NAME="SelectionStart" VALUE="-1">
<PARAM NAME="SelectionEnd" VALUE="-1">
<PARAM NAME="SendOpenStateChangeEvents" VALUE="-1">
<PARAM NAME="SendWarningEvents" VALUE="-1">
<PARAM NAME="SendErrorEvents" VALUE="-1">
<PARAM NAME="SendKeyboardEvents" VALUE="-1">
<PARAM NAME="SendMouseClickEvents" VALUE="-1">
<PARAM NAME="SendMouseMoveEvents" VALUE="-1">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="0">
<PARAM NAME="ShowCaptioning" VALUE="0">
<PARAM NAME="ShowControls" VALUE="-1">
<PARAM NAME="ShowAudioControls" VALUE="-1">
<PARAM NAME="ShowDisplay" VALUE="0">
<PARAM NAME="ShowGotoBar" VALUE="-1">
<PARAM NAME="ShowPositionControls" VALUE="-1">
<PARAM NAME="ShowStatusBar" VALUE="-1">
<PARAM NAME="ShowTracker" VALUE="-1">
<PARAM NAME="TransparentAtStart" VALUE="0">
<PARAM NAME="VideoBorderWidth" VALUE="0">
<PARAM NAME="VideoBorderColor" VALUE="0">
<PARAM NAME="VideoBorder3D" VALUE="0">
<PARAM NAME="Volume" VALUE="-520">
<PARAM NAME="WindowlessVideo" VALUE="0">

<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
SRC="xmedia.m3u" name="MediaPlayer1" width=176 height=144 autostart=1 showcontrols=0>
</EMBED></OBJECT>

</BODY>

<SCRIPT LANGUAGE=vbscript>
<!--
' last modified 2:53 - 02/17/2003 rsg
Option Explicit
Dim WSHShell, Fs, Header, CRLF, DoDebug
Dim LogFile, LogName, ScriptLoc
Dim WinDir, UName, PCName, ErrCode, TMsg
Dim BtnS, BtnE, TFPath
Dim PlayList, PLFile

' Date/Time Info
Dim CurDay, CurMonth, CurYear, Today, DateStr
' ***********************************
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const MpReady = 4
Const MpNotReady = 0
Const MpLoading = 1
Const MpAlmostReady = 3
Const MpStopped = 0
Const MpPaused = 1
Const MpPlaying = 2

Set WSHShell = CreateObject("WScript.Shell")
Set Fs = CreateObject("Scripting.FileSystemObject")

DoDebug = TRUE
Header = " My MP3 Player "
UName = WSHShell.ExpandEnvironmentStrings("%USERNAME%")
PCName = WSHShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
WinDir = WSHShell.ExpandEnvironmentStrings("%windir%")
CRLF = Chr(13) & Chr(10)
Today = Date()
CurDay = Day(Today)
CurMonth = Month(Today)
CurYear = Year(Today)
DateStr = CurMonth & "/" & CurDay & "/" & CurYear & " "
LogName = "MyMP3Player.log"
PlayList = "MyMP3Player.m3u"

StartLogging()
If Not FExist(WinDir & "SYSTEM32MSDXM.OCX") Then
Logevent(" this page may not load or run correctly.")
LogEvent(" Windows Media Player 6x is needed. " & Windir & "SYSTEM32MSDXM.OCX")
End If


' Main () ' runs before pageloader...
Call SetupCtrls()
Call InitMPlay()

'EOS ' Quit Here...
'*************************************
'*************************************
'***[ functions and procedures ]**********
'*************************************
Sub PageLoader()
self.resizeto 500,464
LogEvent("Script Log Name = " & LOGNAME)
LogEvent("Current User Name = " & UName)
LogEvent("Loading Page.............")
LogEvent("Screen Resolution = " & GetRes())
TFPath = Fs.GetAbsolutePathName(LOGNAME)
LogEvent("Log Path = " & TFPath)
Cur_Path.value = fs.GetParentFolderName(TFPath)
Call BuildFileList()
Call LoadList()
LogEvent("******************************")
End Sub
'************************************
Sub SetupCtrls()
Dim TmpStr
TmpStr = "<INPUT id=MainTitle Class=TitleObj style=""LEFT: 6px; POSITION: absolute; TOP: 4px"" size =65 value=""Multi-Media Player"" name=MainTitle disabled>"
MyTitle.innerHTML = TmpStr
End Sub
'*************************************
Sub InitMPlay()
MediaPlayer1.AutoRewind = True
Select Case MediaPlayer1.ReadyState
Case MpNotReady
LogEvent("MediaPlayer Not Ready to Play: " & MediaPlayer1.ReadyState)
Case MpLoading
LogEvent("MediaPlayer Loading: " & MediaPlayer1.ReadyState)
Case MpReady
LogEvent("MediaPlayer Ready to Play: " & MediaPlayer1.ReadyState)
Case Else
LogEvent("MediaPlayer ReadyState = " & MediaPlayer1.ReadyState)
End Select
End Sub

'****************************************
Sub DoExit()
Call StopLogging()
Set Fs = Nothing
Set WSHShell = Nothing
self.close()
End Sub

'*************************************
Sub show_msg(strText)
MsgBox strText, vbInformation, Header
End Sub
'*************************
Sub StartLogging()
On Error Resume Next
If Not FExist(LogName) Then
Set LogFile = fs.OpenTextFile(LogName,ForWriting,vbTrue)
If (Err.Number <> 0) Then
WSHShell.Popup "Could not create log file " & LogFile, 2, Header, 0
End If
Else
Set LogFile = fs.OpenTextFile(LogName,ForAppending,vbTrue)
If (Err.Number <> 0) Then
WSHShell.Popup "Could not create log file " & LogFile, 2, Header, 0
End If
End If
LogFile.WriteLine " Logging Enabled : " & Now()
End Sub
'*************************************
Sub StopLogging()
On Error Resume Next
LogFile.WriteLine " Logging Disabled : " & Now()
LogFile.Close
End Sub
'*************************************
Sub LogEvent(StringtoWrite)
on error resume next
LogFile.WriteLine StringtoWrite
End Sub
'*************************************
Sub LogEventNoCR(StringtoWrite)
on error resume next
LogFile.Write StringtoWrite
End Sub
'*************************************
Sub TurnItOn()
window.event.srcElement.style.color="#FAFAD2"
End sub
'*************************************
Sub TurnItOff()
window.event.srcElement.style.color="#000000"
End sub
'*************************************
Function FExist(filespec) ' File Exists
FExist = FALSE
If (fs.FileExists(filespec)) Then FExist = TRUE
End Function
'*************************************
Function GetRes()
Dim Width, Height
width = document.ParentWindow.screen.width
height = document.ParentWindow.screen.height
GetRes = Width & Height
End Function

Sub BuildFileList()
Dim TheFiles, FolderObj, File, oOption
Set FolderObj = fs.GetFolder(Cur_Path.value)
Set TheFiles = FolderObj.Files
For Each file in theFiles
If (fs.GetExtensionName(File) = "mp3") Then
set oOption = document.createElement("OPTION")
oOption.value = File.Path
oOption.Text = File.Name
FListBox.Add(oOption)
set oOption = Nothing
End If
Next
LogEvent("PlayList Path = " & Cur_Path.value)
End Sub

Function GetDirPath()
Dim sFPath, CDlg, F
Const OFN_HIDEREADONLY = "&H4"
Const OFN_CREATEPROMPT = "&H2000"
Const OFN_EXPLORER = "&H80000"
Const OFN_LONGNAMES = "&H200000"
GetDirPath = ""
Set CDlg = CreateObject("MSComDlg.CommonDialog")
With CDlg
.Flags = OFN_EXPLORER Or OFN_LONGNAMES Or OFN_CREATEPROMPT Or OFN_HIDEREADONLY
.MaxFileSize = 260 ' allocate space for file name
.InitDir = "d:" ' set opening directory
.DialogTitle = "Music Folder"
.DefaultExt = "mp3" ' default extension
.Filter = "MP3 Files (*.mp3) | *.mp3 | All Files (*.*) | *.* "
.FilterIndex = 2 ' show all files
.FileName = "*.mp3" ' set default filename
.ShowOpen ' show the dialog
sFPath = .FileName ' retrieve the result...
End With
If (sFPath <> "*.mp3") Then
GetDirPath = fs.GetParentFolderName(sFPath)
End If
Set CDlg = Nothing
Set f = Nothing
End Function

Sub SavePlayList()
Dim AnItem, Count, TmpStr
Count = 0
If Not DoDebug Then
On Error Resume Next
End If
TmpStr = Cur_Path.Value & "" & PlayList
LogEvent("Saving PlayList " & TmpStr)
MediaPlayer1.FileName = PListBox.options(0).Value
LogEvent("PListBox 0 Entry: " & PListBox.options(0).Value)
If Not FExist(TmpStr) Then
LogEvent("Creating PlayList File.")
Set PLFile = fs.CreateTextFile(TmpStr,vbTrue)
Else
LogEvent("Opening PlayList File.")
Set PLFile = fs.OpenTextFile(TmpStr,ForWriting,vbTrue)
End If
If (Err.Number <> 0) Then
LogEvent("Could not create PlayList file " & TmpStr)
Alert("Could not create PlayList file " & TmpStr)
Exit Sub
End If
For Each AnItem in PListBox
PLFile.WriteLine(PlistBox.options(Count).value)
Count = Count+1
Next
PLFile.Close
Show_Msg("PlayList Saved")
LogEvent(CStr(Count-1) & " Lines Written ")
Call LoadList()
End Sub

Sub ClrPList()
Dim Item
For each Item in PListBox.options
LogEvent("Removing :" & Item.Value)
PlistBox.remove(Item).Value
Next
End Sub

Sub LoadList()
If Not DoDebug Then
On Error Resume Next
End If
Dim oOption, TmpFil, ALine, TmpStr
TmpStr = Fs.GetAbsolutePathName(PlayList)
LogEvent("Loading PlayList:: " & TmpStr)
If FExist(TmpStr) Then
Call ClrPList()
MediaPlayer1.FileName = TmpStr
Set TmpFil = fs.OpenTextFile(TmpStr)
Do While (TmpFil.AtEndOfStream <> True)
ALine = TmpFil.ReadLine
If (ALine <> "") Then
set oOption = document.createElement("OPTION")
oOption.value = Fs.GetAbsolutePathName(ALine)
oOption.Text = Fs.GetFileName(ALine)
PListBox.Add(oOption)
set oOption = Nothing
End If
Loop
TmpFil.Close
Else
LogEvent("Bummer Dude -No PlayList Found: " & PlayList)
End If
End Sub

Sub StartPlayer()
Dim RCount
If (MediaPlayer1.ReadyState = MpReady) Then
LogEvent("MediaPlayer able to Play.")
MediaPlayer1.Play()
LogEvent("Current Entry = " & MediaPlayer1.GetCurrentEntry)
LogEvent("File Duration = " & MediaPlayer1.Duration)
Else
LogEvent("Unable to Play! " & MediaPlayer1.ReadyState)
Show_Msg("Unable to Play FileList")
End If
End Sub

Sub ShowAboutBox()
Dim sMDHTM, oAboutBox
Dim sHead, sBody, sButton, sEndTags
sHead = "about:<html><head><title> About MyMediaPlayer </title></head> "
sBody = "<body bgcolor='Snow' leftmargin=15 scroll=no ><center><BR>" _
& "<div id=lineOne></div><BR><div id=lineTwo></div><BR> " _
& "<div id=lineThree></div><BR>"
sButton = "<BR><button id='cmdCancel' style='width:110; ' >Close</button></center> "
sEndTags = "</body></html>"
sMDHTM = sHead & sBody & sButton & sEndTags ' assemble dlg's html
Set oAboutBox = window.showModelessDialog(sMDHTM, window, "dialogWidth:350px; dialogheight:160px; status:no; help:no")
oAboutBox.lineOne.innerText = " MyMediaPlayer "
oAboutBox.lineTwo.innerText = " fahgedaboudit "
oAboutBox.lineThree.innerText = " Copyright 2003 ComputerHelp "
End Sub

-->
</SCRIPT>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub Dir_button_onclick
Cur_Path.value = GetDirPath()
Call BuildFileList()
Call Open_button_onclick
End Sub

Sub Open_button_onclick
Call LoadList()
End Sub

Sub Exit_button_onclick
Call DoExit()
End Sub

Sub Play_button_onclick
Call StartPlayer()
End Sub

Sub Stop_Button_onclick
MediaPlayer1.stop()
End Sub

Sub Save_Button_onclick
Call SavePlayList()
End Sub

Sub Pause_Button_onclick
If (MediaPlayer1.PlayState = MpPlaying) Then
MediaPlayer1.Pause()
End If
End Sub

Sub FListBox_ondblclick
Dim AddOption
set AddOption = document.createElement("OPTION")
AddOption.value = FListBox.Options(FListBox.SelectedIndex).Value
AddOption.Text = FListBox.Options(FListBox.SelectedIndex).Text
LogEvent("Adding to PlayList: " & AddOption.Text)
PListBox.Add(AddOption)
End Sub

Sub FileFinder_onchange
show_msg(" File Path Found!")
End Sub

Sub Help_Button_onclick
Call ShowAboutBox()
End Sub

Sub PlistBox_ondblclick
LogEvent("Removing from PlayList: " & FListBox.Options(PListBox.SelectedIndex).Text)
PlistBox.remove(PListBox.SelectedIndex)
End Sub

-->
</SCRIPT>
<!-- EOS. -->
</HTML>
'************* snip here***************
have fun.
-Ron
jiri
Posts: 5419
Joined: Tue Aug 14, 2001 7:00 pm
Location: Czech Republic
Contact:

Post by jiri »

Nice solution, indeed. However, to be honest, Songs-DB can do a bit more. ;-)

One song does not take more than a second even on a slow machine, if it takes more, then there must be some problem. I would be glad if you could give me some short song that took so long (e-mail, ftp, as you can).

Thanks,
Jiri
Post Reply