Difference between revisions of "ISDBDevice::ActiveDeviceList"

From MediaMonkey Wiki
Jump to: navigation, search
 
(Property description)
Line 9: Line 9:
  
 
Returns the list of devices connected to the computer.
 
Returns the list of devices connected to the computer.
 +
 +
===Example===
 +
 +
<source lang="vb">
 +
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("Sync Now Playing to Galaxy Nexus")
 +
    mnuTest.OnClickFunc = "SDBOnClick"
 +
    mnuTest.UseScript = Script.ScriptPath   
 +
End Sub
 +
 
 +
Sub SDBOnClick(Item) 
 +
  Dim DeviceHandle : DeviceHandle = -1
 +
  Dim Devices : Set Devices = SDB.Device.ActiveDeviceList("VID_04E8&PID_6860")
 +
  Dim i : i = 0
 +
  For i = 0 To Devices.Count-1
 +
  If Devices.DeviceHandle(i) <> -1 Then
 +
  DeviceHandle = Devices.DeviceHandle(i)
 +
  End If
 +
  Next
 +
 
 +
  SDB.Device.StartSynch DeviceHandle, SDB.Player.CurrentSongList
 +
End Sub
 +
</source>
  
 
[[Category:Scripting|{{PAGENAME}}]]
 
[[Category:Scripting|{{PAGENAME}}]]

Revision as of 13:28, 11 March 2013

CoClass SDBDevice, Interface ISDBDevice

Property Get ActiveDeviceList(containID As String) As ISDBDeviceList


Parameters

Name Type Description
containID String Specifies the string that must be in each device ID in the list of devices


Property description

Returns the list of devices connected to the computer.

Example

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("Sync Now Playing to Galaxy Nexus")
    mnuTest.OnClickFunc = "SDBOnClick"
    mnuTest.UseScript = Script.ScriptPath    
End Sub
   
Sub SDBOnClick(Item)   
  Dim DeviceHandle : DeviceHandle = -1
  Dim Devices : Set Devices = SDB.Device.ActiveDeviceList("VID_04E8&PID_6860")
  Dim i : i = 0 
  For i = 0 To Devices.Count-1
	   If Devices.DeviceHandle(i) <> -1 Then
		   DeviceHandle = Devices.DeviceHandle(i)
	   End If
  Next
  
  SDB.Device.StartSynch DeviceHandle, SDB.Player.CurrentSongList
End Sub