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:
shukusai
specifically meansFestival
’s internalsFestival
means 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
Collection
management- Pretty much everything
The Frontend
implementation must:
- Keep a channel to
Kernel
open at all times - Properly implement the messages
To/From
theKernel
- Properly handle shared data
There are shared functions/data that shukusai/Kernel
exposes, notably:
Collection
(and everything within it)State
Volume
Key
(and other keys)CONSTANTS
macros!()
- 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
- Forward input to
log::error!
, appended with red... FAIL
- Flip a
bool
in place - Lock a
Mutex
ormass_panic!()
- Write to a
RwLock
ormass_panic!
log::error
a message and terminate all threads- Forward input to
log::info
, appended with green... OK
- Forward input to
log::debug
, appended with green... OK
- Forward input to
log::trace
, appended with green... OK
recv
a channel message,mass_panic!
on failuresend
a channel message,mass_panic!
on failure- Forward input to
log::info
, appended with white... SKIP
- Forward input to
log::debug
, appended with white... SKIP
- Forward input to
log::trace
, appended with white... SKIP
- Forward input to
log::warn
, appended with white... SKIP
- Sleep the current thread for
x
milliseconds
Structs
- A key representing the index of an
Album
in theCollection
- A key representing the index of an
Artist
in theCollection
- The main music
Collection
- The
Kernel
ofFestival
Key
into theCollection
- A separated collection of keys
- A key representing an index in a
Playlist
- A key representing an index in the
Queue
- Read Only Lock.
- Dynamically-sized view into a contiguous
Key
sequence - A key representing the index of a
Song
in theCollection
- Audio/System State
- Wrapper around
f64
that is between0.0..100.0
Enums
- Messages
Frontend
can send toKernel
- Messages
Kernel
can send toFrontend
Constants
- Build profile (debug/release)
- Current major version of the
Collection
- Current
git
commit - Copyright notice
- Logging separator
- “Festival”, a
&'static str
- Unique
Bincode
header - Festival + Version
- Festival Version
- Current major version of the
State
Functions
- Initializes the logger.