void eDVBScan::PATready(int err) { SCAN_eDebug("[eDVBScan] got pat, err %d", err); m_ready |= readyPAT; if (!err) m_ready |= validPAT; startFilter(); // for starting the SDT filter }
/// Fill the menu with plugin names and make connections foreach(FilterPlugin* plugin, pluginManager()->filterPlugins()){ QAction* action = plugin->action(); mainWindow()->filterMenu->addAction(action); // Action refers to this filter, so we can retrieve it later // QAction* action = new QAction(plugin->name(),plugin); /// Does the filter have an icon? Add it to the toolbar /// @todo add functionality to ModelFilter if(!action->icon().isNull()) mainWindow()->filterToolbar->addAction(action); /// Connect after it has been added connect(action,SIGNAL(triggered()),this,SLOT(startFilter())); }
void eDVBScan::stateChange(iDVBChannel *ch) { int state; if (ch->getState(state)) return; if (m_channel_state == state) return; if (state == iDVBChannel::state_ok) { startFilter(); m_channel_state = state; } else if (state == iDVBChannel::state_failed) { if (m_ch_current && m_channel) { int type; m_ch_current->getSystem(type); m_ch_unavailable.push_back(m_ch_current); if (type == iDVBFrontend::feTerrestrial) { eDVBFrontendParametersTerrestrial parm; m_ch_current->getDVBT(parm); if (parm.system == eDVBFrontendParametersTerrestrial::System_DVB_T_T2) { /* we have to scan T2 as well as T */ ePtr<iDVBFrontend> fe; eDVBFrontendParameters eparm; parm.system = eDVBFrontendParametersTerrestrial::System_DVB_T2; eparm.setDVBT(parm); m_channel->getFrontend(fe); if (fe) { ePtr<iDVBFrontendParameters> feparm = new eDVBFrontendParameters(eparm); /* but only if the frontend supports T2 */ if (fe->isCompatibleWith(feparm)) { addChannelToScan(feparm); } } } } } nextChannel(); } /* unavailable will timeout, anyway. */ }
/// Fill the menu with plugin names and make connections foreach(FilterPlugin* plugin, pluginManager()->filterPlugins()){ QAction* action = plugin->action(); QString pluginName = plugin->name(); QMenu * assignedMenu = mainWindow()->filterMenu; // Check for categories if(pluginName.contains("|")) { // Split by delimiter, filter category then filter name QStringList pluginNames = pluginName.split("|"); action->setText( pluginNames.back().trimmed() ); QString catName = pluginNames.front().trimmed(); // Try to locate exciting submenu QMenu * m = nullptr; for(QMenu * child : assignedMenu->findChildren<QMenu*>()){ QString menuName = child->title(); if(menuName == catName){ m = child; break; } } if(m == nullptr) m = mainWindow()->filterMenu->addMenu(catName); assignedMenu = m; } assignedMenu->addAction(action); // Action refers to this filter, so we can retrieve it later // QAction* action = new QAction(plugin->name(),plugin); /// Does the filter have an icon? Add it to the toolbar /// @todo add functionality to ModelFilter if(!action->icon().isNull()) mainWindow()->filterToolbar->addAction(action); /// Connect after it has been added connect(action,SIGNAL(triggered()),this,SLOT(startFilter())); }
void eDVBScan::stateChange(iDVBChannel *ch) { int state; if (ch->getState(state)) return; if (m_channel_state == state) return; if (state == iDVBChannel::state_ok) { if (m_ch_current && m_channel) { int type; m_ch_current->getSystem(type); if (type == iDVBFrontend::feTerrestrial) { eDVBFrontendParametersTerrestrial parm; m_ch_current->getDVBT(parm); if (parm.system == eDVBFrontendParametersTerrestrial::System_DVB_T_T2) { /* we have a lock, this is a valid DVB-T transponder, set our system parameter */ parm.system = eDVBFrontendParametersTerrestrial::System_DVB_T; m_ch_current->setDVBT(parm); } } } if (!m_ch_blindscan.empty()) { /* update current blindscan iteration channel with scanned parameters */ if (m_ch_current && m_channel) { ePtr<iDVBFrontend> fe; m_channel->getFrontend(fe); if (fe) { ePtr<iDVBTransponderData> tp; fe->getTransponderData(tp, false); if (tp) { ePtr<eDVBFrontendParameters> feparm = new eDVBFrontendParameters; int type; m_ch_current->getSystem(type); switch (type) { case iDVBFrontend::feSatellite: { eDVBFrontendParametersSatellite parm; m_ch_current->getDVBS(parm); parm.system = tp->getSystem(); parm.frequency = tp->getFrequency(); parm.symbol_rate = tp->getSymbolRate(); parm.modulation = tp->getModulation(); feparm->setDVBS(parm); break; } case iDVBFrontend::feCable: { eDVBFrontendParametersCable parm; m_ch_current->getDVBC(parm); parm.system = tp->getSystem(); parm.frequency = tp->getFrequency(); parm.symbol_rate = tp->getSymbolRate(); parm.modulation = tp->getModulation(); feparm->setDVBC(parm); break; } case iDVBFrontend::feTerrestrial: { eDVBFrontendParametersTerrestrial parm; m_ch_current->getDVBT(parm); parm.system = tp->getSystem(); parm.frequency = tp->getFrequency(); parm.bandwidth = tp->getBandwidth(); parm.modulation = tp->getConstellation(); feparm->setDVBT(parm); break; } case iDVBFrontend::feATSC: { eDVBFrontendParametersATSC parm; m_ch_current->getATSC(parm); parm.system = tp->getSystem(); parm.frequency = tp->getFrequency(); feparm->setATSC(parm); break; } } m_ch_current = m_ch_blindscan_result = feparm; } } } } startFilter(); m_channel_state = state; } else if (state == iDVBChannel::state_failed) { if (m_ch_current && m_channel) { int type; m_ch_current->getSystem(type); m_ch_unavailable.push_back(m_ch_current); if (type == iDVBFrontend::feTerrestrial) { eDVBFrontendParametersTerrestrial parm; m_ch_current->getDVBT(parm); if (parm.system == eDVBFrontendParametersTerrestrial::System_DVB_T_T2) { /* we have to scan T2 as well as T */ ePtr<iDVBFrontend> fe; eDVBFrontendParameters eparm; parm.system = eDVBFrontendParametersTerrestrial::System_DVB_T2; eparm.setDVBT(parm); m_channel->getFrontend(fe); if (fe) { ePtr<iDVBFrontendParameters> feparm = new eDVBFrontendParameters(eparm); /* but only if the frontend supports T2 */ if (fe->isCompatibleWith(feparm)) { addChannelToScan(feparm); } } } } } if (!m_ch_blindscan.empty()) { /* tune failure, this means the blindscan channel iteration run has completed */ SCAN_eDebug("[eDVBScan] blindscan channel completed"); m_ch_blindscan.pop_front(); } nextChannel(); } /* unavailable will timeout, anyway. */ }
//filter void startVibration() { vibrationLedOn(); startFilter(); // manuel doc2466.pdf p.72+ // 8000000UL / 1024 = 7812.5 = 128 us de periode = compter 31.25 // 8000000UL / 256 = 31250.0 = 32 us de periode = compter 125 // -> close enough : divisible par 2? pas vraiment // -> avantage: atmega8 compteur 8 bits// FCPU 8000000UL / 1 = 125 ns de période // 8000000UL / 64 = 125000 = 8 us de periode = compter 500 // -> divisible par 2: 250, compteur 16 bits // 8000000UL / 8 = 1000000 = 1 us de periode = compter 4000 // FCPU 8000000UL / 1 = 125 ns de période = compter 32000 pour une période // 250 Hz = 4 ms periode // p76 : BOTTOM to OCR0 (P/2) cleared, OCR1:2000 us ou 2000 periode d'horloge/8 // BOTTOM to OCR0 (P/2) set OCR1 même // repeat // total : 4000 us: 4 ms: fréquence de 250 Hz : désiré // f.OC1A = 8 000 000/ ( 2 * 8 * (1+1999) ) = 250 TCNT1 = 0; // //OCR1A = 1999; // 1999 + 1 = 2000 (voir equation p.102) // f.OCnA = f.clk_I/O / ( 2 N (1+OCRnA) // N = 8 // HALF_PERIOD_COUNT *2 * N is desired OCR1A = HALF_PERIOD_COUNT-1; //see equation on p.102 for explanation on "-1" //WGM13:0 = 4 //COM1A1:0 = 0b01 (toggle on compare match) TCCR1A &= ~_BV(COM1A1); TCCR1A |= _BV(COM1A0); //pas touche au FOC1 : pas besoin, je crois //DDR_OC1A=1 // p. 112 CTC with OCR1A mode 0b0100 ou 0x4 TCCR1B &= ~_BV(WGM13); // WGM13 = 0 TCCR1B |= _BV(WGM12); // WGM12 = 1 TCCR1A &= ~_BV(WGM11); // WGM11 = 0 TCCR1A &= ~_BV(WGM10); // WGM10 = 0 //horloge /8 CS1 : 0b010 ou o2 ou 0x2 TCCR1B &= ~_BV(CS12); // CS12 = 0 TCCR1B |= _BV(CS11); // CS11 = 1 TCCR1B &= ~_BV(CS10); // CS10 = 0 //TIMSK1 no. No interrupt DDRD = 0xFF; }
void StepMotionBlurFilter::handleStartEvent( const media_timed_event* pEvent) { PRINT(("StepMotionBlurFilter::handleStartEvent\n")); startFilter(); }
void OffsetFilter::handleStartEvent( const media_timed_event* pEvent) { PRINT(("OffsetFilter::handleStartEvent\n")); startFilter(); }
void FlipTransition::handleStartEvent( const media_timed_event* pEvent) { PRINT(("FlipTransition::handleStartEvent\n")); startFilter(); }
void *filter(void *p){ queue_t *inQueue = (queue_t *) p; queue_t *outQueue = NULL; unsigned long long val = 0; unsigned long long divider = 2; pthread_t *nextThread = NULL; while(1){ val = dequeue(inQueue); if(outQueue != NULL){ // If the value 1 is given, start with terminating this filter. if(val == 1){ enqueue(outQueue, val); void *result; pthread_join(*nextThread, &result); free(nextThread); freeQueue(outQueue); break; } /* * If the value is not a multiple of this filter's divider * send it to the next filter. */ if(val % divider != 0){ enqueue(outQueue, val); } }else{ /* * No next filter yet, the first value in the queue is this * filter's divider. */ divider = val; if(val == 1){ break; } printf("%llu\n", divider); /* * Search for the next non multiple of the divider, the * value found will be the divider of the next filter. * If a 1 (terminate) is found, we don't have to build the * next filter. */ do{ val = dequeue(inQueue); }while(val != 1 && val % divider == 0); if(val != 1){ outQueue = newQueue(); if(outQueue == NULL){ break; } enqueue(outQueue, val); nextThread = startFilter(outQueue); }else{ break; } } } return NULL; }
void FlangerNode::handleStartEvent( const media_timed_event* pEvent) { PRINT(("FlangerNode::handleStartEvent\n")); startFilter(); }
/** Constructor */ SharedFilesDialog::SharedFilesDialog(RetroshareDirModel *_tree_model,RetroshareDirModel *_flat_model,QWidget *parent) : RsAutoUpdatePage(1000,parent),model(NULL) { /* Invoke the Qt Designer generated object setup routine */ ui.setupUi(this); NotifyQt *notify = NotifyQt::getInstance(); connect(notify, SIGNAL(filesPreModChanged(bool)), this, SLOT(preModDirectories(bool))); connect(notify, SIGNAL(filesPostModChanged(bool)), this, SLOT(postModDirectories(bool))); //== connect(ui.localButton, SIGNAL(toggled(bool)), this, SLOT(showFrame(bool))); //== connect(ui.remoteButton, SIGNAL(toggled(bool)), this, SLOT(showFrameRemote(bool))); //== connect(ui.splittedButton, SIGNAL(toggled(bool)), this, SLOT(showFrameSplitted(bool))); connect(ui.viewType_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentViewModel(int))); connect( ui.dirTreeView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( spawnCustomPopupMenu( QPoint ) ) ); connect(ui.indicatorCBox, SIGNAL(currentIndexChanged(int)), this, SLOT(indicatorChanged(int))); tree_model = _tree_model ; flat_model = _flat_model ; tree_proxyModel = new SFDSortFilterProxyModel(tree_model, this); tree_proxyModel->setSourceModel(tree_model); tree_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); tree_proxyModel->setSortRole(RetroshareDirModel::SortRole); tree_proxyModel->sort(COLUMN_NAME); flat_proxyModel = new SFDSortFilterProxyModel(flat_model, this); flat_proxyModel->setSourceModel(flat_model); flat_proxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); flat_proxyModel->setSortRole(RetroshareDirModel::SortRole); flat_proxyModel->sort(COLUMN_NAME); // Mr.Alice: I removed this because it causes a crash for some obscur reason. Apparently when the model is changed, the proxy model cannot // deal with the change by itself. Should I call something specific? I've no idea. Removing this does not seem to cause any harm either. //tree_proxyModel->setDynamicSortFilter(true); //flat_proxyModel->setDynamicSortFilter(true); connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter())); connect(ui.filterPatternLineEdit, SIGNAL(returnPressed()), this, SLOT(startFilter())); connect(ui.filterPatternLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(filterRegExpChanged())); /* Set header resize modes and initial section sizes */ QHeaderView * header = ui.dirTreeView->header () ; header->resizeSection ( COLUMN_NAME, 490 ); header->resizeSection ( COLUMN_SIZE, 70 ); header->resizeSection ( COLUMN_AGE, 100 ); header->resizeSection ( COLUMN_FRIEND,100); header->resizeSection ( COLUMN_DIR, 100 ); header->setStretchLastSection(false); /* Set Multi Selection */ ui.dirTreeView->setSelectionMode(QAbstractItemView::ExtendedSelection); /* Hide platform specific features */ copylinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard" ), this ); connect( copylinkAct , SIGNAL( triggered() ), this, SLOT( copyLink() ) ); copylinkhtmlAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Copy retroshare Links to Clipboard (HTML)" ), this ); connect( copylinkhtmlAct , SIGNAL( triggered() ), this, SLOT( copyLinkhtml() ) ); sendlinkAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links" ), this ); connect( sendlinkAct , SIGNAL( triggered() ), this, SLOT( sendLinkTo( ) ) ); #ifdef RS_USE_LINKS sendlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Send retroshare Links to Cloud" ), this ); connect( sendlinkCloudAct , SIGNAL( triggered() ), this, SLOT( sendLinkToCloud( ) ) ); addlinkCloudAct = new QAction(QIcon(IMAGE_COPYLINK), tr( "Add Links to Cloud" ), this ); connect( addlinkCloudAct , SIGNAL( triggered() ), this, SLOT( addLinkToCloud( ) ) ); #endif collCreateAct= new QAction(QIcon(IMAGE_COLLCREATE), tr("Create Collection..."), this) ; connect(collCreateAct,SIGNAL(triggered()),this,SLOT(collCreate())) ; collModifAct= new QAction(QIcon(IMAGE_COLLMODIF), tr("Modify Collection..."), this) ; connect(collModifAct,SIGNAL(triggered()),this,SLOT(collModif())) ; collViewAct= new QAction(QIcon(IMAGE_COLLVIEW), tr("View Collection..."), this) ; connect(collViewAct,SIGNAL(triggered()),this,SLOT(collView())) ; collOpenAct = new QAction(QIcon(IMAGE_COLLOPEN), tr( "Download from collection file..." ), this ) ; connect(collOpenAct, SIGNAL(triggered()), this, SLOT(collOpen())) ; }