feat: working version

This commit is contained in:
2024-06-28 23:55:33 +02:00
parent c2f0cd0492
commit 1f48737b2b
7 changed files with 1123 additions and 2 deletions

25
src/instructions.rs Normal file
View File

@@ -0,0 +1,25 @@
#[repr(u8)]
pub enum MixerInstruction {
SelectNext,
SelectPrevious,
ToggleMuteCurrent,
IncreaseCurrent,
DecreaseCurrent,
GetCurrent,
PlayPauseCurrent,
}
impl MixerInstruction {
pub fn from_u8(byte: u8) -> Self {
match byte {
0 => MixerInstruction::SelectNext,
1 => MixerInstruction::SelectPrevious,
2 => MixerInstruction::ToggleMuteCurrent,
3 => MixerInstruction::IncreaseCurrent,
4 => MixerInstruction::DecreaseCurrent,
5 => MixerInstruction::GetCurrent,
6 => MixerInstruction::PlayPauseCurrent,
_ => panic!("Could not parse '{byte}' to MixerInstruction"),
}
}
}