void MainWindow::on_comboBox_TrackerSelect_currentIndexChanged(QString s) { QString ct = ui->comboBox_TrackerSelect->currentText(); if (!ct.isEmpty() && _previouslySelectedTracker != ct) { _previouslySelectedTracker = ct; Q_EMIT selectPlugin(ct); } }
//------------------------------------------------------------------------- // select the plug-in by index void PluginRegistry::selectPluginByIndex (size_t idx) { AbstractPlugin* p = getPluginAt( idx ); if( ( p != nullptr ) && (p != getSelectedPlugin()) ) { selectPlugin( p ); } }
//------------------------------------------------------------------------- // select the "next" plug-in, cycling through "plug-in selection order" void PluginRegistry::selectNextPlugin (void) { if( getSelectedPlugin() == nullptr ) { return; } selectPlugin( getSelectedPlugin()->next () ); }
PluginManagerWidget::PluginManagerWidget( QWidget *parent ) : QWidget( parent ), m_ui( new Ui::PluginManagerWidget ) { m_ui->setupUi(this); pluginsModel = new QStandardItemModel(this); m_ui->viewPlugins->setModel( pluginsModel ); connect( m_ui->viewPlugins, SIGNAL(clicked(QModelIndex)), SLOT(selectPlugin(QModelIndex)) ); }
void PluginListView::currentChanged ( const QModelIndex & current, const QModelIndex & previous ) { QAbstractItemView::currentChanged(current,previous); selectPlugin(current); }
static int plugin_run(struct playerHandles *ph, char *key, int *totaltime){ int ret,temp=-1; struct pluginitem *plugin; struct streamInfo si; pthread_t threads; char buf[S_BUFSIZE+1]; fd_set fdset; struct timeval timeout; int rfd; int i; if(!(si.name=malloc((SI_NAME_SIZE+1)*sizeof(char))) || !(si.description=malloc((SI_DESCRIPTION_SIZE+1)*sizeof(char))) || !(si.genre=malloc((SI_GENRE_SIZE+1)*sizeof(char))) || !(si.type=malloc((SI_TYPE_SIZE+1)*sizeof(char)))){ fprintf(stderr,"Can't malloc for si\n"); return DEC_RET_ERROR; } memset(si.name,0,SI_NAME_SIZE); memset(si.genre,0,SI_GENRE_SIZE); memset(si.description,0,SI_DESCRIPTION_SIZE); memset(si.type,0,SI_TYPE_SIZE); si.bitrate=0; h.metaint=h.bytecount=0; h.go=1; streamIO(parse_meta_si,&si); print_stream_meta(&si); if(!(plugin=selectPlugin(ph->plugin_head,si.type))){ fprintf(stderr,"No plugin matches content-type. Trying first plugin.\n"); for(i=0;i<PLUGIN_NULL && ph->plugin_head[i]==NULL;i++) plugin=ph->plugin_head[i]; if(plugin==NULL) return -1; } ph->ffd=h.rfd; pthread_create(&threads,NULL,(void *)&sio_thread,(void *)ph); ret=plugin->modplay(ph,key,&temp); h.go=0; //#if defined(__APPLE__) || defined(Linux) rfd=fileno(h.rfd); do{ timeout.tv_sec=0; timeout.tv_usec=100000; FD_ZERO(&fdset); FD_SET(rfd,&fdset); if(select(1,&fdset,NULL,NULL,&timeout)<1) break; }while((temp=fread(buf,1,S_BUFSIZE,h.rfd))==S_BUFSIZE); // OSX seems to block when closing the write end unless the read end is first closed close(rfd); h.rfd=NULL; //#else #if 0 if(pthread_cancel(threads)!=0)fprintf(stderr,"Failed cancel.\n"); if(pthread_join(threads,NULL)!=0)fprintf(stderr,"Failed join\n"); #endif //usleep(100000); return ret; }