mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
labels and icons
This commit is contained in:
parent
3e748fefa7
commit
eb0547dc37
6 changed files with 19 additions and 18 deletions
|
|
@ -26,6 +26,6 @@
|
||||||
(bsp/s (fill/x (align/w :view-tracks-devices))
|
(bsp/s (fill/x (align/w :view-tracks-devices))
|
||||||
(bsp/s (fill/x (align/w :view-tracks-outputs))
|
(bsp/s (fill/x (align/w :view-tracks-outputs))
|
||||||
(bsp/s (fill/x (align/w :view-tracks-names))
|
(bsp/s (fill/x (align/w :view-tracks-names))
|
||||||
(fill/xy (either :is-editing
|
(fill/xy (either :is-editing
|
||||||
(bsp/e (fixed/x 20 :view-scenes-names) :view-editor)
|
(bsp/e (fixed/x 20 :view-scenes-names) :view-editor)
|
||||||
:view-scenes)))))))))))
|
:view-scenes)))))))))))
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,9 @@ impl HasClipsSize for App {
|
||||||
//});
|
//});
|
||||||
|
|
||||||
impl App {
|
impl App {
|
||||||
|
pub fn update_clock (&self) {
|
||||||
|
ViewCache::update_clock(&self.view_cache, self.clock(), self.size.w() > 80)
|
||||||
|
}
|
||||||
pub fn toggle_dialog (&mut self, mut dialog: Option<Dialog>) -> Option<Dialog> {
|
pub fn toggle_dialog (&mut self, mut dialog: Option<Dialog>) -> Option<Dialog> {
|
||||||
std::mem::swap(&mut self.dialog, &mut dialog);
|
std::mem::swap(&mut self.dialog, &mut dialog);
|
||||||
dialog
|
dialog
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,6 @@ use crate::*;
|
||||||
pub(crate) use std::fmt::Write;
|
pub(crate) use std::fmt::Write;
|
||||||
pub(crate) use ::tengri::tui::ratatui::prelude::Position;
|
pub(crate) use ::tengri::tui::ratatui::prelude::Position;
|
||||||
|
|
||||||
impl App {
|
|
||||||
|
|
||||||
pub fn update_clock (&self) {
|
|
||||||
ViewCache::update_clock(&self.view_cache, self.clock(), self.size.w() > 80)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tengri_proc::view(TuiOut)]
|
#[tengri_proc::view(TuiOut)]
|
||||||
impl App {
|
impl App {
|
||||||
pub fn view_nil (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_nil (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
|
|
@ -95,7 +88,11 @@ impl App {
|
||||||
cache.bpm.view.clone(), cache.beat.view.clone(), cache.time.view.clone())
|
cache.bpm.view.clone(), cache.beat.view.clone(), cache.time.view.clone())
|
||||||
}
|
}
|
||||||
pub fn view_editor (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_editor (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
self.editor()
|
let bg = self.editor()
|
||||||
|
.and_then(|editor|editor.clip().clone())
|
||||||
|
.map(|clip|clip.read().unwrap().color.darker)
|
||||||
|
.unwrap_or(self.color.darker);
|
||||||
|
Fill::xy(Tui::bg(bg.rgb, self.editor()))
|
||||||
}
|
}
|
||||||
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
pub fn view_editor_status (&self) -> impl Content<TuiOut> + use<'_> {
|
||||||
self.editor().map(|e|Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
self.editor().map(|e|Fixed::x(20, Outer(true, Style::default().fg(Tui::g(96))).enclose(
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,8 @@ impl ArrangementCommand {
|
||||||
if clip.is_none() {
|
if clip.is_none() {
|
||||||
//app.clip_auto_create();
|
//app.clip_auto_create();
|
||||||
*clip = Some(Arc::new(RwLock::new(MidiClip::new(
|
*clip = Some(Arc::new(RwLock::new(MidiClip::new(
|
||||||
"", false, 384, None, Some(ItemTheme::random())
|
&format!("t{track:02}s{scene:02}"),
|
||||||
|
false, 384, None, Some(ItemTheme::random())
|
||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
clip.as_ref().map(|c|c.into())
|
clip.as_ref().map(|c|c.into())
|
||||||
|
|
|
||||||
|
|
@ -329,9 +329,9 @@ pub trait ClipsView:
|
||||||
for (scene_index, scene, ..) in self.scenes_with_sizes() {
|
for (scene_index, scene, ..) in self.scenes_with_sizes() {
|
||||||
let (name, theme): (Arc<str>, ItemTheme) = if let Some(Some(clip)) = &scene.clips.get(track_index) {
|
let (name, theme): (Arc<str>, ItemTheme) = if let Some(Some(clip)) = &scene.clips.get(track_index) {
|
||||||
let clip = clip.read().unwrap();
|
let clip = clip.read().unwrap();
|
||||||
(clip.name.clone(), clip.color)
|
(format!(" ⏹ {}", &clip.name).into(), clip.color)
|
||||||
} else {
|
} else {
|
||||||
(" ---- ".into(), ItemTheme::G[32])
|
(" ⏹ -- ".into(), ItemTheme::G[32])
|
||||||
};
|
};
|
||||||
let fg = theme.lightest.rgb;
|
let fg = theme.lightest.rgb;
|
||||||
let mut outline = theme.base.rgb;
|
let mut outline = theme.base.rgb;
|
||||||
|
|
|
||||||
|
|
@ -46,19 +46,19 @@ pub(crate) fn note_y_iter (note_lo: usize, note_hi: usize, y0: u16)
|
||||||
(note_lo..=note_hi).rev().enumerate().map(move|(y, n)|(y, y0 + y as u16, n))
|
(note_lo..=note_hi).rev().enumerate().map(move|(y, n)|(y, y0 + y as u16, n))
|
||||||
}
|
}
|
||||||
|
|
||||||
content!(TuiOut:|self: PianoHorizontal| Tui::bg(Tui::g(40), Bsp::s(
|
content!(TuiOut:|self: PianoHorizontal| Bsp::s(
|
||||||
Bsp::e(
|
Bsp::e(
|
||||||
Fixed::x(5, format!("{}x{}", self.size.w(), self.size.h())),
|
Fixed::x(5, format!("{}x{}", self.size.w(), self.size.h())),
|
||||||
self.timeline()
|
self.timeline()
|
||||||
),
|
),
|
||||||
Bsp::e(
|
Bsp::e(
|
||||||
self.keys(),
|
self.keys(),
|
||||||
self.size.of(Tui::bg(Tui::g(32), Bsp::b(
|
self.size.of(Bsp::b(
|
||||||
Fill::xy(self.notes()),
|
Fill::xy(self.notes()),
|
||||||
Fill::xy(self.cursor()),
|
Fill::xy(self.cursor()),
|
||||||
)))
|
))
|
||||||
),
|
),
|
||||||
)));
|
));
|
||||||
|
|
||||||
impl PianoHorizontal {
|
impl PianoHorizontal {
|
||||||
/// Draw the piano roll background.
|
/// Draw the piano roll background.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue