[PR #190] [CLOSED] Event hooks #829

Closed
opened 2026-02-27 20:00:07 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/190
Author: @ashthespy
Created: 3/15/2018
Status: Closed

Base: masterHead: events


📝 Commits (7)

  • 545c9ea Preliminary event hooks
  • 3712f67 Add track_id to events
  • 08a00a6 Add cargo.lock and rustfmt
  • b584b21 Merge branch 'master' into events
  • 63309f8 Refactor Events -> Event, and move it to core
  • a9fb957 Consolidate PlayerEvent and Event
  • 8592ebd rustfmt for nightly

📊 Changes

18 files changed (+233 additions, -180 deletions)

View changed files

📝 audio/src/fetch.rs (+2 -10)
📝 connect/src/spirc.rs (+78 -9)
📝 core/src/audio_key.rs (+1 -5)
📝 core/src/authentication.rs (+5 -9)
📝 core/src/connection/codec.rs (+1 -2)
📝 core/src/connection/handshake.rs (+1 -4)
📝 core/src/connection/mod.rs (+8 -16)
📝 core/src/diffie_hellman.rs (+8 -16)
core/src/events.rs (+53 -0)
📝 core/src/lib.rs (+1 -0)
📝 core/src/session.rs (+1 -5)
📝 examples/play.rs (+1 -3)
📝 playback/src/audio_backend/jackaudio.rs (+2 -6)
📝 playback/src/audio_backend/pipe.rs (+1 -4)
📝 playback/src/player.rs (+28 -57)
📝 protocol/build.rs (+1 -4)
📝 src/main.rs (+33 -23)
📝 src/player_event_handler.rs (+8 -7)

📄 Description

Greetings,
A proof of concept of event hooks. This is in addition to the existing --onchange hooks.

Discussions

  1. What is the right place for the Events enum?
  2. How do we want to expose these events?
  3. Any more events required?
  4. Should we consolidate these events along with --onchange ones?

PS: Rust infant - double check the implementation please!

Edit: I will clean it up the comments, run rustfmt after you guys think it's useable!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/190 **Author:** [@ashthespy](https://github.com/ashthespy) **Created:** 3/15/2018 **Status:** ❌ Closed **Base:** `master` ← **Head:** `events` --- ### 📝 Commits (7) - [`545c9ea`](https://github.com/librespot-org/librespot/commit/545c9eaa9732bc7fe0236289ac931185930a6d55) Preliminary event hooks - [`3712f67`](https://github.com/librespot-org/librespot/commit/3712f67fe395c8a786479011661e79968c33bb5c) Add `track_id` to events - [`08a00a6`](https://github.com/librespot-org/librespot/commit/08a00a6b81e388dacadeba39955595126e1faca4) Add `cargo.lock` and `rustfmt` - [`b584b21`](https://github.com/librespot-org/librespot/commit/b584b21695f489b2723e648a5393a1a7ee61466f) Merge branch 'master' into events - [`63309f8`](https://github.com/librespot-org/librespot/commit/63309f86e50f70180ab2c98bb9c20607ce526609) Refactor `Events` -> `Event`, and move it to `core` - [`a9fb957`](https://github.com/librespot-org/librespot/commit/a9fb957c905a4b0dc0406d578cf15df64abc33e3) Consolidate `PlayerEvent` and `Event` - [`8592ebd`](https://github.com/librespot-org/librespot/commit/8592ebd8540cf6618a58af50f0e0edd2135c7c82) rustfmt for nightly ### 📊 Changes **18 files changed** (+233 additions, -180 deletions) <details> <summary>View changed files</summary> 📝 `audio/src/fetch.rs` (+2 -10) 📝 `connect/src/spirc.rs` (+78 -9) 📝 `core/src/audio_key.rs` (+1 -5) 📝 `core/src/authentication.rs` (+5 -9) 📝 `core/src/connection/codec.rs` (+1 -2) 📝 `core/src/connection/handshake.rs` (+1 -4) 📝 `core/src/connection/mod.rs` (+8 -16) 📝 `core/src/diffie_hellman.rs` (+8 -16) ➕ `core/src/events.rs` (+53 -0) 📝 `core/src/lib.rs` (+1 -0) 📝 `core/src/session.rs` (+1 -5) 📝 `examples/play.rs` (+1 -3) 📝 `playback/src/audio_backend/jackaudio.rs` (+2 -6) 📝 `playback/src/audio_backend/pipe.rs` (+1 -4) 📝 `playback/src/player.rs` (+28 -57) 📝 `protocol/build.rs` (+1 -4) 📝 `src/main.rs` (+33 -23) 📝 `src/player_event_handler.rs` (+8 -7) </details> ### 📄 Description Greetings, A proof of concept of event hooks. This is in addition to the existing `--onchange` hooks. #### Discussions 1. What is the right place for the `Events` enum? 2. How do we want to expose these events? 3. Any more events required? 4. Should we consolidate these events along with `--onchange` ones? PS: Rust infant - double check the implementation please! Edit: I will clean it up the comments, run `rustfmt` after you guys think it's useable! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:00:07 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#829
No description provided.