本文整理汇总了C++中CloseComponent函数的典型用法代码示例。如果您正苦于以下问题:C++ CloseComponent函数的具体用法?C++ CloseComponent怎么用?C++ CloseComponent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CloseComponent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QTDR_CloseDownHandlers
void QTDR_CloseDownHandlers (void)
{
if (gDataReader != NULL) {
DataHCloseForRead(gDataReader);
CloseComponent(gDataReader);
gDataReader = NULL;
}
if (gDataWriter != NULL) {
DataHCloseForWrite(gDataWriter);
CloseComponent(gDataWriter);
gDataWriter = NULL;
}
// dispose of the data buffer
if (gDataBuffer != NULL)
DisposePtr(gDataBuffer);
// dispose of the routine descriptors
if (gReadDataHCompletionUPP != NULL)
DisposeDataHCompletionUPP(gReadDataHCompletionUPP);
if (gWriteDataHCompletionUPP != NULL)
DisposeDataHCompletionUPP(gWriteDataHCompletionUPP);
gDoneTransferring = false;
#if TARGET_OS_WIN32
// kill the timer that tasks the data handlers
KillTimer(NULL, gTimerID);
#endif
}
开发者ID:fruitsamples,项目名称:ThreadsImporter,代码行数:32,代码来源:QTDataRef.c
示例2: OSSpinLockLock
CoreAudioOutput::~CoreAudioOutput()
{
OSSpinLockLock(_spinlockAU);
if(_au != NULL)
{
AudioOutputUnitStop(_au);
AudioUnitUninitialize(_au);
#if defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
if (IsOSXVersionSupported(10, 6, 0))
{
AudioComponentInstanceDispose(_au);
}
else
{
CloseComponent(_au);
}
#else
CloseComponent(_au);
#endif
_au = NULL;
}
OSSpinLockUnlock(_spinlockAU);
delete _buffer;
_buffer = NULL;
free(_spinlockAU);
_spinlockAU = NULL;
}
开发者ID:MoochMcGee,项目名称:desmume-plus,代码行数:31,代码来源:coreaudiosound.cpp
示例3: openMovSettingsPopup
void openMovSettingsPopup(TPropertyGroup *props, bool macBringToFront) {
#ifdef _WIN32
if (InitializeQTML(0) != noErr) return;
#endif
ComponentInstance ci =
OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
QTAtomContainer atoms;
QTNewAtomContainer(&atoms);
fromPropertiesToAtoms(*props, atoms);
ComponentResult err;
if ((err = SCSetSettingsFromAtomContainer(ci, atoms)) != noErr) {
CloseComponent(ci);
ci = OpenDefaultComponent(StandardCompressionType,
StandardCompressionSubType);
assert(false);
}
QTDisposeAtomContainer(atoms);
#ifdef MACOSX
// Install an external procedure to use a callback filter on the request
// settings dialog
// On MACOSX we need to change the dialog appearance in order to pop-up in front
// of the
// toonz main window.
/*
gProcStruct.filterProc = NewSCModalFilterUPP(QTCmpr_FilterProc);
// I don't install any hook
gProcStruct.hookProc = NULL;
gProcStruct.customName[0] = 0;
// I don't use refcon
gProcStruct.refcon = 0;
// set the current extended procs
SCSetInfo(ci, scExtendedProcsType, &gProcStruct);
*/
#endif
err = SCRequestSequenceSettings(ci);
// assert(err==noErr);
QTAtomContainer atomsOut;
if (SCGetSettingsAsAtomContainer(ci, &atomsOut) != noErr) assert(false);
fromAtomsToProperties(atomsOut, *props);
QTDisposeAtomContainer(atomsOut);
CloseComponent(ci);
// int dataSize=0, numChildren = 0, numLevels=0;
// retrieveData(settings, kParentAtomIsContainer, dataSize, numChildren,
// numLevels);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:59,代码来源:movsettings.cpp
示例4: osx_output_enable
static bool
osx_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,代码来源:osx_output_plugin.c
示例5: close_coreaudio
static int close_coreaudio(audio_output_t *ao)
{
mpg123_coreaudio_t* ca = (mpg123_coreaudio_t*)ao->userptr;
if (ca) {
ca->decode_done = 1;
while(!ca->play_done && ca->play) usleep(10000);
/* No matter the error code, we want to close it (by brute force if necessary) */
AudioConverterDispose(ca->converter);
AudioOutputUnitStop(ca->outputUnit);
AudioUnitUninitialize(ca->outputUnit);
CloseComponent(ca->outputUnit);
/* Free the ring buffer */
sfifo_close( &ca->fifo );
/* Free the conversion buffer */
if (ca->buffer) {
free( ca->buffer );
ca->buffer = NULL;
}
}
return 0;
}
开发者ID:abraxasrex,项目名称:mpk-mini-js,代码行数:27,代码来源:coreaudio.c
示例6: CoreAudioDrv_PCM_Shutdown
void CoreAudioDrv_PCM_Shutdown(void)
{
OSStatus result;
struct AudioUnitInputCallback callback;
if (!Initialised) {
return;
}
// stop processing the audio unit
CoreAudioDrv_PCM_StopPlayback();
// Remove the input callback
callback.inputProc = 0;
callback.inputProcRefCon = 0;
result = AudioUnitSetProperty(output_audio_unit,
kAudioUnitProperty_SetInputCallback,
kAudioUnitScope_Input,
0,
&callback,
sizeof(callback));
result = CloseComponent(output_audio_unit);
pthread_mutex_destroy(&mutex);
Initialised = 0;
}
开发者ID:JohnnyonFlame,项目名称:jfaudiolib,代码行数:27,代码来源:driver_coreaudio.c
示例7: HGetVol
//------------------------------------------------------------------------
bool pixel_map::save_as_qt(const char *filename) const
{
FSSpec fss;
OSErr err;
// get file specification to application directory
err = HGetVol(nil, &fss.vRefNum, &fss.parID);
if (err == noErr)
{
GraphicsExportComponent ge;
CopyCStringToPascal(filename, fss.name);
// I decided to use PNG as output image file type.
// There are a number of other available formats.
// Should I check the file suffix to choose the image file format?
err = OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypePNG, &ge);
if (err == noErr)
{
err = GraphicsExportSetInputGWorld(ge, m_pmap);
if (err == noErr)
{
err = GraphicsExportSetOutputFile (ge, &fss);
if (err == noErr)
{
GraphicsExportDoExport(ge, nil);
}
}
CloseComponent(ge);
}
}
return err == noErr;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:33,代码来源:agg_mac_pmap.cpp
示例8: OsxAudioUnitsOutput_Destroy
/*----------------------------------------------------------------------
| OsxAudioUnitsOutput_Destroy
+---------------------------------------------------------------------*/
static BLT_Result
OsxAudioUnitsOutput_Destroy(OsxAudioUnitsOutput* self)
{
/* drain the queue */
OsxAudioUnitsOutput_Drain(&ATX_BASE(self, BLT_OutputNode));
/* stop the audio pump */
OsxAudioUnitsOutput_Stop(&ATX_BASE_EX(self, BLT_BaseMediaNode, BLT_MediaNode));
/* close the audio unit */
if (self->audio_unit) {
ComponentResult result;
result = CloseComponent(self->audio_unit);
if (result != noErr) {
ATX_LOG_WARNING_1("CloseComponent failed (%d)", (int)result);
}
}
/* destroy the queue */
ATX_List_Destroy(self->packet_queue);
/* destroy the lock */
pthread_mutex_destroy(&self->lock);
/* destruct the inherited object */
BLT_BaseMediaNode_Destruct(&ATX_BASE(self, BLT_BaseMediaNode));
/* free the object memory */
ATX_FreeMemory(self);
return BLT_SUCCESS;
}
开发者ID:MattLeMay,项目名称:Bluetune,代码行数:36,代码来源:BltOsxAudioUnitsOutput.c
示例9: DirectAudioCodecClose
SMACsdec::~SMACsdec()
{
if(mDecoder != NULL)
{
#if USE_DIRECT_ADEC
DirectAudioCodecClose(mDecoder);
#else
CloseComponent(mDecoder);
#endif
}
delete[] mOutputBuffer;
delete[] mFloatBuffer;
#if TARGET_API_MAC_OSX
delete mThreadStateMutex;
mThreadStateMutex = NULL;
#endif
#if CaptureDataToFile
if(mOutputFileRefNum != -1)
{
FSCloseFork(mOutputFileRefNum);
}
#endif
}
开发者ID:MaddTheSane,项目名称:a52codec,代码行数:26,代码来源:SMACsdec.cpp
示例10: qt_mac_createCGImageFromQImage
QList<QByteArray> QMacPasteboardMimePict::convertFromMime(const QString &mime, QVariant variant,
QString flav)
{
QList<QByteArray> ret;
if (!resolveMimeQuickTimeSymbols())
return ret;
if (!canConvert(mime, flav))
return ret;
QCFType<CGImageRef> cgimage = qt_mac_createCGImageFromQImage(qvariant_cast<QImage>(variant));
Handle pic = NewHandle(0);
GraphicsExportComponent graphicsExporter;
ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType,
kQTFileTypePicture, &graphicsExporter);
if (!result) {
unsigned long sizeWritten;
result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage);
if (!result)
result = ptrGraphicsExportSetOutputHandle(graphicsExporter, pic);
if (!result)
result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten);
CloseComponent(graphicsExporter);
}
int size = GetHandleSize((Handle)pic);
// Skip the Picture File header (512 bytes) and feed the raw data
QByteArray ar(reinterpret_cast<char *>(*pic + 512), size - 512);
ret.append(ar);
DisposeHandle(pic);
return ret;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:32,代码来源:qmime_mac.cpp
示例11: coreaudio_free
static void coreaudio_free(void *data)
{
coreaudio_t *dev = (coreaudio_t*)data;
if (!dev)
return;
if (dev->dev_alive)
{
AudioOutputUnitStop(dev->dev);
#ifdef OSX_PPC
CloseComponent(dev->dev);
#else
AudioComponentInstanceDispose(dev->dev);
#endif
}
if (dev->buffer)
fifo_free(dev->buffer);
slock_free(dev->lock);
scond_free(dev->cond);
free(dev);
}
开发者ID:ColinKinloch,项目名称:RetroArch,代码行数:25,代码来源:coreaudio.c
示例12: coreaudio_free
static void coreaudio_free(void *data)
{
coreaudio_t *dev = (coreaudio_t*)data;
if (!dev)
return;
if (dev->dev_alive)
{
AudioOutputUnitStop(dev->dev);
#if (defined(__MACH__) && (defined(__ppc__) || defined(__ppc64__)))
CloseComponent(dev->dev);
#else
AudioComponentInstanceDispose(dev->dev);
#endif
}
if (dev->buffer)
fifo_free(dev->buffer);
slock_free(dev->lock);
scond_free(dev->cond);
free(dev);
}
开发者ID:Ezio-PS,项目名称:RetroArch,代码行数:25,代码来源:coreaudio.c
示例13: osx_output_disable
static void
osx_output_disable(struct audio_output *ao)
{
struct osx_output *oo = (struct osx_output *)ao;
CloseComponent(oo->au);
}
开发者ID:Acidburn0zzz,项目名称:mpd,代码行数:7,代码来源:osx_output_plugin.c
示例14: qWarning
QVariant QMacPasteboardMimePict::convertToMime(const QString &mime, QList<QByteArray> data, QString flav)
{
if(data.count() > 1)
qWarning("QMacPasteboardMimePict: Cannot handle multiple member data");
QVariant ret;
if (!resolveMimeQuickTimeSymbols())
return ret;
if(!canConvert(mime, flav))
return ret;
const QByteArray &a = data.first();
// This function expects the 512 header (just to skip it, so create the extra space for it).
Handle pic = NewHandle(a.size() + 512);
memcpy(*pic + 512, a.constData(), a.size());
GraphicsImportComponent graphicsImporter;
ComponentResult result = OpenADefaultComponent(GraphicsImporterComponentType,
kQTFileTypePicture, &graphicsImporter);
QCFType<CGImageRef> cgImage;
if (!result)
result = ptrGraphicsImportSetDataHandle(graphicsImporter, pic);
if (!result)
result = ptrGraphicsImportCreateCGImage(graphicsImporter, &cgImage,
kGraphicsImportCreateCGImageUsingCurrentSettings);
if (!result)
ret = QVariant(QPixmap::fromMacCGImageRef(cgImage).toImage());
CloseComponent(graphicsImporter);
DisposeHandle(pic);
return ret;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:31,代码来源:qmime_mac.cpp
示例15: verify_noerr
void AUEditWindow::CloseView ()
{
if (mEditView) {
verify_noerr(CloseComponent(mEditView));
mEditView = 0;
}
}
开发者ID:fruitsamples,项目名称:Services,代码行数:7,代码来源:AUEditWindow.cpp
示例16: QuickTimeComponentVersion
int __stdcall QuickTimeComponentVersion(char *type, char *subtype) {
OSType real_type, real_subtype;
ComponentInstance ci;
long version;
// If we don't have QuickTime, we can't have any components, either.
if (QuickTimeVersion() == 0)
return 0;
// If our type or subtype is invalid, return 0.
if (strlen(type) != 4 || strlen(subtype) != 4)
return 0;
// Convert our type strings to Macintosh OSType codes.
real_type = (type[0] << 24 | type[1] << 16 | type[2] << 8 | type[3]);
real_subtype =
(subtype[0] << 24 | subtype[1] << 16 | subtype[2] << 8 | subtype[3]);
// Open up an instance of our component.
ci = OpenDefaultComponent(real_type, real_subtype);
if (!ci)
return 0;
// Get the version of our component.
version = GetComponentVersion(ci);
if (GetComponentInstanceError(ci) != noErr)
return 0;
// Close our component instance.
if (CloseComponent(ci) != noErr)
return 0;
return version;
}
开发者ID:colonelqubit,项目名称:halyard,代码行数:34,代码来源:qtcheck.c
示例17: COREAUDIO_CloseDevice
static void
COREAUDIO_CloseDevice(_THIS)
{
if (this->hidden != NULL) {
if (this->hidden->audioUnitOpened) {
OSStatus result = noErr;
AURenderCallbackStruct callback;
const AudioUnitElement output_bus = 0;
const AudioUnitElement input_bus = 1;
const int iscapture = this->iscapture;
const AudioUnitElement bus =
((iscapture) ? input_bus : output_bus);
const AudioUnitScope scope =
((iscapture) ? kAudioUnitScope_Output :
kAudioUnitScope_Input);
/* stop processing the audio unit */
result = AudioOutputUnitStop(this->hidden->audioUnit);
/* Remove the input callback */
SDL_memset(&callback, '\0', sizeof(AURenderCallbackStruct));
result = AudioUnitSetProperty(this->hidden->audioUnit,
kAudioUnitProperty_SetRenderCallback,
scope, bus, &callback,
sizeof(callback));
CloseComponent(this->hidden->audioUnit);
this->hidden->audioUnitOpened = 0;
}
SDL_free(this->hidden->buffer);
SDL_free(this->hidden);
this->hidden = NULL;
}
}
开发者ID:DAOWAce,项目名称:pcsxr,代码行数:34,代码来源:SDL_coreaudio.c
示例18: Core_CloseAudio
void Core_CloseAudio(_THIS)
{
OSStatus result;
struct AURenderCallbackStruct callback;
/* stop processing the audio unit */
result = AudioOutputUnitStop (outputAudioUnit);
if (result != noErr) {
SDL_SetError("Core_CloseAudio: AudioOutputUnitStop");
return;
}
/* Remove the input callback */
callback.inputProc = 0;
callback.inputProcRefCon = 0;
result = AudioUnitSetProperty (outputAudioUnit,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Input,
0,
&callback,
sizeof(callback));
if (result != noErr) {
SDL_SetError("Core_CloseAudio: AudioUnitSetProperty (kAudioUnitProperty_SetInputCallback)");
return;
}
result = CloseComponent(outputAudioUnit);
if (result != noErr) {
SDL_SetError("Core_CloseAudio: CloseComponent");
return;
}
SDL_free(buffer);
}
开发者ID:ahpho,项目名称:wowmapviewer,代码行数:34,代码来源:SDL_coreaudio.c
示例19: InitializeQTExporters
void _HYPlatformGraphicPane::_SavePicture (_String prompt)
{
InitializeQTExporters ();
if (graphicsFormats.lLength)
{
_String filePath;
long menuChoice = SaveFileWithPopUp (filePath,
savePicPrompt,prompt,savePicAs,graphicsFormats);
if (menuChoice>=0)
{
ComponentInstance grexc = OpenComponent ((Component)qtGrexComponents(menuChoice));
GraphicsExportSetInputGWorld (grexc,thePane);
FSSpec fs;
Str255 buff;
StringToStr255 (filePath,buff);
FSMakeFSSpec(0,0,buff,&fs);
GraphicsExportSetOutputFile (grexc,&fs);
GraphicsExportRequestSettings (grexc,nil,nil);
unsigned long dummy;
OSType t,c;
GraphicsExportGetDefaultFileTypeAndCreator (grexc,&t,&c);
GraphicsExportSetOutputFileTypeAndCreator (grexc,t,c);
GraphicsExportDoExport (grexc,&dummy);
CloseComponent (grexc);
}
}
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:28,代码来源:HYPlatformGraphicPane.cpp
示例20: close_output
static void close_output(void)
{
if(dmp.fd == -1) return;
if(gNoteAllocator != NULL)
CloseComponent(gNoteAllocator);
dmp.fd = -1; //disabled
}
开发者ID:OS2World,项目名称:MM-SOUND-TiMidity-MCD,代码行数:7,代码来源:mac_qt_a.c
注:本文中的CloseComponent函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论