I'm having two problems. I'm using XCode 3.2.3 and coding for iPhone 3.2 and
4.0 (same problems), both the simulator and the device. Dev machine runs OSX
10.6.4.
I am using DSMI by just grabbing the libdsmi_iphone.m and the libdsmi_iphone.h
and including them in the project. For good luck, I also include the CFNetwork
framework.
PROBLEM 1
Can't use libdsmi_iphone as an instance variable (I'm using a nonatomic retain
property) in a UIViewController. If I use this code in my viewDidLoad method,
it fires and retains the libdsmi (I should release after, but I don't for this
test):
self.libdsmi = [[libdsmi_iphone alloc] init];
then this code, in a slider-move method
[self.libdsmi writeMIDIMessage:MIDI_CC MIDIChannel:0 withData1:1 withData2:counter++];
does nothing. This would all be irrelevant, except that this works in the
onChange method
libdsmi_iphone *midiLib = [[libdsmi_iphone alloc] init];
[midiLib writeMIDIMessage:MIDI_CC MIDIChannel:0 withData1:1 withData2:counter++];
[midiLib release];
Not sure what this might be about. If I initialize an NSString in the same
place, it gets read just fine in the onChange method (so it's not a basic
coding/conceptual error).
PROBLEM 2
I am only able to send 82 messages. This is strange as can be:
libdsmi_iphone *midiLib = [[libdsmi_iphone alloc] init];
[midiLib writeMIDIMessage:MIDI_CC MIDIChannel:0 withData1:1 withData2:counter++];
[midiLib release];
Counter gets to 81 and then I receive no more on the server-side. it's not the
value of counter, because I can send up to 127 with no problems.
Perhaps I need to set some delegates or something so a buffer somewhere can
drain...?
Thanks and thanks for your help and this great library!
Original issue reported on code.google.com by
dr2...@gmail.comon 7 Sep 2010 at 2:16