Exemple #1
0
void SeparateConference::Vibrate()
{
//    qDebug() << "Start vibrate";
    QVibrateAccessory vib;
    vib.setVibrateNow( true );
    QTimer::singleShot(500, this, SLOT(stopVibrate()));
}
Exemple #2
0
void irc_engine::Vibrate()
{
    QVibrateAccessory vib;
    if (!vib.vibrateNow())
    {
        vib.setVibrateNow( true );
        QTimer::singleShot(300, this, SLOT(stopVibrate()));
    }
}
Exemple #3
0
/*!
  Stop all ringing and vibration.  Does nothing if no ring is in progress.
  */
void RingControl::stopRing( )
{
    if(d->msgTid) {
        killTimer(d->msgTid);
        d->msgTid = 0;
        setSoundPriority(false);
    }

    if(d->vrbTid) {
        killTimer(d->vrbTid);
        d->vrbTid = 0;
        d->vibrateActive = false;
        QVibrateAccessory vib;
        vib.setVibrateNow( false );
    }

    if (d->curAlertType != QPhoneProfile::Off)
    {
#ifdef MEDIA_SERVER
        if(d->soundcontrol) {
            d->soundcontrol->sound()->stop();
            delete d->soundcontrol->sound();
            delete d->soundcontrol;
            d->soundcontrol = 0;
        }
#elif defined(Q_WS_QWS)
        if (d->soundclient) d->soundclient->stop(0);
#endif
        if (d->curAlertType == QPhoneProfile::Once)
        {
            // stopping a once off ring
            setSoundPriority(false);
        }

        d->curAlertType = QPhoneProfile::Off;
    }

    if (d->currentRingSource != NotRinging)
    {
        d->currentRingSource = NotRinging;
        emit ringTypeChanged(NotRinging);
    }
}
/*!
    \reimp
 */
void QBluetoothDefaultPasskeyAgent::requestPasskey(QBluetoothPasskeyRequest &req)
{
    QBluetoothLocalDevice device(req.localDevice());
    QBluetoothRemoteDevice remote(req.remoteDevice());
    device.updateRemoteDevice(remote);

    if (m_passDialog->isVisible()) {
        qLog(Bluetooth) << "Got new pairing request for"
            << remote.address().toString()
            << "but another pairing already in progress, rejecting new pair request";
        req.setRejected();
        return;
    }

    QString msg = "<P>";
    msg += tr("You are trying to pair with %1 [%2]. Please enter a PIN. You will need to enter the same PIN on the other device.", "%1=name, %2=address")
            .arg(remote.name()).arg(remote.address().toString());

    // brighten the screen
    QtopiaServiceRequest e1("QtopiaPowerManager", "setBacklight(int)");
    e1 << -1; // read brightness setting from config
    e1.send();

    // vibrate the phone if profile allows
    QPhoneProfileManager manager;
    QPhoneProfile profile = manager.activeProfile();
    if (profile.vibrate()) {
        QVibrateAccessory acc;
        acc.setVibrateNow(true);
        QTimer::singleShot(1000, this, SLOT(stopVibration()));
    }

    m_passDialog->reset();
    m_passDialog->setPrompt(msg);
    m_passDialog->setWindowModality(Qt::WindowModal);
    QtopiaApplication::execDialog(m_passDialog);

    QString pairPin = m_passDialog->password();
    if (!pairPin.isEmpty())
        req.setPasskey(pairPin);
    else
        req.setRejected();
}
Exemple #5
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);
}
Exemple #6
0
void irc_engine::stopVibrate()
{
    QVibrateAccessory vib;
    vib.setVibrateNow( false );
}
Exemple #7
0
void SeparateConference::stopVibrate()
{
//    qDebug() << "Stop vibrate";
    QVibrateAccessory vib;
    vib.setVibrateNow( false );
}
/*!
    \internal
*/
void QBluetoothDefaultPasskeyAgent::stopVibration()
{
    QVibrateAccessory acc;
    acc.setVibrateNow(false);
}