这篇教程C++ FindNextComponent函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中FindNextComponent函数的典型用法代码示例。如果您正苦于以下问题:C++ FindNextComponent函数的具体用法?C++ FindNextComponent怎么用?C++ FindNextComponent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了FindNextComponent函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: LoadAudioUnitsvoid 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,
示例2: DelegateOnly_ImageCodecOpen// Component Open Request - Requiredpascal 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,
示例3: openOutputOSStatus 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,
示例4: CloseViewvoid 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,
示例5: mDescCAComponent::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,
示例6: findGraphicsExporterComponentsvoid 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,
示例7: showConfigurationsvoid 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,
示例8: m_outputUnitAudioDestinationMac::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,
示例9: FindNextComponentbool 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,
示例10: XWindowAUEditWindow::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,
示例11: whilebool 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,
示例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,
示例13: mManuNameCAComponent::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,
示例14: XWindowAUEditWindow::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,
示例15: FindNextComponentComponent 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,
示例16: ca_open_playbackstatic ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName){ ComponentDescription desc; Component comp; ca_data *data; OSStatus err; if(!deviceName) deviceName = ca_device; else if(strcmp(deviceName, ca_device) != 0) return ALC_INVALID_VALUE; /* open the default output unit */ desc.componentType = kAudioUnitType_Output;#if TARGET_OS_IPHONE desc.componentSubType = kAudioUnitSubType_RemoteIO;#else desc.componentSubType = kAudioUnitSubType_DefaultOutput;#endif // TARGET_OS_IPHONE desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; comp = FindNextComponent(NULL, &desc); if(comp == NULL) { ERR("FindNextComponent failed/n"); return ALC_INVALID_VALUE; } data = calloc(1, sizeof(*data)); err = OpenAComponent(comp, &data->audioUnit); if(err != noErr) { ERR("OpenAComponent failed/n"); free(data); return ALC_INVALID_VALUE; } /* init and start the default audio unit... */ err = AudioUnitInitialize(data->audioUnit); if(err != noErr) { ERR("AudioUnitInitialize failed/n"); CloseComponent(data->audioUnit); free(data); return ALC_INVALID_VALUE; } device->DeviceName = strdup(deviceName); device->ExtraData = data; return ALC_NO_ERROR;}
开发者ID:CliffsDover,项目名称:OpenAL-MOB,代码行数:54,
示例17: ClearOSStatus CAComponent::Restore (CFPropertyListRef &inData){ if (mDesc.Restore (inData)) return -1; Clear(); mComp = FindNextComponent (NULL, &mDesc); // this will restore the current flags... if (mComp) GetComponentInfo (Comp(), &mDesc, NULL, NULL, NULL); return noErr;}
开发者ID:fruitsamples,项目名称:PublicUtility,代码行数:13,
示例18: initoutput int initoutput(){ ComponentDescription desc; Component comp; OSStatus err; UInt32 size; Boolean canwrite; AudioStreamBasicDescription inputdesc,outputdesc; desc.componentType=kAudioUnitType_Output; desc.componentSubType=kAudioUnitSubType_DefaultOutput; desc.componentManufacturer=kAudioUnitManufacturer_Apple; desc.componentFlags=0; desc.componentFlagsMask=0; comp=FindNextComponent(NULL,&desc);if (comp==NULL) return -1; err=OpenAComponent(comp,&out);if (err) return err; err=AudioUnitInitialize(out);if (err) return err; err=AudioUnitGetPropertyInfo(out,kAudioUnitProperty_StreamFormat,kAudioUnitScope_Output,0,&size,&canwrite); if (err) return err; err=AudioUnitGetProperty(out,kAudioUnitProperty_StreamFormat,kAudioUnitScope_Input,0,&outputdesc,&size); if (err) return err; // dumpdesc(&outputdesc); inputdesc.mSampleRate=44100.0; inputdesc.mFormatID='lpcm';#if __BIG_ENDIAN__ inputdesc.mFormatFlags=0x0e;#else inputdesc.mFormatFlags=0x0c;#endif inputdesc.mBytesPerPacket=4; inputdesc.mFramesPerPacket=1; inputdesc.mBytesPerFrame=4; inputdesc.mChannelsPerFrame=2; inputdesc.mBitsPerChannel=16; inputdesc.mReserved=0;// dumpdesc(&inputdesc); err=AudioConverterNew(&inputdesc,&outputdesc,&conv); if (err) {// printf("AudioConvertNew failed %.*s/n",4,(char*)&err); return err; } return err; }
开发者ID:paulGolubev,项目名称:jumper,代码行数:51,
示例19: osx_output_enablestatic boolosx_output_enable(struct audio_output *ao, GError **error_r){ struct osx_output *oo = (struct osx_output *)ao; ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = oo->component_subtype; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; Component comp = FindNextComponent(NULL, &desc); if (comp == 0) { g_set_error(error_r, osx_output_quark(), 0, "Error finding OS X component"); return false; } OSStatus status = OpenAComponent(comp, &oo->au); if (status != noErr) { g_set_error(error_r, osx_output_quark(), status, "Unable to open OS X component: %s", GetMacOSStatusCommentString(status)); return false; } if (!osx_output_set_device(oo, error_r)) { CloseComponent(oo->au); return false; } AURenderCallbackStruct callback; callback.inputProc = osx_render; callback.inputProcRefCon = oo; ComponentResult result = AudioUnitSetProperty(oo->au, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &callback, sizeof(callback)); if (result != noErr) { CloseComponent(oo->au); g_set_error(error_r, osx_output_quark(), result, "unable to set callback for OS X audio unit"); return false; } return true;}
开发者ID:Acidburn0zzz,项目名称:mpd,代码行数:50,
示例20: MinimalSGSettingsDialog// SGSettingsDialog with the "Compression" panel removedstatic OSErr MinimalSGSettingsDialog(SeqGrabComponent seqGrab, SGChannel sgchanVideo, WindowPtr gMonitor){ OSErr err; Component *panelListPtr = NULL; UInt8 numberOfPanels = 0; ComponentDescription cd = { SeqGrabPanelType, VideoMediaType, 0, 0, 0 }; Component c = 0; Component *cPtr = NULL; numberOfPanels = CountComponents(&cd); panelListPtr = (Component *) NewPtr(sizeof(Component) * (numberOfPanels + 1)); cPtr = panelListPtr; numberOfPanels = 0; CFStringRef compressionCFSTR = CFSTR("Compression"); do { ComponentDescription compInfo; c = FindNextComponent(c, &cd); if (c) { Handle hName = NewHandle(0); GetComponentInfo(c, &compInfo, hName, NULL, NULL); CFStringRef nameCFSTR = CFStringCreateWithPascalString(kCFAllocatorDefault, (unsigned char *)(*hName), kCFStringEncodingASCII); if (CFStringCompare (nameCFSTR, compressionCFSTR, kCFCompareCaseInsensitive) != kCFCompareEqualTo) { *cPtr++ = c; numberOfPanels++; } DisposeHandle(hName); } } while (c); if ((err = SGSettingsDialog(seqGrab, sgchanVideo, numberOfPanels, panelListPtr, seqGrabSettingsPreviewOnly, (SGModalFilterUPP) NewSGModalFilterUPP(SeqGrabberModalFilterProc), (long)gMonitor))) { return err; } return 0;}
开发者ID:MattHung,项目名称:sage-graphics,代码行数:50,
示例21: FindNextComponentOSStatus CAPlayThrough::SetupAUHAL(AudioDeviceID in){ OSStatus err = noErr; Component comp; ComponentDescription desc; //There are several different types of Audio Units. //Some audio units serve as Outputs, Mixers, or DSP //units. See AUComponent.h for listing desc.componentType = kAudioUnitType_Output; //Every Component has a subType, which will give a clearer picture //of what this components function will be. desc.componentSubType = kAudioUnitSubType_HALOutput; //all Audio Units in AUComponent.h must use //"kAudioUnitManufacturer_Apple" as the Manufacturer desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; //Finds a component that meets the desc spec's comp = FindNextComponent(NULL, &desc); if (comp == NULL) exit (-1); //gains access to the services provided by the component OpenAComponent(comp, &mInputUnit); //AUHAL needs to be initialized before anything is done to it err = AudioUnitInitialize(mInputUnit); checkErr(err); err = EnableIO(); checkErr(err); err= SetInputDeviceAsCurrent(in); checkErr(err); err = CallbackSetup(); checkErr(err); //Don't setup buffers until you know what the //input and output device audio streams look like. err = AudioUnitInitialize(mInputUnit); return err;}
开发者ID:aranm,项目名称:CAPlayThrough,代码行数:49,
示例22: QTMissing_IsComponentOfTypeAvailableBoolean QTMissing_IsComponentOfTypeAvailable (OSType theType, OSType theSubType){ ComponentDescription myCompDesc; Component myComponent = NULL; // look for the specified component myCompDesc.componentType = theType; myCompDesc.componentSubType = theSubType; myCompDesc.componentManufacturer = 0; myCompDesc.componentFlags = 0; myCompDesc.componentFlagsMask = cmpIsMissing; myComponent = FindNextComponent(NULL, &myCompDesc); return(myComponent != NULL);}
开发者ID:fruitsamples,项目名称:qtmissingcomp.win,代码行数:16,
示例23: coreaudio_initstatic intcoreaudio_init (void) { trace ("coreaudio_init/n"); //selecting the default output unit ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; OSStatus err = noErr; Component comp = FindNextComponent(NULL, &desc); if (comp == NULL) { trace ("FindNextComponent= failed to find the default output component./n"); return -1; } err = OpenAComponent(comp, &output_unit); if (comp == NULL) { trace ("OpenAComponent= %s/n", GetMacOSStatusErrorString(err)); return -1; } // filling out the description for linear PCM data (can only be called after opening audio component) if (coreaudio_set_data_format(&plugin.fmt) < 0) return -1; // callback AURenderCallbackStruct input_cb; input_cb.inputProc = coreaudio_callback; input_cb.inputProcRefCon = NULL; err = AudioUnitSetProperty(output_unit, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Input, 0, &input_cb, sizeof(input_cb)); if (err) { trace ("AudioUnitSetProperty-CB= %s/n", GetMacOSStatusErrorString(err)); return -1; } // Initialize unit err = AudioUnitInitialize(output_unit); if (err) { trace ("AudioUnitInitialize= %s/n", GetMacOSStatusErrorString(err)); return -1; } au_state = 1; // audio unit initialised state = OUTPUT_STATE_STOPPED; return 0;}
开发者ID:amitkr,项目名称:deadbeef,代码行数:47,
示例24: CountComponents// 1.// Create the Sequence Grabber (using GWorld as target memory)void QuicktimeLiveImageStream::createSequenceGrabber(){ ComponentDescription sg_component_description; sg_component_description.componentType = SeqGrabComponentType; /* A unique 4-byte code indentifying the command set */ sg_component_description.componentSubType = 0L; /* Particular flavor of this instance */ sg_component_description.componentManufacturer = 'appl'; /* Vendor indentification */ sg_component_description.componentFlags = 0L; /* 8 each for Component,Type,SubType,Manuf/revision */ sg_component_description.componentFlagsMask = 0L; /* Mask for specifying which flags to consider in search, zero during registration */ long num_sg_components = CountComponents (&sg_component_description); if (num_sg_components) { Component aComponent = 0; ComponentDescription full_sg_component_description = sg_component_description; aComponent = FindNextComponent(aComponent, &full_sg_component_description); if (aComponent) { m_gSeqGrabber = OpenComponent(aComponent); // If we got a sequence grabber, set it up if (m_gSeqGrabber != 0L) { // Check capability and setting of Sequence Grabber GDHandle origDevice; CGrafPtr origPort; // Create GWorld GetGWorld (&origPort, &origDevice); SetGWorld (m_gw, NULL); // set current graphics port to offscreen // Initialize the sequence grabber ComponentResult result = noErr; result = SGInitialize (m_gSeqGrabber); if (result == noErr) { // Set GWorld result = SGSetGWorld(m_gSeqGrabber, (CGrafPtr)m_gw, 0); if (result != noErr) { OSG_FATAL << "Could not set GWorld on SG" << std::endl; } } // Set GWorld back SetGWorld(origPort, origDevice); } } }}
开发者ID:hyyh619,项目名称:OpenSceneGraph-3.4.0,代码行数:48,
示例25: init_audio_unitstatic void init_audio_unit(AudioUnit *au) { OSStatus err = noErr; ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_HALOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; Component comp = FindNextComponent(NULL, &desc); if (comp == NULL) { DBG_DYNA_AUDIO_DRV("!!CoreAudio: can't audio component/n"); } err = OpenAComponent(comp, au); if (err != noErr) { DBG_DYNA_AUDIO_DRV("!!CoreAudio: can't open audio component/n"); }}
开发者ID:gabrieldelsaint,项目名称:UIM,代码行数:19,
示例26: PyMac_PRECHECKstatic PyObject *Cm_FindNextComponent(PyObject *_self, PyObject *_args){ PyObject *_res = NULL; Component _rv; Component aComponent; ComponentDescription looking;#ifndef FindNextComponent PyMac_PRECHECK(FindNextComponent);#endif if (!PyArg_ParseTuple(_args, "O&O&", CmpObj_Convert, &aComponent, CmpDesc_Convert, &looking)) return NULL; _rv = FindNextComponent(aComponent, &looking); _res = Py_BuildValue("O&", CmpObj_New, _rv); return _res;}
开发者ID:JupiterSmalltalk,项目名称:openqwaq,代码行数:19,
示例27: callocstatic au_instance_t *audiounits_create_player(SEXP source, float rate, int flags) { ComponentDescription desc = { kAudioUnitType_Output, kAudioUnitSubType_DefaultOutput, kAudioUnitManufacturer_Apple, 0, 0 }; Component comp; OSStatus err; au_instance_t *ap = (au_instance_t*) calloc(sizeof(au_instance_t), 1); ap->source = source; ap->sample_rate = rate; ap->done = NO; ap->position = 0; ap->length = LENGTH(source); ap->stereo = NO; { /* if the source is a matrix with 2 rows then we'll use stereo */ SEXP dim = Rf_getAttrib(source, R_DimSymbol); if (TYPEOF(dim) == INTSXP && LENGTH(dim) > 0 && INTEGER(dim)[0] == 2) ap->stereo = YES; } ap->loop = (flags & APFLAG_LOOP) ? YES : NO; memset(&ap->fmtOut, 0, sizeof(ap->fmtOut)); ap->fmtOut.mSampleRate = ap->sample_rate; ap->fmtOut.mFormatID = kAudioFormatLinearPCM; ap->fmtOut.mChannelsPerFrame = ap->stereo ? 2 : 1; ap->fmtOut.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;#if __ppc__ || __ppc64__ || __BIG_ENDIAN__ ap->fmtOut.mFormatFlags |= kAudioFormatFlagIsBigEndian;#endif ap->fmtOut.mFramesPerPacket = 1; ap->fmtOut.mBytesPerPacket = ap->fmtOut.mBytesPerFrame = ap->fmtOut.mFramesPerPacket * ap->fmtOut.mChannelsPerFrame * 2; ap->fmtOut.mBitsPerChannel = 16; if (ap->stereo) ap->length /= 2; comp = FindNextComponent(NULL, &desc); if (!comp) Rf_error("unable to find default audio output"); err = OpenAComponent(comp, &ap->outUnit); if (err) Rf_error("unable to open default audio (%08x)", err); err = AudioUnitInitialize(ap->outUnit); if (err) { CloseComponent(ap->outUnit); Rf_error("unable to initialize default audio (%08x)", err); } R_PreserveObject(ap->source); return ap;}
开发者ID:brezniczky,项目名称:audio,代码行数:42,
示例28: CheckInitstatic OSStatus CheckInit (){ if (playBackWasInit) return 0; OSStatus result = noErr; callbackSem = SDL_CreateSemaphore(0); SDL_CreateThread(RunCallBackThread, NULL); { ComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; Component comp = FindNextComponent (NULL, &desc); if (comp == NULL) { SDL_SetError ("CheckInit: FindNextComponent returned NULL"); if (result) return -1; } result = OpenAComponent (comp, &theUnit); if (result) return -1; result = AudioUnitInitialize (theUnit); if (result) return -1; playBackWasInit = true; } return 0;}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:41,
示例29: ca_open_playbackstatic ALCenum ca_open_playback(ALCdevice *device, const ALCchar *deviceName){ ComponentDescription desc; Component comp; ca_data *data; OSStatus err; if(!deviceName) deviceName = ca_device; else if(strcmp(deviceName, ca_device) != 0) return ALC_INVALID_VALUE; /* open the default output unit */ desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; comp = FindNextComponent(NULL, &desc); if(comp == NULL) { ERR("FindNextComponent failed/n"); return ALC_INVALID_VALUE; } data = calloc(1, sizeof(*data)); device->ExtraData = data; err = OpenAComponent(comp, &data->audioUnit); if(err != noErr) { ERR("OpenAComponent failed/n"); free(data); device->ExtraData = NULL; return ALC_INVALID_VALUE; } return ALC_NO_ERROR;}
开发者ID:9heart,项目名称:DT3,代码行数:40,
示例30: Closebool CCoreAudioUnit::Open(ComponentDescription desc){ if (m_Component) Close(); // Find the required Component Component outputComp = FindNextComponent(NULL, &desc); if (outputComp == NULL) // Unable to find the AudioUnit we requested { CLog::Log(LOGERROR, "CCoreAudioUnit::Open: Unable to locate AudioUnit Component."); return false; } // Create an instance of the AudioUnit Component OSStatus ret = OpenAComponent(outputComp, &m_Component); if (ret) // Unable to open AudioUnit { CLog::Log(LOGERROR, "CCoreAudioUnit::Open: Unable to open AudioUnit Component. Error = 0x%08x (%4.4s)", ret, CONVERT_OSSTATUS(ret)); return false; } return true;}
开发者ID:flyingtime,项目名称:boxee,代码行数:22,
注:本文中的FindNextComponent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ FindNextFile函数代码示例 C++ FindNext函数代码示例 |