void CPDFSDK_PageView::LoadFXAnnots() { CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled(); //Disable the default AP construction. CPDF_InterForm::EnableUpdateAP(FALSE); m_pAnnotList = new CPDF_AnnotList(m_page); CPDF_InterForm::EnableUpdateAP(enableAPUpdate); int nCount = m_pAnnotList->Count(); SetLock(TRUE); for(int i=0; i<nCount; i++) { CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i); CPDF_Document * pDoc = GetPDFDocument(); CheckUnSupportAnnot(pDoc, pPDFAnnot); CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); ASSERT(pAnnotHandlerMgr != NULL); if(pAnnotHandlerMgr) { CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this); if(!pAnnot) continue; m_fxAnnotArray.Add(pAnnot); pAnnotHandlerMgr->Annot_OnLoad(pAnnot); } } SetLock(FALSE); }
void setupInBuffer() { if(infd>0) { ALOGW("Tried to open buffer twice!"); return; // already made } infd = open("/dev/audio/audio_loop", O_RDWR, S_IRUSR|S_IWUSR); if(infd<0) { ALOGE("Could not open microphone audio loop buffer!"); return; } ALOGE("successfully opened microphone audio loop buffer in /dev/audio/audio_loop"); // expand file to correct size //lseek(infd, sizeof(unsigned short)*(BUFFER_SIZE+1)-1, SEEK_SET); //write(infd, " ", 1); // mmap inposition = (unsigned short*) mmap(NULL, sizeof(unsigned short)*(BUFFER_SIZE+1), PROT_READ|PROT_WRITE, MAP_SHARED, infd, 0); if(!inposition) ALOGE("Could not MMAP audio loop microphone buffer!"); ALOGI("Opened audio loop microphone successfully."); indata = inposition+sizeof(unsigned short); // set initial read lock on buffer if (SetLock(infd) == -1) ALOGI("Error setting fnctl lock for input buffer!\n"); }
HS_DBREF CHSInterface::ConsoleUser(int objnum) { HS_DBREF dbUser; dbUser = GetLock(objnum, LOCK_USE); if (dbUser == HSNOTHING || objnum == HSNOTHING) return HSNOTHING; #ifndef TM3 if (IsPlayer(dbUser)) #else if (isPlayer(dbUser)) #endif { // If the user is not in the same location as the object, // set the lock to the object and return NOTHING. #ifdef PENNMUSH if (Location(dbUser) != Location(objnum) || !HasFlag(dbUser, TYPE_PLAYER, PLAYER_CONNECT) && IsPlayer(dbUser)) #else if (Location(dbUser) != Location(objnum) || !Connected(dbUser) && isPlayer(dbUser)) #endif { SetLock(objnum, objnum, LOCK_USE); // Delete attribute from player. hsInterface.AtrDel(dbUser, "MCONSOLE", GOD); #ifdef PENNMUSH notify_except(db[Location(objnum)].contents, dbUser, tprintf("%s unmans the %s.", Name(dbUser), Name(objnum)), 0); #else notify_except(Location(objnum), dbUser, NOTHING, tprintf("%s unmans the %s.", Name(dbUser), Name(objnum)), 0); #endif return NOTHING; } } return dbUser; }
void EffectPanelUtils::OnLockButtonClick(wxCommandEvent& event) { wxButton * button = (wxButton*)event.GetEventObject(); SetLock(button); }