Mailing Lists: Apple Mailing Lists

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

How do I use SoundComponentGetInfo() properly and avoid getting siUnknownInfoType



Title: How do I use SoundComponentGetInfo() properly and avoid getting siUnknownInfoType
Hi All,

My program needs to gather information about the available Sound Components.  Unfortunately, as I iterate through the Sound Compressor components, when I ask for various information using SoundComponentGetInfo(), I am consistently getting a returned value of –231 (siUnknownInfoType).

I am asking for 6 types of data: siNumberChannels, siQuality, siVolume, siSampleRateAvailable, siSampleSizeAvailable and siOptionsDialog.  The first 5 always fail to return data. The last type, siOptionsDialog, does return data and actually appears to work as expected.

Would you take a look at the code snippet below and tell me if I am doing something that is obviously incorrect?  Any pointers will be greatly appreciated.

thanks,

douglas

------------------

- (IBAction)Get_Sound_Component_Info: (id)sender
{
    short                    Has_Options_Display;
    int                      Channel_Info;
    long                     Quality;
    long                     Volume;

    SoundInfoList            Size_Info;
    SoundInfoList            Rate_Info;
    
    SoundSource              Sound_Source;
    
    Component                Current_Component;
    ComponentInstance        Component_Instance = NULL;
    ComponentResult          Component_Result;
    
    ComponentDescription     Component_Info = {0, 0, 0, 0, 0};
    ComponentDescription     Find_Component_Descriptor = {0, 0, 0, 0, 0};
    
    Find_Component_Descriptor.componentType = 'scom';
    Find_Component_Descriptor.componentFlags = 0;

    Current_Component = FindNextComponent( Current_Component, &Find_Component_Descriptor );
    while ( Current_Component != NULL )
    {
        GetComponentInfo( Current_Component, &Component_Info, NULL, NULL, NULL );
                
        Has_Options_Display = 0;
        Channel_Info = 0;
        Component_Result = 0;
        Quality = 0;
        Volume = 0;
        
        Component_Instance = OpenDefaultComponent( Component_Info.componentType, Component_Info.componentSubType );

        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siNumberChannels, &Channel_Info );
        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siQuality, &Quality );
        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siVolume, &Volume );
        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siOptionsDialog, &Has_Options_Display );
        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siSampleRateAvailable, &Rate_Info );
        Component_Result = SoundComponentGetInfo( Component_Instance, NULL, siSampleSizeAvailable, &Size_Info );
        
        CloseComponent( Component_Instance );
        
        Current_Component = FindNextComponent( Current_Component, &Find_Component_Descriptor );
        }
    }

 _______________________________________________
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

References: 
 >RE: FullScreen AutoStart (From: "Dave Walker" <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.