Пример #1
0
void DialupImpl::connectNotification( const QPhoneCall&,
        QPhoneCall::Notification notification, const QString& value)
{
    if ( notification == QPhoneCall::DataStateUpdate )
    {

        QPhoneCall::DataState dState = QPhoneCall::parseDataState( value );
        if ( dState & QPhoneCall::PPPdStopped ) {
            pppdProcessBlocked = false;
            status();
        }
        if ( qLogEnabled( Network ) ) {
            QString s = "DataCall ";
            if ( dState & QPhoneCall::PPPdStarted )
                s+="started ";
            if ( dState & QPhoneCall::PPPdStopped )
                s+="stopped ";
            if ( dState & QPhoneCall::PPPdFailed )
                s+="failed ";
            if ( dState & QPhoneCall::DataActive )
                s+="dataActive ";
            if ( dState & QPhoneCall::DataInactive )
                s+="dataInactive ";
            if ( dState & QPhoneCall::Connecting )
                s+="connecting ";
            if ( dState & QPhoneCall::ConnectFailed )
                s+="connectFailed ";
            qLog(Network) << "Data state: " << s;
        }
    } 
}
Пример #2
0
AudioInputStream::AudioInputStream( QObject *parent )
    : MediaStream( parent )
{
    audio = 0;
    dumpAudioData = qLogEnabled(SipAudioData);
    open( WriteOnly );
}
Пример #3
0
static bool gsmVoiceStart()
{
    gsmVoiceStop();

    // Move away alsa config (used e.g. by blueooth a2dp sound)
    if(QFile::exists("/home/root/.asoundrc")) {
        QFile::rename("/home/root/.asoundrc", "/home/root/.asoundrc.tmp");
    }

    voicePs = new QProcess();

    // Dump output always to stderr if audio logging is enabled
    if (qLogEnabled(AudioState)) {
        QStringList env = QProcess::systemEnvironment();
        for (int i = 0; i < env.count(); i++) {
            if (env.at(i).startsWith("GSM_VOICE_ROUTING_LOGFILE")) {
                env.removeAt(i);
                voicePs->setEnvironment(env);
                break;
            }
        }
        voicePs->setProcessChannelMode(QProcess::ForwardedChannels);
    }

    voicePs->start("gsm-voice-routing");
    if (voicePs->waitForStarted(3000)) {
        qLog(AudioState) << "starting gsm-voice-routing pid " << voicePs->pid();
        return true;
    }
    qWarning() << "failed to start gsm-voice-routing: " <<
               voicePs->errorString();
    return false;
}
Пример #4
0
AudioOutputStream::AudioOutputStream( QObject *parent )
    : MediaStream( parent )
{
    audio = 0;
    timer = 0;
    isOpen = false;
    retryCount = 0;
    interval = 2;   // XXX

    dumpAudioData = qLogEnabled(SipAudioData);
    open( WriteOnly );
}
Пример #5
0
/*!
    This function dumps the content to the Network log stream if
    Qt Extended is build in debug mode; otherwise does nothing.
*/
void QtopiaNetworkProperties::debugDump() const
{
    if (qLogEnabled(Network)) {
        QString key;
        QString value;

        QtopiaNetworkProperties::const_iterator i = constBegin();
        qLog(Network) << "Dumping network settings";
        while ( i != constEnd() )
        {
            qLog(Network) << i.key() << ": " << i.value().toString();
            i++;
        }
    }
}
Пример #6
0
void PerftestQVFbScreen::exposeRegion(QRegion region, int windowIndex)
{
    if (qLogEnabled(UI)) {
        QWSWindow *changed = 0;
        if (windowIndex >= 0 && QWSServer::instance() && QWSServer::instance()->clientWindows().count() > windowIndex)
            changed = QWSServer::instance()->clientWindows().at(windowIndex);
        if(changed && !changed->client()->identity().isEmpty()) {
            QRect r = region.boundingRect();
            qLog(UI)
                << changed->client()->identity()
                << ": expose_region"
                << QString("QRect(%1,%2 %3x%4)").arg(r.left()).arg(r.top()).arg(r.width()).arg(r.height());
        }
    }

    QVFbScreen::exposeRegion(region, windowIndex);
}
Пример #7
0
void RingControl::startRinging(RingType t)
{
    stopRing();

    if(t == Call && !d->callEnabled)
        return;
    else if(t == Msg && !d->msgEnabled)
        return;

    if(qLogEnabled(QtopiaServer)) {
        QString type;
        switch(t) {
            case NotRinging:
                type = "NotRinging";
                break;
            case Call:
                type = "Call";
                break;
            case Msg:
                type = "Message";
                break;
        }
        qLog(QtopiaServer) << "RingControl: Ringing" << type;
    }

    if(t == NotRinging)
        return;

    d->ringtime.start();

    QPhoneProfile profile = d->profileManager->activeProfile();
    QString ringToneDoc;

    // try contact ringtone

    if (t == Call) {

        // try personalized ring tone
        ringToneDoc = findRingTone();
        // try profile ring tone
        // try video ring tone first.
        if (ringToneDoc.isEmpty()) {
            ringToneDoc = profile.videoTone().fileName();

            if (!ringToneDoc.isEmpty()) {
                d->videoTone = true;
            }
        }

        // try profile ring tone
        if (ringToneDoc.isEmpty() || d->videoToneFailed) {
            ringToneDoc = profile.callTone().fileName();
            d->videoTone = false;
            d->videoToneFailed = false;
        }

        // last resort, fall back to system ring tone
        if (ringToneDoc.isEmpty())
            ringToneDoc = profile.systemCallTone().fileName();

        d->curRingTone = ringToneDoc;

        d->curAlertType = profile.callAlert();
    }
    else if (t == Msg)
    {
        d->curAlertType = profile.msgAlert();

        if (d->curAlertType == QPhoneProfile::Continuous ||
            d->curAlertType == QPhoneProfile::Ascending)
        {
            d->msgTid = startTimer(msgRingTime());
        }

        ringToneDoc = profile.messageTone().fileName();

        // fall back if above settings lead to non-existent ringtone.
        if (ringToneDoc.isEmpty())
            ringToneDoc = profile.systemMessageTone().fileName();

        d->curRingTone = ringToneDoc;
    }

    if (profile.vibrate())
    {
        QVibrateAccessory vib;
        vib.setVibrateNow( true );
        d->vibrateActive = true;
        d->vrbTid = startTimer(vibrateDuration());
    }

    if(d->curAlertType == QPhoneProfile::Ascending)
        d->lastRingVolume = 1;
    else
        d->lastRingVolume = d->ringVolume;

    d->currentRingSource = t;

    if(d->lastRingVolume && d->curAlertType != QPhoneProfile::Off) {
        initSound();
#ifdef MEDIA_SERVER
        if ( !d->videoTone ) {
            if(d->soundcontrol && d->soundcontrol->sound()->fileName() != ringToneDoc) {
                delete d->soundcontrol->sound();
                delete d->soundcontrol;
                d->soundcontrol = 0;
            }
            if (!d->soundcontrol) {
                d->soundcontrol = new QSoundControl(new QSound(d->curRingTone));
                connect(d->soundcontrol, SIGNAL(done()), this, SLOT(nextRing()) );
          }
            d->soundcontrol->setPriority(QSoundControl::RingTone);
            d->soundcontrol->setVolume(volmap[d->lastRingVolume]);

            d->soundcontrol->sound()->play();
        } else {
            qLog(Media) << "Video ringtone selected" << d->curRingTone;
            QtopiaIpcSendEnvelope env = d->videoAdaptor->send( MESSAGE(playVideo(QString)) );
            env << d->curRingTone;
        }
#elif defined(Q_WS_QWS)
        if(d->soundclient)
            d->soundclient->play(0, d->curRingTone,
                                 volmap[d->lastRingVolume],
                                 QWSSoundClient::Priority);
#endif
    }

    emit ringTypeChanged(d->currentRingSource);
}