bool DepthCamera::start() { if (isRunning()) { logger(LOG_ERROR) << "DepthCamera: Camera is already running. Please stop it before calling start() again." << std::endl; return false; } wait(); if (_captureThread && _captureThread->joinable()) { logger(LOG_ERROR) << "DepthCamera: Camera is still running. Please wait for the current capture loop to complete before calling start() again." << std::endl; return false; } if(!_callBackTypesRegistered) { logger(LOG_ERROR) << "DepthCamera: Please register a callback to " << _id << " before starting capture" << std::endl; return false; } resetFilters(); if(!_start()) return false; _running = true; _isPaused = false; //_captureThreadWrapper(); _captureThread = ThreadPtr(new Thread(&DepthCamera::_captureThreadWrapper, this)); return true; }
RKObjectListViewSettings::RKObjectListViewSettings (bool tool_window, QObject* parent) : QSortFilterProxyModel (parent) { RK_TRACE (APP); is_tool_window = tool_window; update_timer = new QTimer (this); update_timer->setSingleShot (true); connect (update_timer, SIGNAL(timeout()), this, SLOT(updateSelfNow())); filter_widget = 0; in_reset_filters = false; persistent_settings_actions[ShowObjectsHidden] = new QAction (i18n ("Show Hidden Objects"), this); persistent_settings_actions[ShowFieldsType] = new QAction (i18n ("Type"), this); persistent_settings_actions[ShowFieldsLabel] = new QAction (i18n ("Label"), this); persistent_settings_actions[ShowFieldsClass] = new QAction (i18n ("Class"), this); for (int i = 0; i < SettingsCount; ++i) { if (is_tool_window) persistent_settings[i] = RKSettingsModuleObjectBrowser::isDefaultForWorkspace ((PersistentSettings) i); else persistent_settings[i] = RKSettingsModuleObjectBrowser::isDefaultForVarselector ((PersistentSettings) i); persistent_settings_actions[i]->setCheckable (true); persistent_settings_actions[i]->setChecked (persistent_settings[i]); connect (persistent_settings_actions[i], SIGNAL (toggled(bool)), this, SLOT(filterSettingsChanged ())); } resetFilters (); // inits defaults }
void ResamplingAudioSource::flushBuffers() { buffer.clear(); bufferPos = 0; sampsInBuffer = 0; subSampleOffset = 0.0; resetFilters(); }
//============================================================================== void FilteringAudioSource::prepareToPlay (int samplesPerBlockExpected, double sampleRate_) { sampleRate = sampleRate_; resetFilters(); if (input != nullptr) input->prepareToPlay (samplesPerBlockExpected, sampleRate); }
//======================================================================== FilteringAudioSource::FilteringAudioSource (AudioSource* inputSource, bool deleteInputWhenDeleted) : input (inputSource, deleteInputWhenDeleted), sampleRate (44100.0), filterSource (true) { jassert (input != nullptr); gains[Low] = 1.0f; gains[Mid] = 1.0f; gains[High] = 1.0f; // configure the filters resetFilters(); }
bool DepthCamera::reset() { if(isRunning()) { logger(LOG_ERROR) << "DepthCamera: Please stop the depth camera before calling reset" << std::endl; return false; } if(!_reset()) { logger(LOG_ERROR) << "DepthCamera: Failed to reset device " << id() << std::endl; return false; } resetFilters(); return true; }
void ResamplingAudioSource::prepareToPlay (int samplesPerBlockExpected, double sampleRate) { const SpinLock::ScopedLockType sl (ratioLock); input->prepareToPlay (samplesPerBlockExpected, sampleRate); buffer.setSize (numChannels, roundToInt (samplesPerBlockExpected * ratio) + 32); buffer.clear(); sampsInBuffer = 0; bufferPos = 0; subSampleOffset = 0.0; filterStates.calloc ((size_t) numChannels); srcBuffers.calloc ((size_t) numChannels); destBuffers.calloc ((size_t) numChannels); createLowPass (ratio); resetFilters(); }
int LogStream::doCycle () { return fc->flush (&nbw) || streamCycle () || resetFilters (); }
void LLPanelMainInventory::onCustomAction(const LLSD& userdata) { if (!isActionEnabled(userdata)) return; const std::string command_name = userdata.asString(); if (command_name == "new_window") { newWindow(); } if (command_name == "sort_by_name") { const LLSD arg = "name"; setSortBy(arg); } if (command_name == "sort_by_recent") { const LLSD arg = "date"; setSortBy(arg); } if (command_name == "show_filters") { toggleFindOptions(); } if (command_name == "reset_filters") { resetFilters(); } if (command_name == "close_folders") { closeAllFolders(); } if (command_name == "empty_trash") { const std::string notification = "ConfirmEmptyTrash"; gInventory.emptyFolderType(notification, LLFolderType::FT_TRASH); } if (command_name == "empty_lostnfound") { const std::string notification = "ConfirmEmptyLostAndFound"; gInventory.emptyFolderType(notification, LLFolderType::FT_LOST_AND_FOUND); } if (command_name == "save_texture") { saveTexture(userdata); } // This doesn't currently work, since the viewer can't change an assetID an item. if (command_name == "regenerate_link") { LLInventoryPanel *active_panel = getActivePanel(); LLFolderViewItem* current_item = active_panel->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } const LLUUID item_id = current_item->getListener()->getUUID(); LLViewerInventoryItem *item = gInventory.getItem(item_id); if (item) { item->regenerateLink(); } active_panel->setSelection(item_id, TAKE_FOCUS_NO); } if (command_name == "find_original") { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } current_item->getListener()->performAction(getActivePanel()->getModel(), "goto"); } if (command_name == "find_links") { LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { return; } const LLUUID& item_id = current_item->getListener()->getUUID(); const std::string &item_name = current_item->getListener()->getName(); mFilterSubString = item_name; LLInventoryFilter *filter = mActivePanel->getFilter(); filter->setFilterSubString(item_name); mFilterEditor->setText(item_name); mFilterEditor->setFocus(TRUE); filter->setFilterUUID(item_id); filter->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); filter->setFilterLinks(LLInventoryFilter::FILTERLINK_ONLY_LINKS); } }
//----------------------------------------------------------------------------// SoundDevices::SoundDevices() { ALDEVICEINFO ALDeviceInfo; char *devices; int index; const char *defaultDeviceName; const char *actualDeviceName; // DeviceInfo vector stores, for each enumerated device, it's device name, selection status, spec version #, and extension support vDeviceInfo.empty(); vDeviceInfo.reserve(10); defaultDeviceIndex = 0; // grab function pointers for 1.0-API functions, and if successful proceed to enumerate all devices if (alcIsExtensionPresent(nullptr, "ALC_ENUMERATION_EXT")) { devices = (char *)alcGetString(nullptr, ALC_DEVICE_SPECIFIER); defaultDeviceName = (char *)alcGetString(nullptr, ALC_DEFAULT_DEVICE_SPECIFIER); index = 0; // go through device list (each device terminated with a single nullptr, list terminated with double nullptr) while (devices != nullptr) { if (strcmp(defaultDeviceName, devices) == 0) { defaultDeviceIndex = index; } ALCdevice *device = alcOpenDevice(devices); if (device) { ALCcontext *context = alcCreateContext(device, nullptr); if (context) { alcMakeContextCurrent(context); // if new actual device name isn't already in the list, then add it... actualDeviceName = alcGetString(device, ALC_DEVICE_SPECIFIER); bool bNewName = (getDeviceIndex(actualDeviceName) < 0); if ((bNewName) && (actualDeviceName != nullptr) && (strlen(actualDeviceName) > 0)) { memset(&ALDeviceInfo, 0, sizeof(ALDEVICEINFO)); ALDeviceInfo.bSelected = true; ALDeviceInfo.strDeviceName = actualDeviceName; alcGetIntegerv(device, ALC_MAJOR_VERSION, sizeof(int), &ALDeviceInfo.iMajorVersion); alcGetIntegerv(device, ALC_MINOR_VERSION, sizeof(int), &ALDeviceInfo.iMinorVersion); ALDeviceInfo.pvstrExtensions = new std::vector<Ogre::String>; // Check for ALC Extensions if (alcIsExtensionPresent(device, "ALC_EXT_CAPTURE") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_CAPTURE"); if (alcIsExtensionPresent(device, "ALC_EXT_EFX") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("ALC_EXT_EFX"); // Check for AL Extensions if (alIsExtensionPresent("AL_EXT_OFFSET") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_OFFSET"); if (alIsExtensionPresent("AL_EXT_LINEAR_DISTANCE") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_LINEAR_DISTANCE"); if (alIsExtensionPresent("AL_EXT_EXPONENT_DISTANCE") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("AL_EXT_EXPONENT_DISTANCE"); if (alIsExtensionPresent("EAX2.0") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("EAX2.0"); if (alIsExtensionPresent("EAX3.0") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("EAX3.0"); if (alIsExtensionPresent("EAX4.0") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("EAX4.0"); if (alIsExtensionPresent("EAX5.0") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("EAX5.0"); if (alIsExtensionPresent("EAX-RAM") == AL_TRUE) ALDeviceInfo.pvstrExtensions->push_back("EAX-RAM"); // Get Source Count ALDeviceInfo.uiSourceCount = getMaxNumSources(); vDeviceInfo.push_back(ALDeviceInfo); } alcMakeContextCurrent(nullptr); alcDestroyContext(context); } alcCloseDevice(device); } devices += strlen(devices) + 1; index += 1; } } resetFilters(); }
connect(ui->seqVolDial, SIGNAL(valueChanged(int)), this, SLOT(updateSEQ())); connect(ui->seqPlayPushButton, SIGNAL(clicked()), this, SLOT(updateSEQ())); connect(ui->seqSpeedupDial, SIGNAL(valueChanged(int)), this, SLOT(updateSEQ())); connect(ui->seqRecPushButton, SIGNAL(clicked()), this, SLOT(resetREC())); connect(ui->reverbGroupBox, SIGNAL(clicked(bool)), this, SLOT(toggleSFX(bool))); connect(ui->reverbc1SpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateReverb())); connect(ui->reverbc2SpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateReverb())); connect(ui->reverbc3SpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateReverb())); connect(ui->reverbc4SpinBox, SIGNAL(valueChanged(double)), this, SLOT(updateReverb())); connect(ui->reverbd1SspinBox, SIGNAL(valueChanged(int)), this, SLOT(updateReverb())); connect(ui->reverbd2SpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateReverb())); connect(ui->reverbd3SpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateReverb())); connect(ui->actionDAC, SIGNAL(triggered()), this, SLOT(openDACDialog())); connect(ui->filterUpdateButton, SIGNAL(clicked()), this, SLOT(updateFilters())); connect(ui->filterResetButton, SIGNAL(clicked()), this, SLOT(resetFilters())); connect(filterTypeBG, SIGNAL(buttonClicked(int)), this, SLOT(updateFilterType(int))); connect(serial, SIGNAL(readyRead()), this, SLOT(readSerial())); } void MainWindow::toggleControl(int id) { if(0 == id) { ui->envSetpointSpinBox->setEnabled(false); ui->envMaxSpinBox->setEnabled(false); ui->setpointLabel->setEnabled(false); ui->maxLabel->setEnabled(false); } else { ui->envSetpointSpinBox->setEnabled(true);