Exemplo n.º 1
0
void PlayerSubtitle::onPlayerStart()
{
    if (!m_enabled)
        return;
    if (!autoLoad()) {
        if (m_file == m_sub->fileName())
            return;
        m_sub->setFileName(m_file);
        m_sub->setFuzzyMatch(false);
        if (m_file.isEmpty()) {
            const int n = m_player->currentSubtitleStream();
            if (n >= 0 && !m_tracks.isEmpty() && m_tracks.size() <= n) {
                m_sub->processHeader(QByteArray(), QByteArray()); // reset
                return;
            }
            QVariantMap track = m_tracks[n].toMap();
            QByteArray codec(track.value("codec").toByteArray());
            QByteArray data(track.value("extra").toByteArray());
            m_sub->processHeader(codec, data);
        } else {
            m_sub->loadAsync();
        }
        return;
    }
    if (m_file != m_sub->fileName())
        return;
    if (!m_player)
        return;
    // autoLoad was false then reload then true then reload
    // previous loaded is user selected subtitle
    m_sub->setFileName(getSubtitleBasePath(m_player->file()));
    m_sub->setFuzzyMatch(true);
    m_sub->loadAsync();
    return;
}
Exemplo n.º 2
0
void EmuScreen::bootComplete() {
	globalUIState = UISTATE_INGAME;
	host->BootDone();
	host->UpdateDisassembly();

	g_gameInfoCache.FlushBGs();

	NOTICE_LOG(BOOT, "Loading %s...", PSP_CoreParameter().fileToStart.c_str());
	autoLoad();

	I18NCategory *s = GetI18NCategory("Screen"); 

#ifndef MOBILE_DEVICE
	if (g_Config.bFirstRun) {
		osm.Show(s->T("PressESC", "Press ESC to open the pause menu"), 3.0f);
	}
#endif
	memset(virtKeys, 0, sizeof(virtKeys));

	const char *renderer = (const char*)glGetString(GL_RENDERER);
	if (strstr(renderer, "Chainfire3D") != 0) {
		osm.Show(s->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true);
	}

	System_SendMessage("event", "startgame");
}
Exemplo n.º 3
0
void AVFilterSubtitle::onPlayerStart()
{
    setOptions(QString());
    if (!autoLoad())
        return;
    findAndSetFile(m_player->file());
}
Exemplo n.º 4
0
void PlayerSubtitle::onEnableChanged(bool value)
{
    m_enabled = value;
    if (value) {
        if (m_player) {
            connectSignals();
        }
        if (autoLoad()) {
            if (!m_player)
                return;
            QString path = m_player->file();
            //path.remove(p->source().scheme() + "://");
            QString name = QFileInfo(path).completeBaseName();
            path = QFileInfo(path).dir().absoluteFilePath(name);
            m_sub->setFileName(path);
            m_sub->setFuzzyMatch(true);
            m_sub->loadAsync();
        } else {
            m_sub->setFileName(m_file);
            m_sub->setFuzzyMatch(false);
            m_sub->loadAsync();
        }
    } else {
        if (m_player) {
            disconnectSignals();
        }
    }
}
Exemplo n.º 5
0
void PlayerSubtitle::onPlayerStart()
{
    if (!autoLoad()) {
        if (m_file == m_sub->fileName())
            return;
        m_sub->setFileName(m_file);
        m_sub->setFuzzyMatch(false);
        m_sub->loadAsync();
        return;
    }
    if (m_file != m_sub->fileName())
        return;
    if (!m_player)
        return;
    // autoLoad was false then reload then true then reload
    // previous loaded is user selected subtitle
    QString path = m_player->file();
    //path.remove(p->source().scheme() + "://");
    QString name = QFileInfo(path).completeBaseName();
    path = QFileInfo(path).dir().absoluteFilePath(name);
    m_sub->setFileName(path);
    m_sub->setFuzzyMatch(true);
    m_sub->loadAsync();
    return;
}
Exemplo n.º 6
0
void PlayerSubtitle::onEnabledChanged(bool value)
{
    m_enabled = value;
    if (value) {
        if (m_player) {
            connectSignals();
        }
        if (autoLoad()) {
            if (!m_player)
                return;
            m_sub->setFileName(getSubtitleBasePath(m_player->file()));
            m_sub->setFuzzyMatch(true);
            m_sub->loadAsync();
        } else {
            m_sub->setFileName(m_file);
            m_sub->setFuzzyMatch(false);
            m_sub->loadAsync();
        }
    } else {
        if (m_player) {
            disconnectSignals();
        }
    }
}
Exemplo n.º 7
0
void EmuScreen::bootGame(const std::string &filename) {
	booted_ = true;
	std::string fileToStart = filename;

	CoreParameter coreParam;
	coreParam.cpuCore = g_Config.bJit ? CPU_JIT : CPU_INTERPRETER;
	coreParam.gpuCore = g_Config.bSoftwareRendering ? GPU_SOFTWARE : GPU_GLES;
	coreParam.enableSound = g_Config.bEnableSound;
	coreParam.fileToStart = fileToStart;
	coreParam.mountIso = "";
	coreParam.startPaused = false;
	coreParam.printfEmuLog = false;
	coreParam.headLess = false;

	if (g_Config.iInternalResolution == 0) {
		coreParam.renderWidth = dp_xres;
		coreParam.renderHeight = dp_yres;
	} else {
		if (g_Config.iInternalResolution < 0)
			g_Config.iInternalResolution = 1;
		coreParam.renderWidth = 480 * g_Config.iInternalResolution;
		coreParam.renderHeight = 272 * g_Config.iInternalResolution;
	}

	coreParam.outputWidth = dp_xres;
	coreParam.outputHeight = dp_yres;
	coreParam.pixelWidth = pixel_xres;
	coreParam.pixelHeight = pixel_yres;

	std::string error_string;
	if (PSP_Init(coreParam, &error_string)) {
		invalid_ = false;
	} else {
		invalid_ = true;
		errorMessage_ = error_string;
		ERROR_LOG(BOOT, "%s", errorMessage_.c_str());
		System_SendMessage("event", "failstartgame");
		return;
	}

	globalUIState = UISTATE_INGAME;
	host->BootDone();
	host->UpdateDisassembly();

	g_gameInfoCache.FlushBGs();

	NOTICE_LOG(BOOT, "Loading %s...", fileToStart.c_str());
	autoLoad();

	I18NCategory *s = GetI18NCategory("Screen"); 

#ifdef _WIN32
	if (g_Config.bFirstRun) {
		osm.Show(s->T("PressESC", "Press ESC to open the pause menu"), 3.0f);
	}
#endif
	memset(virtKeys, 0, sizeof(virtKeys));

	const char *renderer = (const char*)glGetString(GL_RENDERER);
	if (strstr(renderer, "Chainfire3D") != 0) {
		osm.Show(s->T("Chainfire3DWarning", "WARNING: Chainfire3D detected, may cause problems"), 10.0f, 0xFF30a0FF, -1, true);
	}

	System_SendMessage("event", "startgame");
}