1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::output::actions::*;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub enum Action {
OutputAction(OutputAction),
InnerAction(InnerAction),
}
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize, Deserialize)]
pub enum InnerAction {
RepeatLastChord(OutputActionType),
SwitchConfig(std::path::PathBuf),
}
impl From<OutputAction> for Action {
fn from(oe: OutputAction) -> Self {
Self::OutputAction(oe)
}
}
impl From<Pulse> for Action {
fn from(pulse: Pulse) -> Self {
Self::OutputAction(OutputAction::Pulse(pulse))
}
}
impl From<StateChange> for Action {
fn from(sc: StateChange) -> Self {
Self::OutputAction(OutputAction::StateChange(sc))
}
}
impl From<Toggle> for Action {
fn from(toggle: Toggle) -> Self {
Self::OutputAction(OutputAction::Toggle(toggle))
}
}
impl From<InnerAction> for Action {
fn from(ie: InnerAction) -> Self {
Self::InnerAction(ie)
}
}