Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/OSSIA/libossia
Browse files Browse the repository at this point in the history
  • Loading branch information
reno- committed Oct 11, 2017
2 parents 168212e + a56a27f commit 7729a6c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
9 changes: 1 addition & 8 deletions OSSIA/ossia-max/src/object_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ enum class object_class
client
};

enum class address_scope
{
relative = 0,
absolute,
global
};

struct object_base;

class t_matcher
Expand Down Expand Up @@ -90,7 +83,7 @@ struct object_base
bool m_is_pattern{};
bool m_dead{false}; // wether this object is being deleted or not;
bool m_is_deleted;
address_scope m_addr_scope{};
ossia::net::address_scope m_addr_scope{};
object_class m_otype{};


Expand Down
4 changes: 2 additions & 2 deletions OSSIA/ossia-max/src/remote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ bool remote::do_registration(const std::vector<ossia::net::node_base*>& _nodes)
for (auto node : _nodes)
{

if (m_addr_scope == address_scope::absolute)
if (m_addr_scope == ossia::net::address_scope::absolute)
{
// get root node
node = &node->get_device().get_root_node();
Expand All @@ -365,7 +365,7 @@ bool remote::do_registration(const std::vector<ossia::net::node_base*>& _nodes)

std::vector<ossia::net::node_base*> nodes{};

if (m_addr_scope == address_scope::global)
if (m_addr_scope == ossia::net::address_scope::global)
nodes = ossia::max::find_global_nodes(name);
else
nodes = ossia::net::find_nodes(*node, name);
Expand Down
10 changes: 5 additions & 5 deletions OSSIA/ossia-max/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ std::vector<ossia::net::node_base*> find_global_nodes(ossia::string_view addr)
return nodes;
}

ossia::max::address_scope get_address_scope(ossia::string_view addr)
ossia::net::address_scope get_address_scope(ossia::string_view addr)
{
address_scope type = address_scope::relative;
ossia::net::address_scope type = ossia::net::address_scope::relative;
if (boost::starts_with(addr, "//") )
type = address_scope::relative;
type = ossia::net::address_scope::relative;
else if ( boost::starts_with(addr, "/") )
type = address_scope::absolute;
type = ossia::net::address_scope::absolute;
else if ( addr.find(":/") != std::string::npos )
type = address_scope::global;
type = ossia::net::address_scope::global;
return type;
}

Expand Down
6 changes: 3 additions & 3 deletions OSSIA/ossia-max/src/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ std::vector<ossia::net::node_base*> find_global_nodes(ossia::string_view addr);
* @param addr: the address to process
* @return
*/
ossia::max::address_scope get_address_scope(ossia::string_view addr);
ossia::net::address_scope get_address_scope(ossia::string_view addr);

/**
* @brief attribute2value : convert t_atom array from attribute to vector of ossia::value
Expand Down Expand Up @@ -80,7 +80,7 @@ bool max_object_register(T* x)

std::vector<ossia::net::node_base*> nodes{};

if (x->m_addr_scope == address_scope::global)
if (x->m_addr_scope == ossia::net::address_scope::global)
{
nodes = {ossia::max::find_global_nodes(x->m_name->s_name)};
}
Expand All @@ -102,7 +102,7 @@ bool max_object_register(T* x)
start_level = 1;
}

if (x->m_addr_scope == address_scope::relative)
if (x->m_addr_scope == ossia::net::address_scope::relative)
{
// then try to locate a parent view or model
if (x->m_otype == object_class::view || x->m_otype == object_class::remote)
Expand Down
4 changes: 2 additions & 2 deletions OSSIA/ossia-max/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ bool view::do_registration(const std::vector<ossia::net::node_base*>& _nodes)
{
std::string name = m_name->s_name;

if (m_addr_scope == address_scope::absolute)
if (m_addr_scope == ossia::net::address_scope::absolute)
{
// get root node
_node = &_node->get_device().get_root_node();
Expand All @@ -200,7 +200,7 @@ bool view::do_registration(const std::vector<ossia::net::node_base*>& _nodes)

std::vector<ossia::net::node_base*> nodes{};

if (m_addr_scope == address_scope::global)
if (m_addr_scope == ossia::net::address_scope::global)
nodes = ossia::max::find_global_nodes(name);
else
nodes = ossia::net::find_nodes(*_node, name);
Expand Down

0 comments on commit 7729a6c

Please sign in to comment.