Skip to content

Commit

Permalink
Add Record menu tab
Browse files Browse the repository at this point in the history
  • Loading branch information
addiswebb committed Aug 18, 2024
1 parent 7c544b7 commit a7c17d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use zip::{write::SimpleFileOptions, ZipArchive, ZipWriter};

use crate::{
keyframe::{Keyframe, KeyframeType},
sequencer::{Change, ChangeData, Sequencer, SequencerState},
sequencer::{Sequencer, SequencerState},
settings::{MonitorEdge, Settings, SettingsPage},
};

Expand Down Expand Up @@ -535,6 +535,17 @@ impl eframe::App for App {
}
});
});
ui.menu_button("Record", |ui| {
if ui
.add(egui::Button::new(if self.sequencer.recording.load(Ordering::Relaxed) {"Stop Recording"} else { "Start Recording"}).shortcut_text("F8"))
.clicked()
{
self.sequencer.toggle_recording();
ui.close_menu();
}
ui.add(egui::Checkbox::new(&mut self.sequencer.clear_before_recording, "Overwrite Recording"));
ui.add(egui::Checkbox::new(&mut self.settings.retake_screenshots, "Retake Screenshots"));
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/sequencer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub struct Sequencer {
play: Arc<AtomicBool>,
#[serde(skip)]
was_recording: bool,
clear_before_recording: bool,
pub clear_before_recording: bool,
#[serde(skip)]
recording_instant: Arc<Mutex<Instant>>,
#[serde(skip)]
Expand Down

0 comments on commit a7c17d8

Please sign in to comment.