示例#1
0
void OSSMidiPortDriver::stop() {
	for (int i = sessions.size() - 1; i >= 0; i--) {
		MidiSession *midiSession = sessions[i]->midiSession;
		stopSession(sessions[i]);
		if (midiSession != NULL) deleteMidiSession(midiSession);
	}
	qDebug() << "OSS MIDI Port Driver stopped";
}
示例#2
0
void OSSMidiPortDriver::deletePort(MidiSession *midiSession) {
	for (int i = 0; i < sessions.size(); i++) {
		if (sessions[i]->midiSession == midiSession) {
			stopSession(sessions[i]);
			midiSessions.removeOne(midiSession);
			break;
		}
	}
}
示例#3
0
			void TaskModuleShutdown::run() {
				long connectionId = APP_CONTEXT.getConnectionStore()->getConnectionIdForSessionId(mSessionId);
				if (connectionId == 0) {
					// no connection found for this session ... just shut down!
					stopSession();
				} else {
					callNS::CallOutLogOffUserSession logoffSession;
					logoffSession.setConnectionId(connectionId);
					APP_CONTEXT.getRpcOutgoingQueue()->addElement(&logoffSession);
					WaitForSingleObject(logoffSession.getAnswerHandle(),INFINITE);
					if (logoffSession.getResult() == 0) {
						// no error
						if (logoffSession.isLoggedOff()) {
							stopSession();
							APP_CONTEXT.getConnectionStore()->removeConnection(connectionId);
						} else {
							WLog_Print(logger_TaskModuleShutdown, WLOG_ERROR, "CallOutLogOffUserSession reported that logoff in freerds was not successful!");
						}
					} else {
						// report error
						WLog_Print(logger_TaskModuleShutdown, WLOG_ERROR, "CallOutLogOffUserSession reported error %d!", logoffSession.getResult());
					}
				}
			}
SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *parent)
:   QWidget(parent), statsTimer(-1)
{
    setupUi(this);

#ifdef QT_NO_NETWORKINTERFACE
    interfaceName->setVisible(false);
    interfaceNameLabel->setVisible(false);
    interfaceGuid->setVisible(false);
    interfaceGuidLabel->setVisible(false);
#endif

    session = new QNetworkSession(config, this);

    connect(session, SIGNAL(stateChanged(QNetworkSession::State)),
            this, SLOT(updateSession()));
    connect(session, SIGNAL(error(QNetworkSession::SessionError)),
            this, SLOT(updateSessionError(QNetworkSession::SessionError)));

    updateSession();

    sessionId->setText(QString("0x%1").arg(qulonglong(session), 8, 16, QChar('0')));

    configuration->setText(session->configuration().name());

    connect(openSessionButton, SIGNAL(clicked()),
            this, SLOT(openSession()));
    connect(openSyncSessionButton, SIGNAL(clicked()),
            this, SLOT(openSyncSession()));
    connect(closeSessionButton, SIGNAL(clicked()),
            this, SLOT(closeSession()));
    connect(stopSessionButton, SIGNAL(clicked()),
            this, SLOT(stopSession()));
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
    connect(deleteSessionButton, SIGNAL(clicked()),
            this, SLOT(deleteSession()));
#endif
}
示例#5
0
bool OSSMidiPortDriver::setPortProperties(MidiPropertiesDialog *mpd, MidiSession *midiSession) {
	int sessionIx = -1;
	QString midiPortName = "";
	if (midiSession != NULL) {
		for (int i = 0; i < sessions.size(); i++) {
			if (sessions[i]->midiSession == midiSession) {
				sessionIx = i;
				midiPortName = sessions[i]->midiPortName;
				break;
			}
		}
	}
	QList<QString> midiInPortNames;
	OSSMidiPortDriver::enumPorts(midiInPortNames);
	midiInPortNames.removeOne(sequencerName);
	mpd->setMidiList(midiInPortNames, -1);
	mpd->setMidiPortName(midiPortName);
	if (mpd->exec() != QDialog::Accepted) return false;
	if (sessionIx == -1 || midiPortName == mpd->getMidiPortName()) return true;
	stopSession(sessions[sessionIx]);
	midiSession->getSynthRoute()->setMidiSessionName(midiSession, mpd->getMidiPortName());
	return startSession(midiSession, mpd->getMidiPortName(), false);
}
示例#6
0
void ADStatistics::onPause()
{
    stopSession();
}
Writeback::~Writeback() {
    stopSession();
    if (!mFd.close()) {
        ALOGE("%s error closing fd", __func__);
    }
}