{"id":22863793,"url":"https://github.com/nilsding/crocket","last_synced_at":"2026-05-15T13:03:44.488Z","repository":{"id":67628533,"uuid":"163646831","full_name":"nilsding/crocket","owner":"nilsding","description":"Crystal wrapper for Rocket","archived":false,"fork":false,"pushed_at":"2019-01-01T06:04:15.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T13:51:30.941Z","etag":null,"topics":["crystal","demoscene","gnu-rocket","rocket"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/nilsding.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}},"created_at":"2018-12-31T06:56:28.000Z","updated_at":"2019-06-01T13:52:50.000Z","dependencies_parsed_at":"2023-04-15T11:16:15.871Z","dependency_job_id":null,"html_url":"https://github.com/nilsding/crocket","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/nilsding%2Fcrocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsding%2Fcrocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsding%2Fcrocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nilsding%2Fcrocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nilsding","download_url":"https://codeload.github.com/nilsding/crocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246446075,"owners_count":20778735,"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":["crystal","demoscene","gnu-rocket","rocket"],"created_at":"2024-12-13T11:17:32.233Z","updated_at":"2025-10-08T05:51:49.890Z","avatar_url":"https://github.com/nilsding.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crocket\n\nA Crystal wrapper for [Rocket][rocket].\n\nStill a work-in-progress, and a proof-of-concept.  Caveat emptor!\n\nAn example project is available at [nilsding/crocket_example][example].\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n```yaml\ndependencies:\n  crocket:\n    github: nilsding/crocket\n```\n2. Run `shards install`.  This will automatically build the librocket library as\n   well (don't worry, it doesn't take long).\n\n## Usage\n\nUsage should be similar to normal Rocket, but with a more Crystal-ish API.\n\n```crystal\nrequire \"crocket\"\n\n# Create a new SyncDevice\ndevice = Crocket::SyncDevice.new(\"sync\")\n\n# Set up some callbacks\nCrocket::SyncDevice.define_pause_callback do |should_pause|\n  if should_pause\n    audio_stream.pause\n  else\n    audio_stream.play\n  end\nend\nCrocket::SyncDevice.define_set_row_callback do |row|\n  seek_row_in_audio_stream(row)\nend\nCrocket::SyncDevice.define_is_playing_callback do\n  audio_stream.playing?\nend\n\n# Connect to the Rocket editor\nabort \"failed to connect to host\" unless device.tcp_connect(\"localhost\")\n\n# Get some tracks\nclear_r = device[\"clear.r\"]\nclear_g = device[\"clear.g\"]\nclear_b = device[\"clear.b\"]\n\nloop do\n  row = get_row_from_audio_stream\n  unless device.update(row)\n    device.tcp_connect(\"localhost\")\n  end\n\n  # Do something with the values for the current row\n  p [row, clear_r[row], clear_g[row], clear_b[row]]\nend\n\n# Save the tracks for later demo use\ndevice.save_tracks\n```\n\nTo compile your Crystal app with librocket in edit mode, simply run `shards\ninstall`.\n\nFor demo/playback mode where it reads the tracks from files you need to define\nthe `sync_player` flag.  This can be achieved via `shards install\n-Dsync_player`.\n\nThe edit mode methods are stubbed out when the app is compiled for demo mode.\nThis means that you do not need to manually surround the relevant edit methods\n(e.g. `#tcp_connect`, `#save_tracks`, and the callbacks) with a `{% if\nflag?(:sync_player) %}` check.\n\n## Development\n\nTODO: Write development instructions here\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/nilsding/crocket/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Georg Gadinger](https://github.com/nilsding) - creator and maintainer\n\n[rocket]: https://github.com/rocket/rocket\n[example]: https://github.com/nilsding/crocket_example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsding%2Fcrocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnilsding%2Fcrocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnilsding%2Fcrocket/lists"}