示例#1
0
QBluetoothLocalDevice::QBluetoothLocalDevice(QObject *parent)
:   QObject(parent)
{
    OrgBluezManagerInterface manager(QLatin1String("org.bluez"), QLatin1String("/"),
                                     QDBusConnection::systemBus());

    QDBusPendingReply<QDBusObjectPath> reply = manager.DefaultAdapter();
    reply.waitForFinished();
    if (reply.isError())
        return;

    OrgBluezAdapterInterface *adapter = new OrgBluezAdapterInterface(QLatin1String("org.bluez"),
                                                                     reply.value().path(),
                                                                     QDBusConnection::systemBus());

    this->d_ptr = new QBluetoothLocalDevicePrivate;
    this->d_ptr->adapter = adapter;    
    this->d_ptr->q_ptr = this;
    this->d_ptr->agent = 0x0;
    this->d_ptr->msgConnection = 0x0;
    this->d_ptr->currentMode = static_cast<QBluetoothLocalDevice::HostMode>(-1);

    connect(adapter, SIGNAL(PropertyChanged(QString,QDBusVariant)),
            this->d_ptr, SLOT(PropertyChanged(QString,QDBusVariant)));

//    connect(d_ptr, SIGNAL(pairingFinished(const QBluetoothAddress&,QBluetoothLocalDevice::Pairing)), this, SIGNAL(pairingFinished(const QBluetoothAddress&,QBluetoothLocalDevice::Pairing)));
//    connect(this->d_ptr, SIGNAL(pairingDisplayPinCode(const QBluetoothAddress &,QString)),
//            this, SIGNAL(pairingDisplayPinCode(const QBluetoothAddress &,QString)));

    qsrand(QTime::currentTime().msec());
    this->d_ptr->agent_path = agentPath;
    this->d_ptr->agent_path.append(QString::fromLatin1("/%1").arg(qrand()));

}
void QBluetoothLocalDevicePrivate::initializeAdapter()
{
    if (adapter)
        return;

    OrgBluezManagerInterface manager(QLatin1String("org.bluez"), QLatin1String("/"), QDBusConnection::systemBus());

    if (localAddress == QBluetoothAddress()) {
        QDBusPendingReply<QDBusObjectPath> reply = manager.DefaultAdapter();
        reply.waitForFinished();
        if (reply.isError())
            return;

        adapter = new OrgBluezAdapterInterface(QLatin1String("org.bluez"), reply.value().path(), QDBusConnection::systemBus());
    } else {
        QDBusPendingReply<QList<QDBusObjectPath> > reply = manager.ListAdapters();
        reply.waitForFinished();
        if (reply.isError())
            return;

        foreach (const QDBusObjectPath &path, reply.value()) {
            OrgBluezAdapterInterface *tmpAdapter = new OrgBluezAdapterInterface(QLatin1String("org.bluez"), path.path(), QDBusConnection::systemBus());

            QDBusPendingReply<QVariantMap> reply = tmpAdapter->GetProperties();
            reply.waitForFinished();
            if (reply.isError())
                continue;

            QBluetoothAddress path_address(reply.value().value(QLatin1String("Address")).toString());

            if (path_address == localAddress) {
                adapter = tmpAdapter;
                break;
            } else {
                delete tmpAdapter;
            }
        }
    }

    currentMode = static_cast<QBluetoothLocalDevice::HostMode>(-1);
    if (adapter) {
        connect(adapter, SIGNAL(PropertyChanged(QString,QDBusVariant)), SLOT(PropertyChanged(QString,QDBusVariant)));

        qsrand(QTime::currentTime().msec());
        agent_path = agentPath;
        agent_path.append(QString::fromLatin1("/%1").arg(qrand()));
    }
}
QmitkStringPropertyOnDemandEdit::QmitkStringPropertyOnDemandEdit(mitk::StringProperty *property, QWidget *parent)
  : QFrame(parent), PropertyEditor(property), m_StringProperty(property)
{
  setFrameStyle(QFrame::NoFrame);
  setLineWidth(0);

  // create HBoxLayout with two buttons
  m_layout = new QHBoxLayout(this);
  m_layout->setMargin(0);

  m_label = new QLabel(this);
  m_layout->addWidget(m_label);

  m_toolbutton = new QClickableLabel2(this);
  m_toolbutton->setText("...");
  m_layout->addWidget(m_toolbutton);

  m_layout->addStretch(10);

  connect(m_toolbutton, SIGNAL(clicked()), this, SLOT(onToolButtonClicked()));

  ensurePolished();
  adjustSize();

  PropertyChanged();
}
 _UGCombinedBoolPropEditor(mitk::BoolProperty* boolProp,
                           QmitkUGCombinedRepresentationPropertyWidget* combo)
   : PropertyEditor(boolProp), m_BoolProperty(boolProp),
   m_ComboBox(combo)
 {
   PropertyChanged();
 }
