DRMSFFormatter Class Reference

Inherits from
Conforms to
Availability
Available in OS X v10.2 and later.
Declared in
DRMSFFormatter.h

Overview

NSFormatter subclass

Instances of DRMSFFormatter format the textual representation of cells that contain MSF objects and convert textual representations of msf values into MSF objects. DRMSFFormatters are typically instantiated in IB using the DiscRecording Interface builder palette.

Tasks

Miscellaneous

Instance Methods

format

Returns the format string to the caller

- (NSString*) format;
Availability
  • Available in OS X v10.2 and later.
Declared In
DRMSFFormatter.h

initWithFormat:

Initializes the formatter with the format string

- (id) initWithFormat:(NSString*)format;
Parameters
format

An NString specifying the printf-style format string.

Return Value

A DRMSFFormatter

Availability
  • Available in OS X v10.2 and later.
Declared In
DRMSFFormatter.h

setFormat:

Sets the format string of the receiver

- (void) setFormat:(NSString*)format;
Parameters
format

An NString specifying the printf-style format string.

Discussion

The format string is very similar to a printf-style format string with %-escaped formatting characters.

  • %% A "%" character

  • %m Minutes as a decimal number

  • %s Seconds as a decimal number

  • %f Frames as a decimal number

In addition to these formatting characters an optional length specifier can come between then % and the formatting character. This length specifier will force the field in question to be at least that wide. for example a format specifier of "%02m:%02s" will cause a DRMSF object representing 3 minutes 9 seconds to be formatted as "03:09".

A formatter is aware of and respects rounding. If a bit of the msf is not zero, but the format does not display that value, the next higher value will be increased by one to reflect that. Extending our example above, an DRMSF with a value of 3 minutes, 9 seconds, 15 frames using a format specfier of "%02m:%02s", will be formatted as "03:10" since the 15 frames rounds up the seconds to the next value

Availability
  • Available in OS X v10.2 and later.
Declared In
DRMSFFormatter.h