 		case read
 		case write
 	}
+    
+    private enum LevelBarType {
+        case upper
+        case lower
+        case single
+    }
 
 	@IBInspectable public var meteringLevelBarWidth: CGFloat = 3.0 {
 		didSet {

		let offset = max(self.currentMeteringLevelsArray.count - self.maximumNumberBars, 0)

		for index in offset..<self.currentMeteringLevelsArray.count {
			self.drawBar(index - offset, meteringLevelIndex: index, isUpperBar: true, context: context)
			self.drawBar(index - offset, meteringLevelIndex: index, isUpperBar: false, context: context)
		}
	}

	private func drawBar(_ barIndex: Int, meteringLevelIndex: Int, isUpperBar: Bool, context: CGContext) {
		context.saveGState()

		var barPath: UIBezierPath!

		let xPointForMeteringLevel = self.xPointForMeteringLevel(barIndex)
		let heightForMeteringLevel = self.heightForMeteringLevel(self.currentMeteringLevelsArray[meteringLevelIndex])

		if isUpperBar {
			barPath = UIBezierPath(roundedRect: CGRect(x: xPointForMeteringLevel, y: self.centerY - heightForMeteringLevel,
				width: self.meteringLevelBarWidth, height: heightForMeteringLevel), cornerRadius: self.meteringLevelBarCornerRadius)
		} else {
			barPath = UIBezierPath(roundedRect: CGRect(x: xPointForMeteringLevel, y: self.centerY, width: self.meteringLevelBarWidth,
				height: heightForMeteringLevel), cornerRadius: self.meteringLevelBarCornerRadius)
		}

		UIColor.black.set()
		barPath.fill()


			self.setNeedsDisplay()
		}
	}
    @IBInspectable public var meteringLevelBarSingleStick: Bool = false {
        didSet {
            self.setNeedsDisplay()
        }
    }

	public var audioVisualizationMode: AudioVisualizationMode = .read
	
