Commit graph

31 commits

Author SHA1 Message Date
Jarkko Lehtoranta
46195f18d6
Handle play_request_id as an event 2023-07-19 14:49:05 +03:00
Nick Steel
68bbb4fbbc Fix latest clippy and fmt warnings 2022-11-22 13:38:02 +00:00
JasonLG1979
8545f361c4 Major Events Overhaul
Special thanks to @eladyn for all of their help and suggestions.

* Add all player events to `player_event_handler.rs`

* Move event handler code to `player_event_handler.rs`

* Add session events

* Clean up and de-noise events and event firing

* Added metadata support via a TrackChanged event

* Add `event_handler_example.py`

* Handle invalid track start positions by just starting the track from the beginning

* Add repeat support to `spirc.rs`

* Add `disconnect`, `set_position_ms` and `set_volume` to `spirc.rs`

* Set `PlayStatus` to the correct value when Player is loading to avoid blanking out the controls when `self.play_status` is `LoadingPlay` or `LoadingPause` in `spirc.rs`

* Handle attempts to play local files better by basically ignoring attempts to load them in `handle_remote_update` in `spirc.rs`

* Add an event worker thread that runs async to the main thread(s) but sync to itself to prevent potential data races for event consumers.

* Get rid of (probably harmless) `.unwrap()` in `main.rs`

* Ensure that events are emited in a logical order and at logical times

* Handle invalid and disappearing devices better

* Ignore SpircCommands unless we're active with the exception of ShutDown
2022-09-17 16:21:10 -05:00
Roderick van Domburg
05b9b13cf8
Merge branch 'dev' into new-api and update crates 2022-07-27 23:31:11 +02:00
Jason Gray
47f1362453
Port remove unsafe code and catch up with dev (#956) 2022-02-14 12:15:19 +01:00
Jason Gray
ceebb374f0
Remove unsafe code (#940)
Remove unsafe code
2022-01-23 19:02:04 +01:00
Roderick van Domburg
59d00787c9
Update player crates and transitive dependencies 2022-01-09 16:04:53 +01:00
Evan Cameron
6a33eb4efa
minor cleanup 2021-02-28 21:54:19 -05:00
johannesd3
220061e158 Migrate application to tokio 1.0 2021-02-21 17:05:36 +01:00
Sasha Hilton
632894a13e
Merge pull request #526 from marcelbuesing/align-player-events
Align PLAYER_EVENT naming
2021-02-05 04:25:43 +00:00
maxthiel
2f7bf54076 Add a preload event to warn about new track coming soon 2020-12-10 21:17:41 +00:00
marcelbuesing
a3774632a0
Align PLAYER_EVENT naming 2020-09-25 16:11:30 +02:00
Sasha Hilton
6eabf4a75c
Merge pull request #449 from kaymes/blocking_sink_events
Add blocking SinkActive|SinkInactive events
2020-07-24 03:07:38 +01:00
Konstantin Seiler
223b8d611e Roll back the meta data processing. 2020-03-20 17:31:18 +11:00
Konstantin Seiler
b562ec6015 rename variable. 2020-03-12 23:29:24 +11:00
Konstantin Seiler
c9117542eb Refactor TrackMetaData in the player and add the metadata to the player events.
Fire more events in the --onevent script and set more variables.
2020-03-12 23:01:45 +11:00
Konstantin Seiler
6f28b0486f Emit blocking sink events 2020-03-10 23:26:01 +11:00
Konstantin Seiler
18d1181bf5 Clean up some code
Ensure the player events are emitted correctly.
Only call the external script on events we want to notify about.
Stop sink when loading to pause.
cargo fmt
2020-02-03 18:58:44 +11:00
Konstantin Seiler
5784b4652c Prepare for gapless play.
- change communication between player and spirc to use player events channel.
- enhance player events channel
- have spirc send loading messages to Spotify
- enable preloading of tracks in the player
2020-02-01 08:41:11 +11:00
marcelbuesing
38d82f2dc2
Rerun rustfmt on full codebase 2020-01-17 18:47:30 +01:00
ashthespy
d26590afc5
Update to Rust 2018
- Fix deprecated Error::cause warnings and missing dyn
- Reset max_width
- Add rustfmt to Travis
- Run rustfmt on full codebase
 with `cargo fmt --all`
- Add rustfmt to Travis
- Complete migration to edition 2018
- Replace try! shorthand
- Use explicit `dyn Trait`
2020-01-17 18:11:52 +01:00
marcelbuesing
be2ad9059a
Migrate to rust 2018 edition 2020-01-17 15:54:42 +01:00
ruben
81e7c9b9d3 Changed TRACK_ID from base16 to base62 so that it is equal with the official Spotify app 2018-11-04 18:41:33 +01:00
William R. Fraser
9fa138a116 implement using tokio-process instead 2018-10-16 02:34:56 -07:00
William R. Fraser
eaac599ce3 reap the exit statuses from 'onevent' child processes 2018-10-16 00:24:33 -07:00
Sasha Hilton
237ef1e4f9 Format according to rustfmt 2018-02-26 02:50:41 +01:00
Simon Persson
23d3c1593f Just spawn event handlers, don't wait for exit code. 2018-02-20 23:17:06 +01:00
Simon Persson
93af49aadf Send player event messages over futures aware channel. 2018-02-20 23:12:29 +01:00
Simon Persson
2eb4aa61d3 Use single program on events, and pass events in envars. 2018-02-20 22:45:14 +01:00
Simon Persson
1b943d069f Move PlayerEvent into player. 2018-02-20 21:57:42 +01:00
Simon Persson
b0ee03112f First attempt at a better playback event system. 2018-02-16 00:16:38 +01:00