ABButtonTrigger Class Reference

Button trigger. More...

#import <ABButtonTrigger.h>

Inherits ABTrigger.

Instance Methods

(id) - init
 Designated initializer.
 
(void) - setTitle:forState:
 Set the title for a given state.
 
(NSString *) - titleForState:
 Get title for the given state.
 
(void) - setIcon:forState:
 Set the icon for a given state.
 
(UIImage *) - iconForState:
 Get icon for the given state.
 
(void) - setColor:forState:
 Set the color for a given state.
 
(UIColor *) - colorForState:
 Get color for the given state.
 
(void) - addBlock:forRemoteControlEvents:
 Add a block to be called in response to events within Audiobus Remote.
 

Class Methods

(ABButtonTrigger *) + buttonTriggerWithTitle:icon:block:
 Create a button trigger.
 
- Class Methods inherited from ABTrigger
(ABTrigger *) + triggerWithSystemType:block:
 Create a trigger with a system type.
 
(ABTrigger *) + triggerWithTitle:icon:block:
 Create a custom trigger.
 

Additional Inherited Members

- Properties inherited from ABTrigger
ABTriggerState state
 Trigger state.
 
ABTriggerPerformBlock block
 Block to be performed on trigger activation/update.
 
uint32_t numericIdentifier
 A numeric (or fourcc) identifier for the trigger, such as 'trig'.
 

Detailed Description

Button trigger.

This class implements a kind of trigger that appears as a button.

Method Documentation

+ (ABButtonTrigger*) buttonTriggerWithTitle: (NSString *)  title
icon: (UIImage *)  icon
block: (ABTriggerPerformBlock block 

Create a button trigger.

Parameters
titleA user-readable title (used for accessibility)
iconA icon of maximum dimensions 80x80, to use to draw the trigger button. This icon will be used as a mask to render the inset button effect. Icon size should be divisible by 2.
blockBlock to be called when trigger is activated
- (id) init

Designated initializer.

- (void) setTitle: (NSString *)  title
forState: (ABTriggerState state 

Set the title for a given state.

Parameters
titleUser-readable title (used for accessibility)
stateState to apply title to
- (NSString*) titleForState: (ABTriggerState state

Get title for the given state.

Parameters
stateA state
Returns
Title for state
- (void) setIcon: (UIImage *)  icon
forState: (ABTriggerState state 

Set the icon for a given state.

Parameters
iconA icon of maximum dimensions 80x80, to use to draw the trigger button. This icon will be used as a mask to render the inset button effect. Icon size should be divisible by 2.
stateState to apply icon to
- (UIImage*) iconForState: (ABTriggerState state

Get icon for the given state.

Parameters
stateA state
Returns
Icon for state
- (void) setColor: (UIColor *)  color
forState: (ABTriggerState state 

Set the color for a given state.

By default, normal state icons are drawn in 50% grey, selected icons are drawn in 20% grey unless a custom selected state icon is provided, in which case it is also drawn in 50% grey. Alternate state icons are drawn in green. Triggers with system state ABTriggerTypeRecordToggle are drawn in red.

Parameters
colorThe color to use to render the icon for the given state
stateState to apply color to
- (UIColor*) colorForState: (ABTriggerState state

Get color for the given state.

Parameters
stateA state
Returns
Color for state
- (void) addBlock: (ABTriggerPerformBlock block
forRemoteControlEvents: (UIControlEvents)  controlEvents 

Add a block to be called in response to events within Audiobus Remote.

This method allows your app to react to UIControlEventTouchDown, UIControlEventTouchUpInside UIControlEventTouchUpOutside, UIControlEventTouchCancel events originating from Audiobus Remote.

This method must only used with triggers that have been added using ABAudiobusController's addRemoteTrigger: and addRemoteTriggerMatrix:rows:cols: methods.

Parameters
blockThe block executed if control event occurs.
controlEventsThe UIControlEvents for which the block shall be executed.

The documentation for this class was generated from the following file: