• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa and PortAudio!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa and PortAudio!


  • Subject: Re: Cocoa and PortAudio!
  • From: David Newberry <email@hidden>
  • Date: Wed, 16 Oct 2002 20:12:57 -0700

Jont,

So, here's the problem. I wanted to implement an NSSlider to change to
pitch of the tone. That wouldn't be much of a problem if it weren't for
the fact that the function that writes the audio buffer is declared as
a normal C++-function and I didn't know but to put it outside of the
implementation of my "MyDocument"-file. It looks something like this in
my Cocoa-App.

...

I'm not an expert, but I would suggest these two possible solutions:

- Instead of a C++ function, make it a method of your controller class. That would allow you to access properties ("instance variables"? Sorry, I'm still used to REALbasic terminology) of your controller ([or the] implementation of your "MyDocument"-file), such as the slider.

You would have to reword the function declaration in the syntax used for methods, but that's all you'd really have to change. (Well, and calling it. You'd just send the message to "self".)

- Leave it as a function, and add another parameter where you'd pass the value of the slider. Since your function would be getting called from a method which would have access to the slider control, you could simply pass it's value into the function and not worry about accessing the slider from inside the function itself.

Good luck on your project, and happy programming. :)

Peace,
-David Newberry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Cocoa developers in Austin, Texas
  • Next by Date: Re: Declarations near usage
  • Previous by thread: Re: Cocoa and PortAudio!
  • Next by thread: NSTextFieldCell subclass won't edit
  • Index(es):
    • Date
    • Thread