// -------------------------------------------------------------------------------------------------------- void KFileTreeWidget::doubleClicked () { if (picked_pickable == current_dir_node) return; if (((KFileTreeNode*)picked_pickable)->getType() == KDL_FILE_TYPE_DIR) { setCurrentDir (((KFileTreeNode*)picked_pickable)->getAbsPathName()); } else { notifyReceivers (((KFileTreeNode*)picked_pickable)->getAbsPathName(), KDL_NOTIFICATION_TYPE_OPEN_FILE); notifyReceivers (); } }
// -------------------------------------------------------------------------------------------------------- void KFileTreeWidget::setCurrentDir ( const std::string & dirName ) { std::string absDirPath; if (dirName[0] == '.' && current_dir_node) { // path relative to the current directory should begin with a dot absDirPath = current_dir_node->getAbsPathName() + "/" + dirName; } else { absDirPath = kFileAbsPathName(dirName); } if (kFileIsDir(absDirPath) && (current_dir_node == NULL || (current_dir_node->getAbsPathName() != absDirPath))) { removeAllPickables(); if (current_dir_node) { delete current_dir_node; } current_dir_node = new KFileTreeDirCurrent(absDirPath); addPickable(up_node); addPickable(current_dir_node); current_dir_node->createTree(); up_node->setCurrentDir(current_dir_node); initializeIds(); deleteDisplayList(); notifyReceivers (current_dir_node->getAbsPathName(), KDL_NOTIFICATION_TYPE_OPEN_DIRECTORY); } }
/** * @brief Start the transmission of a TransmissionObject on this * PhysicalResource and notify all attached Receivers */ void startTransmission(TransmissionObjectPtr transmissionObject) { transmissionObject->setPhysicalResource(this); transmissionObject->setIsStart(true); notifyReceivers(transmissionObject); transmissionObjects.push_front(transmissionObject); };
// -------------------------------------------------------------------------------------------------------- bool KKeyRecorder::handleKey ( const KKey & key ) { if (key.name == "RETURN") { stopRecording(); return true; } if (recorded_sequence == "") { recorded_sequence = key.name; } else { recorded_sequence += " " + key.name; } num_recorded_keys++; if (num_recorded_keys >= max_num_recorded_keys) { stopRecording(); return true; } notifyReceivers(recorded_sequence); return true; }
void FrameCapture::captureLoop() { while(keepCapturing) { cv::Mat frame; *captureDevice >> frame; cv::flip( frame, frame, 1); //1 is flip horizontal notifyReceivers(frame); boost::this_thread::interruptible_wait(framerateWaitMs); } }
// -------------------------------------------------------------------------------------------------------- void KFileTreeWidget::picked () { deleteDisplayList(); notifyReceivers (((KFileTreeNode*)picked_pickable)->getPathName(), KDL_NOTIFICATION_TYPE_SELECT_NODE); }
/** * @brief Stop the transmission of a TransmissionObject on this * PhysicalResource and notify all attached Receivers */ void stopTransmission(TransmissionObjectPtr transmissionObject) { transmissionObject->setIsStart(false); notifyReceivers(transmissionObject); transmissionObjects.remove(transmissionObject); };
// -------------------------------------------------------------------------------------------------------- void KKeyRecorder::stopRecording () { recording = false; KEventHandler::setFocusKeyHandler(NULL); notifyReceivers(recorded_sequence); }