Skip to content

Commit

Permalink
[cues] Cleanup code, fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Nov 20, 2022
1 parent 07cb36b commit 5974c9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ossia/preset/cue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int cues::get_cue(std::string_view name)
cues.begin(), cues.end(), [=](const cue& c) { return c.name == name; });
if(BOOST_UNLIKELY(it == cues.end()))
{
cues.push_back(cue{.name{name}});
cues.push_back(cue{.name = std::string(name)});
return cues.size() - 1;
}
else
Expand Down
16 changes: 4 additions & 12 deletions src/ossia/preset/cue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct cue
class OSSIA_EXPORT cues : Nano::Observer
{
public:
std::vector<cue> cues{{.name{"Init"}}};

void set_device(ossia::net::device_base* dev);

int size() const noexcept { return cues.size(); }
Expand All @@ -31,7 +33,8 @@ class OSSIA_EXPORT cues : Nano::Observer
return (idx >= 0 && idx < std::ssize(cues)) ? &cues[idx] : nullptr;
}
std::optional<int> find_cue(std::string_view name);
std::vector<cue> cues{{.name{"Init"}}};
int get_cue(std::string_view name);


void create(std::string_view name);

Expand Down Expand Up @@ -63,19 +66,8 @@ class OSSIA_EXPORT cues : Nano::Observer

//private:
ossia::net::device_base* dev{};
int get_cue(std::string_view name);
int m_current{0};

struct selector
{
enum
{
Add,
Remove
} mode{Add};
std::string pattern{"/"};
};
std::vector<selector> m_selectors{selector{}};
std::unordered_set<ossia::net::node_base*> m_selection;
};
}

0 comments on commit 5974c9c

Please sign in to comment.