Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a Composition in Code



Regarding programmatic editing of qtz files, I've
tried two approaches.  

1)  Opening the qtz as a QuickTime movie. 
Compositions are stored in a new type of QT track, and
can be edited using the QT APIs.  For instance you can
merge compositions, or add an audio track.  You can
probably form connections between compositions as part
of the merge, but I haven't tried this.

2)  I've had success setting the input parameters of a
qtz file by editing it directly as a property list,
then saving a new copy.  

In Ruby:
    qtz_path =
OSX::NSBundle.mainBundle.pathForResource_ofType(inputs[:qtz_path],
'qtz')
    unless input_params.empty?
      data =
OSX::NSData.dataWithContentsOfFile(qtz_path)
      plist =
OSX::NSPropertyListSerialization.propertyListFromData_mutabilityOption_format_errorDescription(data,
2, nil, nil)  # 2 is for mutable plist                
                           
      plist.setObject_forKey(input_params,
'inputParameters') unless input_params.empty?
      data =
OSX::NSPropertyListSerialization.dataFromPropertyList_format_errorDescription(plist,
100, nil)  # 100 is the xml format                    
                                            
     # data saves as new quartz file
    end



email@hidden
415 786 8665


 
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.