#include-Once

; #INDEX# =========================================================================================
; Title .........: VLC
; AutoIt Version : 3.3.6.0
; Language ..... : English
; Description ...: Functions to use the VideoLAN VLC ActiveX Plugin
; Author(s) .....: oetzn - autoit.de
; =================================================================================================

; #VARIABLES =====================================================================================
Global Const $CLSID = "{9BE31822-FDAD-461B-AD51-BE1D1C159921}"
Global $oError = _InitComErrFunc()
Global $oVLC
Global $oPlaylist
Global $oAudio
Global $oLog
Global $oInput
; =================================================================================================

; #CURRENT# =======================================================================================
; _VLC_PlayItem
; _VLC_Play_Resume
; _VLC_Stop
; _VLC_ChangeItem
; _VLC_IsPlaying
; _VLC_RemoveItem
; _VLC_TogglePause
; _VLC_AddItem
; _VLC_GetPlayListCount
; _VLC_ClearPlayList
; _VLC_SetMuteState
; _VLC_GetMuteState
; _VLC_ToggleMute
; _VLC_Volume
; _VLC_GetTrack
; _VLC_ChannelState
; _VLC_Obj_Init
; _VLC_AutoPlayState
; _VLC_AutoLoopState
; _VLC_BaseURLState
; _VLC_GetCurVersion
; _VLC_GetPluginInfo
; _VLC_HasVout
; =================================================================================================

