Re: highlight a nsview on click-drag?

2015-03-17 Thread Graham Cox
On 17 Mar 2015, at 10:28 pm, Sandor Szatmari admin.szatmari@gmail.com wrote: I like the simplicity of your design, but considering point b, how does a play head that spans multiple tracks, for a multi track editing interface, work? Presumably, we're talking about each view managing

Re: highlight a nsview on click-drag?

2015-03-17 Thread Sandor Szatmari
Graham, On Mar 15, 2015, at 18:57, Graham Cox graham@bigpond.com wrote: If I were designing this, I'd probably have a single NSView subclass that handled three things: a) optimally drawing the waveform, b) maintaining and drawing the playhead and I like the simplicity of your design,

Re: highlight a nsview on click-drag?

2015-03-15 Thread Robert Martin
Why bother with a timer loop to animate the wiper when that functionality is built-in through CoreAnimation? Especially since you are using an image as the wave background. CoreAnimation will move the wiper smoothly and accurately. All you have to do is provide the distance it must travel and

Re: highlight a nsview on click-drag?

2015-03-15 Thread Patrick J. Collins
A fairly simple way to implement a selection rectangle is to use CALayer, but that only gives you the visual aspect. What does it select? Answer that question first and that will tend to lead you to the appropriate way to implement it. This NSView is of an audio waveform. I currently have my

Re: highlight a nsview on click-drag?

2015-03-15 Thread Patrick J. Collins
Why bother with a timer loop to animate the wiper when that functionality is built-in through CoreAnimation? Especially since you are using an image as the wave background. I guess because I like the playhead being tied to the actual current sample position, not a separate animation that is

Re: highlight a nsview on click-drag?

2015-03-15 Thread Kyle Sluder
On Sun, Mar 15, 2015, at 02:22 AM, Patrick J. Collins wrote: My next approach was to save my drawn waveform to an NSImage and use that as a background for my view... If you have a better suggestion for how I could handle this, I'd love to hear it. This is a good idea. It would be better yet

Re: highlight a nsview on click-drag?

2015-03-15 Thread Graham Cox
On 15 Mar 2015, at 7:22 pm, Patrick J. Collins patr...@collinatorstudios.com wrote: This NSView is of an audio waveform. I currently have my drawRect: method draw the lines of my waveform, Have you designed it so that it only draws the minimum it needs to? For example, if your audio

Re: highlight a nsview on click-drag?

2015-03-14 Thread Graham Cox
On 15 Mar 2015, at 3:44 am, Patrick J. Collins patr...@collinatorstudios.com wrote: Is there anything built-in that does this for me? No. You need to stop thinking this way. Cocoa does a lot, but it doesn't do everything. It goes only as far as very general solutions to very general

highlight a nsview on click-drag?

2015-03-14 Thread Patrick J. Collins
I have a NSView with a background image, and am wondering, what is the best / easiest way to create the behavior so that if I click on a point within this NSView and drag a direction, the click point to the current mouse position would then be highlighted (inverse the colors of the image for that