TimerSettingTuple

class TimerSettingTuple : NSObject, NSCoding

This is the basic element that describes one timer.

  • These are the default thresholds that we apply to our timer when automatically determining the traffic lights for podium mode.

    Declaration

    Swift

    private static let _podiumModeWarningThreshold: Float
  • A preset final threshold (half the warning)

    Declaration

    Swift

    private static let _podiumModeFinalThreshold: Float
  • This enum contains all the various timer state Dictionary keys.

    See more

    Declaration

    Swift

    private enum TimerStateKeys : String
  • This is the App Status object that owns this instance.

    Declaration

    Swift

    var handler: LGV_Timer_State!
  • This will be used to track the timer progress.

    Declaration

    Swift

    var firstTick: TimeInterval
  • This will be used to track the timer progress.

    Declaration

    Swift

    var lastTick: TimeInterval
  • This is the color from the color theme, and is used to transmit the color to the watch.

    Declaration

    Swift

    var storedColor: AnyObject!
  • uid

    This will be a unique ID, assigned to the pref, so we can match it.

    Declaration

    Swift

    var uid: String
  • This is how the timer will display

    Declaration

    Swift

    var displayMode: TimerDisplayMode { get set }
  • This determines what kind of alert the timer makes when it is complete.

    Declaration

    Swift

    var alertMode: AlertMode { get set }
  • This determines what kind of sound the timer makes when it makes sounds.

    Declaration

    Swift

    var soundMode: SoundMode { get set }
  • This is the 0-based index for the color theme.

    Declaration

    Swift

    var colorTheme: Int { get set }
  • This will be the 0-based ID of a sound for this timer.

    Declaration

    Swift

    var soundID: Int { get set }
  • This will be the 0-based ID of a following timer for this. -1, if no succeeding timer.

    Declaration

    Swift

    var succeedingTimerID: Int { get set }
  • This will be a boolean value that is true if the timer is to make audible ticks and transition noises.

    Declaration

    Swift

    var audibleTicks: Bool { get set }
  • This is the URI of a selected song to play as an alarm.

    Declaration

    Swift

    var songURLString: String { get set }
  • This is the set (start) time for the countdown timer. It is an integer, with the number of seconds (0 - 86399)

    Declaration

    Swift

    var timeSet: Int { get set }
  • This is the number of seconds (0 - 86399) before the yellow light comes on in Podium Mode. If 0, then it is automatically calculated.

    Declaration

    Swift

    var timeSetPodiumWarn: Int { get set }
  • This is the number of seconds (0 - 86399) before the red light comes on in Podium Mode. If 0, then it is automatically calculated.

    Declaration

    Swift

    var timeSetPodiumFinal: Int { get set }
  • The actual time for this timer.

    Declaration

    Swift

    var currentTime: Int { get set }
  • This is the current status of this timer.

    Declaration

    Swift

    var timerStatus: TimerStatus { get set }
  • The actual time for this timer, as a long, spoken text string.

    Declaration

    Swift

    var setSpeakableTime: String { get }
  • The actual time for this timer, as a numerical only, spoken text string.

    Declaration

    Swift

    var currentQuickSpeakableTime: String { get }
  • Declaration

    Swift

    var dictionary: [String : Any] { get set }

    Return Value

    The state, as a simple dictionary object.

  • Default initializer

    Declaration

    Swift

    override init()
  • Initialize just like a tuple.

    Declaration

    Swift

    convenience init(timeSet: Int, timeSetPodiumWarn: Int, timeSetPodiumFinal: Int, currentTime: Int, displayMode: TimerDisplayMode, colorTheme: Int, alertMode: AlertMode, soundMode: SoundMode, alertVolume: Int, soundID: Int, succeedingTimerID: Int, audibleTicks: Bool, songURLString: String, timerStatus: TimerStatus, uid: String!, handler: LGV_Timer_State! = nil)

    Parameters

    timeSet

    This is the set (start) time for the countdown timer. It is an integer, with the number of seconds (0 - 86399)

    timeSetPodiumWarn

    This is the number of seconds (0 - 86399) before the yellow light comes on in Podium Mode. If 0, then it is automatically calculated.

    timeSetPodiumFinal

    This is the number of seconds (0 - 86399) before the red light comes on in Podium Mode. If 0, then it is automatically calculated.

    displayMode

    This is how the timer will display

    colorTheme

    This is the 0-based index for the color theme.

    alertMode

    This determines what kind of alert the timer makes when it is complete.

    soundMode

    This determines what kind of sound the timer makes when it makes sounds.

    soundID

    This is the ID of the sound to play (when in mode 1 or 2).

    succeedingTimerID

    This is the ID of the next timer to play after this one.

    audibleTicks

    This is a boolean that, if true, means that each second’s transition will be marked by an audible tick, as well as transitions from one state to another.

    songURLString

    This is a String, containing a music URL (when in mode 1 or 2).

    uid

    This is a unique ID for this setting. It can be defaulted.

    handler

    This is the owner of this instance. Default is nil.

  • Initialize from a stored dictionary.

    Declaration

    Swift

    convenience init(dictionary: [String : Any], handler: LGV_Timer_State! = nil)

    Parameters

    dictionary

    This is a Dictionary that contains the state.

    handler

    This is the owner of this instance. Default is nil.

  • Returns the value in an easily readable format.

    Declaration

    Swift

    override var description: String { get }
  • Returns true if this is selected.

    Declaration

    Swift

    var selected: Bool { get set }
  • This calculates the auto-calculation for the warning, or yellow traffic light for the Podium Mode timer.

    Declaration

    Swift

    class func calcPodiumModeWarningThresholdForTimerValue(_ inTimerSet: Int) -> Int

    Parameters

    inTimerSet

    The value of the countdown timer.

    Return Value

    an Int, with the warning threshold.

  • This calculates the auto-calculation for the final, or red traffic light for the Podium Mode timer.

    Declaration

    Swift

    class func calcPodiumModeFinalThresholdForTimerValue(_ inTimerSet: Int) -> Int

    Parameters

    inTimerSet

    The value of the countdown timer.

    Return Value

    an Int, with the final threshold.

  • Equatable operator. Simply compares the UIDs

    Declaration

    Swift

    static func == (left: TimerSettingTuple, right: TimerSettingTuple) -> Bool

    Parameters

    left

    The left timer object.

    right

    The right timer object.

    Return Value

    true, if the UIDs match.

  • Delete thyself.

    Declaration

    Swift

    func seppuku()
  • Initialize from a serialized state.

    Declaration

    Swift

    required init?(coder: NSCoder)

    Parameters

    coder

    The coder containing the state

  • Serialize the object state.

    Declaration

    Swift

    func encode(with: NSCoder)

    Parameters

    with

    The coder we’ll be setting the state into.