Expand description
§Festival
Festival’s internals that powers all of its frontends.
The crate festival is being squatted, so instead, Festival’s
original name, shukusai, is used.
祝祭/shukusai translated means: Festival.
In documentation:
shukusaispecifically meansFestival’s internalsFestivalmeans a frontend OR the project as a whole
§Warning
The internals are not stable. There’s no restrictive, type-safe public API.
If you’re implementing a frontend, you are expected to implement the Kernel’s messages correctly.
You can look at festival-gui’s code as an example,
and the internal documentation as reference.
§API
The “API” between shukusai and the frontends are:
Each frontend must implement the correct message passing behavior to/from the Kernel and other various things.
Kernel itself will handle:
- Logging initialization
Collectionmanagement- Pretty much everything
The Frontend implementation must:
- Keep a channel to
Kernelopen at all times - Properly implement the messages
To/FromtheKernel - Properly handle shared data
There are shared functions/data that shukusai/Kernel exposes, notably:
Collection(and everything within it)StateVolumeKey(and other keys)CONSTANTSmacros!()- etc…
It is up to the frontend on how to use these functions/data.
None of the data/message relationships are restrictive enough to be a public API, and a lot of behavior depends on knowledge that I have of the internals. Since I will most likely be creating all the frontends, there are no plans to make a well-defined public API for now (it’s a lot of work).
Macros§
- fail
- Forward input to
log::error!, appended with red... FAIL - flip
- Flip a
boolin place - lock
- Lock a
Mutexormass_panic!() - lock_
read - Read a
RwLock/RoLockormass_panic! - lock_
write - Write to a
RwLockormass_panic! - mass_
panic log::errora message and terminate all threads- ok
- Forward input to
log::info, appended with green... OK - ok_
debug - Forward input to
log::debug, appended with green... OK - ok_
trace - Forward input to
log::trace, appended with green... OK - recv
recva channel message,mass_panic!on failure- recv_
or_ die recva channel message,panic!current thread on failure- send
senda channel message,mass_panic!on failure- send_
or_ die senda channel message,panic!current thread on failure- skip
- Forward input to
log::info, appended with white... SKIP - skip_
debug - Forward input to
log::debug, appended with white... SKIP - skip_
trace - Forward input to
log::trace, appended with white... SKIP - skip_
warn - Forward input to
log::warn, appended with white... SKIP - sleep
- Sleep the current thread for
xmilliseconds - unwrap_
or_ mass matchaResult,mass_panic!onResult::Err
Structs§
- Album
- Struct holding
Albummetadata, with pointers to anArtistandSong(s) - Album
Key - A key representing the index of an
Albumin theCollection - Artist
- Struct holding
Artistmetadata, with pointers toAlbum(s) - Artist
Key - A key representing the index of an
Artistin theCollection - Collection
- The main music
Collection - Kernel
- The
KernelofFestival - Key
Keyinto theCollection- Keychain
- A separated collection of keys
- Playlist
Key - A key representing an index in a
Playlist - Queue
Key - A key representing an index in the
Queue - RoLock
- Read Only Lock.
- Slice
- Dynamically-sized view into a contiguous
Keysequence - Song
- Struct holding
Songmetadata, with a pointer to theAlbumit belongs to - SongKey
- A key representing the index of a
Songin theCollection - State
- Audio/System State
- Volume
- Wrapper around
f64that is between0.0..100.0
Enums§
- Frontend
ToKernel - Messages
Frontendcan send toKernel - Kernel
ToFrontend - Messages
Kernelcan send toFrontend
Constants§
- BUILD
- Build profile (debug/release)
- COLLECTION_
VERSION - Current major version of the
Collection - COMMIT
- Current
gitcommit - COPYRIGHT
- Copyright notice
- DASH
- Logging separator
- FESTIVAL
- “Festival”, a
&'static str - FESTIVAL_
HEADER - Unique
Bincodeheader - FESTIVAL_
NAME_ VER - Festival + Version
- FESTIVAL_
VERSION - Festival Version
- STATE_
VERSION - Current major version of the
State
Functions§
- init_
logger - Initializes the logger.