{"id":18356250,"url":"https://github.com/erengy/atf","last_synced_at":"2025-04-10T01:47:57.255Z","repository":{"id":153401983,"uuid":"65050955","full_name":"erengy/atf","owner":"erengy","description":"Advanced title formatting (WIP)","archived":false,"fork":false,"pushed_at":"2017-01-01T10:12:32.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-15T17:43:04.335Z","etag":null,"topics":["work-in-progress"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erengy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"github":"erengy","patreon":"erengy"}},"created_at":"2016-08-05T21:44:03.000Z","updated_at":"2021-11-19T02:23:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"a44572ae-0527-4976-95f5-a85c45c71e9d","html_url":"https://github.com/erengy/atf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erengy%2Fatf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erengy%2Fatf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erengy%2Fatf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erengy%2Fatf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erengy","download_url":"https://codeload.github.com/erengy/atf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248142593,"owners_count":21054665,"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":["work-in-progress"],"created_at":"2024-11-05T22:09:22.937Z","updated_at":"2025-04-10T01:47:57.248Z","avatar_url":"https://github.com/erengy.png","language":"C++","funding_links":["https://github.com/sponsors/erengy","https://patreon.com/erengy"],"categories":[],"sub_categories":[],"readme":"# atf\n\n*atf* is an implementation of the scripting language known as *Advanced Title Formatting* or *Tagz*. The language has been used by some popular applications such as [Winamp](http://www.winamp.com), [foobar2000](https://www.foobar2000.org), [Mp3tag](http://www.mp3tag.de/en/) and [MusicBrainz Picard](https://picard.musicbrainz.org).\n\nBasically, it converts this:\n\n    [%artist% - ][%album% - ][$num(%track%,2) - ]$if2(%title%,$filepart(%filename%))\n\n...to this:\n\n    Iron Maiden - Brave New World - 04 - Blood Brothers\n\n## Usage\n\n***(atf is currently not in a usable state.)***\n\nThe library doesn't have any fields on its own. Applications have to override the `EvaluateField` virtual function in order to provide the data to corresponding fields:\n\n```cpp\nstd::string CustomAtf::EvaluateField(const std::string\u0026 field) const {\n  const std::map\u003cstd::string, std::string\u003e fields{\n    {\"artist\", \"Iron Maiden\"},\n    {\"album\", \"Brave New World\"},\n    {\"track\", \"4\"},\n    {\"title\", \"Blood Brothers\"},\n  };\n\n  auto it = fields.find(field);\n  return it != fields.end() ? it.second : std::string();\n}\n```\n\nThe library does provide you with a basic set of functions such as `if` and `len`. You may override the `EvaluateFunction` virtual function according to your application's needs:\n\n```cpp\nstd::string CustomAtf::EvaluateFunction(\n    const std::string\u0026 name, const std::vector\u003cstd::string\u003e\u0026 params) const {\n  std::string result;\n\n  // $reverse(x)\n  // Reverses the order of the characters in string x.\n  if (name == \"reverse\" \u0026\u0026 params.size() == 1) {\n    const auto\u0026 x = params.back();\n    std::copy_backward(x.begin(), x.end(), result.end());\n    return result;\n  }\n\n  return Atf::EvaluateFunction(name, params);\n}\n```\n\n## Documentation\n\n- [Winamp ATF Reference](https://web.archive.org/web/20130603113007/http://media.winamp.com/main/help/50/atf/atf.htm)\n- [foobar2000 Title Formatting Reference](http://wiki.hydrogenaud.io/index.php?title=Foobar2000:Title_Formatting_Reference)\n- [Mp3tag Scripting Functions](http://help.mp3tag.de/main_scripting.html)\n- [MusicBrainz Picard Scripting](https://picard.musicbrainz.org/docs/scripting/)\n\n## License\n\n*atf* is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferengy%2Fatf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferengy%2Fatf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferengy%2Fatf/lists"}