Browse Source

Correct JackGraphManager::GetPortsAux to use port type.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1652 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.68
sletz 18 years ago
parent
commit
f6fc09c170
5 changed files with 12 additions and 23 deletions
  1. +1
    -1
      ChangeLog
  2. +2
    -2
      common/JackAPI.cpp
  3. +5
    -16
      common/JackGraphManager.cpp
  4. +2
    -2
      common/JackPort.cpp
  5. +2
    -2
      common/JackPort.h

+ 1
- 1
ChangeLog View File

@@ -15,7 +15,7 @@ Tom Szilagyi

2007-10-25 Stephane Letz <letz@grame.fr>

* Merge of Dmitry Baikov MIDI branch.
* Merge of Dmitry Baikov MIDI branch. Correct JackGraphManager::GetPortsAux to use port type.

2007-10-24 Stephane Letz <letz@grame.fr>



+ 2
- 2
common/JackAPI.cpp View File

@@ -297,7 +297,7 @@ EXPORT int jack_port_flags(const jack_port_t* port)
jack_error("jack_port_flags called with an incorrect port %ld", myport);
return -1;
} else {
return GetGraphManager()->GetPort(myport)->Flags();
return GetGraphManager()->GetPort(myport)->GetFlags();
}
}

@@ -311,7 +311,7 @@ EXPORT const char* jack_port_type(const jack_port_t* port)
jack_error("jack_port_flags called an incorrect port %ld", myport);
return NULL;
} else {
return GetGraphManager()->GetPort(myport)->Type();
return GetGraphManager()->GetPort(myport)->GetType();
}
}



+ 5
- 16
common/JackGraphManager.cpp View File

@@ -612,12 +612,12 @@ int JackGraphManager::CheckPorts(jack_port_id_t port_src, jack_port_id_t port_ds
JackPort* src = GetPort(port_src);
JackPort* dst = GetPort(port_dst);

if ((dst->Flags() & JackPortIsInput) == 0) {
if ((dst->fFlags & JackPortIsInput) == 0) {
jack_error("Destination port in attempted (dis)connection of %s and %s is not an input port", src->fName, dst->fName);
return -1;
}

if ((src->Flags() & JackPortIsOutput) == 0) {
if ((src->fFlags & JackPortIsOutput) == 0) {
jack_error("Source port in attempted (dis)connection of %s and %s is not an output port", src->fName, dst->fName);
return -1;
}
@@ -736,23 +736,12 @@ const char** JackGraphManager::GetPortsAux(const char* port_name_pattern, const
}

if (matching && port_name_pattern && port_name_pattern[0]) {
if (regexec(&port_regex, port->fName, 0, NULL, 0)) {
if (regexec(&port_regex, port->GetName(), 0, NULL, 0)) {
matching = false;
}
}

/*
if (matching && type_name_pattern && type_name_pattern[0]) {
jack_port_type_id_t ptid = psp[i].ptype_id;
if (regexec (&type_regex,engine->port_types[ptid].type_name,0, NULL, 0)) {
matching = false;
}
}
*/

// TO BE IMPROVED
if (matching && type_name_pattern && type_name_pattern[0]) {
if (regexec(&type_regex, JACK_DEFAULT_AUDIO_TYPE, 0, NULL, 0)) {
if (matching && type_name_pattern && type_name_pattern[0]) {
if (regexec(&type_regex, port->GetType(), 0, NULL, 0)) {
matching = false;
}
}


+ 2
- 2
common/JackPort.cpp View File

@@ -181,12 +181,12 @@ const char* JackPort::GetShortName() const
return strchr(fName, ':') + 1;
}

int JackPort::Flags() const
int JackPort::GetFlags() const
{
return fFlags;
}

const char* JackPort::Type() const
const char* JackPort::GetType() const
{
const JackPortType* type = GetPortType(fTypeId);
return type->name;


+ 2
- 2
common/JackPort.h View File

@@ -88,8 +88,8 @@ class JackPort
int UnsetAlias(const char* alias);
bool NameEquals(const char* target);

int Flags() const;
const char* Type() const;
int GetFlags() const;
const char* GetType() const;

int Lock();
int Unlock();


Loading…
Cancel
Save