Proto commits in tramhao/termusic

These 56 commits are when the Protocol Buffers files have changed:

Commit:e8586ea
Author:hasezoey

style(tui): add some notes why a function is called twice

The documentation is generated from this commit.

Commit:6ab5eda
Author:hasezoey
Committer:hasezoey

feat(lib::player): modify "ShufflePlaylist" to not return the new state, but event "PlaylistShuffled" does simplifies keeping track what has been updated and what not on which client. re https://github.com/tramhao/termusic/pull/429#issuecomment-2682645660

Commit:5993dd7
Author:hasezoey
Committer:hasezoey

feat(lib::player): add PlaylistShuffle event as a event for when shuffling happened was still missing. Note that this implementation currently gets / requests the playlist after a shuffle twice.

Commit:4e30e51
Author:hasezoey
Committer:hasezoey

feat: remove the now unused "ReloadPlaylist" command

Commit:a06a060
Author:hasezoey
Committer:hasezoey

feat: move deleting non-existent tracks from the playlist to the server now nothing in the TUI touches "playlist.log" or message "ReloadPlaylist" anymore

Commit:550d17d
Author:hasezoey
Committer:hasezoey

feat: remove "PlaySelected" and introduce "PlaySpecific" refactor cryptic "PlaySelected" to a "PlaySpecific" message with index. This make understanding the function and behavior easier. Now the last thing that touches "playlist.log" / sends "ReloadPlaylist" is removing deleted items from the playlist.

Commit:1130f6c
Author:hasezoey
Committer:hasezoey

feat: move shuffling of the playlist to the server re #152

Commit:6c91b54
Author:hasezoey
Committer:hasezoey

feat: get the initial playlist values from the server No more "load" from "playlist.log" on tui initial playlist load re #152

Commit:3fe6f1d
Author:hasezoey
Committer:hasezoey

feat: let the server handle swapping in the playlist now the tui does not swap in playlist anymore. Though the TUI still shuffles & searches for random tracks. re #152

Commit:ddee0a2
Author:hasezoey
Committer:hasezoey

feat: also send playlist loop-mode change via event This way, future multiple clients can change a mode and it is populated to all clients, instead of just the calling one.

Commit:299e302
Author:hasezoey
Committer:hasezoey

feat: change playlist removal to also handle clearing

Commit:8a8292f
Author:hasezoey
Committer:hasezoey

feat: let the server handle removing from the playlist now the tui does not remove from playlist anymore. Though the TUI still shuffles & searched for random tracks. re #152

Commit:07a353f
Author:hasezoey
Committer:hasezoey

feat: let the server handle adding to the playlist now the tui does not append the playlist anymore. Though the TUI still shuffles & removes. re #152

Commit:3683c18
Author:hasezoey
Committer:hasezoey

refactor(player.proto): "CycleLoop" return the new mode and move the tui logic to set from that returned mode.

Commit:456705d
Author:hasezoey
Committer:hasezoey

style(lib::proto::player): document some "UpdateTrackChanged" fields

Commit:014e79d
Author:hasezoey
Committer:hasezoey

feat(lib::proto::player): change "index" fields to be u64

Commit:a3cf1f6
Author:hasezoey
Committer:hasezoey

feat(lib::proto::player): stream "gapless state" updates even though it is already returned with the "ToggleGapless" function.

Commit:6421280
Author:hasezoey
Committer:hasezoey

refactor(lib::proto::player): rename "ToggleGaplessReply" to "GaplessState" and document it

Commit:a6d2d12
Author:hasezoey
Committer:hasezoey

refactor(lib::proto::player): rename "TogglePauseResponse" to "PlayState" and document it

Commit:f106811
Author:hasezoey
Committer:hasezoey

style(lib::proto::player): rename and relocate "EmptyReply" -> "Empty"

Commit:84de546
Author:hasezoey
Committer:hasezoey

refactor(lib::proto::player): remove extra Empty message types and use "Empty" instead

Commit:34f2fe4
Author:hasezoey
Committer:hasezoey

style(lib::proto::player): sort rpcs

Commit:13a22ab
Author:hasezoey

fix(protobuf): update definition to be compatible with pre-protobuf 3.15 because ubuntu 22.04 still uses protobuf 3.12 and 3.15 added non-experimental "option" keyword

Commit:d86ed54
Author:hasezoey
Committer:hasezoey

feat: impl stream update for track change

Commit:9f5e9d1
Author:hasezoey
Committer:hasezoey

feat: impl stream update for missed events This way it is easier to indicate to the client that a "Lagged" event happened, instead of returning a error as it is not actually fatal (in this use-case).

Commit:4db7edf
Author:hasezoey
Committer:hasezoey

feat: impl stream update for play status

