void QDeclarativeRadioData::connectSignals() { connect(m_radioData, SIGNAL(programTypeChanged(QRadioData::ProgramType)), this, SLOT(_q_programTypeChanged(QRadioData::ProgramType))); connect(m_radioData, SIGNAL(stationIdChanged(QString)), this, SIGNAL(stationIdChanged(QString))); connect(m_radioData, SIGNAL(programTypeNameChanged(QString)), this, SIGNAL(programTypeNameChanged(QString))); connect(m_radioData, SIGNAL(stationNameChanged(QString)), this, SIGNAL(stationNameChanged(QString))); connect(m_radioData, SIGNAL(radioTextChanged(QString)), this, SIGNAL(radioTextChanged(QString))); connect(m_radioData, SIGNAL(alternativeFrequenciesEnabledChanged(bool)), this, SIGNAL(alternativeFrequenciesEnabledChanged(bool))); // Since the radio data type depends on the service for the tuner, the availability is also dictated from the tuner connect(m_radioTuner, SIGNAL(availabilityChanged(QMultimedia::AvailabilityStatus)), this, SLOT(_q_availabilityChanged(QMultimedia::AvailabilityStatus))); connect(m_radioData, SIGNAL(error(QRadioData::Error)), this, SLOT(_q_error(QRadioData::Error))); }
void CarPI::_mp3PlayerTextChanged(QString text) { if (_sourceCurrent != sourceCDChanger) return; emit radioTextChanged(text); }
void CarPI::_displayTextChanged(QString text) { enum CarPISource source = sourceUnknown; if (text.isEmpty()) { /* Radio wyłączone */ _sourceCurrent = sourceUnknown; } //qDebug() << "CarPI: Display text changed to" << text; /* Detekcja pauzy */ if (text == " PAUSE ") { if (!_sourcePaused) { _sourcePaused = true; emit pauseStateChanged(true); _lastRadioText = text; emit radioTextChanged(text); } return; } else { if (_sourcePaused) { _sourcePaused = false; emit pauseStateChanged(false); } } /* Detekcja regulacji głosności */ if (text.startsWith("VOLUME ")) { emit volumeChanged(text.mid(7, 2).toInt()); return; } /* Detekcja źródła */ if (text == "AUX ") { source = sourceAUX; text = "BLUETOOTH "; /* Podmieniamy AUX na BLUETOOTH */ } else if ((text == "CD ") || (text == " LOAD CD ") || (text.startsWith("ALB ")) || (text.startsWith("LOAD ALB ")) || (text.length() > 12)) { source = sourceCD; } else if ((text == "CD CHANGER ") || (text.startsWith("CD "))) { source = sourceCDChanger; if (_sourceCurrent != source) { text = "USB"; emit radioTextChanged(text); } } else if ((text == "RADIO FM ")) { source = sourceFM; } if ((_sourceCurrent != source) && (source != sourceUnknown)) { _sourceCurrent = source; emit sourceChanged(_sourceCurrent); } if (_sourceCurrent != sourceCDChanger) { _lastRadioText = text; emit radioTextChanged(text); } }