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: Default Components



If I did understand the answer above correctly, executing a program as  follows would change the search order of the Component Manager.i.e. iMovie should no more open my component? But this is not the case.

Hmmm, I can't speak for iMovie but here's some very quick and dirty code to test the SetDefaultComponent call and it seems to work for me. I would try this yourself from an application to confirm its operation.

int main(int argc, char* argv[])
{
    ComponentDescription desc;
    ComponentInstance ci = OpenDefaultComponent(MovieExportType, kQTFileTypeMovie);
    Component c;
    GetComponentInfo(ci, &desc, NULL, NULL, NULL);
     CloseComponent(ci);
     ci = NULL;
    
    // the component desc contains "spit, MooV, appl and corresponding flags as you would expect
    
    // now we want to change the order so the 'hint' exporter is returned by default -- type and subType
    // already contain what we need 'spit' and 'MooV' so just change the manufacturer and flags
    desc.componentManufacturer = 'hint';
    desc.componentFlags = 0;
    desc.componentFlagsMask = 0;
    
    // now find it, open it and make sure it's the one we want
    c = FindNextComponent(0, &desc);
    ci = OpenComponent(c);
    GetComponentInfo(ci, &desc, NULL, NULL, NULL);
    
   // desc now contains "spit, MooV, hint and some flags as we would expect
   
   // now make this component the default component
    err = SetDefaultComponent(c, defaultComponentAnyManufacturer);
    CloseComponent(ci);
   ci = NULL;
    
   // now open the Default component, it should be the 'hint' exporter instead of the 'appl' exporter
   // which was previously returned by this same call above
    ci = OpenDefaultComponent(MovieExportType, kQTFileTypeMovie);
    GetComponentInfo(ci, &desc, NULL, NULL, NULL);
    
    // desc contains "spit, MooV, hint and some flags again as expected
   CloseComponent(ci);

   return 0;
}

regards,
edward

 Edward Agabeg
 WWDR Engineer
 QuickTime and Audio
 Worldwide Developer Relations
 Apple

 http://www.apple.com/developer
 http://www.apple.com/quicktime

-- This message was sent from a personal account --
-- All views are mine and not necessarily shared by my employer --
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quicktime-api/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.