Skip to content

Commit

Permalink
feat(metadata): add clear property
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Jan 24, 2024
1 parent 256339f commit 2d9cc71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/rohrkabel/metadata/metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace pipewire
metadata &operator=(metadata &&) noexcept;

public:
[[rk::needs_update]] void clear_property(std::uint32_t id, const std::string &key);
[[rk::needs_update]] void set_property(std::uint32_t id, std::string key, std::string type, std::string value);

public:
Expand Down
6 changes: 6 additions & 0 deletions src/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ namespace pipewire
return *this;
}

void metadata::clear_property(std::uint32_t id, const std::string &key)
{
pw_metadata_set_property(m_impl->metadata, id, key.c_str(), nullptr, nullptr);
m_impl->properties.erase(key);
}

void metadata::set_property(std::uint32_t id, std::string key, std::string type, std::string value)
{
pw_metadata_set_property(m_impl->metadata, id, key.c_str(), type.c_str(), value.c_str());
Expand Down

0 comments on commit 2d9cc71

Please sign in to comment.