diff --git a/Framework/MIKMIDI Tests/MIKMIDISequencerTests.m b/Framework/MIKMIDI Tests/MIKMIDISequencerTests.m new file mode 100644 index 00000000..346ed788 --- /dev/null +++ b/Framework/MIKMIDI Tests/MIKMIDISequencerTests.m @@ -0,0 +1,48 @@ +// +// MIKMIDISequencerTests.m +// MIKMIDI +// +// Created by Andrew Madsen on 3/13/15. +// Copyright (c) 2015 Mixed In Key. All rights reserved. +// + +#import +#import +#import + +@interface MIKMIDISequencerTests : XCTestCase + +@property (nonatomic, strong) MIKMIDISequencer *sequencer; + +@end + +@implementation MIKMIDISequencerTests + +- (void)setUp +{ + [super setUp]; + + self.sequencer = [MIKMIDISequencer sequencer]; +} + +- (void)tearDown +{ + [super tearDown]; +} + +- (void)testBuiltinSynthesizers +{ + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSURL *testMIDIFileURL = [bundle URLForResource:@"bach" withExtension:@"mid"]; + NSError *error = nil; + MIKMIDISequence *sequence = [MIKMIDISequence sequenceWithFileAtURL:testMIDIFileURL convertMIDIChannelsToTracks:NO error:&error]; + XCTAssertNotNil(sequence); + + self.sequencer.sequence = sequence; + for (MIKMIDITrack *track in sequence.tracks) { + MIKMIDISynthesizer *synth = [self.sequencer builtinSynthesizerForTrack:track]; + XCTAssertNotNil(synth, @"-builtinSynthesizerForTrack: test failed, because it returned nil."); + } +} + +@end diff --git a/Framework/MIKMIDI.xcodeproj/project.pbxproj b/Framework/MIKMIDI.xcodeproj/project.pbxproj index 334d1bba..ad8fa2d8 100644 --- a/Framework/MIKMIDI.xcodeproj/project.pbxproj +++ b/Framework/MIKMIDI.xcodeproj/project.pbxproj @@ -247,6 +247,7 @@ 9DBEBD691AAA303700E59734 /* MIKMIDIChannelPressureEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DBEBD661AAA303700E59734 /* MIKMIDIChannelPressureEvent.m */; }; 9DBEBD6A1AAA303700E59734 /* MIKMIDIChannelPressureEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DBEBD661AAA303700E59734 /* MIKMIDIChannelPressureEvent.m */; }; 9DCDDB501AB2363C00F8347E /* Parallax-Loader.mid in Resources */ = {isa = PBXBuildFile; fileRef = 9DCDDB4F1AB2363C00F8347E /* Parallax-Loader.mid */; }; + 9DCDDB5A1AB3514100F8347E /* MIKMIDISequencerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DCDDB591AB3514100F8347E /* MIKMIDISequencerTests.m */; }; 9DE259E519A7B4F800DA93E9 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DE259E419A7B4F800DA93E9 /* AudioUnit.framework */; }; 9DE259E619A7B50100DA93E9 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D74EF2D17A7133900BEE89F /* CoreMIDI.framework */; }; 9DE259E819A7B50600DA93E9 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9DE259E719A7B50600DA93E9 /* AudioToolbox.framework */; }; @@ -422,6 +423,7 @@ 9DBEBD651AAA303700E59734 /* MIKMIDIChannelPressureEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIKMIDIChannelPressureEvent.h; sourceTree = ""; }; 9DBEBD661AAA303700E59734 /* MIKMIDIChannelPressureEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MIKMIDIChannelPressureEvent.m; sourceTree = ""; }; 9DCDDB4F1AB2363C00F8347E /* Parallax-Loader.mid */ = {isa = PBXFileReference; lastKnownFileType = audio.midi; path = "Parallax-Loader.mid"; sourceTree = ""; }; + 9DCDDB591AB3514100F8347E /* MIKMIDISequencerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MIKMIDISequencerTests.m; sourceTree = ""; }; 9DE259E419A7B4F800DA93E9 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; 9DE259E719A7B50600DA93E9 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 9DED4E201AA77DAC00DA8356 /* MIKMIDIPitchBendChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIKMIDIPitchBendChangeEvent.h; sourceTree = ""; }; @@ -488,6 +490,7 @@ 9D4DF13E1AAB57430065F004 /* MIKMIDI_Tests.m */, 9D4DF14C1AAB57800065F004 /* MIKMIDISequenceTests.m */, 9D4DF1531AAB60490065F004 /* MIKMIDITrackTests.m */, + 9DCDDB591AB3514100F8347E /* MIKMIDISequencerTests.m */, 9D4DF13C1AAB57430065F004 /* Supporting Files */, 9D4DF1501AAB57CD0065F004 /* Resources */, ); @@ -1067,6 +1070,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9DCDDB5A1AB3514100F8347E /* MIKMIDISequencerTests.m in Sources */, 9D4DF13F1AAB57430065F004 /* MIKMIDI_Tests.m in Sources */, 9D4DF14D1AAB57800065F004 /* MIKMIDISequenceTests.m in Sources */, 9D4DF1541AAB60490065F004 /* MIKMIDITrackTests.m in Sources */,