core: Move Letterbox to config module

This commit is contained in:
Mike Welsh 2021-01-06 00:42:10 -08:00
parent 87ae91963b
commit bacb66b97b
1 changed files with 30 additions and 0 deletions

30
core/src/config.rs Normal file
View File

@ -0,0 +1,30 @@
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/// Controls whether the content is letterboxed or pillarboxed when the
/// player's aspect ratio does not match the movie's aspect ratio.
///
/// When letterboxed, black bars will be rendered around the exterior
/// margins of the content.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(rename = "letterbox"))]
pub enum Letterbox {
/// The content will never be letterboxed.
#[cfg_attr(feature = "serde", serde(rename = "off"))]
Off,
/// The content will only be letterboxed if the content is running fullscreen.
#[cfg_attr(feature = "serde", serde(rename = "fullscreen"))]
Fullscreen,
/// The content will always be letterboxed.
#[cfg_attr(feature = "serde", serde(rename = "on"))]
On,
}
impl Default for Letterbox {
fn default() -> Self {
Letterbox::Fullscreen
}
}