SoundViewController

class SoundViewController : UIViewController, UICollisionBehaviorDelegate

Sound View Controller DUPLICATED means this also appears on the Music View Controller

  • Declare db to load options DUPLICATED

    Declaration

    Swift

    let dbInterface: <<error type>>
  • DUPLICATED

    Declaration

    Swift

    let sensorManager: <<error type>>
  • Helpful dictionary to find code from beep string

    Declaration

    Swift

    var getBeepCode: [String : Int]
  • DUPLICATED

    Declaration

    Swift

    @IBOutlet
    weak var menuButton: UIBarButtonItem!
  • DUPLICATED Progress bar

    Declaration

    Swift

    @IBOutlet
    weak var stackViewBar: UIStackView!
  • DUPLICATED Over the range

    Declaration

    Swift

    @IBOutlet
    weak var progressBarOverflowUI: UIProgressView!
  • DUPLICATED Under the range

    Declaration

    Swift

    @IBOutlet
    weak var progressBarUnderflow: UIProgressView!
  • DUPLICATED Calculate how full each progress bar should be: The progress bars are: The one that shows how far under the range they are The one that shows where in the range The one that shows how far over the range they are

    Declaration

    Swift

    @objc
    func updateProgress(notification: NSNotification)

    Parameters

    notification

    contains the current progress

  • DUPLICATED Calculate the size of each progress bar on the screen: The progress bars are: The one that shows how far under the range they are The one that shows where in the range The one that shows how far over the range they are

    Declaration

    Swift

    func updateProgressView()
  • Defintions for beacons DUPLICATED

    Declaration

    Swift

    let locationManager: CLLocationManager
  • Declare variables that are loaded from profile DUPLICATED

    Declaration

    Swift

    var selectedProfile: String
  • DUPLICATED Load a user profile into global memory using the global selectedProfile

    Declaration

    Swift

    func loadProfile()
  • DUPLICATED Allow the user to update the sweep range on the fly Will update the view of the progress bars

    Declaration

    Swift

    @IBAction
    func sweepRangeSlider(_ sender: UISlider)
  • This is a function that gets activated whenever the start/stop button is pressed It will give feedback when it is looking for a connection and when it found one It should connect and init the audio player when started It should eset number beeps, stop the audio and disconnect when stopped

    Declaration

    Swift

    @IBAction
    func controlButton(_ sender: Any)
  • Creates a large array that will be filled with false and some true at the specified indices (the first is controlled by the user while the rest are hardcoded) The main sweep loop will reference this array at each index to see whether to play the reward music

    Declaration

    Swift

    func populateRewards() -> ([Int : Bool])
  • When the sview is loaded function will (in order) 1.Call the super view

    1. Create the side menu
    2. Choose which user profile is being used via default settings
    3. Load the profile preference
    4. Dynamically change the progress bars according to preferences
    5. Register functions for calls from other files (create observers)
    6. Handle Beacon stuff
    7. Center the text in the dynamic view

    Declaration

    Swift

    override func viewDidLoad()
  • For Beacons DUPLICATED

    Declaration

    Swift

    func addViewController(atOffset offset: CGFloat, dataForVC data: AnyObject?) -> UIView?
  • For Beacons DUPLICATED

    Declaration

    Swift

    @objc
    func handlePan(gestureRecognizer: UIPanGestureRecognizer)
  • For Beacons DUPLICATED

    Declaration

    Swift

    func pin(view: UIView)
  • For Beacons DUPLICATED

    Declaration

    Swift

    func setVisibility(view: UIView, alpha: CGFloat)
  • For Beacons DUPLICATED

    Declaration

    Swift

    func addVelocity(toView view: UIView, fromGestureRecognizer panGesture: UIPanGestureRecognizer)
  • For Beacons DUPLICATED

    Declaration

    Swift

    func itemBehavior(forView view: UIView) -> UIDynamicItemBehavior?
  • For Beacons DUPLICATED

    Declaration

    Swift

    func collisionBehavior(_ behavior: UICollisionBehavior, endedContactFor item: UIDynamicItem, withBoundaryIdentifier identifier: NSCopying?)
  • This function is called when the user switched cane movement directions. If the sweep is long enough it will beep or speak the count (depending on the mode) Also if the sweep activated is one of the key numbers to play music, it will play the selected song Parameter notification: Passed in container that has the length of the sweep

    Declaration

    Swift

    @objc
    func processSweeps(notification: NSNotification)
  • Honestly have no idea what’s going on here

    Declaration

    Swift

    func centralManagerDidUpdateState(_ central: CBCentralManager)