Commit:2345869
Author:hasezoey
Committer:hasezoey

feat: impl stream update for speed

Commit:b48931d
Author:hasezoey
Committer:hasezoey

feat: initial Protobuf server event streaming for now only a placeholder client implementation (printing events). also only one event for initial commit.

Commit:487237b
Author:hasezoey
Committer:hasezoey

style(player.proto): consistent style

Commit:37853b5
Author:hasezoey
Committer:hasezoey

style(player.proto): remove commented-out old duration implementation

Commit:8937ecf
Author:hasezoey
Committer:hasezoey

feat: move protobuf from "playback" to "lib"

Commit:fad7e21
Author:hasezoey
Committer:hasezoey

feat(playback::proto): transfer "volume" as a "uint32" a signed value is unnecessary, and protobuf does not support sizes lower than 32

Commit:dbc6aa2
Author:hasezoey

fix(playback::proto): remove usage of "optional" as in the CI's systems it is still experimental

Commit:45524fa
Author:hasezoey
Committer:hasezoey

feat(playback::proto): transfer duration instead of i64 seconds for "GetProgressResponse" more granularity in the tui

Commit:9455491
Author:hasezoey
Committer:hasezoey

refactor(playback::proto): change to use own message type for player-time

Commit:8dcbfcb
Author:hasezoey
Committer:hasezoey

feat(playback::proto): transfer duration instead of i64 seconds for Seek replies

Commit:16f3fcd
Author:hasezoey

Revert "Merge pull request #154 from GaelicGabe/refactor-daemon" This reverts commit 8c3cd5684c3fb03e91c24eb37c90d3067943dce4, reversing changes made to f34d1b446a3c82944f8aa487bde3368a0cae616e.

Commit:f20df54
Author:user

Refactor daemon play-track feature and surrounding The play-selected-track flow was highly confusing, it involved 3 PlayerCmd's and 1 file write and 1 file read from the TUI and daemon respectively. This commit refactors this flow into 1 PlayerCmd and 0 file interaction. This PR also tries to simplify some other daemon flows by for example removing Eos signals sent by the daemon to itself when the next track should be played. Instead this is accomplished by just calling a function for playing the next track. The function that plays the next track is also completely reworked and renamed. It is now called `play_next_track` rather than `start_play`. This PR also makes sure that the daemon internal state is actually accurately representing what is going on in the application, previously the music player may play a track but the `current_track` would not point to this track. This commit also gets rid of 2 fields in the GeneralPlayer struct that turned out to not be necessary after the refactor. This commit also does some preporatory work for moving towards a model where playing tracks not in the playlist is possible. For example playing a track directly from the library. Finally this commit creates several comments for TODOs and thoughts about future improvements for the code.

Commit:5a2e7c3
Author:user

Refactor Playlist next track logic and cleanup Remove unecessary function abstractions in the playlist logic. Improve next track selection by replacing the function with an iterator. This allows us to not have duplicate songs in the random list (or if we want the random list to have duplicate songs then that's trivial). On top of that encode possibility of not having a current track in type logic. Cleanup and reformat project.

Commit:accc3b4
Author:user
Committer:user

Update playlist ui on track change The UI now changes which track is marked as playing when the daemon sends a track changed update. UI is no longer updating on track change via polling the progress, instead it updates properly on daemon update track change events. Also reverting a bug introduced by having u64 in the proto file rather than u32.

Commit:5f8a1e9
Author:user
Committer:user

Large refactor types, daemon-update subscribers This large refactor commit moves the proto description to lib::types, it starts placing From and TryFrom implementations in lib::types for gRPC types. It also implements a server-to-client gRPC interface where the UI can subscribe to events from the daemon. This will hopefully make it easier for the UI to update itself when important events happen in the daemon for example when the playing track is changed.

Commit:212696b
Author:tramhao

radio info is updated in lyric form

Commit:b485563
Author:tramhao

start working on current track

Commit:fa1c1cd
Author:tramhao

skip previous and play selected works

Commit:cd4bdd2
Author:tramhao

reload config and reload playlist works

Commit:0d514f3
Author:tramhao

seek forward/backword works

Commit:bfeba54
Author:tramhao

toggle pause improve the display on progress title

Commit:2562238
Author:tramhao

toggle gapless works

Commit:738c2b3
Author:tramhao

speed change works

Commit:27db3b4
Author:tramhao

cycle loop mode works

Commit:82e3bfe
Author:tramhao

volume works

Commit:adc4824
Author:tramhao

volume up/down works but the first press is not working

Commit:56cf3b2
Author:tramhao

status works

Commit:3335b41
Author:tramhao

start working on get progress

Commit:b86f7ab
Author:tramhao

start working on next

Commit:ad3dafd
Author:tramhao

start working on grpc solution