Пример #1
0
			BwtMergeTempFileNameSet(std::string const & tmpfilenamebase, uint64_t const id)
			: 
				gt(constructFileName(tmpfilenamebase,id,".gt")),
				bwt(constructFileName(tmpfilenamebase,id,".bwt")),
				hwt(constructFileName(tmpfilenamebase,id,".hwt")),
				hist(constructFileName(tmpfilenamebase,id,".hist")),
				sampledisa(constructFileName(tmpfilenamebase,id,".sampledisa"))
			{
				
			}
Пример #2
0
			BwtMergeTempFileNameSet(std::string const & tmpfilenamebase, uint64_t const id, uint64_t const numbwtfiles, uint64_t const numgtfiles)
			: 
				gt(constructFileNameVector(tmpfilenamebase,id,".gt",numgtfiles)),
				bwt(constructFileNameVector(tmpfilenamebase,id,".bwt",numbwtfiles)),
				hwtreq(constructFileName(tmpfilenamebase,id,".hwtreq")),
				hwt(constructFileName(tmpfilenamebase,id,".hwt")),
				hist(constructFileName(tmpfilenamebase,id,".hist")),
				sampledisa(constructFileName(tmpfilenamebase,id,".sampledisa"))
			{
				
			}
Пример #3
0
void gep::ScriptingManager::registerScript(const std::string& filename, LoadOptions::Enum loadOptions)
{
    GEP_ASSERT(m_state == State::AcceptingScriptRegistration,
        "You are not allowed to register a script at this point! "
        "Check 'filename' below to see which script was supposed to be registered",
        filename);
    m_scriptsToLoad.append(constructFileName(filename, loadOptions));
}
Пример #4
0
void gep::ScriptingManager::loadScript(const std::string& filename, LoadOptions::Enum loadOptions)
{
    auto scriptFileName = constructFileName(filename, loadOptions);

    // load and execute a Lua file
    int err = luaL_loadfile(m_L, scriptFileName.c_str());
    if(err != LUA_OK)
    {
        // the top of the stack should be the error string
        if (lua_isstring(m_L, lua_gettop(m_L)))
        {
            // get the top of the stack as the error and pop it off
            const char* theError = lua_tostring(m_L, lua_gettop(m_L));
            lua_pop(m_L, 1);

            luaL_error(m_L, theError);
        }
        else
        {
            luaL_error(m_L, "Unknown error loading Lua file \"%s\"", scriptFileName.c_str());
        }
    }
    else
    {
        // if not an error, then the top of the stack will be the function to call to run the file
        err = lua_pcall(m_L, 0, LUA_MULTRET, 0);
        if (err != LUA_OK)
        {
            // the top of the stack should be the error string
            if (lua_isstring(m_L, lua_gettop(m_L)))
            {
                // get the top of the stack as the error and pop it off
                const char* theError = lua_tostring(m_L, lua_gettop(m_L));
                lua_pop(m_L, 1);

                luaL_error(m_L, theError);
            }
            else
            {
                luaL_error(m_L, "Unknown error executing Lua file \"%s\"", scriptFileName.c_str());
            }
        }
    }
}
Пример #5
0
void Call::startRecording(bool force) {
	if (force)
		hideConfirmation(2);

	if (isRecording)
		return;

	if (handler->isConferenceRecording(confID)) {
		debug(QString("Call %1: call is part of a conference that is already being recorded").arg(id));
		return;
	}

	if (force) {
		emit showLegalInformation();
	} else {
		setShouldRecord();
		if (shouldRecord == 0)
			return;
		if (shouldRecord == 1)
			ask();
		else // shouldRecord == 2
			emit showLegalInformation();
	}

	debug(QString("Call %1: start recording").arg(id));

	// set up encoder for appropriate format

	timeStartRecording = QDateTime::currentDateTime();
	QString fn = constructFileName();

	stereo = preferences.get(Pref::OutputStereo).toBool();
	stereoMix = preferences.get(Pref::OutputStereoMix).toInt();

	QString format = preferences.get(Pref::OutputFormat).toString();

	if (format == "wav")
		writer = new WaveWriter;
	else if (format == "mp3")
		writer = new Mp3Writer;
	else /*if (format == "vorbis")*/
		writer = new VorbisWriter;

	if (preferences.get(Pref::OutputSaveTags).toBool())
		writer->setTags(constructCommentTag(), timeStartRecording);

	bool b = writer->open(fn, skypeSamplingRate, stereo);
	fileName = writer->fileName();

	if (!b) {
		QMessageBox *box = new QMessageBox(QMessageBox::Critical, PROGRAM_NAME " - Error",
			QString(PROGRAM_NAME " could not open the file %1.  Please verify the output file pattern.").arg(fileName));
		box->setWindowModality(Qt::NonModal);
		box->setAttribute(Qt::WA_DeleteOnClose);
		box->show();
		removeFile();
		delete writer;
		return;
	}

	serverLocal = new QTcpServer(this);
	serverLocal->listen();
	connect(serverLocal, SIGNAL(newConnection()), this, SLOT(acceptLocal()));
	serverRemote = new QTcpServer(this);
	serverRemote->listen();
	connect(serverRemote, SIGNAL(newConnection()), this, SLOT(acceptRemote()));

	QString rep1 = skype->sendWithReply(QString("ALTER CALL %1 SET_CAPTURE_MIC PORT=\"%2\"").arg(id).arg(serverLocal->serverPort()));
	QString rep2 = skype->sendWithReply(QString("ALTER CALL %1 SET_OUTPUT SOUNDCARD=\"default\" PORT=\"%2\"").arg(id).arg(serverRemote->serverPort()));

	if (!rep1.startsWith("ALTER CALL ") || !rep2.startsWith("ALTER CALL")) {
		QMessageBox *box = new QMessageBox(QMessageBox::Critical, PROGRAM_NAME " - Error",
			QString(PROGRAM_NAME " could not obtain the audio streams from Skype and can thus not record this call.\n\n"
			"The replies from Skype were:\n%1\n%2").arg(rep1, rep2));
		box->setWindowModality(Qt::NonModal);
		box->setAttribute(Qt::WA_DeleteOnClose);
		box->show();
		removeFile();
		delete writer;
		delete serverRemote;
		delete serverLocal;
		return;
	}

	if (preferences.get(Pref::DebugWriteSyncFile).toBool()) {
		syncFile.setFileName(fn + ".sync");
		syncFile.open(QIODevice::WriteOnly);
		syncTime.start();
	}

	isRecording = true;
	emit startedRecording(id);
}