phrase list select and append/insert

This commit is contained in:
🪞👃🪞 2024-10-10 09:44:28 +03:00
parent 333e8bf98a
commit dc3edc86ff
2 changed files with 27 additions and 4 deletions

View file

@ -22,6 +22,10 @@ pub enum SequencerFocus { Transport, PhrasePool, PhraseEditor }
/// Contains all phrases in a project
pub struct PhrasePool<E: Engine> {
_engine: PhantomData<E>,
/// Scroll offset
pub scroll: usize,
/// Highlighted phrase
pub phrase: usize,
/// Phrases in the pool
pub phrases: Vec<Arc<RwLock<Option<Phrase>>>>,
/// Whether this widget is focused
@ -120,6 +124,8 @@ impl<E: Engine> PhrasePool<E> {
pub fn new () -> Self {
Self {
_engine: Default::default(),
scroll: 0,
phrase: 0,
phrases: vec![Arc::new(RwLock::new(Some(Phrase::default())))],
focused: false
}