Difference between revisions of "ISDBDownloader::GetDownloadProgress"

From MediaMonkey Wiki
Jump to: navigation, search
 
(Example code)
Line 33: Line 33:
 
   Dim Percentage
 
   Dim Percentage
 
   Percentage = SDB.Downloader.GetDownloadProgress("http://www.spiker.wz.cz/SecretStream.mp3", true)
 
   Percentage = SDB.Downloader.GetDownloadProgress("http://www.spiker.wz.cz/SecretStream.mp3", true)
   MsgBox( Percentage&" % downloaded")
+
   If Percentage = -1 then
 +
    MsgBox( "This download is not in progress")
 +
  Else
 +
    MsgBox( Percentage&" % downloaded")
 +
  End If
 
End Sub
 
End Sub
  

Revision as of 13:40, 10 June 2010

CoClass SDBDownloader, Interface ISDBDownloader

Function GetDownloadProgress( URL As String) As Long


Parameters

Name Type Description
URL String URL to find the progress for
UsePercent Boolean If this parameter is TRUE then percentage (0-100) is returned, otherwise amount of downloaded bytes are returned.


Method description

Returns download progress of the given URL.

Added in MediaMonkey 4.0

Example code

Option Explicit

Dim UI  : Set UI = SDB.UI

Sub OnStartUp()
    Dim mnuTest

    Set mnuTest = SDB.UI.AddMenuItem(SDB.UI.Menu_Edit, 0, 0)
    mnuTest.Caption = SDB.Localize("Get Download Progress")
    mnuTest.OnClickFunc = "SDBOnClick"
    mnuTest.UseScript = Script.ScriptPath   
End Sub

Sub SDBOnClick(Item)   
  Dim Percentage
  Percentage = SDB.Downloader.GetDownloadProgress("http://www.spiker.wz.cz/SecretStream.mp3", true)
  If Percentage = -1 then
    MsgBox( "This download is not in progress")
  Else
    MsgBox( Percentage&" % downloaded")
  End If
End Sub