On Apr 24, 2010, at 12:52 PM, Izak van Langevelde <eezac...@xs4all.nl> wrote:

The table shows a so-called 'exposure sheet' for an animation, where each row corresponds to one frame, and the columns correspond to the various foreground and background animation layers. There is one column for audio, and for synchronization purposes it is nice to show a wave form of the audio. However, the waveform is fixed, i.e. not editable, so adding and deleting table rows only affects the position fn table rows with respect to the audio: the audio is background, both as audio and as picture. Columns are not sortable, although it would be nice to be able to reorder them.

It sounds like you're going for something similar to what you'd see if you looked at a reel of 8mm film.

Since at some point you have to generate the entire waveform as one image, I'd probably use a custom NSCell subclass in the appropriate column, and point it at the NSImage that contains your waveform. Then when the tableview goes to draw that cell in a row (I believe the delegate method informing you of this is called - tableView:willDisplayCell: or something similar) I'd poke the cell to tell it what offset into the image it should draw. The cell's drawing method would then draw the subset of the waveform image.

This avoids the problem you describe of creating tons of image slices; there's only one NSImage object but your cells are smart enough to share it and only draw the relevant parts when asked.

HTH,
--Kyle Sluder
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to