[Drawkit] compiling b6

James Maxwell jbmaxwell at rubato-music.com
Thu Aug 27 19:14:41 PDT 2009


Thanks Graham,

That's no problem - I'm not bothered by the warnings.

I'm actually getting back to DrawKit after a long time away. I've been  
working hard at the machine-learning stuff internal to my program (and  
my PhD thesis), and since it's finally showing signs of actually  
working I'm starting to think again about how everything should be  
implemented into my "dream" music app.
You may recall that I needed a "musical grid", in which the vertical  
lines could be moved to account for changes in the rhythmic values  
expressed by the grid: time signatures, beat divisions, and so on. I  
had hacked together a version that just got in and messed with your  
code in a very nasty way. It worked, but it was really ugly. Now that  
I have some more Obj-C and Cocoa experience, I want to try to deal  
with this issue in a more elegant way (I'm going back and recoding  
pretty much everything I did last year). And besides, my old method  
relied on the fact that earlier builds of DK didn't make m_divsCache,  
and its relatives, private. Now that they're private I can't  
manipulate them directly like I used to (of course, I could just hack  
away at your source again, and make those public, but that seems  
really nasty).
So, I'm wondering if you have any thoughts on how I can make a movable  
grid? I really only need to be able to move the vertical grid lines (I  
actually don't want horizontal grid lines at all), but with all of the  
fundamental paths being private, I can't see any way of managing this.

Since you do mention in the documentation that non-traditional grids  
should be possible, given a little subclassing work, I'd appreciate  
any thoughts you might have on where I should starting looking.

thanks,

J.


On 27-Aug-09, at 6:16 PM, Graham Cox wrote:

>
> On 28/08/2009, at 3:08 AM, James Maxwell wrote:
>
>> Just curious. I'm finally getting around to building beta 6, and  
>> I'm getting all sorts of warning about "_a" shadowing a previous  
>> local, when I try to build beta 6.
>> Is this anything to worry about? Does it point to some other  
>> problem in my build directory, perhaps?
>
>
> Hi James,
>
> This is a nuisance - but no more than that. It's caused by the  
> implementation of the MIN and MAX macros. It's not unusual to nest  
> these to clip a value between an upper and a lower limit:
>
>
> val = MAX(MIN(val, upper), lower)
>
> unfortunately when you do this you end up with two local variables  
> called _a in the expansion of the macros (both MIN and MAX chose '- 
> a' whereas they could easily have used something different). It  
> doesn't stop them working properly when nested but it throws up this  
> warning. I should probably get around to filing a bug on this with  
> Apple.
>
> If it bugs you there is DK's own LIMIT macro which clips a value  
> between two limits without this warning. I've been gradually  
> replacing nested MIN/MAX calls with this.
>
> --Graham
>
>
> _______________________________________________
> Drawkit mailing list
> Drawkit at lists.apptree.net
> http://lists.apptree.net/listinfo.cgi/drawkit-apptree.net



More information about the Drawkit mailing list