Re: CAAnimation - Letting it run without stopping when new animation is activated

2009-03-20 Thread Matt Long
Use animation grouping. I you use groups, set beginTime with your offset for each animation's time to start. The duration of each animation must be the full duration of the entire animation put together end to end. Your group animation should also have the same duration. Here's some pseudo

Re: CAAnimation - Letting it run without stopping when new animation is activated

2009-03-20 Thread Matt Long
/xlinterpreter On 21 Mar 2009, at 00:07, Matt Long wrote: Use animation grouping. I you use groups, set beginTime with your offset for each animation's time to start. The duration of each animation must be the full duration of the entire animation put together end to end. Your group animation should

Re: problems with CAAnimation

2009-03-19 Thread Matt Long
Your layer's transform.scale knows nothing of the toValue in the animation. You have to explicitly set it in the layer in addition to animating it. This also means that you need to add the animation using the correct keypath otherwise it will use the default animation instead of yours.

Re: problems with CAAnimation

2009-03-19 Thread Matt Long
Ok. You've just raised the bar! ;-) Seems that you would have to specify the key path you're wanting for each animation which leads me to think you won't be able to use grouping as you envision as setAnimations on the CAAnimationGroup only takes an array rather than a dictionary in which

Re: problems with CAAnimation

2009-03-19 Thread Matt Long
I'll address the issue with the animation ignoring your duration first. Try placing your addAnimation call before the setValue:forKeyPath. Let me know if that works. Also, you will *need* to specify a fromValue in your animation. If you want the current value (in the case where an

Re: subLayers - GPU - optimizing

2009-03-09 Thread Matt Long
A crash when trying to add your layer again after a call to removeFromSuperlayer suggests that you're not retaining the layer and it's been autoreleased. You either need to re-allocate each time or retain it yourself. How are you allocating your CALayer inside of your Layer object? -Matt

Re: Core animation - Safari Find effect

2009-02-04 Thread Matt Long
It's not really clear what you are asking. Your final question is Does this sound correct? to which I would respond, yes. Though earlier in the message you ask for advice on the remaining parts. It would help if you were to clarify what you mean. When you say ...a miracle happens...(string

Re: Targetting Tiger

2009-01-24 Thread Matt Long
Not sure what you mean by capable of running tiger. If you have a machine capable of running Leopard, it should be able to run tiger. Someone correct me if I'm wrong as I haven't actually done this, but can' t you simply get an external drive you connect through USB and install tiger onto

Re: access programmatically the quartz composer image filters?

2009-01-21 Thread Matt Long
I don't know for sure the answer to whether or not the Quartz Composer filters are the same as what Core Image gives you, but I would bet they are. Have you seen this reference?

Re: Draw NSView over QTMovieView

2009-01-20 Thread Matt Long
You can add controls to your View in IB and then use a QTMovieLayer to display your movie (assuming you are Leopard only). Just make sure when you add the QTMovieLayer to your view's sub-layers that you use - insertSublayer:atIndex passing it an index of zero. This will keep all of the

Re: CALayer unwanted blurring

2009-01-19 Thread Matt Long
How very interesting... I wanted to confirm this so I wrote a little code. Here's an image of the results. http://cimgf.com/files/BlurryLayer.png And here's the Xcode project: http://cimgf.com/files/BlurryLayer.zip Thanks for pointing that out David. -Matt On Jan 19, 2009, at 11:21 AM,

Re: CALayer unwanted blurring

2009-01-18 Thread Matt Long
Joe, Can you post some code? We can't really know what might be the cause without it. Thanks. -Matt On Jan 17, 2009, at 5:30 PM, Joe Wildish wrote: I am sub-classing CALayer and experiencing some strange behaviour. Sometimes the content of one of my sub-classes is blurred. I can't

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Matt Long
Because you can't. These are the only properties you can animate: http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/CoreAnimation_guide/Articles/AnimProps.html -Matt On Jan 16, 2009, at 10:46 AM, Adam Venturella wrote: Basically, I was thinking: Hey, why can't I use CABasicAnimation

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Matt Long
Yes. It's what they're made for. What are you trying to do? -Matt On Jan 16, 2009, at 11:23 AM, Adam Venturella wrote: So something like this would be better served with an NSTimer I take it? On Fri, Jan 16, 2009 at 9:54 AM, Matt Long matt.l...@matthew- long.com wrote: Because you can't

Re: CABasicAnimation : Can I run a CABasicAnimation and get it's updated values on it's progress?

