| 243 | |
| 244 | pub(crate) fn execute_bgm_volume(&mut self) -> Result<(), EngineError> { |
| 245 | if let Some(window) = self.weak.upgrade() { |
| 246 | let volume = window.get_main_volume() / 100.0; |
| 247 | let bgm_volume = window.get_bgm_volume() / 100.0; |
| 248 | self.media_player |
| 249 | .borrow() |
| 250 | .change_bgm_volume(volume * bgm_volume); |
| 251 | } |
| 252 | |
| 253 | Ok(()) |
| 254 | } |
| 255 | |
| 256 | pub(crate) fn execute_voice_volume(&mut self) -> Result<(), EngineError> { |
| 257 | if let Some(window) = self.weak.upgrade() { |
| 258 | let volume = window.get_main_volume() / 100.0; |