当前位置: 首页>>代码示例>>C++>>正文


C++ FindNextComponent函数代码示例

本文整理汇总了C++中FindNextComponent函数的典型用法代码示例。如果您正苦于以下问题:C++ FindNextComponent函数的具体用法?C++ FindNextComponent怎么用?C++ FindNextComponent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FindNextComponent函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LoadAudioUnits

void LoadAudioUnits()
{
   ComponentDescription desc;
   Component component;
   
   desc.componentType = kAudioUnitType_Effect; //'aufx'
   desc.componentSubType = 0;
   desc.componentManufacturer = 0;
   desc.componentFlags = 0;
   desc.componentFlagsMask = 0;
   
   component = FindNextComponent(NULL, &desc);
   while (component != NULL) {
      ComponentDescription found;
      Handle nameHandle = NewHandle(0);
      GetComponentInfo(component, &found, nameHandle, 0, 0);
      HLock(nameHandle);
      int len = ((const char *)(*nameHandle))[0];
      wxString name((const char *)(*nameHandle)+1, len);
      HUnlock(nameHandle);
      DisposeHandle(nameHandle);

      Effect::RegisterEffect(new AudioUnitEffect(name, component));

      component = FindNextComponent (component, &desc);
   }
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:27,代码来源:LoadAudioUnits.cpp

示例2: DelegateOnly_ImageCodecOpen

// Component Open Request - Required
pascal ComponentResult DelegateOnly_ImageCodecOpen(DelegateOnly_Globals glob, ComponentInstance self)
{
	ComponentDescription cd = { decompressorComponentType, k422YpCbCr8CodecType, FOUR_CHAR_CODE('app3'), 0, 0 };
	Component c = 0;
	
	ComponentResult rc;
	
	// Allocate memory for our globals, set them up and inform the component manager that we've done so
	glob = (DelegateOnly_Globals)NewPtrClear(sizeof(DelegateOnly_GlobalsRecord));
	if (rc = MemError()) goto bail;
	
	SetComponentInstanceStorage(self, (Handle)glob);
	
	glob->self = self;
	glob->target = self;
	
	if (c = FindNextComponent(c, &cd)) {
		
		rc = OpenAComponent(c, &glob->delegateComponent);
		if (rc) goto bail;

		ComponentSetTarget(glob->delegateComponent, self);
	}

bail:
	return rc;
}
开发者ID:fruitsamples,项目名称:DelegateOnlyComponent,代码行数:28,代码来源:DelegateOnly_Codec.c

示例3: openOutput

OSStatus openOutput (AudioUnit *outputUnit)
{
	OSStatus		status = noErr;
	ComponentDescription	description;
	Component		component;

	description.componentType = kAudioUnitType_Output;
	description.componentSubType = kAudioUnitSubType_DefaultOutput;
	description.componentManufacturer = kAudioUnitManufacturer_Apple;
	description.componentFlags = 0;
	description.componentFlagsMask = 0;

	component = FindNextComponent(NULL, &description);
	if (component == NULL)
	{
		fprintf(stderr, "Could not find audio output device.\n");
		exit(EXIT_FAILURE);
	}

	status = OpenAComponent(component, outputUnit);
	if (status != noErr)
	{
		fprintf(stderr, "Could not open audio output device.\n");
		exit(EXIT_FAILURE);
	}

	status = AudioUnitInitialize(*outputUnit);
	if (status != noErr)
	{
		fprintf(stderr, "Could not initialize audio output device.\n");
		exit(EXIT_FAILURE);
	}

	return status;
}
开发者ID:Distrotech,项目名称:audiofile,代码行数:35,代码来源:osxplay.c

示例4: CloseView

void AUEditWindow::SetUnitToDisplay (AudioUnit editUnit, ComponentDescription& inDesc)
{
	CloseView();
	
	mEditUnit = editUnit;

	Component editComp = FindNextComponent(NULL, &inDesc);
	
	verify_noerr(OpenAComponent(editComp, &mEditView));
	
	ControlRef rootControl;
	verify_noerr(GetRootControl(mWindow, &rootControl));

	Rect r;
	ControlRef viewPane;
	GetControlBounds(rootControl, &r);
	Float32Point location = { kOffsetForAUView_X, kOffsetForAUView_Y };
	Float32Point size = { Float32(r.right), Float32(r.bottom) };
	verify_noerr(AudioUnitCarbonViewCreate(mEditView, mEditUnit, mWindow, rootControl, &location, &size, &viewPane));
	
	AudioUnitCarbonViewSetEventListener(mEditView, EventListener, this);

	GetControlBounds(viewPane, &r);
	size.x = r.right-r.left + kOffsetForAUView_X; size.y = r.bottom-r.top + kOffsetForAUView_Y;
	
	Rect r2;
	GetControlBounds (mResizeableControl->MacControl(), &r2);
	
	if ((r.bottom - r.top) < (r2.bottom - r2.top + 20))
		size.y = r2.bottom + 20;
		
	SetSize(size);	
}
开发者ID:fruitsamples,项目名称:Services,代码行数:33,代码来源:AUEditWindow.cpp

示例5: mDesc

CAComponent::CAComponent (OSType inType, OSType inSubtype, OSType inManu)
	: mDesc (inType, inSubtype, inManu),
	  mManuName(0), mAUName(0), mCompName(0), mCompInfo (0)
{
	mComp = FindNextComponent (NULL, &mDesc);
	GetComponentInfo (Comp(), &mDesc, NULL, NULL, NULL);
}
开发者ID:DanielAeolusLaude,项目名称:ardour,代码行数:7,代码来源:CAComponent.cpp

示例6: findGraphicsExporterComponents

void findGraphicsExporterComponents(_List& compList, _SimpleList& compIndex)
{
    ComponentDescription cd, cd2;
    Component c = 0;
    
    cd.componentType 			= GraphicsExporterComponentType;
    cd.componentSubType 		= 0;
    cd.componentManufacturer 	= 0;
    cd.componentFlags 			= 0;
    cd.componentFlagsMask 		= graphicsExporterIsBaseExporter;
    
    _String	fileFormat;
    
    while( ( c = FindNextComponent( c, &cd ) ) != 0 ) 
    {
    	 Handle     cInfo = NewHandle(256);
    	 GetComponentInfo (c,&cd2,cInfo,nil,nil);
    	 (*cInfo)[**cInfo+1] = 0;
    	 fileFormat = (char*)(*cInfo+1);
    	 if (fileFormat.sLength)
    	 {
    		 compList&& &fileFormat; 
    		 compIndex << (long)c;
    	 } 
    	 DisposeHandle(cInfo);
    }
} 
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:27,代码来源:HYPlatformGraphicPane.cpp

示例7: showConfigurations

void showConfigurations(encodingParameters *params)
{
	ComponentDescription cd;
	cd.componentType = 'aenc';
	cd.componentSubType = 'aac ';
	cd.componentManufacturer = kAppleManufacturer;
	cd.componentFlags = 0;
	cd.componentFlagsMask = 0;
	long qtversion = 0;
	Gestalt(gestaltQuickTime,&qtversion);
	int lcversion = CallComponentVersion((ComponentInstance)FindNextComponent(NULL, &cd));
	cd.componentSubType = 'aach';
	int heversion = CallComponentVersion((ComponentInstance)FindNextComponent(NULL, &cd));
	if(heversion != badComponentInstance)
		fprintf(stderr,"Using QuickTime %d.%d.%d (LC-AAC encoder %d.%d.%d, HE-AAC encoder %d.%d.%d)\n",(qtversion>>24)&0xff,(qtversion>>20)&0xf,(qtversion>>16)&0xf,(lcversion>>16)&0xffff,(lcversion>>8)&0xff,lcversion&0xff,(heversion>>16)&0xffff,(heversion>>8)&0xff,heversion&0xff);
	else
开发者ID:QuocHuy7a10,项目名称:Arianrhod,代码行数:16,代码来源:qtaacenc.cpp

示例8: m_outputUnit

AudioDestinationMac::AudioDestinationMac(AudioSourceProvider& provider, float sampleRate)
    : m_outputUnit(0)
    , m_provider(provider)
    , m_renderBus(2, kBufferSize, false)
    , m_sampleRate(sampleRate)
    , m_isPlaying(false)
{
    // Open and initialize DefaultOutputUnit
    Component comp;
    ComponentDescription desc;

    desc.componentType = kAudioUnitType_Output;
    desc.componentSubType = kAudioUnitSubType_DefaultOutput;
    desc.componentManufacturer = kAudioUnitManufacturer_Apple;
    desc.componentFlags = 0;
    desc.componentFlagsMask = 0;
    comp = FindNextComponent(0, &desc);

    ASSERT(comp);

    OSStatus result = OpenAComponent(comp, &m_outputUnit);
    ASSERT(!result);

    result = AudioUnitInitialize(m_outputUnit);
    ASSERT(!result);

    configure();
}
开发者ID:sysrqb,项目名称:chromium-src,代码行数:28,代码来源:AudioDestinationMac.cpp

示例9: FindNextComponent

bool auLoader::loadPlugin()
{
  Component comp = FindNextComponent(NULL, &m_desc);
  if(comp == NULL)
  {
    debug(LOG_ERROR, "AU '%s' '%s' '%s' was not found", m_type, m_subtype, m_manuf);
    return false;
  }
  else
  {
    debug(LOG_INFO, "AU '%s' '%s' '%s' found", m_type, m_subtype, m_manuf);
  }
  
  OSErr result = OpenAComponent(comp, &m_plugin);
  if(result)
  {
    debug(LOG_ERROR, "Could not open AU");
    return false;
  }
  else
  {
    debug(LOG_INFO, "AU opened");
  }
  
  return true;
}
开发者ID:Epitek,项目名称:KickMaker,代码行数:26,代码来源:auLoader.cpp

示例10: XWindow

AUEditWindow::AUEditWindow(XController *owner, IBNibRef nibRef, CFStringRef name, AudioUnit editUnit, ComponentDescription inCompDesc ) :
	XWindow(owner, nibRef, name),
	mEditUnit(editUnit)
{
	Component editComp = FindNextComponent(NULL, &inCompDesc);
	
	verify_noerr(OpenAComponent(editComp, &mEditView));
	
	ControlRef rootControl;
	verify_noerr(GetRootControl(mWindow, &rootControl));

	ControlRef customControl = 0;

	ControlID controlID;
	controlID.signature    	= 'cust';
    controlID.id        	= 1000;
    GetControlByID( mWindow, &controlID, &customControl );

	ControlRef ourControl = customControl ? customControl : rootControl;

	Rect r = {0,0,400,400};
	ControlRef viewPane;
	if(customControl) GetControlBounds(ourControl, &r);

	Float32Point location = { r.left, r.top };
	Float32Point size = { Float32(r.right - r.left ), Float32(r.bottom - r.top ) };
	
	
	verify_noerr(AudioUnitCarbonViewCreate(mEditView, mEditUnit, mWindow, ourControl, &location, &size, &viewPane));

	GetControlBounds(viewPane, &r);
	size.x = r.right-r.left; size.y = r.bottom-r.top;
	if(!customControl) SetSize(size);
	Show();	
}
开发者ID:fruitsamples,项目名称:Services,代码行数:35,代码来源:AUEditWindow.cpp

示例11: while

bool macsgCamera::findCamera() {
	int num_components = 0;
	Component c = 0;
	ComponentDescription cd;
     
	cd.componentType = SeqGrabComponentType;
	cd.componentSubType = 0;
	cd.componentManufacturer = 0;
	cd.componentFlags = 0;
	cd.componentFlagsMask = 0;
     
	while((c = FindNextComponent(c, &cd)) != 0) {
		// add component c to the list
		num_components++;  
	}
            
    //fprintf(stdout, "number of SGcomponents: %d\n",num_components);

	if(num_components==0) {
		fprintf(stderr, "no quicktime camera found\n");
		return false;
	} else {
		cameraID = 0;
		return true;
	}
}
开发者ID:field,项目名称:FieldKit.scala,代码行数:26,代码来源:macsgCamera.cpp

示例12: CountComponents

// 2.
// Create the Video Digitizer (using GWorld Pixmap as target mamory)
void QuicktimeLiveImageStream::createVideoDigitizer()
{
    // #define videoDigitizerComponentType = 'vdig'
    ComponentDescription video_component_description;
    video_component_description.componentType         = 'vdig'; /* A unique 4-byte code indentifying the command set */
    video_component_description.componentSubType      = 0;      /* Particular flavor of this instance */
    video_component_description.componentManufacturer = 0;      /* Vendor indentification */
    video_component_description.componentFlags        = 0;      /* 8 each for Component,Type,SubType,Manuf/revision */
    video_component_description.componentFlagsMask    = 0;      /* Mask for specifying which flags to consider in search, zero during registration */
    long num_video_components = CountComponents (&video_component_description);
    OSG_DEBUG << " available Video DigitizerComponents : " << num_video_components << std::endl;
    if (num_video_components)
    {
        Component aComponent = 0;
        short     aDeviceID  = 0;
        do
        {
            ComponentDescription full_video_component_description = video_component_description;
            aComponent = FindNextComponent(aComponent, &full_video_component_description);
            if (aComponent && (aDeviceID == m_videoDeviceID))
            {
                OSG_DEBUG << "Component" << std::endl;
                OSErr                err;
                Handle compName = NewHandle(256);
                Handle compInfo = NewHandle(256);
                err = GetComponentInfo( aComponent, &full_video_component_description, compName,compInfo,0);
                OSG_DEBUG << "    Name: " << pstr_printable((StringPtr)*compName) << std::endl;
                OSG_DEBUG << "    Desc: " << pstr_printable((StringPtr)*compInfo) << std::endl;
                //Capabilities
                VideoDigitizerComponent component_instance = OpenComponent(aComponent);
                m_vdig = component_instance;
                //Setup
                // Onscreen
                // Check capability and setting of Sequence Grabber
                GDHandle origDevice;
                CGrafPtr origPort;
                GetGWorld (&origPort, &origDevice);
                VideoDigitizerError error;
                Rect                destinationBounds;
                destinationBounds.left   = 0;
                destinationBounds.top    = 0;
                destinationBounds.right  = m_videoRectWidth;
                destinationBounds.bottom = m_videoRectHeight;                    
                error = VDSetPlayThruDestination(m_vdig, m_pixmap, &destinationBounds, 0, 0);
                //error = VDSetPlayThruGlobalRect(m_vdig, (GrafPtr)origPort, &destinationBounds);
                if (error != noErr)
                {
                    OSG_FATAL << "VDSetPlayThruDestination : error" << std::endl;
                }
                print_video_component_capability(component_instance);
                break;
            }
            ++aDeviceID;
        }
        while (0 != aComponent);
     }
}
开发者ID:aalex,项目名称:osg,代码行数:59,代码来源:QuicktimeLiveImageStream.cpp

示例13: mManuName

CAComponent::CAComponent (const ComponentDescription& inDesc, CAComponent* next)
	: mManuName(0), mAUName(0), mCompName(0), mCompInfo (0)
{
	mComp = FindNextComponent ((next ? next->Comp() : NULL), const_cast<ComponentDescription*>(&inDesc));
	if (mComp)
		GetComponentInfo (Comp(), &mDesc, NULL, NULL, NULL);
	else
		memcpy (&mDesc, &inDesc, sizeof(ComponentDescription));
}
开发者ID:DanielAeolusLaude,项目名称:ardour,代码行数:9,代码来源:CAComponent.cpp

示例14: XWindow

AUEditWindow::AUEditWindow(XController *owner, IBNibRef nibRef, CFStringRef name, AudioUnit editUnit, bool forceGeneric) :
	XWindow(owner, nibRef, name),
	mEditUnit(editUnit)
{
	OSStatus err;
	ComponentDescription editorComponentDesc;
	
	// set up to use generic UI component
	editorComponentDesc.componentType = kAudioUnitCarbonViewComponentType;
	editorComponentDesc.componentSubType = 'gnrc';
	editorComponentDesc.componentManufacturer = 'appl';
	editorComponentDesc.componentFlags = 0;
	editorComponentDesc.componentFlagsMask = 0;
	
	if (!forceGeneric) {
		// ask the AU for its first editor component
		UInt32 propertySize;
		err = AudioUnitGetPropertyInfo(editUnit, kAudioUnitProperty_GetUIComponentList,
			kAudioUnitScope_Global, 0, &propertySize, NULL);
		if (!err) {
			int nEditors = propertySize / sizeof(ComponentDescription);
			ComponentDescription *editors = new ComponentDescription[nEditors];
			err = AudioUnitGetProperty(editUnit, kAudioUnitProperty_GetUIComponentList,
				kAudioUnitScope_Global, 0, editors, &propertySize);
			if (!err)
				// just pick the first one for now
				editorComponentDesc = editors[0];
			delete[] editors;
		}
	}
	Component editComp = FindNextComponent(NULL, &editorComponentDesc);
	
	verify_noerr(OpenAComponent(editComp, &mEditView));
	
	ControlRef rootControl;
	verify_noerr(GetRootControl(mWindow, &rootControl));

	Rect r;
	ControlRef viewPane;
	GetControlBounds(rootControl, &r);
	Float32Point location = { 0., 0. };
	Float32Point size = { Float32(r.right), Float32(r.bottom) };
	verify_noerr(AudioUnitCarbonViewCreate(mEditView, mEditUnit, mWindow, rootControl, &location, &size, &viewPane));
	
	AudioUnitCarbonViewSetEventListener(mEditView, EventListener, this);

	GetControlBounds(viewPane, &r);
	size.x = r.right-r.left; size.y = r.bottom-r.top;
	SetSize(size);
	Show();

/*	EventLoopTimerRef timer;
	RequireNoErr(
		InstallEventLoopTimer(
			GetMainEventLoop(), 5., 0., TimerProc, this, &timer));*/
}
开发者ID:arnelh,项目名称:Examples,代码行数:56,代码来源:AUEditWindow.cpp

示例15: FindNextComponent

Component	SMACIMAsdec::FindIMAAudioDecoderComponent(const AudioStreamBasicDescription& inFormat)
{
	Component				theDecoderComponent = NULL;
	ComponentDescription	theDecoderDescription = { kAudioDecoderComponentType, inFormat.mFormatID, 0, 0, 0 };

	// If a component has sub types, ala MPEG-4, you'll need to loop here and look at the sub-type	
	theDecoderComponent = FindNextComponent(NULL, &theDecoderDescription);

	return theDecoderComponent;
}
开发者ID:fruitsamples,项目名称:AudioCodecs,代码行数:10,代码来源:SMACIMAsdec.cpp


注:本文中的FindNextComponent函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。