remove compile errors (still will not link and JACKPortEngine is not close to done)

This commit is contained in:
Paul Davis
2013-07-30 23:26:46 -04:00
parent 5e0c6af406
commit fbfa0acebe
20 changed files with 78 additions and 51 deletions

View File

@@ -105,6 +105,7 @@ public:
bool get_sync_offset (pframes_t& offset) const;
int create_process_thread (boost::function<void()> func, pthread_t*, size_t stacksize);
bool is_realtime() const;
bool connected() const;
/* END BACKEND PROXY API */

View File

@@ -94,6 +94,8 @@ class PortEngine {
virtual std::string get_port_name (PortHandle) const = 0;
virtual PortHandle* get_port_by_name (const std::string&) const = 0;
DataType port_data_type (PortHandle) const;
virtual std::string make_port_name_relative (const std::string& name) const = 0;
virtual std::string make_port_name_non_relative (const std::string& name) const = 0;
virtual bool port_is_mine (const std::string& fullname) const = 0;

View File

@@ -58,7 +58,7 @@ class PortManager
int connect (const std::string& source, const std::string& destination);
int disconnect (const std::string& source, const std::string& destination);
int disconnect (boost::shared_ptr<Port>);
bool connected (const std::string&);
bool has_connections (const std::string&);
int reestablish_ports ();
int reconnect_ports ();
@@ -71,7 +71,7 @@ class PortManager
void port_renamed (const std::string&, const std::string&);
ChanCount n_physical_outputs () const;
ChanCount n_physical_inputs () const;
const char ** get_ports (const std::string& port_name_pattern, const std::string& type_name_pattern, uint32_t flags);
const char ** get_ports (const std::string& port_name_pattern, DataType type, uint32_t flags);
void remove_all_ports ();

View File

@@ -668,6 +668,16 @@ AudioEngine::is_realtime() const
return _backend->is_realtime();
}
bool
AudioEngine::connected() const
{
if (!_backend) {
return false;
}
return _backend->connected();
}
void
AudioEngine::transport_start ()
{

View File

@@ -459,7 +459,7 @@ Bundle::connected_to_anything (AudioEngine& engine)
rather than doing it with Port.
*/
if (engine.connected (ports[j])) {
if (engine.has_connections (ports[j])) {
return true;
}
}

View File

@@ -98,3 +98,17 @@ JACKPortEngine::physically_connected (PortHandle p)
return false;
}
DataType
JACKPortEngine::port_data_type (PortHandle p)
{
const char* t = jack_port_type (p);
if (strcmp (p, JACK_DEFAULT_AUDIO_TYPE) == 0) {
return DataType::AUDIO;
} else if (strcmp (p, JACK_DEFAULT_MIDI_TYPE) == 0) {
return DataType::MIDI;
}
return DataType::NIL;
}

View File

@@ -263,7 +263,7 @@ AudioEngine::port_renamed (const std::string& old_relative_name, const std::stri
}
const char **
AudioEngine::get_ports (const string& port_name_pattern, const string& type_name_pattern, uint32_t flags)
AudioEngine::get_ports (const string& port_name_pattern, DataType type, uint32_t flags)
{
GET_PRIVATE_JACK_POINTER_RET (_jack,0);
if (!_running) {
@@ -274,7 +274,21 @@ AudioEngine::get_ports (const string& port_name_pattern, const string& type_name
return 0;
}
}
return jack_get_ports (_priv_jack, port_name_pattern.c_str(), type_name_pattern.c_str(), flags);
const char* jack_type_string;
switch (type) {
case DataType::AUDIO:
jack_type_string = JACK_DEFAULT_AUDIO_TYPE;
break;
case DataType::AUDIO:
jack_type_string = JACK_DEFAULT_MIDI_TYPE;
break;
case DataType::NIL
return 0;
}
return jack_get_ports (_priv_jack, port_name_pattern.c_str(), jack_type_string, flags);
}
void