2009-01-16 Thread Matt Long
, Adam Venturella wrote: Set the volume on an Audio Queue (make a fade out/fade in) So on the interval, I will call: AudioQueueSetParameter (queueObject, kAudioQueueParam_Volume, value ); Where value is 0-1 On Fri, Jan 16, 2009 at 10:34 AM, Matt Long matt.l...@matthew-long.com wrote: Yes

Re: Manipulating QC input ports with QCRenderer

2009-01-15 Thread Matt Long
Inputs and Outputs in the root patch can be accessed with @path.patchname.value where patchname is the name of the input or output. http://www.cocoabuilder.com/archive/message/cocoa/2008/12/27/226313 -Matt On Jan 15, 2009, at 1:44 PM, Jonathan Selander wrote: Does anybody have an idea on

Re: Removing CALayer after Animation

2009-01-08 Thread Matt Long
autoreleased at that point. hth, -Matt On Jan 8, 2009, at 12:10 AM, Bridger Maxwell wrote: Hey, Is the animation your own subclass of CAAnimation? I am justing using CAKeyframeAnimation. TTFN Bridger On Tue, Jan 6, 2009 at 1:45 PM, Matt Long matt.l...@matthew- long.comwrote: Bridger, As far

Re: Accessing inputs in a quartz composition programatically

2009-01-07 Thread Matt Long
If you are using a QCView, use this: http://developer.apple.com/technotes/tn2005/tn2146.html If you are using Core Animation (i.e. QCCompositionLayer), try this blog post: http://www.cimgf.com/2008/09/24/core-animation-tutorial-core-animation-and-quartz-composer-qccompositionlayer/ and

Re: Synchronizing QTMovieLayers

2009-01-06 Thread Matt Long
Seth, Synchronization is done at a lower level. You need to get the movie time base of the movie you want to be the master and then set the master time base for the movie you want to be the slave. Since this is done at the Movie primitive level it doesn't matter that you are using

Re: Removing CALayer after Animation

2009-01-06 Thread Matt Long
Bridger, As far as I can tell there is nothing inherent in the CA API to do what you want, however, KVC is available to you. When you create your animation, do this: [animation setValue:objectLayer forKey:@parentLayer]; Where objectLayer is the layer the animation is going to be run on.

Re: -[CKConnection connect]

2008-12-30 Thread Matt Long
Both? I can see reasons to want both depending upon what the developer is providing the end-user. How about a parameter letting me specify? ;-) -Matt On Dec 30, 2008, at 7:51 AM, Mike Abdullah wrote: What is the desired intent of the -connect method? If you call it while already connected,

Re: Quartz compoziton colors not good in Cocoa App

2008-12-26 Thread Matt Long
Have you tried setting a Clear renderer as Layer 1? Are you loading the composition in a QCView or a Core Animation QCCompositionLayer? Also, do your dimensions match between the composition and the view you're loading it into? -Matt On Dec 26, 2008, at 8:30 AM, Gustavo Pizano wrote:

Re: Quartz Bindings

