I'm wondering if there is a problem with the filename of the MIDI file in question.
This is the start of the PlayMidi function...
procedure PlayMidi(midiFileName : NSString);
var
path: NSString;
url : NSURL;
err : NSError;
begin
// Do nothing if already playing a midi file
if(myMidiPlayer.IsPlaying) then
exit;
// If player has not been paused
if(filePOS = 0) then
begin
// Path to your application bundle's resource directory
// with the midi filename appended
path := NSBundle.mainBundle.resourcePath.stringByAppendingPathComponent(midiFileName);
url := NSURL.fileURLWithPath(path);
I thought I would try to monitor the state of
path and
url, because
url is used in the creation of the AVMidiPlayer object.
if Form1.PathLabel.Caption='PathLabel' then;
Form1.PathLabel.Caption:=path;
if Form1.URLLabel.Caption='URLLabel' then;
Form1.URLLabel.Caption:=url;
This, of course, doesn't work because
path is an
NSString and
url is an
NSUrl. How do I convert them to TLabel.Caption-friendly strings?
[Edited to add code tags.]