示例#5
0
文件: C700.cpp 项目: justcfx2u/C700
//-----------------------------------------------------------------------------
OSStatus	C700::Render(   AudioUnitRenderActionFlags &	ioActionFlags,
                            const AudioTimeStamp &			inTimeStamp,
                            UInt32							inNumberFrames)
{
    OSStatus result = AUInstrumentBase::Render(ioActionFlags, inTimeStamp, inNumberFrames);

    CallHostBeatAndTempo(NULL, &mTempo);
    mEfx->SetTempo( mTempo );
    //バッファの確保
    float				*output[2];
    AudioBufferList&	bufferList = GetOutput(0)->GetBufferList();

    int numChans = bufferList.mNumberBuffers;
    if (numChans > 2) return -1;
    output[0] = (float*)bufferList.mBuffers[0].mData;
    output[1] = numChans==2 ? (float*)bufferList.mBuffers[1].mData : NULL;

    //パラメータの反映
    for ( int i=0; i<kNumberOfParameters; i++ ) {
        if (mParameterHasChanged[i]) {
            mEfx->SetParameter(i, Globals()->GetParameter(i));
            mParameterHasChanged[i] = false;
            if (i == kParam_alwaysDelayNote) {
                // 遅延時間の変更をホストに通知
                PropertyChanged(kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0);
            }
        }
    }

    mEfx->SetSampleRate( GetOutput(0)->GetStreamFormat().mSampleRate );

    mEfx->Render(inNumberFrames, output);

    return result;
}
示例#6
0
void QOfonoModem::connectOfono()
{
    bool wasValid = isValid();
    if (d_ptr->modem) {
        delete d_ptr->modem;
        d_ptr->modem = NULL;
        if (!d_ptr->properties.isEmpty()) {
            QStringList keys = d_ptr->properties.keys();
            d_ptr->properties.clear();
            for (int i=0; i<keys.size(); i++) {
                propertyChanged(keys[i], QVariant());
            }
        }
    }
    if (!d_ptr->modemPath.isEmpty()) {
        OfonoModem* modem = new OfonoModem("org.ofono", d_ptr->modemPath, QDBusConnection::systemBus(), this);
        if (modem->isValid()) {
            d_ptr->modem = modem;
            connect(new QDBusPendingCallWatcher(modem->GetProperties(), modem),
                SIGNAL(finished(QDBusPendingCallWatcher*)),
                SLOT(onGetPropertiesFinished(QDBusPendingCallWatcher*)));
            connect(modem,
                SIGNAL(PropertyChanged(QString,QDBusVariant)),
                SLOT(onPropertyChanged(QString,QDBusVariant)));
        } else {
示例#7
0
QmitkStringPropertyView::QmitkStringPropertyView( const mitk::StringProperty* property, QWidget* parent )
    : QLabel( parent ),
      PropertyView( property ),
      m_StringProperty(property)
{
    PropertyChanged();
}
void NetworkManager::connectToConnman(QString)
{
    disconnectFromConnman();
    m_manager = new NetConnmanManagerInterface("net.connman", "/",
            QDBusConnection::systemBus(), this);

    if (!m_manager->isValid()) {

        delete m_manager;
        m_manager = NULL;

        // shouldn't happen but in this case service isn't available
        if (m_available)
            Q_EMIT availabilityChanged(m_available = false);
    } else {
        connect(m_manager, SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this, SLOT(propertyChanged(QString,QDBusVariant)));

        QDBusPendingReply<QVariantMap> props_reply = m_manager->GetProperties();
        QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(props_reply, this);
        connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
                this, SLOT(getPropertiesFinished(QDBusPendingCallWatcher*)));

        if (!m_available)
            Q_EMIT availabilityChanged(m_available = true);
    }
}
LayerPropertyTrack::LayerPropertyTrack(QObject* parent) :
  LayerProperty(parent),
  m_nColorCode(Directional),
  m_nDirectionScheme(EndPoints),
  m_nDirectionMapping(RGB),
  m_color(Qt::yellow),
  m_nRenderRep(Line),
  m_dTubeRadius(0.2),
  m_nNumberOfSides(5)
{
  connect(this, SIGNAL(ColorCodeChanged(int)), this, SIGNAL(PropertyChanged()));
  connect(this, SIGNAL(DirectionSchemeChanged(int)), this, SIGNAL(PropertyChanged()));
  connect(this, SIGNAL(DirectionMappingChanged(int)), this, SIGNAL(PropertyChanged()));
  connect(this, SIGNAL(SolidColorChanged(QColor)), this, SIGNAL(PropertyChanged()));
  connect(this, SIGNAL(RenderRepChanged()), this, SIGNAL(PropertyChanged()));
}
示例#10
0
	bool BaseSettingsManager::event (QEvent *e)
	{
		if (e->type () != QEvent::DynamicPropertyChange)
			return false;

		auto event = dynamic_cast<QDynamicPropertyChangeEvent*> (e);

		const QByteArray& name = event->propertyName ();
		const auto& propName = QString::fromUtf8 (name);
		const auto& propValue = property (name);
		GetSettings ()->setValue (propName, propValue);
		PropertyChanged (propName, propValue);

		if (ApplyProps_.contains (name))
		{
			const auto& objects = ApplyProps_.values (name);
			Q_FOREACH (const auto& object, objects)
			{
				if (!object.first)
					continue;

				if (!QMetaObject::invokeMethod (object.first, object.second))
					qWarning () << Q_FUNC_INFO
						<< "could not find method in the metaobject"
						<< name
						<< object.first
						<< object.second;
			}
		}

		event->accept ();
		return true;
	}
void QOfonoMessageWaiting::connectOfono()
{
    bool wasReady = isReady();
    // FIXME: Clearing properties here results in false *Changed signal
    // emissions. Ideally ready() should not be derived from
    // properties.isEmpty(). Also compare with QOfonoSimManager.
    if (d_ptr->messageWaiting) {
        delete d_ptr->messageWaiting;
        d_ptr->messageWaiting = 0;
        d_ptr->properties.clear();
    }

    d_ptr->messageWaiting = new OfonoMessageWaiting("org.ofono", d_ptr->modemPath, QDBusConnection::systemBus(),this);

    if (d_ptr->messageWaiting->isValid()) {
        connect(d_ptr->messageWaiting,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this,SLOT(propertyChanged(QString,QDBusVariant)));

        QDBusPendingReply<QVariantMap> reply;
        reply = d_ptr->messageWaiting->GetProperties();
        reply.waitForFinished();
        if (reply.isError()) {
            Q_EMIT getPropertiesFailed();
        } else {
            QVariantMap properties = reply.value();
            for (QVariantMap::ConstIterator it = properties.constBegin();
                    it != properties.constEnd(); ++it) {
                updateProperty(it.key(), it.value());
            }
        }
    }

    if (wasReady != isReady())
        Q_EMIT readyChanged();
}
示例#12
0
void QOfonoCallForwarding::setModemPath(const QString &path)
{
    if (path == d_ptr->modemPath ||
            path.isEmpty())
        return;

    if (path != modemPath()) {
        if (d_ptr->callForward) {
            delete d_ptr->callForward;
            d_ptr->callForward = 0;
            d_ptr->properties.clear();
        }
        d_ptr->callForward = new OfonoCallForwarding("org.ofono", path, QDBusConnection::systemBus(),this);

        if (d_ptr->callForward->isValid()) {
            d_ptr->modemPath = path;
            connect(d_ptr->callForward,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                    this,SLOT(propertyChanged(QString,QDBusVariant)));

            QDBusPendingReply<QVariantMap> reply = d_ptr->callForward->GetProperties();
            QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
            connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
                    SLOT(getPropertiesComplete(QDBusPendingCallWatcher*)));
            Q_EMIT modemPathChanged(path);
        }
    }
}
示例#13
0
void QOfonoRadioSettings::setModemPath(const QString &path)
{
    if (path == d_ptr->modemPath ||
            path.isEmpty())
        return;

    QStringList removedProperties = d_ptr->properties.keys();

    delete d_ptr->radioSettings;
    d_ptr->radioSettings = new OfonoRadioSettings("org.ofono", path, QDBusConnection::systemBus(),this);

    if (d_ptr->radioSettings->isValid()) {
        d_ptr->modemPath = path;

        connect(d_ptr->radioSettings,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                this,SLOT(propertyChanged(QString,QDBusVariant)));

        QVariantMap properties = d_ptr->radioSettings->GetProperties().value();
        for (QVariantMap::ConstIterator it = properties.constBegin();
             it != properties.constEnd(); ++it) {
            updateProperty(it.key(), it.value());
            removedProperties.removeOne(it.key());
        }

        Q_EMIT modemPathChanged(path);
    }

    foreach (const QString &p, removedProperties)
        updateProperty(p, QVariant());
}
示例#14
0
void QOfonoCallMeter::setModemPath(const QString &path)
{
    if (path == d_ptr->modemPath ||
            path.isEmpty())
        return;

    if (path != modemPath()) {
        if (d_ptr->callMeter) {
            delete d_ptr->callMeter;
            d_ptr->callMeter = 0;
            d_ptr->properties.clear();
        }
        d_ptr->callMeter = new OfonoCallMeter("org.ofono", path, QDBusConnection::systemBus(),this);

        if (d_ptr->callMeter->isValid()) {
            d_ptr->modemPath = path;
            connect(d_ptr->callMeter,SIGNAL(PropertyChanged(QString,QDBusVariant)),
                    this,SLOT(propertyChanged(QString,QDBusVariant)));

            connect(d_ptr->callMeter,SIGNAL(NearMaximumWarning()),this,SIGNAL(nearMaximumWarning()));
            QDBusPendingReply<QVariantMap> reply;
            reply = d_ptr->callMeter->GetProperties();
            reply.waitForFinished();
            d_ptr->properties = reply.value();
            Q_EMIT modemPathChanged(path);
        }
    }
}
示例#15
0
void QBluetoothDeviceDiscoveryAgentPrivate::start()
{

    if(pendingCancel == true) {
        pendingStart = true;
        return;
    }

    discoveredDevices.clear();

    QDBusPendingReply<QDBusObjectPath> reply = manager->DefaultAdapter();
    reply.waitForFinished();
    if (reply.isError()) {
        errorString = reply.error().message();
#ifdef QTM_DEVICEDISCOVERY_DEBUG
        qDebug() << Q_FUNC_INFO << "ERROR: " << errorString;
#endif
        lastError = QBluetoothDeviceDiscoveryAgent::IOFailure;
        Q_Q(QBluetoothDeviceDiscoveryAgent);
        emit q->error(lastError);
        return;
    }

    adapter = new OrgBluezAdapterInterface(QLatin1String("org.bluez"), reply.value().path(),
                                           QDBusConnection::systemBus());

    Q_Q(QBluetoothDeviceDiscoveryAgent);
    QObject::connect(adapter, SIGNAL(DeviceFound(QString,QVariantMap)),
                     q, SLOT(_q_deviceFound(QString,QVariantMap)));
    QObject::connect(adapter, SIGNAL(PropertyChanged(QString,QDBusVariant)),
                     q, SLOT(_q_propertyChanged(QString,QDBusVariant)));

    QDBusPendingReply<QVariantMap> propertiesReply = adapter->GetProperties();
    propertiesReply.waitForFinished();
    if(propertiesReply.isError()) {
#ifdef QTM_DEVICEDISCOVERY_DEBUG
        qDebug() << Q_FUNC_INFO << "ERROR: " << errorString;
#endif
        errorString = propertiesReply.error().message();
        lastError = QBluetoothDeviceDiscoveryAgent::IOFailure;
        Q_Q(QBluetoothDeviceDiscoveryAgent);
        emit q->error(lastError);
        return;
    }

    QDBusPendingReply<> discoveryReply = adapter->StartDiscovery();
    if (discoveryReply.isError()) {
        delete adapter;
        adapter = 0;
        errorString = discoveryReply.error().message();
        lastError = QBluetoothDeviceDiscoveryAgent::IOFailure;
        Q_Q(QBluetoothDeviceDiscoveryAgent);
        emit q->error(lastError);
#ifdef QTM_DEVICEDISCOVERY_DEBUG
        qDebug() << Q_FUNC_INFO << "ERROR: " << errorString;
#endif
        return;
    }
}
示例#16
0
 void MainViewModel::StartUrl(const char* value, bool notify)
 {
     if (_startUrl != value)
     {
         _startUrl = value;
         if (notify) PropertyChanged(PropertyChangedEventArgs("StartUrl"));
     }
 }
示例#17
0
 void MainViewModel::UrlsCount(int value, bool notify)
 {
     if (_urlsCount != value)
     {
         _urlsCount = value;
         if (notify) PropertyChanged(PropertyChangedEventArgs("UrlsCount"));
     }
 }
示例#18
0
 void MainViewModel::CanStop(bool value)
 {
     if (value != _canStop)
     {
         _canStop = value;
         PropertyChanged(PropertyChangedEventArgs("CanStop"));
     }
 }
示例#19
0
 void MainViewModel::CanStart(bool value)
 {
     if (value != _canStart)
     {
         _canStart = value;
         PropertyChanged(PropertyChangedEventArgs("CanStart"));
     }
 }
示例#20
0
QmitkStringPropertyEditor::QmitkStringPropertyEditor( mitk::StringProperty* property, QWidget* parent )
    : QLineEdit( parent ),
      PropertyEditor( property ),
      m_StringProperty(property)
{
    PropertyChanged();
    connect(this, SIGNAL(textChanged(const QString&)), this, SLOT(onTextChanged(const QString&)));
}
示例#21
0
 void MainViewModel::Text(const char* value, bool notify)
 {
     if (_text != value)
     {
         _text = value;
         if (notify) PropertyChanged(PropertyChangedEventArgs("Text"));
     }
 }
示例#22
0
 void MainViewModel::ThreadsCount(int value, bool notify)
 {
     if (_threadsCount != value)
     {
         _threadsCount = value;
         if (notify) PropertyChanged(PropertyChangedEventArgs("ThreadsCount"));
     }
 }
示例#23
0
void Rectangle::SetTop(float p_Top)
{
	if (m_Top != p_Top)
	{
		m_Top = p_Top;

		PropertyChanged(this, PropertyChangedEventArgs("Top"));
	}
}
示例#24
0
void Rectangle::SetRight(float p_Right)
{
	if (m_Right != p_Right)
	{
		m_Right = p_Right;

		PropertyChanged(this, PropertyChangedEventArgs("Right"));
	}
}
示例#25
0
void Rectangle::SetLeft(float p_Left)
{
	if (m_Left != p_Left)
	{
		m_Left = p_Left;

		PropertyChanged(this, PropertyChangedEventArgs("Left"));
	}
}
示例#26
0
void Rectangle::SetBottom(float p_Bottom)
{
	if (m_Bottom != p_Bottom)
	{
		m_Bottom = p_Bottom;

		PropertyChanged(this, PropertyChangedEventArgs("Bottom"));
	}
}
示例#27
0
Ofono::Ofono(QObject *parent) :
    QObject(parent)
{
    //INIT-MEMBER-VARS:
    m_ofonoModemInterface = new OrgOfonoModemInterface("org.ofono", "/phonesim", QDBusConnection::systemBus());
    m_ofonoVoiceCallManagerInterface = new OrgOfonoVoiceCallManagerInterface("org.ofono", "/phonesim", QDBusConnection::systemBus());

    QObject::connect(m_ofonoVoiceCallManagerInterface,SIGNAL(PropertyChanged(QString,QDBusVariant)),this,SLOT(propertyChanged(QString,QDBusVariant)));
}
	void			DetectedPulse (Float64 startTime, Float64 duration)
	{
		mPulseTimeStats[mCurrentPTSIndex].start = startTime;
		mPulseTimeStats[mCurrentPTSIndex].length = duration;
		
		mCurrentPTSIndex = (++mCurrentPTSIndex % kPulseTSSize);
		
		PropertyChanged (kAUPulseMetricsPropertyID, kAudioUnitScope_Global, 0);
	}
示例#29
0
SearchEngine::SearchEngine() : m_scriptDebugger(NULL), m_debuggerWindow(NULL), m_scriptDebugingEnabled(false)
{
	m_scriptEngine = new QScriptEngine(this);
	initScriptEngine();
	init();
	m_result = SearchItemsStorrage::getInstance();
	QApplicationSettingsPtr pSettings = QApplicationSettings::getInstance();
	connect(pSettings.get(), SIGNAL(PropertyChanged(QString, QString)), SLOT(OnSettngsChnaged(QString, QString)));
}
示例#30
0
BluetoothDevice::BluetoothDevice(QDBusObjectPath path, QObject *parent) :
	QObject(parent),m_device(new OrgBluezDeviceInterface("org.bluez",path.path(),QDBusConnection::systemBus(),this)),audio(NULL),input(NULL)
{
    if(!m_device->isValid())
	return;
    QObject::connect(m_device,SIGNAL(PropertyChanged(QString,QDBusVariant)),
		     this,SLOT(propertyChanged(QString,QDBusVariant)));

   setupProfiles();
}