forked from charlieroberts/midiStroke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartNote.m
51 lines (43 loc) · 1.42 KB
/
StartNote.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import "StartNote.h"
@implementation StartNote
- (id) init {
if (self = [super init]) {
NSArray * keys = [NSArray arrayWithObjects: @"number", @"channel", @"ccValue", nil];
NSArray * values = [NSArray arrayWithObjects: @"45",@"1",@"", nil];
properties = [[NSMutableDictionary alloc] initWithObjects: values forKeys: keys];
endNotes = [[NSMutableArray alloc] init];
}
return self;
}
- (id) initWithCoder: (NSCoder *) coder {
if (self = [super init])
{
[self setProperties: [coder decodeObjectForKey:@"properties"]];
[self setEndNotes: [coder decodeObjectForKey:@"endNotes"]];
}
return self;
}
- (void) encodeWithCoder: (NSCoder *) encoder {
[encoder encodeObject: properties forKey:@"properties"];
[encoder encodeObject:endNotes forKey:@"endNotes"];
}
- (void) dealloc { [properties release]; [endNotes release]; [super dealloc]; }
- (NSMutableDictionary *) properties { return properties; }
- (void) setProperties: (NSDictionary *)newProperties {
if (properties != newProperties) {
[properties autorelease];
properties = [[NSMutableDictionary alloc] initWithDictionary: newProperties];
}
}
- (NSMutableArray *) endNotes;
{
return endNotes;
}
- (void) setEndNotes: (NSArray *)newEndNotes
{
if (endNotes != newEndNotes) {
[endNotes autorelease];
endNotes = [[NSMutableArray alloc] initWithArray: newEndNotes];
}
}
@end