Crate shukusai

Crate shukusai 

Source
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 means Festival’s internals
  • Festival 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 the Kernel
  • Properly handle shared data

There are shared functions/data that shukusai/Kernel exposes, notably:

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 bool in place
lock
Lock a Mutex or mass_panic!()
lock_read
Read a RwLock/RoLock or mass_panic!
lock_write
Write to a RwLock or mass_panic!
mass_panic
log::error a 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
recv a channel message, mass_panic! on failure
recv_or_die
recv a channel message, panic! current thread on failure
send
send a channel message, mass_panic! on failure
send_or_die
send a 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 x milliseconds
unwrap_or_mass
match a Result, mass_panic! on Result::Err

Structs§

Album
Struct holding Album metadata, with pointers to an Artist and Song(s)
AlbumKey
A key representing the index of an Album in the Collection
Artist
Struct holding Artist metadata, with pointers to Album(s)
ArtistKey
A key representing the index of an Artist in the Collection
Collection
The main music Collection
Kernel
The Kernel of Festival
Key
Key into the Collection
Keychain
A separated collection of keys
PlaylistKey
A key representing an index in a Playlist
QueueKey
A key representing an index in the Queue
RoLock
Read Only Lock.
Slice
Dynamically-sized view into a contiguous Key sequence
Song
Struct holding Song metadata, with a pointer to the Album it belongs to
SongKey
A key representing the index of a Song in the Collection
State
Audio/System State
Volume
Wrapper around f64 that is between 0.0..100.0

Enums§

FrontendToKernel
Messages Frontend can send to Kernel
KernelToFrontend
Messages Kernel can send to Frontend

Constants§

BUILD
Build profile (debug/release)
COLLECTION_VERSION
Current major version of the Collection
COMMIT
Current git commit
COPYRIGHT
Copyright notice
DASH
Logging separator
FESTIVAL
“Festival”, a &'static str
FESTIVAL_HEADER
Unique Bincode header
FESTIVAL_NAME_VER
Festival + Version
FESTIVAL_VERSION
Festival Version
STATE_VERSION
Current major version of the State

Functions§

init_logger
Initializes the logger.