Skip to content

Commit f1d896a

Browse files
committed
set audio feature as the default
1 parent 60856c5 commit f1d896a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ rodio = { version = "0.18", optional = true }
1414
gilrs = { version = "0.10", optional = true }
1515

1616
[features]
17-
default = ["gamepad"]
18-
gamepad = ["gilrs"]
17+
default = ["audio", "gamepad"]
1918
audio = ["rodio"]
19+
gamepad = ["gilrs"]

src/interface/gui.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ async fn run_async(rom_path: Option<PathBuf>, boot_rom_path: Option<PathBuf>) {
7575
let _ = event_loop.run(move |event, elwt| match event {
7676
Event::WindowEvent { event, window_id } if window_id == target_window_id => match event {
7777
WindowEvent::CloseRequested => {
78+
#[cfg(feature = "audio")]
7879
state.audio.stop();
7980
elwt.exit();
8081
}
@@ -205,6 +206,7 @@ struct State {
205206
rom_frame_ready: bool,
206207
input: InputState,
207208
overlay: Overlay,
209+
#[cfg(feature = "audio")]
208210
audio: AudioOutput,
209211
#[cfg(feature = "gamepad")]
210212
gilrs: Option<Gilrs>,
@@ -455,7 +457,10 @@ impl State {
455457
}
456458
}
457459

460+
#[cfg(feature = "audio")]
458461
let mut audio = AudioOutput::new();
462+
463+
#[cfg(feature = "audio")]
459464
audio.start(&mut emulator);
460465

461466
#[cfg(feature = "gamepad")]
@@ -478,6 +483,7 @@ impl State {
478483
rom_frame_ready: false,
479484
input: InputState::default(),
480485
overlay: Overlay::new(),
486+
#[cfg(feature = "audio")]
481487
audio,
482488
#[cfg(feature = "gamepad")]
483489
gilrs,

0 commit comments

Comments
 (0)