I tried to send this on Friday, but alas, it was over the size limit. So, I am posting in installments; this is the first of four...
In our Cocoa app we create custom tracks in a music sequence and populate them with our own events. At runtime this works quite well. However, now I'm trying to implement Save/Open. As you can see from the log output below, the basic track information persists (MIDI track name event) but the custom UserEvents do not. Is this a bug or am I missing something in my code?
Here are the Save & Open functions:
- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { [ self buildSequence ];
CAShow( _curSequence ); // for debugging CFDataRef dataRef; if( MusicSequenceSaveSMFData( _curSequence, &dataRef, 480 ) != noErr ) [ NSException raise:@"Document::dataOfType" format:@"Cannot save SMF data." ];
return (NSData *)dataRef; }
*************************************************** Craig Hopson, Managing Partner Red Rock Software, Inc. 10 West Broadway, Suite 850 Salt Lake City, UT 84101 office: 801.322.4322 x103 cell: 801.949.3526 http://www.redrocksw.com
|