Re: Get controller from nib
Re: Get controller from nib
- Subject: Re: Get controller from nib
- From: James Maxwell <email@hidden>
- Date: Tue, 18 May 2010 17:00:53 -0700
okay, so I kind of hacked around it. I gave my AppController (which is a delegate of File's Owner) an outlet for the Central_MIDI_Controller, and hooked that up in IB. Then I also gave the AppController an accessor for "midiController", that returns the reference to Central_MIDI_Controller connected in IB.
From the MIDIInstrument init, I can run [[NSApp delegate] midiController] and get the instance of Central_MIDI_Controller loaded in the nib. As I say, it feels a bit hackish. Though it does work, and advice is still welcome.
cheers,
J.
On 2010-05-18, at 4:28 PM, James Maxwell wrote:
>
> Hello All,
>
> I'm working on MIDI set-up customization for my music app. I have a main controller object, called Central_MIDI_Controller, that uses the VVMIDI framework to detect MIDI ports, and handle low-level MIDI stuff. I have an object called MIDIInstrument, which is a simple wrapper-type object, intended to bundle together a name string with a MIDI port, channel, and some program change "presets", defined by the user.
> I've put the Central_MIDI_Controller in my MainMenu.nib, and it's settings are stored in the UserDefaults. I put it there because I want it to persist across different documents. What I'm wondering about is how to get the list of available MIDI ports to the MIDIInstrument objects, which will be created dynamically, as the user creates customized instances of MIDIInstrument.
> What I'm not understanding is how to allow newly created MIDIInstrument objects to read the available/enabled ports from Central_MIDI_Controller. I know this is probably really simple, but how do I grab a reference to a controller object loaded only in the MainMenu.nib file?
>
> thanks in advance,
>
> J.
>
>
>
> James B Maxwell
> Composer/Doctoral Student
> School for the Contemporary Arts (SCA)
> School for Interactive Arts + Technology (SIAT)
> Simon Fraser University
> email@hidden
> email@hidden
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
James B Maxwell
Composer/Doctoral Student
School for the Contemporary Arts (SCA)
School for Interactive Arts + Technology (SIAT)
Simon Fraser University
email@hidden
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden