[qjackctl-devel] qjackctl/src qjackctlPatchbay.cpp, 1.47, 1.48 qjackctlPatchbay.h, 1.26, 1.27
JACK Audio Connection Kit Qt GUI Interface
Brought to you by:
rncbc
From: Rui N. C. <rn...@us...> - 2008-09-14 16:49:49
|
Update of /cvsroot/qjackctl/qjackctl/src In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7607/src Modified Files: qjackctlPatchbay.cpp qjackctlPatchbay.h Log Message: - Patchbay snapshot fixed to differentiate socket clients according to its type (Audio, MIDI or ALSA-Seq), avoiding the mess and gross mistake of hanging disparate type ports under the same client item. Index: qjackctlPatchbay.cpp =================================================================== RCS file: /cvsroot/qjackctl/qjackctl/src/qjackctlPatchbay.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- qjackctlPatchbay.cpp 27 Apr 2008 16:43:17 -0000 1.47 +++ qjackctlPatchbay.cpp 14 Sep 2008 16:49:36 -0000 1.48 @@ -366,12 +366,14 @@ // Client finder. -qjackctlSocketItem *qjackctlSocketList::findSocket ( const QString& sSocketName ) +qjackctlSocketItem *qjackctlSocketList::findSocket ( + const QString& sSocketName, int iSocketType ) { QListIterator<qjackctlSocketItem *> iter(m_sockets); while (iter.hasNext()) { qjackctlSocketItem *pSocket = iter.next(); - if (sSocketName == pSocket->socketName()) + if (sSocketName == pSocket->socketName() && + iSocketType == pSocket->socketType()) return pSocket; } @@ -488,7 +490,7 @@ QString sClientName = sClientPort.left(iColon); QString sPortName = qjackctlClientAlias::escapeRegExpDigits( sClientPort.right(sClientPort.length() - iColon - 1)); - pSocket = findSocket(sClientName); + pSocket = findSocket(sClientName, iSocketType); if (pSocket) pPlug = pSocket->findPlug(sPortName); if (pSocket == NULL) { @@ -551,7 +553,7 @@ snd_seq_port_info_get_name(pPortInfo)); qjackctlSocketItem *pSocket = NULL; qjackctlPlugItem *pPlug = NULL; - pSocket = findSocket(sClientName); + pSocket = findSocket(sClientName, iSocketType); if (pSocket) pPlug = pSocket->findPlug(sPortName); if (pSocket == NULL) { @@ -761,9 +763,10 @@ QString sSocketName; QString sSkel = pSocketItem->socketName(); sSkel.remove(QRegExp("[0-9]+$")).append("%1"); + int iSocketType = pSocketItem->socketType(); int iSocketNo = 1; do { sSocketName = sSkel.arg(++iSocketNo); } - while (findSocket(sSocketName)); + while (findSocket(sSocketName, iSocketType)); // Show up as a new socket... socketForm.setWindowTitle(tr("%1 <Copy> - %2") .arg(pSocketItem->socketName()).arg(m_sSocketCaption)); @@ -773,7 +776,7 @@ socketForm.setJackClient(m_pJackClient); socketForm.setAlsaSeq(m_pAlsaSeq); qjackctlPatchbaySocket socket(sSocketName, - pSocketItem->clientName(), pSocketItem->socketType()); + pSocketItem->clientName(), iSocketType); if (pSocketItem->isExclusive()) socket.setExclusive(true); QListIterator<qjackctlPlugItem *> iter(pSocketItem->plugs()); @@ -1317,7 +1320,8 @@ while (iter.hasNext()) { pISocket = iter.next(); qjackctlSocketItem *pISocketForward - = m_pPatchbayView->ISocketList()->findSocket(pISocket->forward()); + = m_pPatchbayView->ISocketList()->findSocket( + pISocket->forward(), pISocket->socketType()); if (pISocketForward == NULL) continue; // Set new connector color. @@ -1965,11 +1969,13 @@ while (iter.hasNext()) { qjackctlPatchbayCable *pCable = iter.next(); // Get proper sockets... - if (pCable->outputSocket() && pCable->inputSocket()) { + qjackctlPatchbaySocket *pOSocket = pCable->outputSocket(); + qjackctlPatchbaySocket *pISocket = pCable->inputSocket(); + if (pOSocket && pISocket) { qjackctlSocketItem *pOSocketItem - = m_pOSocketList->findSocket((pCable->outputSocket())->name()); + = m_pOSocketList->findSocket(pOSocket->name(), pOSocket->type()); qjackctlSocketItem *pISocketItem - = m_pISocketList->findSocket((pCable->inputSocket())->name()); + = m_pISocketList->findSocket(pISocket->name(), pISocket->type()); if (pOSocketItem && pISocketItem) connectSockets(pOSocketItem, pISocketItem); } @@ -2099,8 +2105,9 @@ QString sIClientPort = ppszIClientPorts[iIClientPort]; int iColon = sIClientPort.indexOf(':'); if (iColon >= 0) { - qjackctlSocketItem *pISocket = m_pISocketList->findSocket( - sIClientPort.left(iColon)); + qjackctlSocketItem *pISocket + = m_pISocketList->findSocket( + sIClientPort.left(iColon), pOSocket->socketType()); if (pISocket) connectSockets(pOSocket, pISocket); } @@ -2156,20 +2163,26 @@ if (sOPortName == pOPlug->plugName()) { int iOPort = snd_seq_port_info_get_port(pOPortInfo); // Now, look for subscribers of his port... - snd_seq_query_subscribe_set_type(pAlsaSubs, SND_SEQ_QUERY_SUBS_READ); + snd_seq_query_subscribe_set_type(pAlsaSubs, + SND_SEQ_QUERY_SUBS_READ); snd_seq_query_subscribe_set_index(pAlsaSubs, 0); seq_addr.client = iOClient; seq_addr.port = iOPort; snd_seq_query_subscribe_set_root(pAlsaSubs, &seq_addr); while (snd_seq_query_port_subscribers(pAlsaSeq, pAlsaSubs) >= 0) { seq_addr = *snd_seq_query_subscribe_get_addr(pAlsaSubs); - if (snd_seq_get_any_client_info(pAlsaSeq, seq_addr.client, pIClientInfo) == 0) { - QString sIClientName = snd_seq_client_info_get_name(pIClientInfo); - qjackctlSocketItem *pISocket = m_pISocketList->findSocket(sIClientName); + if (snd_seq_get_any_client_info(pAlsaSeq, + seq_addr.client, pIClientInfo) == 0) { + QString sIClientName + = snd_seq_client_info_get_name(pIClientInfo); + qjackctlSocketItem *pISocket + = m_pISocketList->findSocket( + sIClientName, pOSocket->socketType()); if (pISocket) connectSockets(pOSocket, pISocket); } - snd_seq_query_subscribe_set_index(pAlsaSubs, snd_seq_query_subscribe_get_index(pAlsaSubs) + 1); + snd_seq_query_subscribe_set_index(pAlsaSubs, + snd_seq_query_subscribe_get_index(pAlsaSubs) + 1); } } } Index: qjackctlPatchbay.h =================================================================== RCS file: /cvsroot/qjackctl/qjackctl/src/qjackctlPatchbay.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- qjackctlPatchbay.h 27 Apr 2008 16:43:17 -0000 1.26 +++ qjackctlPatchbay.h 14 Sep 2008 16:49:37 -0000 1.27 @@ -177,7 +177,7 @@ void removeSocket(qjackctlSocketItem *pSocket); // Socket finder. - qjackctlSocketItem *findSocket(const QString& sSocketName); + qjackctlSocketItem *findSocket(const QString& sSocketName, int iSocketType); // List view accessor. qjackctlSocketListView *listView() const; |