Exemplo n.º 1
0
Arquivo: dvb.cpp Projeto: ambrosa/test
RESULT eDVBResourceManager::addChannel(const eDVBChannelID &chid, eDVBChannel *ch)
{
	ePtr<iDVBFrontend> fe;
	if (!ch->getFrontend(fe))
	{
		eDVBFrontend *frontend = (eDVBFrontend*)&(*fe);
		if (frontend->is_simulate())
			m_active_simulate_channels.push_back(active_channel(chid, ch));
		else
		{
			m_active_channels.push_back(active_channel(chid, ch));
			/* emit */ m_channelAdded(ch);
		}
	}
	return 0;
}
Exemplo n.º 2
0
void ScreenPhone::keypadEvent(const QString &digit)
{
    QVariant actualKeypadText = controller->qmlviewer->rootContext()->contextProperty("keypadText");

    if(digit=="c1")
    {
        setActive_channel(1);
        changeChannel();
        return;
    }

    if(digit=="c2")
    {
        setActive_channel(2);
        changeChannel();
        return;
    }

    if(digit=="backspace")
    {
        QString temp(actualKeypadText.toString());
        controller->qmlviewer->rootContext()->setContextProperty("keypadText", temp.left(temp.length()-1));
        return;
    }

    if(digit=="clear")
    {
        controller->qmlviewer->rootContext()->setContextProperty("keypadText", "");
        return;
    }

    if(active_channel()==1)
    {
        sendDTMF((pjsua_call_id)this->m_c1_call_id , (char*)digit.toStdString().c_str());
    }
    else if(active_channel()==2)
    {
        sendDTMF((pjsua_call_id)this->m_c1_call_id, (char*)digit.toStdString().c_str());
    }

    controller->qmlviewer->rootContext()->setContextProperty("keypadText",actualKeypadText.toString()+digit);
}