luminol_data/shared/
audio_file.rs

1// Copyright (C) 2024 Melody Madeline Lyons
2//
3// This file is part of Luminol.
4//
5// Luminol is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Luminol is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Luminol.  If not, see <http://www.gnu.org/licenses/>.
17use crate::{optional_path_alox, optional_path_serde, Path};
18
19#[derive(Debug, Clone, PartialEq)]
20#[derive(serde::Deserialize, serde::Serialize)]
21#[derive(alox_48::Deserialize, alox_48::Serialize)]
22#[marshal(class = "RPG::AudioFile")]
23pub struct AudioFile {
24    #[serde(with = "optional_path_serde")]
25    #[marshal(with = "optional_path_alox")]
26    pub name: Path,
27    pub volume: u8,
28    pub pitch: u8,
29}
30
31impl Default for AudioFile {
32    fn default() -> Self {
33        Self {
34            name: None,
35            volume: 100,
36            pitch: 100,
37        }
38    }
39}