2008-12-26 Thread Matt Long
The quartz composition key paths are going to be: @patch.pitch.value @patch.roll.value If you are using a QCCompositionLayer, you can simply call [layer setValue:[NSNumber numberWithFloat:pitch] forKeyPath@patch.pitch.value] or even more simply [layer setValue: [NSNumber

Re: .DS_Store files, dirContentsAtPath? (newb)

2008-12-23 Thread Matt Long
Matt Gemmell is the guy to read on this: http://whathaveyoutried.com/ The shortcut function you are asking for doesn't exist. So now what? What have you tried? People are much more likely to provide answers to questions that show what you are currently doing. You're taking the risk that

Re: How to use animation for CALayer frame.size attribute?

2008-12-20 Thread Matt Long
I'm hoping that all of the asterisks are just artifacts from a copy/ paste maneuver or something, however, if they are not then you're missing some serious fundamentals. This code will never compile. Let's just assume a copy/paste issue. If you are wanting to animate the size of the frame,

Re: KVO and CALayers

2008-12-12 Thread Matt Long
It would appear that you are right. I took your code and plugged it into an xcode project and found that the manager property is not being observed. I knew that you couldn't use KVO for animatable properties in a CALayer, but it appears that CALayers don't allow KVO at all. As soon as I

Re: New to Cocoa and Objective C, and I need some basic pointers

2008-12-05 Thread Matt Long
Try this: http://www.matthew-long.com/2007/11/09/xcode-30-tutorial/ Are you new to programming as well or just new to Cocoa/Objective-C? -Matt On Dec 4, 2008, at 4:25 PM, [EMAIL PROTECTED] wrote: ___ Cocoa-dev mailing list

Re: Programmatically loading an NSImage via other field

2008-12-04 Thread Matt Long
Jon, I'm not sure I understand the whole problem here, but from your initial message I put together a simple demo project that will take the input value from a text field and use that as the path for an NSImageView. It does it on the fly (e.g. as you type). Here is the demo project:

Re: best way to add transitions

2008-12-02 Thread Matt Long
, and it does not work (in my case). I must be missing something. Read the container doc... still not quite grokking - but getting clearer. Part of my problem is relative newness to cocoa and still battling lingo. Gary On Dec 1, 2008, at 7:57 PM, Matt Long wrote: Gary, I haven't used

Re: best way to add transitions

2008-12-01 Thread Matt Long
Gary, I haven't used IKImageView, however, it does implement the NSAnimatablePropertyContainer protocol: http://developer.apple.com/documentation/Cocoa/Reference/NSAnimatablePropertyContainer_protocol/Introduction/Introduction.html#/ /apple_ref/occ/intf/NSAnimatablePropertyContainer This

Re: Simple Core Animation Problem

2008-11-28 Thread Matt Long
- Layers can have rounded rects by setting the layer's cornerRadius property. BTW, you can't create layers in a NIB. The *must* be created in code. - Layers do not inherit from NSResponder so clicks (and double-clicks) must be registered through a backing layer - You can easily hide a view

Re: Using NSAnimation

2008-11-26 Thread Matt Long
Core Animation using layers would make this simpler for you, I think. You can still get the click from the layer backed view, but then add your image to the view's layer tree as a layer. Animating a layer is trivial in CA. I did a blog post on how to animate a layer to the clicked point in

Re: Call getElementById in Cocoa

2008-11-24 Thread Matt Long
You can use an NSXMLDocument: NSString *webpageString = [[[NSString alloc] initWithContentsOfURL:@http://www.google.com ] autorelease]; NSError *error = nil; NSXMLDocument *document = [[NSXMLDocument alloc] initWithXMLString:webpageString

Re: Core Animation: How to swicth off all implicit animations?

2008-11-23 Thread Matt Long
Got it. Thanks for the clarification. -Matt On Nov 23, 2008, at 6:29 AM, Michael Ash wrote: On Sun, Nov 23, 2008 at 12:46 AM, Matt Long [EMAIL PROTECTED] wrote: Ok. This is interesting. I wrote a little code to see what might be going on. Whatever was true when the AppKit release notes

Re: Core Animation: How to swicth off all implicit animations?

2008-11-22 Thread Matt Long
Have you tried : [CATransaction begin]; [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions]; // Your code here [CATransaction commit]; See also:

Re: Core Animation: How to swicth off all implicit animations?

2008-11-22 Thread Matt Long
Ok. This is interesting. I wrote a little code to see what might be going on. Whatever was true when the AppKit release notes were published has either changed or the term supported has a loose definition. Thanks for pointing that out, Mike, but I don't think it's accurate or I've

Re: Layer-backed NSOpenGLView not showing up

2008-11-15 Thread Matt Long
I'll find a reference when I get a chance, but I recall reading somewhere that what you're trying to do won't work. You will need to use CAOpenGLLayer if you want to add sub-layers to it. Just to test it, don't add the sub-layer and see if it shows up then. If it doesn't then you may have

Re: Cora Animation transormation

2008-11-12 Thread Matt Long
You need both of these lines when you create your animation: [animation setRemovedOnCompletion:NO]; [animation setFillMode:kCAFillModeForwards]; Here is a related blog post: http://www.cimgf.com/2008/10/25/core-animation-tutorial-slider-based-layer-rotation/ -Matt On Nov 12, 2008, at 7:57

Re: Cora Animation transormation

2008-11-12 Thread Matt Long
on Amazon for Core Animation for Mac OS X and the iPhone: Creating Compelling Dynamic User Interfaces ;-) Many thanks 2008/11/12 Matt Long [EMAIL PROTECTED]: You need both of these lines when you create your animation: [animation setRemovedOnCompletion:NO]; [animation setFillMode:kCAFillModeForwards

Re: CA: fillMode and rotation animation . . .

2008-11-11 Thread Matt Long
You also need to set it to not remove the animation on completion. [animation setRemovedOnCompletion:NO] -Matt On Nov 11, 2008, at 1:00 AM, Michael A. Crawford wrote: I have a number of layers that use rotation animation about the Z- axis. Whenever the animation(s) complete the layer

Re: Simple Flipbook Animation?

2008-11-01 Thread Matt Long
Jeshua, I put together a little demo app that works in the simulator. Haven't tried on my device yet, though. Take a look here: http://www.cimgf.com/files/ImageFlip.zip And one comment about the code. If you don't want a transition between images when using a keyframe animation for the

Re: Simple Flipbook Animation?

2008-10-31 Thread Matt Long
Look at overriding the layer transition. You can use a page curl filter, if that's your desired effect, to transition changes to the layer's content property. - Create a CATransition object. - Create a CIFilter that implements a page curl (Check out Apple's Core Image Filters docs and

Re: Using Core Animation to animate view properties?

2008-10-22 Thread Matt Long
Hey Jim, I don't know much about NSAnimation as I haven't used it, however, I can try to answer your three questions from a Core Animation standpoint. 1. If you want to know whether an animation is still running, just check to see if it is still in the animations dictionary in the layer.

Re: Custom CALayer Action as animation key?

2008-10-20 Thread Matt Long
Patrick, I believe the only animatable properties are the ones explicitly labeled animatable in the documentation. That is why (I believe) there is a section labeled Animatable Properties in the Core Animation Programming guide. I think the reason is that you can't guarantee that your

Re: Add animation layer and then remove animation layer

2008-10-11 Thread Matt Long
Hey Steve, Your call to setWantsLayer won't take effect until the next run loop. So here is what happens (I think). - First call to changeRightView: - turns on layer backing for next run loop - adds the animation (transition) for next run loop - sets the delegate for

Re: CALayer bounds with ResizeAspect mask?

2008-10-08 Thread Matt Long
Colin, Not sure I completely understand that issue, but in a QTMovieLayer, the movie is tied to the layer dimensions. If you resize the layer, you resize the movie. The layer itself has a frame and a bounds property. All you should need to do is grab [myMovieLayer bounds] or

Re: [OT] Core Animation is it up to the challenge

2008-10-03 Thread Matt Long
Someone correct me if I'm wrong, but this is completely *on*-topic. Core Animation, it's capabilities and limitations are very pertinent. I don't know the answer to your question, but I certainly think it's on-topic. I would like to know the answers you get, myself. Then again, maybe you

Re: Questions on An NSOpenGL Application Design

2008-09-30 Thread Matt Long
Carmen, I don't know anything about reading pixels back from VRAM and this CPU analysis you refer to. Why do you need to do that again? You might want to look into using Core Animation for what you are trying to do. For that matter, you could very easily create a simple Quartz

Re: Adding external library in cocoa app

2008-09-23 Thread Matt Long
If you compiled your libs using the normal linux/unix ./configure, make, make install routine, you likely don't have universal binaries. Can't be sure your issue without seeing your linker error messages, but this is a likely cause. -Matt On Sep 23, 2008, at 11:50 AM, Harsh Trivedi

Re: Drawing an NSImage in a CALayer

2008-09-19 Thread Matt Long
to work. ;-) On Sep 18, 2008, at 5:00 PM, Brad Gibbs wrote: On Sep 18, 2008, at 3:18 PM, Matt Long wrote: You've got some fundamental issues here. That doesn't surprise me... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Drawing an NSImage in a CALayer

2008-09-18 Thread Matt Long
You've got some fundamental issues here. This call in particular: imageLayer drawLayer:imageLayer inContext:ctx]; It doesn't make sense. -drawLayer:inContext is a delegate method. You are overriding drawing functionality for the layer in question. Instead you would set the layer's delegate

Re: Page Curl Transition of Layers

2008-09-17 Thread Matt Long
I think you need to clarify what you mean by swapping of layers into views. The page curl transition works fine in a CALayer. I just set the transition for the opacity key so that whenever opacity gets changed, the transition between the previous layer opacity and the new is done with a

CALayer Mask Logic

2008-09-17 Thread Matt Long
I've noticed that when using the mask property in a CALayer, the mask itself defines what part of the containing layer shows through rather than what part of the layer is actually covered or masked. I'm sure it's just me, but this logic seems inverted from what it ought to be. Is there a

Re: View animator, how to do explicit animations / animation groups?

2008-09-03 Thread Matt Long
Are you trying to remove views or animations? Animations are removed from a layer by default which can be overridden in the removedOnCompletion property (in CAAnimation) in an explicit animation. If you're trying to remove views, however, your code is wrong. You need to find the view you

Re: Core Animation : are text attributes animatable ?

2008-08-27 Thread Matt Long
I can't speak to the example you mention specifically, but I had tried to scale font sizes this way as well and never got the smooth transition either. Instead I used something like this: CATransform3D transform = CATransform3DMakeScale(factor, factor, factor); [mainLayer

Re: Strange flipping bug in Core Animation?

2008-08-07 Thread Matt Long
When you call addSubLayer, you are in essence telling the layer to animate so any properties you changed in the layer will animate after adding the layer. You are doing this in your awakeFromNib which is likely why you don't see the animation when it runs--not sure though. You might want

Re: Creating a Bundle via Code

2008-06-20 Thread Matt Long
This might help: http://www.cimgf.com/2008/05/13/from-hacker-to-microisv-custom-file-formats/ In essence you create a folder and set attributes on it as you suspected. Though these are referred to as packages instead of bundles. Take a look at NSFileManager. You can create a directory that

Re: Getting started with Core Animation

2008-06-02 Thread Matt Long
Hey Graham. I wrote a blog post not too long ago that demonstrates adding layers to a root layer. You can see it here: http://www.cimgf.com/2008/03/15/core-animation-tutorial-dashboard-effect/ I think you want to get the root content layer and then call insertSublayer or addSublayer to it.

Re: File's Owner

2008-05-23 Thread Matt Long
and start adding your code to it. That's really all you *need* to know. -Matt -- Matt Long [EMAIL PROTECTED] http://www.matthew-long.com/ On May 23, 2008, at 12:49 PM, Johnny Lundy [EMAIL PROTECTED] wrote: I decided to once again go verbatim through Cocoa Fundamentals. So

Re: Problem with updating NSProgressIndicator

2008-05-20 Thread Matt Long
I recently wrote a blog post with a demo xcode project that shows an implementation of updating a progress indicator for file copy. You can see it here: http://www.cimgf.com/2008/05/03/cocoa-tutorial-file-copy-with-progress-indicator/ It's a lowest common denominator example, so it might

Re: ImageCapture API versions

2008-05-20 Thread Matt Long
It's included for 10.5. I don't think you want Image Capture for your app, though as this API is mainly for downloading images from the camera after a photo shoot. I don't believe there is any mechanism for causing the picture to be taken (from a button click in your app for example).

Programmatically Set Image Capture Prefs

2008-05-14 Thread Matt Long
Does anyone know if there is a way to programatically set the Image Capture.app preference called When a camera is connected, open:. I want to set this to No Applicaiton using code. I would think that there is some plist file containing this preference, but I've yet to find such a thing.

FSCopyObjectASync Not Calling Callback In Cocoa

2008-04-30 Thread Matt Long
I execute this code and it successfully copies my file from source to destination: - (IBAction)startCopy:(id)sender; { FSFileOperationRef fileOp = FSFileOperationCreate(NULL); FSRef source; FSRef destination; FSPathMakeRef( (const UInt8 *)[[sourceFilePath stringValue]

Re: Getting feedback from application

2008-04-15 Thread Matt Long
This might help you: http://www.matthew-long.com/2007/11/09/xcode-30-tutorial/ It's a bit shorter tutorial than the Apple one. -Matt On Apr 15, 2008, at 9:25 AM, Mike R. Manzano wrote: Please read one of the many fine tutorials on the subject, including this one:

Re: Core Animation layer-backed NSViews and mouse handling

2008-04-08 Thread Matt Long
Hey Mani, I never solved the problem completely, however, I realized that what you need to do, or so it seems, is to somehow get notified when the animation has finished and then actually move the button to the position where the animation stopped. It seems really convoluted to me, but I

Re: Perform Selector After Delay Secondary Window

2008-03-19 Thread Matt Long
Man! That sure simplified things. Thanks for the tip. Works perfectly. I ended up using NSRunLoopCommonModes which is apparently Leopard only. But that's fine for my app. Thanks. -Matt On Mar 19, 2008, at 7:16 PM, Wim Lewis wrote: On Mar 19, 2008, at 6:00 PM, Matt Long wrote: [self

Re: Adding spaces to an NSString

2008-03-18 Thread Matt Long
You could get a char array from your initial NSString and then use stringByAppendingFormat:@%c on an NSString in a loop. Notice the space after the %c. -Matt J. Todd Slack wrote: Hi John, Yes, I have, Are you thinking insertString:atIndex:? So at a basic level, can I get the string