UDF - VLC MEDIA PLAYER - OBJEKT

      UDF - VLC MEDIA PLAYER - OBJEKT

      Hi leute,

      ich hab vorgestern zufällig entdeckt, dass man den VLC Media Player als Objekt einbinden kann oder wie auch immer man da sagt xD
      Also hab ich mal eine UDF geschrieben um diese Funktionen auch ordentlich nutzen zu können.

      Ist jetzt nicht wirklich etwas Atemberaubendes, da es hauptsächlich Schreibarbeit war, aber vielleicht kann es ja doch einmal wer benutzen :D

      Ein paar Funktionen fehlen noch bzw funktionieren noch nicht (unter anderem Lautstärke regeln, aktuellen Track auslesen, etc -.-)
      EDIT1: Ok, ich hab jetzt mal die UDF geupdated(t?), jetzt sollten alle derzeitigen Funktionen korrekt arbeiten!
      Man kann damit auch Videos wiedergeben, und ich werd mich später nochmal dransetzen und noch ein paar Video-Funktionen hinzufügen.
      EDIT2: Sorry aber es funktioniert bei mir im Moment das AutoIt-Highlighting nicht, jetzt hab ichs in einen ganz normalen Code-Tag gepackt.



      Hier die UDF:

      Spoiler anzeigen

      Brainfuck-Quellcode

      1. #include-Once
      2. ; #INDEX# =========================================================================================
      3. ; Title .........: VLC
      4. ; AutoIt Version : 3.3.6.0
      5. ; Language ..... : English
      6. ; Description ...: Functions to use the VideoLAN VLC ActiveX Plugin
      7. ; Author(s) .....: oetzn - autoit.de
      8. ; =================================================================================================
      9. ; #VARIABLES =====================================================================================
      10. Global Const $CLSID = "{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      11. Global $oError = _InitComErrFunc()
      12. Global $oVLC
      13. Global $oPlaylist
      14. Global $oAudio
      15. Global $oLog
      16. Global $oInput
      17. ; =================================================================================================
      18. ; #CURRENT# =======================================================================================
      19. ; _VLC_PlayItem
      20. ; _VLC_Play_Resume
      21. ; _VLC_Stop
      22. ; _VLC_ChangeItem
      23. ; _VLC_IsPlaying
      24. ; _VLC_RemoveItem
      25. ; _VLC_TogglePause
      26. ; _VLC_AddItem
      27. ; _VLC_GetPlayListCount
      28. ; _VLC_ClearPlayList
      29. ; _VLC_SetMuteState
      30. ; _VLC_GetMuteState
      31. ; _VLC_ToggleMute
      32. ; _VLC_Volume
      33. ; _VLC_GetTrack
      34. ; _VLC_ChannelState
      35. ; _VLC_Obj_Init
      36. ; _VLC_AutoPlayState
      37. ; _VLC_AutoLoopState
      38. ; _VLC_BaseURLState
      39. ; _VLC_GetCurVersion
      40. ; _VLC_GetPluginInfo
      41. ; _VLC_HasVout
      42. ; =================================================================================================
      43. ; #INTERNAL_USE_ONLY#==============================================================================
      44. ; __VLC_PlaylistObj
      45. ; __VLC_LogObj
      46. ; __VLC_AudioObj
      47. ; __VLC_InputObj
      48. ; _InitComErrFunc
      49. ; _ComErrorObj
      50. ; =================================================================================================
      51. ; #FUNCTION# ====================================================================================================================
      52. ; Name...........: _VLC_PlayItem
      53. ; Description ...: Plays an item in the Playlist (zero-based index)
      54. ; Syntax.........: _VLC_PlayItem(ByRef $oVLC, $iIndex)
      55. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      56. ; $iIndex - zero-based index of the item in the playlist
      57. ; Return values .: Success: 1 (if $oVLC is an object)
      58. ; Failure: -1 (if $oVLC is no object)
      59. ;
      60. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      61. ; Modified.......:
      62. ; Remarks .......:
      63. ; Related .......:
      64. ; ===============================================================================================================================
      65. Func _VLC_PlayItem(ByRef $oVLC, $iIndex)
      66. If IsObj($oVLC) Then
      67. $oPlaylist.playitem($iIndex)
      68. Return 1
      69. Else
      70. Return -1
      71. EndIf
      72. EndFunc ;==>_VLC_PlayItem
      73. ; #FUNCTION# ====================================================================================================================
      74. ; Name...........: _VLC_Play_Resume
      75. ; Description ...: Plays/resumes the current track
      76. ; Syntax.........: _VLC_Play_Resume(ByRef $oVLC)
      77. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      78. ; Return values .: Success: 1 (if $oVLC is an object)
      79. ; Failure: -1 (if $oVLC is no object)
      80. ;
      81. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      82. ; Modified.......:
      83. ; Remarks .......:
      84. ; Related .......:
      85. ; ===============================================================================================================================
      86. Func _VLC_Play_Resume(ByRef $oVLC)
      87. If IsObj($oVLC) Then
      88. $oPlaylist.play
      89. Return 1
      90. Else
      91. Return -1
      92. EndIf
      93. EndFunc ;==>_VLC_Play_Resume
      94. ; #FUNCTION# ====================================================================================================================
      95. ; Name...........: _VLC_Stop
      96. ; Description ...: Stops the current track
      97. ; Syntax.........: _VLC_Stop(ByRef $oVLC)
      98. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      99. ; Return values .: Success: 1 (if $oVLC is an object)
      100. ; Failure: -1 (if $oVLC is no object)
      101. ;
      102. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      103. ; Modified.......:
      104. ; Remarks .......:
      105. ; Related .......:
      106. ; ===============================================================================================================================
      107. Func _VLC_Stop(ByRef $oVLC)
      108. If IsObj($oVLC) Then
      109. $oPlaylist.stop
      110. Return 1
      111. Else
      112. Return -1
      113. EndIf
      114. EndFunc ;==>_VLC_Stop
      115. ; #FUNCTION# ====================================================================================================================
      116. ; Name...........: _VLC_ChangeItem
      117. ; Description ...: Changes the item which should be played
      118. ; Syntax.........: _VLC_ChangeItem(ByRef $oVLC, $bNext = True)
      119. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      120. ; $bNext (optional) - True = next song will be played, False = previous song will be played
      121. ; Return values .: Success: 1 (if $oVLC is an object)
      122. ; Failure: -1 (if $oVLC is no object)
      123. ;
      124. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      125. ; Modified.......:
      126. ; Remarks .......:
      127. ; Related .......:
      128. ; ===============================================================================================================================
      129. Func _VLC_ChangeItem(ByRef $oVLC, $bNext = True)
      130. If IsObj($oVLC) Then
      131. Switch $bNext
      132. Case True
      133. $oPlaylist.Next
      134. Return 1
      135. Case False
      136. $oPlaylist.prev
      137. Return 1
      138. EndSwitch
      139. Else
      140. Return -1
      141. EndIf
      142. EndFunc ;==>_VLC_ChangeItem
      143. ; #FUNCTION# ====================================================================================================================
      144. ; Name...........: _VLC_IsPlaying
      145. ; Description ...: Returns the current playing state
      146. ; Syntax.........: _VLC_IsPlaying(ByRef $oVLC)
      147. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      148. ; Return values .: Success:
      149. ; True = Playing
      150. ; False = Not Playing
      151. ; Failure: -1 (if $oVLC is no object)
      152. ;
      153. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      154. ; Modified.......:
      155. ; Remarks .......:
      156. ; Related .......:
      157. ; ===============================================================================================================================
      158. Func _VLC_IsPlaying(ByRef $oVLC)
      159. If IsObj($oVLC) Then
      160. Return $oPlaylist.isPlaying
      161. Else
      162. Return -1
      163. EndIf
      164. EndFunc ;==>_VLC_IsPlaying
      165. ; #FUNCTION# ====================================================================================================================
      166. ; Name...........: _VLC_RemoveItem
      167. ; Description ...: Removes an item from the playlist
      168. ; Syntax.........: _VLC_RemoveItem(ByRef $oVLC, $iItem)
      169. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      170. ; $iItem - zero-based index of the item to remove
      171. ; Return values .: Success: 1 (if $oVLC is an object)
      172. ; Failure: -1 (if $oVLC is no object)
      173. ;
      174. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      175. ; Modified.......:
      176. ; Remarks .......: DOES NOT STOP THE MUSIC IF LAST ITEM IS REMOVED AND EVEN IF PLAYING ITEM IS REMOVED
      177. ; Related .......:
      178. ; ===============================================================================================================================
      179. Func _VLC_RemoveItem(ByRef $oVLC, $iItem)
      180. If IsObj($oVLC) And IsInt($iItem) Then
      181. $oPlaylist.removeItem($iItem)
      182. Return 1
      183. Else
      184. Return -1
      185. EndIf
      186. EndFunc ;==>_VLC_RemoveItem
      187. ; #FUNCTION# ====================================================================================================================
      188. ; Name...........: _VLC_TogglePause
      189. ; Description ...: Toggles the playing state; paused/playing
      190. ; Syntax.........: _VLC_TogglePause(ByRef $oVLC)
      191. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      192. ; Return values .: Success: 1 (if $oVLC is an object)
      193. ; Failure: -1 (if $oVLC is no object)
      194. ;
      195. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      196. ; Modified.......:
      197. ; Remarks .......:
      198. ; Related .......:
      199. ; ===============================================================================================================================
      200. Func _VLC_TogglePause(ByRef $oVLC)
      201. If IsObj($oVLC) Then
      202. $oPlaylist.togglePause
      203. Return 1
      204. Else
      205. Return -1
      206. EndIf
      207. EndFunc ;==>_VLC_TogglePause
      208. ; #FUNCTION# ====================================================================================================================
      209. ; Name...........: _VLC_AddItem
      210. ; Description ...: Adds an item to the playlist
      211. ; Syntax.........: _VLC_AddItem(ByRef $oVLC, $sItem)
      212. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      213. ; $sItem - Path to the media file
      214. ; Return values .: Success: 1 (if $oVLC is an object)
      215. ; Failure: -1 (if $oVLC is no object)
      216. ;
      217. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      218. ; Modified.......:
      219. ; Remarks .......:
      220. ; Related .......:
      221. ; ===============================================================================================================================
      222. Func _VLC_AddItem(ByRef $oVLC, $sItem)
      223. If IsObj($oVLC) And IsString($sItem) Then
      224. $oPlaylist.add($sItem)
      225. Return 1
      226. Else
      227. Return -1
      228. EndIf
      229. EndFunc ;==>_VLC_AddItem
      230. ; #FUNCTION# ====================================================================================================================
      231. ; Name...........: _VLC_GetPlayListCount
      232. ; Description ...: Returnes the current count of items in playlist
      233. ; Syntax.........: _VLC_GetPlayListCount(ByRef $oVLC)
      234. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      235. ; Return values .: Success: 1 (if $oVLC is an object)
      236. ; Failure: -1 (if $oVLC is no object)
      237. ;
      238. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      239. ; Modified.......:
      240. ; Remarks .......:
      241. ; Related .......:
      242. ; ===============================================================================================================================
      243. Func _VLC_GetPlayListCount(ByRef $oVLC)
      244. If IsObj($oVLC) Then
      245. Return $oPlaylist.itemCount
      246. Return 1
      247. Else
      248. Return -1
      249. EndIf
      250. EndFunc ;==>_VLC_GetPlayListCount
      251. ; #FUNCTION# ====================================================================================================================
      252. ; Name...........: _VLC_ClearPlayList
      253. ; Description ...: Deletes all items from the playlist
      254. ; Syntax.........: _VLC_ClearPlayList(ByRef $oVLC)
      255. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      256. ; Return values .: Success: 1 (if $oVLC is an object)
      257. ; Failure: -1 (if $oVLC is no object)
      258. ;
      259. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      260. ; Modified.......:
      261. ; Remarks .......: DOES NOT STOP THE MUSIC IF LAST ITEM IS REMOVED AND EVEN IF PLAYING ITEM IS REMOVED
      262. ; Related .......:
      263. ; ===============================================================================================================================
      264. Func _VLC_ClearPlayList(ByRef $oVLC)
      265. If IsObj($oVLC) Then
      266. $oPlaylist.clear
      267. Return 1
      268. Else
      269. Return -1
      270. EndIf
      271. EndFunc ;==>_VLC_ClearPlayList
      272. ; #FUNCTION# ====================================================================================================================
      273. ; Name...........: _VLC_SetMuteState
      274. ; Description ...: Sets the mute state
      275. ; Syntax.........: _VLC_ClearPlayList(ByRef $oVLC)
      276. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      277. ; $bMute - Boolean Variable (True = mute, False = unmute)
      278. ; Return values .: Success: 1 (if $oVLC is an object)
      279. ; Failure: -1 (if $oVLC is no object)
      280. ;
      281. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      282. ; Modified.......:
      283. ; Remarks .......:
      284. ; Related .......:
      285. ; ===============================================================================================================================
      286. Func _VLC_SetMuteState(ByRef $oVLC, $bMute)
      287. If IsObj($oVLC) And IsBool($bMute) Then
      288. Return $oAudio.mute = $bMute
      289. Else
      290. Return -1
      291. EndIf
      292. EndFunc ;==>_VLC_SetMuteState
      293. ; #FUNCTION# ====================================================================================================================
      294. ; Name...........: _VLC_GetMuteState
      295. ; Description ...: Returns the current mute state
      296. ; Syntax.........: _VLC_GetMuteState(ByRef $oVLC)
      297. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      298. ; Return values .: Success:
      299. ; True = muted
      300. ; False = unmuted
      301. ; Failure: -1 (if $oVLC is no object)
      302. ;
      303. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      304. ; Modified.......:
      305. ; Remarks .......:
      306. ; Related .......:
      307. ; ===============================================================================================================================
      308. Func _VLC_GetMuteState(ByRef $oVLC)
      309. If IsObj($oVLC) Then
      310. Return $oAudio.mute
      311. Else
      312. Return -1
      313. EndIf
      314. EndFunc ;==>_VLC_GetMuteState
      315. ; #FUNCTION# ====================================================================================================================
      316. ; Name...........: _VLC_ToggleMute
      317. ; Description ...: Toggles the mute state
      318. ; Syntax.........: _VLC_ToggleMute(ByRef $oVLC)
      319. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      320. ; Return values .: Success: Returns nothing
      321. ; Failure: -1 (if $oVLC is no object)
      322. ;
      323. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      324. ; Modified.......:
      325. ; Remarks .......:
      326. ; Related .......:
      327. ; ===============================================================================================================================
      328. Func _VLC_ToggleMute(ByRef $oVLC)
      329. If IsObj($oVLC) Then
      330. Return $oAudio.toggleMute
      331. Else
      332. Return -1
      333. EndIf
      334. EndFunc ;==>_VLC_ToggleMute
      335. ; #FUNCTION# ====================================================================================================================
      336. ; Name...........: _VLC_GetTrackLength
      337. ; Description ...: Returns the length of the current track
      338. ; Syntax.........: _VLC_GetPlaybackTime(ByRef $oVLC)
      339. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      340. ; Return values .: Success: Returns the length of the current track in millisecounds
      341. ; Failure: -1 (if $oVLC is no object)
      342. ;
      343. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      344. ; Modified.......:
      345. ; Remarks .......:
      346. ; Related .......:
      347. ; ===============================================================================================================================
      348. Func _VLC_GetTrackLength(ByRef $oVLC)
      349. If IsObj($oVLC) Then
      350. Return $oInput.Length
      351. Else
      352. Return -1
      353. EndIf
      354. EndFunc ;==>_VLC_GetTrackLength
      355. ; #FUNCTION# ====================================================================================================================
      356. ; Name...........: _VLC_GetPlaybackTime
      357. ; Description ...: Returns the playback time of the current track
      358. ; Syntax.........: _VLC_GetPlaybackTime(ByRef $oVLC)
      359. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      360. ; Return values .: Success: Returns the playback time of the current track in millisecounds
      361. ; Failure: -1 (if $oVLC is no object)
      362. ;
      363. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      364. ; Modified.......:
      365. ; Remarks .......:playback time = time since the track has started playing
      366. ; Related .......:
      367. ; ===============================================================================================================================
      368. Func _VLC_GetPlaybackTime(ByRef $oVLC)
      369. If IsObj($oVLC) Then
      370. Return $oInput.time
      371. Else
      372. Return -1
      373. EndIf
      374. EndFunc ;==>_VLC_GetPlaybackTime
      375. ; #FUNCTION# ====================================================================================================================
      376. ; Name...........: _VLC_Volume
      377. ; Description ...: Sets/Gets the volume (Range 0-200)
      378. ; Syntax.........: _VLC_Volume(ByRef $oVLC, $iVolume, $bGet = True)
      379. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      380. ; $iVolume - Integer 0-200
      381. ; $bGet - (Optional) Boolean; True: Gets the volume, False: Sets the volume
      382. ; Return values .: Success:
      383. ; $bGet = True: The current volume
      384. ; $bGet = False: If you look for the return value (in a MsgBox) a comparison will be made between the current volume and $iVolume (Return True if the comparison matches and False if the values are different)
      385. ; Failure: -1 (if $oVLC is no object)
      386. ;
      387. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      388. ; Modified.......:
      389. ; Remarks .......:
      390. ; Related .......:
      391. ; ===============================================================================================================================
      392. Func _VLC_Volume(ByRef $oVLC, $iVolume, $bGet = True)
      393. If IsObj($oVLC) And IsInt($iVolume) And IsBool($bGet) Then
      394. Switch $bGet
      395. Case True
      396. Return $oAudio.volume
      397. Case False
      398. Return $oAudio.volume = $iVolume
      399. EndSwitch
      400. Else
      401. Return -1
      402. EndIf
      403. EndFunc ;==>_VLC_Volume
      404. ; #FUNCTION# ====================================================================================================================
      405. ; Name...........: _VLC_GetTrack
      406. ; Description ...: Returns the current track index
      407. ; Syntax.........: _VLC_GetTrack(ByRef $oVLC)
      408. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      409. ; Return values .: Success: Returns the current track
      410. ; Failure: -1 (if $oVLC is no object)
      411. ;
      412. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      413. ; Modified.......:
      414. ; Remarks .......:
      415. ; Related .......:
      416. ; ===============================================================================================================================
      417. Func _VLC_GetTrack(ByRef $oVLC)
      418. If IsObj($oVLC) Then
      419. Return $oAudio.track
      420. Else
      421. Return -1
      422. EndIf
      423. EndFunc ;==>_VLC_GetTrack
      424. ; #FUNCTION# ====================================================================================================================
      425. ; Name...........: _VLC_ChannelState
      426. ; Description ...: Returns/sets the channel
      427. ; Syntax.........: _VLC_ChannelState(ByRef $oVLC, $iChannelID, $iReturnType = "0", $sType = "GET")
      428. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      429. ; $iChannelID - If $sType = "SET" Then this parameter indizes which channel should be used (see Remarks)
      430. ; $iReturnType - 0 OR 1, switches the return type; 0 returns just the number of the channel, 1 returns a string
      431. ; $sType - switches between returning or settings the channel
      432. ; Return values .: Success:
      433. ; If $sType = "GET" returns the current channel used
      434. ; If $sType = "SET" returns nothing
      435. ; Failure: -1 (if $oVLC is no object)
      436. ;
      437. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      438. ; Modified.......:
      439. ; Remarks .......: If $sType = "GET" Then the parameter $iChannelID is ignored, if $sType = "SET" Then the parameter $iReturnType is ignored
      440. ; $iChannelID can be 1,2,3,4,5; 1 = stereo, 2 = reverse stereo, 3 = left, 4 = right, 5 = dolby
      441. ; Related .......:
      442. ; ===============================================================================================================================
      443. Func _VLC_ChannelState(ByRef $oVLC, $iChannelID, $iReturnType = "0", $sType = "GET")
      444. If IsObj($oVLC) And IsInt($iChannelID) And IsInt($iReturnType) And IsString($sType) Then
      445. Switch $sType
      446. Case "GET"
      447. Switch $iReturnType
      448. Case 0
      449. Return $oAudio.channel
      450. Case 1
      451. Switch $oAudio.channel
      452. Case 1
      453. Return "stereo"
      454. Case 2
      455. Return "reverse stereo"
      456. Case 3
      457. Return "left"
      458. Case 4
      459. Return "right"
      460. Case 5
      461. Return "dolby"
      462. EndSwitch
      463. EndSwitch
      464. Case "SET"
      465. Return $oAudio.channel = $iChannelID
      466. Case Else
      467. Return -2
      468. EndSwitch
      469. Else
      470. Return -1
      471. EndIf
      472. EndFunc ;==>_VLC_ChannelState
      473. ; #FUNCTION# ====================================================================================================================
      474. ; Name...........: _VLC_Obj_Init
      475. ; Description ...: Creates the VLC Object
      476. ; Syntax.........: _VLC_Obj_Init()
      477. ; Parameters ....:
      478. ; Return values .: Success: Returns the VLC Object and intializes 3 other necessary objects
      479. ; Failure: -1 if object could not be created
      480. ;
      481. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      482. ; Modified.......:
      483. ; Remarks .......:
      484. ; Related .......:
      485. ; ===============================================================================================================================
      486. Func _VLC_Obj_Init()
      487. $oVLC = ObjCreate("VideoLAN.VLCPlugin.2")
      488. If IsObj($oVLC) Then
      489. $oPlaylist = __VLC_PlaylistObj($oVLC)
      490. $oAudio = __VLC_AudioObj($oVLC)
      491. $oLog = __VLC_LogObj($oVLC)
      492. $oInput = __VLC_InputObj($oVLC)
      493. Return $oVLC
      494. Else
      495. Return -1
      496. EndIf
      497. EndFunc ;==>_VLC_Obj_Init
      498. ; #FUNCTION# ====================================================================================================================
      499. ; Name...........: _VLC_GetCurVersion
      500. ; Description ...: Returns the version of the VLC plugin
      501. ; Syntax.........: _VLC_GetCurVersion(ByRef $oVLC)
      502. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      503. ; Return values .: Success: Returns the version
      504. ; Failure: -1 (if $oVLC is no object)
      505. ;
      506. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      507. ; Modified.......:
      508. ; Remarks .......:
      509. ; Related .......:
      510. ; ===============================================================================================================================
      511. Func _VLC_GetCurVersion(ByRef $oVLC)
      512. If IsObj($oVLC) Then
      513. Return $oVLC.VersionInfo
      514. Else
      515. Return -1
      516. EndIf
      517. EndFunc ;==>_VLC_GetCurVersion
      518. ; #FUNCTION# ====================================================================================================================
      519. ; Name...........: _VLC_GetPluginInfo
      520. ; Description ...: Returns information about the plugin
      521. ; Syntax.........: _VLC_GetPluginInfo(ByRef $oVLC)
      522. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      523. ; Return values .: Success: Returns an 1D-array containing the information
      524. ; Failure: -1 (if $oVLC is no object)
      525. ;
      526. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      527. ; Modified.......:
      528. ; Remarks .......:
      529. ; [0] = Name of the dispatch interface being used
      530. ; [1] = Description of the (document) Object
      531. ; [2] = The ProgID of the Object
      532. ; [3] = The DLL file from with the Object was created
      533. ; [4] = Filename and position of the toolbox icon
      534. ; Related .......:
      535. ; ===============================================================================================================================
      536. Func _VLC_GetPluginInfo(ByRef $oVLC)
      537. Local $aInfo[5]
      538. If IsObj($oVLC) Then
      539. For $i = 1 To 5
      540. $aInfo[$i - 1] = ObjName($oVLC, $i)
      541. Next
      542. Return $aInfo
      543. Else
      544. Return -1
      545. EndIf
      546. EndFunc ;==>_VLC_GetPluginInfo
      547. ; #FUNCTION# ====================================================================================================================
      548. ; Name...........: _VLC_AutoPlayState
      549. ; Description ...: Sets/Gets the autoplay state
      550. ; Syntax.........: _VLC_AutoPlayState(ByRef $oVLC, $bAutoPlay, $sType = "GET")
      551. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      552. ; Return values .: Success:
      553. ; If $sType = "GET" returns True if AutoPlay is enable, false if AutoPlay is disable
      554. ; If $sType = "SET" returns nothing
      555. ; Failure: -1 (if $oVLC is no object)
      556. ;
      557. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      558. ; Modified.......:
      559. ; Remarks .......: If $sType is "GET the parameter $bAutoPlay is ignored
      560. ; Related .......:
      561. ; ===============================================================================================================================
      562. Func _VLC_AutoPlayState(ByRef $oVLC, $bAutoPlay, $sType = "GET")
      563. If IsObj($oVLC) And IsBool($bAutoPlay) Then
      564. Switch $sType
      565. Case "GET"
      566. Return $oVLC.AutoPlay
      567. Case "SET"
      568. Return $oVLC.AutoPlay = $bAutoPlay
      569. EndSwitch
      570. Else
      571. Return -1
      572. EndIf
      573. EndFunc ;==>_VLC_AutoPlayState
      574. ; #FUNCTION# ====================================================================================================================
      575. ; Name...........: _VLC_AutoLoopState
      576. ; Description ...: Sets/Gets the autoloop state
      577. ; Syntax.........: _VLC_AutoLoopState(ByRef $oVLC, $bAutoLoop, $sType = "GET")
      578. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      579. ; Return values .: Success:
      580. ; If $sType = "GET" returns True if Autoloop is enable, false if Autoloop is disable
      581. ; If $sType = "SET" returns nothing
      582. ; Failure: -1 (if $oVLC is no object)
      583. ;
      584. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      585. ; Modified.......:
      586. ; Remarks .......: If $sType is "GET" the parameter $bAutoLoop is ignored
      587. ; Related .......:
      588. ; ===============================================================================================================================
      589. Func _VLC_AutoLoopState(ByRef $oVLC, $bAutoLoop, $sType = "GET")
      590. If IsObj($oVLC) And IsBool($bAutoLoop) Then
      591. Switch $sType
      592. Case "GET"
      593. Return $oVLC.AutoLoop
      594. Case "SET"
      595. Return $oVLC.AutoLoop = $bAutoLoop
      596. EndSwitch
      597. Else
      598. Return -1
      599. EndIf
      600. EndFunc ;==>_VLC_AutoLoopState
      601. ; #FUNCTION# ====================================================================================================================
      602. ; Name...........: _VLC_BaseURLState
      603. ; Description ...: Sets/Gets the base URL
      604. ; Syntax.........: _VLC_BaseURLState(ByRef $oVLC, $sPath, $sType = "GET")
      605. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      606. ; Return values .: Success:
      607. ; If $sType = "GET" returns the BASE URL
      608. ; If $sType = "SET" returns True if the current BASE URL is the same as $sPath and False if they are different, but the BASE URL will not be set if you look for the return value.
      609. ; If you look for the return value, a comparison will be made.
      610. ; Failure: -1 (if $oVLC is no object)
      611. ;
      612. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      613. ; Modified.......:
      614. ; Remarks .......: If $sType is "GET" the parameter $sPath is ignored
      615. ; If no BaseURL was set, the function will return an empty string if asking for the BaseURL
      616. ; Related .......:
      617. ; ===============================================================================================================================
      618. Func _VLC_BaseURLState(ByRef $oVLC, $sPath, $sType = "GET")
      619. If IsObj($oVLC) And IsString($sPath) And IsString($sType) Then
      620. Switch $sType
      621. Case "GET"
      622. Return $oVLC.BaseURL
      623. Case "SET"
      624. Return $oVLC.BaseURL = $sPath
      625. Case Else
      626. Return -2
      627. EndSwitch
      628. Else
      629. Return -1
      630. EndIf
      631. EndFunc ;==>_VLC_BaseURLState
      632. ; #FUNCTION# ====================================================================================================================
      633. ; Name...........: _VLC_HasVout
      634. ; Description ...: Returns whether the current item displays a video
      635. ; Syntax.........: _VLC_HasVout(ByRef $oVLC)
      636. ; Parameters ....: $oVLC - Object Variable returned by _VLC_Obj_Init
      637. ; Return values .: Success: True = Video is displayed by item
      638. ; False = No Video is displayed by item
      639. ; Failure: -1 (if $oVLC is no object)
      640. ;
      641. ; Author ........: Thomas Eizinger (oetzn - autoit.de)
      642. ; Modified.......:
      643. ; Remarks .......: Requires a small Sleep(~500) if called immediately after _VLC_Play_Resume or _VLC_PlayItem, otherwise may return False even if a video is played
      644. ; Related .......:
      645. ; ===============================================================================================================================
      646. Func _VLC_HasVout(ByRef $oVLC)
      647. If IsObj($oVLC) Then
      648. Return $oInput.hasVout
      649. Else
      650. Return -1
      651. EndIf
      652. EndFunc ;==>_VLC_HasVout
      653. ; #INTERNAL_USE_ONLY#==============================================================================
      654. ; =================================================================================================
      655. Func __VLC_PlaylistObj(ByRef $oVLC)
      656. If IsObj($oVLC) Then Return $oVLC.playlist
      657. EndFunc ;==>__VLC_PlaylistObj
      658. Func __VLC_LogObj(ByRef $oVLC)
      659. If IsObj($oVLC) Then Return $oVLC.log
      660. EndFunc ;==>__VLC_LogObj
      661. Func __VLC_AudioObj(ByRef $oVLC)
      662. If IsObj($oVLC) Then Return $oVLC.audio
      663. EndFunc ;==>__VLC_AudioObj
      664. Func __VLC_InputObj(ByRef $oVLC)
      665. If IsObj($oVLC) Then Return $oVLC.input
      666. EndFunc ;==>__VLC_InputObj
      667. Func _InitComErrFunc()
      668. Global $g_eventerror = 0
      669. $oError = ObjEvent("AutoIt.Error", "_ComErrorObj")
      670. If IsObj($oError) Then Return $oError
      671. EndFunc ;==>_InitComErrFunc
      672. Func _ComErrorObj()
      673. MsgBox(48, "COM/OBJECT ERROR!", "Errorcode: 0x" & Hex($oError.number, 8) & @CRLF & _
      674. "Error in line: " & $oError.scriptline & @CRLF & _
      675. "Error describition: " & $oError.windescription)
      676. ;~ "$oError.lastdllerror: " & $oError.lastdllerror & @CRLF & _
      677. ;~ "$oError.description: " & $oError.description & @CRLF & _
      678. ;~ "$oError.helpfile: " & $oError.helpfile & @CRLF & _
      679. ;~ "$oError.source: " & $oError.source & @CRLF & _
      680. ;~ "$oError.helpcontext: " & $oError.helpcontext & @CRLF & _
      681. ;~ )
      682. $g_eventerror = 1
      683. EndFunc ;==>_ComErrorObj
      684. ; =================================================================================================
      685. ; =================================================================================================


      Viel Spaß : D
      Dateien
      • VLC.au3

        (29,24 kB, 838 mal heruntergeladen, zuletzt: )

      Dieser Beitrag wurde bereits 6 mal editiert, zuletzt von „oetzn“ ()

      hmm, daran könnte es liegen..
      Ich muss jetzt leider weg, und kann mich vorraussichtlich erst morgen wieder damit beschäftigen..

      Also schönen Abend noch und vielleicht kommst du ja selber drauf xD
      Wie gesagt, ich schaus mir morgen an, und werd versuchen ob sich da was machen lässt.
      Google mal nach dem Error, also nach "Ungültige Klassenzeichenfolge" vielleicht findest du da was.

      Tschau bis morgen
      @Higggiii

      Ich hab mal in meiner Registry nach der CLSID von dem Plugin geschaut und dabei die folgenden Einträge gefunden:

      Spoiler anzeigen

      Quellcode

      1. [HKEY_CLASSES_ROOT\AppID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}]
      2. @="VideoLAN VLC ActiveX Plugin v2"
      3. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}]
      4. @="VideoLAN VLC ActiveX Plugin v2"
      5. "AppID"="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      6. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Control]
      7. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories]
      8. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{0DE86A57-2BAA-11CF-A229-00AA003D7352}]
      9. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{0DE86A58-2BAA-11CF-A229-00AA003D7352}]
      10. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{40FC6ED4-2438-11CF-A3DB-080036F12502}]
      11. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]
      12. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]
      13. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\InprocServer32]
      14. @="C:\\Programme\\VideoLAN\\VLC\\axvlc.dll"
      15. "ThreadingModel"="Apartment"
      16. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\MiscStatus]
      17. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\MiscStatus\1]
      18. @="131473"
      19. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\ProgID]
      20. @="VideoLAN.VLCPlugin.2"
      21. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Programmable]
      22. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\ToolboxBitmap32]
      23. @="C:\\Programme\\VideoLAN\\VLC\\axvlc.dll,1"
      24. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\TypeLib]
      25. @="{DF2BBE39-40A8-433B-A279-073F48DA94B6}"
      26. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Version]
      27. @="1.0"
      28. [HKEY_CLASSES_ROOT\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\VersionIndependentProgID]
      29. @="VideoLAN.VLCPlugin"
      30. [HKEY_CLASSES_ROOT\VideoLAN.VLCPlugin\CLSID]
      31. @="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      32. [HKEY_CLASSES_ROOT\VideoLAN.VLCPlugin.2\CLSID]
      33. @="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      34. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AppID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}]
      35. @="VideoLAN VLC ActiveX Plugin v2"
      36. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}]
      37. @="VideoLAN VLC ActiveX Plugin v2"
      38. "AppID"="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      39. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Control]
      40. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories]
      41. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{0DE86A57-2BAA-11CF-A229-00AA003D7352}]
      42. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{0DE86A58-2BAA-11CF-A229-00AA003D7352}]
      43. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{40FC6ED4-2438-11CF-A3DB-080036F12502}]
      44. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{7DD95801-9882-11CF-9FA9-00AA006C42C4}]
      45. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Implemented Categories\{7DD95802-9882-11CF-9FA9-00AA006C42C4}]
      46. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\InprocServer32]
      47. @="C:\\Programme\\VideoLAN\\VLC\\axvlc.dll"
      48. "ThreadingModel"="Apartment"
      49. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\MiscStatus]
      50. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\MiscStatus\1]
      51. @="131473"
      52. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\ProgID]
      53. @="VideoLAN.VLCPlugin.2"
      54. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Programmable]
      55. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\ToolboxBitmap32]
      56. @="C:\\Programme\\VideoLAN\\VLC\\axvlc.dll,1"
      57. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\TypeLib]
      58. @="{DF2BBE39-40A8-433B-A279-073F48DA94B6}"
      59. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\Version]
      60. @="1.0"
      61. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{9BE31822-FDAD-461B-AD51-BE1D1C159921}\VersionIndependentProgID]
      62. @="VideoLAN.VLCPlugin"
      63. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VideoLAN.VLCPlugin\CLSID]
      64. @="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
      65. [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VideoLAN.VLCPlugin.2\CLSID]
      66. @="{9BE31822-FDAD-461B-AD51-BE1D1C159921}"


      Könntest ja nachschaun, ob du unter 64bit dieselben hast, einfach mal in die Suche folgendens eingeben ( in der Registry): "{9BE31822-FDAD-461B-AD51-BE1D1C159921"
      EDIT1: Ich habs jetzt ausprobiert, mit der Standard-Installation von VLC 1.0.5 funktioniert es. Man darf blos das Häckchen bei ActiveX Plugin nicht rausmachen :D , sonst kommt der oben genannte Error..


      Mf G

      Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „oetzn“ ()

      Da es keine 64bit-Version des VLC Media Players gibt, wird es wohl auch das Plugin nicht als 64bit Version geben.
      Es handelt sich da bei dem ganzen um eine DLL nämlich um die hier:
      axvlc.dll

      Aber da du ja den VLC Media Player 32Bit auf deinem 64Bit Betriebssystem nutzen kannst, frag ich mich warum denn dann das Objekt in erstellt werden kann ?!

      Ich geb dir bescheid sobald ich was herausgefunden habe, vielleicht hängt es ja mit den Registryeinträgen zusammen, die ich oben gepostet habe.

      [MSIE_newline_end ]
    autoit.de Webutation