{"id":25328457,"url":"https://github.com/hbacelar8/mprisctl","last_synced_at":"2025-04-08T02:49:48.121Z","repository":{"id":277051287,"uuid":"930003244","full_name":"hbacelar8/mprisctl","owner":"hbacelar8","description":"C++ MPRIS controller library","archived":false,"fork":false,"pushed_at":"2025-02-11T21:21:36.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T21:34:12.415Z","etag":null,"topics":["cpp","dbus","mpris"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hbacelar8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T22:00:29.000Z","updated_at":"2025-02-11T21:21:39.000Z","dependencies_parsed_at":"2025-02-11T21:44:18.055Z","dependency_job_id":null,"html_url":"https://github.com/hbacelar8/mprisctl","commit_stats":null,"previous_names":["hbacelar8/mprisctl"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbacelar8%2Fmprisctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbacelar8%2Fmprisctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbacelar8%2Fmprisctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbacelar8%2Fmprisctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbacelar8","download_url":"https://codeload.github.com/hbacelar8/mprisctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767253,"owners_count":20992541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","dbus","mpris"],"created_at":"2025-02-14T02:33:28.580Z","updated_at":"2025-04-08T02:49:48.095Z","avatar_url":"https://github.com/hbacelar8.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MPRIS Controller Library\n\nC++ MPRIS controller library implementation, inspired on the functionnalities of\nthe [playerctl](https://github.com/altdesktop/playerctl) project.\n\nThis is a library though, not intented to be used as a CLI tool.\n\n## Configure and build\n\nIn the project's root:\n\n```bash\ncmake --preset example\n```\n\n```bash\ncmake --build build\n```\n\n## Run the example\n\n```bash\n./build/examples/example\n```\n\n## Example usage\n\n```cpp\n#include \u003ciostream\u003e\n#include \"mprisctl.h\"\n\nint main()\n{\n  // Instantiate the MPRIS controller, opening the ubs connection\n  mpris_ctl::MPRISController mpris_controller;\n\n  // Get a list of all players\n  auto players = mpris_controller.GetAvailablePlayers();\n\n  // Print all players\n  std::cout \u003c\u003c \"List of all players:\" \u003c\u003c std::endl;\n  for (auto player : players)\n  {\n    std::cout \u003c\u003c \"- \" \u003c\u003c player \u003c\u003c std::endl;\n  }\n\n  // Get first player\n  std::string player = players[0];\n\n  // Toogle play/pause\n  mpris_controller.PlayPause(player);\n\n  // Get metadata and print it\n  std::cout \u003c\u003c \"\\nMetadata:\" \u003c\u003c std::endl;\n  mpris_ctl::TrackMetadata metatada = mpris_controller.GetMetadata(player);\n  std::cout \u003c\u003c \"Title: \" \u003c\u003c metatada.title \u003c\u003c std::endl;\n  std::cout \u003c\u003c \"Artist: \" \u003c\u003c metatada.artist \u003c\u003c std::endl;\n  std::cout \u003c\u003c \"Album: \" \u003c\u003c metatada.album \u003c\u003c std::endl;\n  std::cout \u003c\u003c \"Art URL: \" \u003c\u003c metatada.artUrl \u003c\u003c std::endl;\n  std::cout \u003c\u003c \"URL: \" \u003c\u003c metatada.url \u003c\u003c std::endl;\n  std::cout \u003c\u003c \"Length: \" \u003c\u003c metatada.length \u003c\u003c std::endl;\n\n  // Toggle play/pause\n  mpris_controller.PlayPause(player);\n\n  return 0;\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbacelar8%2Fmprisctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbacelar8%2Fmprisctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbacelar8%2Fmprisctl/lists"}