; #INTERNAL_USE_ONLY#==============================================================================
; __VLC_PlaylistObj
; __VLC_LogObj
; __VLC_AudioObj
; __VLC_InputObj
; _InitComErrFunc
; _ComErrorObj
; =================================================================================================

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_PlayItem
; Description ...: Plays an item in the Playlist (zero-based index)
; Syntax.........: _VLC_PlayItem(ByRef $oVLC, $iIndex)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
;                  $iIndex    - zero-based index of the item in the playlist
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_PlayItem(ByRef $oVLC, $iIndex)
	If IsObj($oVLC) Then
		$oPlaylist.playitem($iIndex)
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_PlayItem

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_Play_Resume
; Description ...: Plays/resumes the current track
; Syntax.........: _VLC_Play_Resume(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_Play_Resume(ByRef $oVLC)
	If IsObj($oVLC) Then
		$oPlaylist.play
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_Play_Resume

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_Stop
; Description ...: Stops the current track
; Syntax.........: _VLC_Stop(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_Stop(ByRef $oVLC)
	If IsObj($oVLC) Then
		$oPlaylist.stop
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_Stop

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_ChangeItem
; Description ...: Changes the item which should be played
; Syntax.........: _VLC_ChangeItem(ByRef $oVLC, $bNext = True)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; 				   $bNext (optional) - True = next song will be played, False = previous song will be played
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_ChangeItem(ByRef $oVLC, $bNext = True)
	If IsObj($oVLC) Then
		Switch $bNext
			Case True
				$oPlaylist.Next
				Return 1

			Case False
				$oPlaylist.prev
				Return 1
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_ChangeItem

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_IsPlaying
; Description ...: Returns the current playing state
; Syntax.........: _VLC_IsPlaying(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success:
;						True = Playing
;						False = Not Playing
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_IsPlaying(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oPlaylist.isPlaying
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_IsPlaying

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_RemoveItem
; Description ...: Removes an item from the playlist
; Syntax.........: _VLC_RemoveItem(ByRef $oVLC, $iItem)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; 				   $iItem	 - zero-based index of the item to remove
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: DOES NOT STOP THE MUSIC IF LAST ITEM IS REMOVED AND EVEN IF PLAYING ITEM IS REMOVED
; Related .......:
; ===============================================================================================================================
Func _VLC_RemoveItem(ByRef $oVLC, $iItem)
	If IsObj($oVLC) And IsInt($iItem) Then
		$oPlaylist.removeItem($iItem)
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_RemoveItem

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_TogglePause
; Description ...: Toggles the playing state; paused/playing
; Syntax.........: _VLC_TogglePause(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_TogglePause(ByRef $oVLC)
	If IsObj($oVLC) Then
		$oPlaylist.togglePause
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_TogglePause

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_AddItem
; Description ...: Adds an item to the playlist
; Syntax.........: _VLC_AddItem(ByRef $oVLC, $sItem)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
;				   $sItem	 - Path to the media file
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_AddItem(ByRef $oVLC, $sItem)
	If IsObj($oVLC) And IsString($sItem) Then
		$oPlaylist.add($sItem)
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_AddItem

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetPlayListCount
; Description ...: Returnes the current count of items in playlist
; Syntax.........: _VLC_GetPlayListCount(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_GetPlayListCount(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oPlaylist.itemCount
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetPlayListCount

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_ClearPlayList
; Description ...: Deletes all items from the playlist
; Syntax.........: _VLC_ClearPlayList(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: DOES NOT STOP THE MUSIC IF LAST ITEM IS REMOVED AND EVEN IF PLAYING ITEM IS REMOVED
; Related .......:
; ===============================================================================================================================
Func _VLC_ClearPlayList(ByRef $oVLC)
	If IsObj($oVLC) Then
		$oPlaylist.clear
		Return 1
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_ClearPlayList

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_SetMuteState
; Description ...: Sets the mute state
; Syntax.........: _VLC_ClearPlayList(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
;				   $bMute	 - Boolean Variable (True = mute, False = unmute)
; Return values .: Success: 1 (if $oVLC is an object)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_SetMuteState(ByRef $oVLC, $bMute)
	If IsObj($oVLC) And IsBool($bMute) Then
		Return $oAudio.mute = $bMute
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_SetMuteState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetMuteState
; Description ...: Returns the current mute state
; Syntax.........: _VLC_GetMuteState(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success:
;						True = muted
;						False = unmuted
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_GetMuteState(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oAudio.mute
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetMuteState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_ToggleMute
; Description ...: Toggles the mute state
; Syntax.........: _VLC_ToggleMute(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns nothing
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_ToggleMute(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oAudio.toggleMute
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_ToggleMute

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetTrackLength
; Description ...: Returns the length of the current track
; Syntax.........: _VLC_GetPlaybackTime(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns the length of the current track in millisecounds
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_GetTrackLength(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oInput.Length
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetTrackLength

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetPlaybackTime
; Description ...: Returns the playback time of the current track
; Syntax.........: _VLC_GetPlaybackTime(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns the playback time of the current track in millisecounds
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:playback time = time since the track has started playing
; Related .......:
; ===============================================================================================================================
Func _VLC_GetPlaybackTime(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oInput.time
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetPlaybackTime

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_Volume
; Description ...: Sets/Gets the volume (Range 0-200)
; Syntax.........: _VLC_Volume(ByRef $oVLC, $iVolume, $bGet = True)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; 				   $iVolume	 - Integer 0-200
;				   $bGet	 - (Optional) Boolean; True: Gets the volume, False: Sets the volume
; Return values .: Success:
;						$bGet = True: The current volume
;						$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)
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_Volume(ByRef $oVLC, $iVolume, $bGet = True)
	If IsObj($oVLC) And IsInt($iVolume) And IsBool($bGet) Then
		Switch $bGet
			Case True
				Return $oAudio.volume

			Case False
				Return $oAudio.volume = $iVolume
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_Volume

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetTrack
; Description ...: Returns the current track index
; Syntax.........: _VLC_GetTrack(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns the current track
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_GetTrack(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oAudio.track
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetTrack

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_ChannelState
; Description ...: Returns/sets the channel
; Syntax.........: _VLC_ChannelState(ByRef $oVLC, $iChannelID, $iReturnType = "0", $sType = "GET")
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
;				   $iChannelID - If $sType = "SET" Then this parameter indizes which channel should be used (see Remarks)
;				   $iReturnType - 0 OR 1, switches the return type; 0 returns just the number of the channel, 1 returns a string
;				   $sType - switches between returning or settings the channel
; Return values .: Success:
;						If $sType = "GET" returns the current channel used
;						If $sType = "SET" returns nothing
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: If $sType = "GET" Then the parameter $iChannelID is ignored, if $sType = "SET" Then the parameter $iReturnType is ignored
;				   $iChannelID can be 1,2,3,4,5; 1 = stereo, 2 = reverse stereo, 3 = left, 4 = right, 5 = dolby
; Related .......:
; ===============================================================================================================================
Func _VLC_ChannelState(ByRef $oVLC, $iChannelID, $iReturnType = "0", $sType = "GET")
	If IsObj($oVLC) And IsInt($iChannelID) And IsInt($iReturnType) And IsString($sType) Then
		Switch $sType
			Case "GET"
				Switch $iReturnType
					Case 0
						Return $oAudio.channel

					Case 1
						Switch $oAudio.channel
							Case 1
								Return "stereo"
							Case 2
								Return "reverse stereo"
							Case 3
								Return "left"
							Case 4
								Return "right"
							Case 5
								Return "dolby"

						EndSwitch
				EndSwitch

			Case "SET"
				Return $oAudio.channel = $iChannelID

			Case Else
				Return -2
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_ChannelState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_Obj_Init
; Description ...: Creates the VLC Object
; Syntax.........: _VLC_Obj_Init()
; Parameters ....:
; Return values .: Success: Returns the VLC Object and intializes 3 other necessary objects
; 				   Failure: -1 if object could not be created
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_Obj_Init()
	$oVLC = ObjCreate("VideoLAN.VLCPlugin.2")
	If IsObj($oVLC) Then
		$oPlaylist = __VLC_PlaylistObj($oVLC)
		$oAudio = __VLC_AudioObj($oVLC)
		$oLog = __VLC_LogObj($oVLC)
		$oInput = __VLC_InputObj($oVLC)
		Return $oVLC
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_Obj_Init

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetCurVersion
; Description ...: Returns the version of the VLC plugin
; Syntax.........: _VLC_GetCurVersion(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns the version
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
; Related .......:
; ===============================================================================================================================
Func _VLC_GetCurVersion(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oVLC.VersionInfo
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetCurVersion

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_GetPluginInfo
; Description ...: Returns information about the plugin
; Syntax.........: _VLC_GetPluginInfo(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: Returns an 1D-array containing the information
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......:
;					[0] = Name of the dispatch interface being used
;					[1] = Description of the (document) Object
;					[2] = The ProgID of the Object
;					[3] = The DLL file from with the Object was created
;					[4] = Filename and position of the toolbox icon
; Related .......:
; ===============================================================================================================================
Func _VLC_GetPluginInfo(ByRef $oVLC)
	Local $aInfo[5]
	If IsObj($oVLC) Then
		For $i = 1 To 5
			$aInfo[$i - 1] = ObjName($oVLC, $i)
		Next
		Return $aInfo
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_GetPluginInfo

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_AutoPlayState
; Description ...: Sets/Gets the autoplay state
; Syntax.........: _VLC_AutoPlayState(ByRef $oVLC, $bAutoPlay, $sType = "GET")
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success:
; 						If $sType = "GET" returns True if AutoPlay is enable, false if AutoPlay is disable
; 						If $sType = "SET" returns nothing
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: If $sType is "GET the parameter $bAutoPlay is ignored
; Related .......:
; ===============================================================================================================================
Func _VLC_AutoPlayState(ByRef $oVLC, $bAutoPlay, $sType = "GET")
	If IsObj($oVLC) And IsBool($bAutoPlay) Then
		Switch $sType
			Case "GET"
				Return $oVLC.AutoPlay

			Case "SET"
				Return $oVLC.AutoPlay = $bAutoPlay
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_AutoPlayState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_AutoLoopState
; Description ...: Sets/Gets the autoloop state
; Syntax.........: _VLC_AutoLoopState(ByRef $oVLC, $bAutoLoop, $sType = "GET")
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success:
; 						If $sType = "GET" returns True if Autoloop is enable, false if Autoloop is disable
; 						If $sType = "SET" returns nothing
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: If $sType is "GET" the parameter $bAutoLoop is ignored
; Related .......:
; ===============================================================================================================================
Func _VLC_AutoLoopState(ByRef $oVLC, $bAutoLoop, $sType = "GET")
	If IsObj($oVLC) And IsBool($bAutoLoop) Then
		Switch $sType
			Case "GET"
				Return $oVLC.AutoLoop

			Case "SET"
				Return $oVLC.AutoLoop = $bAutoLoop
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_AutoLoopState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_BaseURLState
; Description ...: Sets/Gets the base URL
; Syntax.........: _VLC_BaseURLState(ByRef $oVLC, $sPath, $sType = "GET")
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success:
; 						If $sType = "GET" returns the BASE URL
; 						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.
;						If you look for the return value, a comparison will be made.
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; Remarks .......: If $sType is "GET" the parameter $sPath is ignored
;				   If no BaseURL was set, the function will return an empty string if asking for the BaseURL
; Related .......:
; ===============================================================================================================================
Func _VLC_BaseURLState(ByRef $oVLC, $sPath, $sType = "GET")
	If IsObj($oVLC) And IsString($sPath) And IsString($sType) Then
		Switch $sType
			Case "GET"
				Return $oVLC.BaseURL

			Case "SET"
				Return $oVLC.BaseURL = $sPath

			Case Else
				Return -2
		EndSwitch
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_BaseURLState

; #FUNCTION# ====================================================================================================================
; Name...........: _VLC_HasVout
; Description ...: Returns whether the current item displays a video
; Syntax.........: _VLC_HasVout(ByRef $oVLC)
; Parameters ....: $oVLC     - Object Variable returned by _VLC_Obj_Init
; Return values .: Success: True = Video is displayed by item
;							False = No Video is displayed by item
; 				   Failure: -1 (if $oVLC is no object)
;
; Author ........: Thomas Eizinger (oetzn - autoit.de)
; Modified.......:
; 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
; Related .......:
; ===============================================================================================================================
Func _VLC_HasVout(ByRef $oVLC)
	If IsObj($oVLC) Then
		Return $oInput.hasVout
	Else
		Return -1
	EndIf
EndFunc   ;==>_VLC_HasVout


; #INTERNAL_USE_ONLY#==============================================================================
; =================================================================================================

Func __VLC_PlaylistObj(ByRef $oVLC)
	If IsObj($oVLC) Then Return $oVLC.playlist
EndFunc   ;==>__VLC_PlaylistObj

Func __VLC_LogObj(ByRef $oVLC)
	If IsObj($oVLC) Then Return $oVLC.log
EndFunc   ;==>__VLC_LogObj

Func __VLC_AudioObj(ByRef $oVLC)
	If IsObj($oVLC) Then Return $oVLC.audio
EndFunc   ;==>__VLC_AudioObj

Func __VLC_InputObj(ByRef $oVLC)
	If IsObj($oVLC) Then Return $oVLC.input
EndFunc   ;==>__VLC_InputObj

Func _InitComErrFunc()
	Global $g_eventerror = 0
	$oError = ObjEvent("AutoIt.Error", "_ComErrorObj")
	If IsObj($oError) Then Return $oError
EndFunc   ;==>_InitComErrFunc

Func _ComErrorObj()
	MsgBox(48, "COM/OBJECT ERROR!", "Errorcode: 0x" & Hex($oError.number, 8) & @CRLF & _
			"Error in line: " & $oError.scriptline & @CRLF & _
			"Error describition: " & $oError.windescription)
;~ 			"$oError.lastdllerror: " & $oError.lastdllerror & @CRLF & _
;~ 			"$oError.description: " & $oError.description & @CRLF & _
;~ 			"$oError.helpfile: " & $oError.helpfile & @CRLF & _
;~ 			"$oError.source: " & $oError.source & @CRLF & _
;~ 			"$oError.helpcontext: " & $oError.helpcontext & @CRLF & _
;~ 	)
	$g_eventerror = 1
EndFunc   ;==>_ComErrorObj

; =================================================================================================
; =================================================================================================