예제 #1
0
void CRecordProcessor::init(QSettings* settings)
{
    time_t rawtime;
    struct tm * timeinfo;
    char buffer [80];


    QObject::connect( this, SIGNAL(updateFileText(QString)), parentwnd, SLOT(getFileText(QString)));
    QString txt = tr("none");
    emit updateFileText( txt );

    CvSize imgsize = imgdb->getImageSize();

    time ( &rawtime );
    timeinfo = localtime ( &rawtime );

    strftime (buffer,80,"sensbli-%Y-%m-%d_%H%M%S.avi",timeinfo);

    if( outfile != NULL )
    {
    	cvReleaseVideoWriter( &outfile );
    }
	outfile =cvCreateVideoWriter( buffer, CV_FOURCC('I','Y','U','V'), 25, cvSize(640,480), 1);

	QString filetext = buffer;
	emit updateFileText( filetext );


}
예제 #2
0
bool startLexer(PyrSymbol *fileSym, int startPos, int endPos, int lineOffset)
{
	char *filename = fileSym->name;

	textlen = -1;

	if(!fileSym->u.source) {
		if (!getFileText(filename, &text, &textlen)) return false;
		fileSym->u.source = text;
		rtf2txt(text);
	}
	else
		text = fileSym->u.source;

	if((startPos >= 0) && (endPos > 0)) {
		textlen = endPos - startPos;
		text += startPos;
	}
	else if(textlen == -1)
		textlen = strlen(text);

	if(lineOffset > 0) errLineOffset = lineOffset;
	else errLineOffset = 0;

	if(startPos > 0) errCharPosOffset = startPos;
	else errCharPosOffset = 0;

	initLongStack(&brackets);
	initLongStack(&closedFuncCharNo);
	initLongStack(&generatorStack);
	lastClosedFuncCharNo = 0;
	textpos = 0;
	linepos = 0;
	lineno = 1;
	charno = 0;

	yylen = 0;
	zzval = 0;
	parseFailed = 0;
	lexCmdLine = 0;
	strcpy(curfilename, filename);
	maxlinestarts = 1000;
	linestarts = (int*)pyr_pool_compile->Alloc(maxlinestarts * sizeof(int*));
	linestarts[0] = 0;
	linestarts[1] = 0;

	return true;
}
예제 #3
0
void checkValidComponent(const QString& path, std::string& errors)
{
	const std::string filePath(path.toUtf8().constData());
	const std::string str = getFileText(path, errors);

	const auto index = str.find("WGComponent");
	if (index == std::string::npos)
	{
		errors += filePath + " did not include WGComponent\n";
		return;
	}

	if (str.find("\"" + FilePath::getFileNoExtension(filePath) + "\"", index) == std::string::npos)
	{
		errors += filePath + " WGComponent was not named after file\n";
		return;
	}
}
예제 #4
0
GLuint loadShader(char * loc, GLenum type, GLuint * program)
{
	GLint status, shader = glCreateShader(type);
	char * data = getFileText(loc);

	glShaderSource(shader, 1, (const GLchar **) &data, NULL);
	glCompileShader(shader);

	if (!*program)
		*program = glCreateProgram();

	glAttachShader(*program, shader);
	glLinkProgram(*program);
	glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
	if (status == GL_FALSE) {
		printf("\nCould not compile %s, does your graphics card support GLSL shaders?\n", loc);
		return 0;
	}

	return shader;
}
예제 #5
0
std::vector<std::string> getFileTextLines(const char* file)
{
  return tokenize(getFileText(file),"\n",0,false);
}
예제 #6
0
GofunAbout::GofunAbout()
{
	setCaption(tr("GoFun About"));
	
	//This is the main grid
	QGridLayout* grid = new QGridLayout(this,4,1);
	grid->setMargin(2);
	
	//This is the 'propaganda' part ;)
	QLabel* left_propaganda = new QLabel(tr("The GNU"),this);
	left_propaganda->setAlignment(Qt::AlignCenter);
	QFont font;
	font.setBold(true);
	left_propaganda->setFont(font);
	QLabel* right_propaganda = new QLabel(tr("Fun Extension"),this);
	right_propaganda->setAlignment(Qt::AlignCenter);
	right_propaganda->setFont(font);
	QLabel* logo_label = new QLabel(this);
	logo_label->setPixmap(QImage("gofun.png").scale(100,100,QImage::ScaleMin));
	logo_label->setAlignment(Qt::AlignHCenter);
	QHBoxLayout* propaganda_layout = new QHBoxLayout;
	propaganda_layout->addWidget(left_propaganda);
	propaganda_layout->addWidget(logo_label);
	propaganda_layout->addWidget(right_propaganda);
	
	//In this group-box licensing information is presented
	QGroupBox* gb_gpl = new QGroupBox(tr("License"),this);
	gb_gpl->setColumnLayout(0, Qt::Vertical );
	gb_gpl->layout()->setSpacing( 6 );
	gb_gpl->layout()->setMargin( 5 );
	
	//In this group-box the credits are shown
	QGroupBox* gb_credits = new QGroupBox(tr("Credits"),this);
	gb_credits->setColumnLayout(0, Qt::Vertical );
	gb_credits->layout()->setSpacing( 6 );
	gb_credits->layout()->setMargin( 5 );
	
	//In this group-box contact and link information is presented
	QGroupBox* gb_cl = new QGroupBox(tr("Contact and links"),this);
	gb_cl->setColumnLayout(0, Qt::Vertical );
	gb_cl->layout()->setSpacing( 6 );
	gb_cl->layout()->setMargin( 5 );
	
	//The following layouts are used inside the group-boxes
	QGridLayout* grid_gpl = new QGridLayout(gb_gpl->layout(),1,1);
	QGridLayout* grid_credits = new QGridLayout(gb_credits->layout(),1,1);
	QGridLayout* grid_cl = new QGridLayout(gb_cl->layout(),2,2);
	
	//Create the text-fields and load the appropriate texts
	QTextEdit* t_gpl = new QTextEdit(gb_gpl);
	t_gpl->setReadOnly(true);
	t_gpl->setText(getFileText("../doc/gofun/COPYING"));
	QTextEdit* t_credits = new QTextEdit(gb_credits);
	t_credits->setReadOnly(true);
	t_credits->setText(getFileText("../doc/gofun/AUTHORS"));
		
	//This is our close-button
	QPushButton* close = new QPushButton(tr("Close"),this);
	connect(close,SIGNAL(clicked()),this,SLOT(hide()));
	
	grid->addLayout(propaganda_layout,0,0);
	grid->addWidget(gb_gpl,1,0);
	grid->addWidget(gb_credits,2,0);
	grid->addWidget(gb_cl,3,0);
	grid->addWidget(close,4,0);
		
	grid_gpl->addWidget(t_gpl,0,0);
	grid_credits->addWidget(t_credits,0,0);
	
	grid_cl->addWidget(new QLabel(tr("Homepage:"),gb_cl),0,0);
	grid_cl->addWidget(new QLabel(" http://gofun.berlios.de/\n",gb_cl),0,1);
	grid_cl->addWidget(new QLabel(tr("E-Mail:"),gb_cl),1,0);
	grid_cl->addWidget(new QLabel(" [email protected]",gb_cl),1,1);
}