
local function isDrive( side )
	return peripheral.getType( side ) == "drive"
end

function isPresent( side )
	if isDrive( side ) then
		return peripheral.call( side, "isPresent" )
	end
	return false
end

function hasData( side )
	if isDrive( side ) then
		return peripheral.call( side, "hasData" )
	end
	return false
end

function getMountPath( side )
	if isDrive( side ) then
		return peripheral.call( side, "getMountPath" )
	end
	return nil
end

function setLabel( side, label )
	if isDrive( side ) then
		peripheral.call( side, "setLabel", label )
	end
end

function getLabel( side )
	if isDrive( side ) then
		return peripheral.call( side, "getLabel" )
	end
	return nil
end

function hasAudio( side )
	if isDrive( side ) then
		return peripheral.call( side, "hasAudio" )
	end
	return false
end

function getAudioTitle( side )
	if isDrive( side ) then
		return peripheral.call( side, "getAudioTitle" )
	end
	return nil
end

function playAudio( side )
	if isDrive( side ) then
		peripheral.call( side, "playAudio" )
	end
end

function stopAudio( side )
	if not side then
		for n,sSide in ipairs( redstone.getSides() ) do
			stopAudio( sSide )
		end
	else
		if isDrive( side ) then
			peripheral.call( side, "stopAudio" )
		end
	end
end

function eject( side )
	if isDrive( side ) then
		peripheral.call( side, "eject" )
	end
end
