Exemplo n.º 1
0
OpenAL::~OpenAL()
{
    audioThread->exit();
    audioThread->wait();
    cleanupInput();
    cleanupOutput();
}
int SC_TerminalClient::run(int argc, char** argv)
{
	Options& opt = mOptions;

	if (!parseOptions(argc, argv, opt)) {
		return mReturnCode;
	}

	// finish argv processing
	const char* codeFile = 0;

	if (argc > 0) {
		codeFile = argv[0];
		opt.mDaemon = true;
		argv++; argc--;
	}

	opt.mArgc = argc;
	opt.mArgv = argv;

	// read library configuration file
	if (opt.mLibraryConfigFile) {
		int argLength = strlen(opt.mLibraryConfigFile);
		SC_LanguageConfig::readLibraryConfigYAML(opt.mLibraryConfigFile);
	} else
		SC_LanguageConfig::readDefaultLibraryConfig();

	// initialize runtime
	initRuntime(opt);

	// startup library
	mShouldBeRunning = true;
	compileLibrary();

	// enter main loop
	if (codeFile) executeFile(codeFile);
	if (opt.mCallRun) runMain();

	if (opt.mDaemon) {
		daemonLoop();
	}
	else {
		initInput();
		if( shouldBeRunning() ) startInput();
		if( shouldBeRunning() ) commandLoop();
		endInput();
		cleanupInput();
	}

	if (opt.mCallStop) stopMain();

	// shutdown library
	shutdownLibrary();
	flush();

	shutdownRuntime();

	return mReturnCode;
}
Exemplo n.º 3
0
Arquivo: audio.cpp Projeto: Pik-9/qTox
Audio::~Audio()
{
    audioThread->exit();
    audioThread->wait();
    cleanupInput();
    cleanupOutput();
    delete d;
}
Exemplo n.º 4
0
    ~AudioPrivate()
    {
        if (audioMeter)
            audioMeter->stop();

        audioThread->exit();
        audioThread->wait();
        cleanupInput();
        cleanupOutput();
    }
Exemplo n.º 5
0
Arquivo: audio.cpp Projeto: Pik-9/qTox
/**
 * @brief Unsubscribe from capturing from an opened input device.
 *
 * If the input device has no more subscriptions, it will be closed.
 */
void Audio::unsubscribeInput()
{
    QMutexLocker locker(&audioLock);

    if (!inSubscriptions)
        return;

    inSubscriptions--;
    qDebug() << "Unsubscribed from audio input device [" << inSubscriptions << "subscriptions left ]";

    if (!inSubscriptions)
        cleanupInput();
}
void close_app()
{ 	
  L("Cleaning up...\n");
  if (method == FRAMEBUFFER)
    closeFB();
  else if (method == ADB)
    closeADB(); 
  else if (method == GRALLOC)
    closeGralloc();
  else if (method == FLINGER)
    closeFlinger();
  
  cleanupInput();
  sendServerStopped();
  unbindIPCserver();
  exit(0); /* normal exit status */
}
Exemplo n.º 7
0
void OpenAL::reinitInput(const QString& inDevDesc)
{
    QMutexLocker locker(&audioLock);
    cleanupInput();
    initInput(inDevDesc);
}