mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
test: fix coverage run
This commit is contained in:
parent
24bc33d3d0
commit
2c59b1acfd
6 changed files with 58 additions and 58 deletions
|
|
@ -287,14 +287,14 @@ pub trait HasScenes: HasSelection + HasEditor + Send + Sync {
|
|||
|
||||
impl Scene {
|
||||
/// Returns the pulse length of the longest clip in the scene
|
||||
fn pulses (&self) -> usize {
|
||||
pub fn pulses (&self) -> usize {
|
||||
self.clips.iter().fold(0, |a, p|{
|
||||
a.max(p.as_ref().map(|q|q.read().unwrap().length).unwrap_or(0))
|
||||
})
|
||||
}
|
||||
/// Returns true if all clips in the scene are
|
||||
/// currently playing on the given collection of tracks.
|
||||
fn is_playing (&self, tracks: &[Track]) -> bool {
|
||||
pub fn is_playing (&self, tracks: &[Track]) -> bool {
|
||||
self.clips.iter().any(|clip|clip.is_some()) && self.clips.iter().enumerate()
|
||||
.all(|(track_index, clip)|match clip {
|
||||
Some(c) => tracks
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ impl Tek {
|
|||
})
|
||||
}
|
||||
|
||||
fn update_clock (&self) {
|
||||
pub fn update_clock (&self) {
|
||||
ViewCache::update_clock(&self.view_cache, self.clock(), self.size.w() > 80)
|
||||
}
|
||||
|
||||
|
|
@ -560,7 +560,7 @@ fn view_status (
|
|||
)))
|
||||
}
|
||||
|
||||
fn button_play_pause (playing: bool) -> impl Content<TuiOut> {
|
||||
pub(crate) fn button_play_pause (playing: bool) -> impl Content<TuiOut> {
|
||||
let compact = true;//self.is_editing();
|
||||
Tui::bg(
|
||||
if playing{Rgb(0,128,0)}else{Rgb(128,64,0)},
|
||||
|
|
@ -577,7 +577,7 @@ fn button_play_pause (playing: bool) -> impl Content<TuiOut> {
|
|||
)
|
||||
}
|
||||
|
||||
fn view_meter <'a> (label: &'a str, value: f32) -> impl Content<TuiOut> + 'a {
|
||||
pub (crate) fn view_meter <'a> (label: &'a str, value: f32) -> impl Content<TuiOut> + 'a {
|
||||
col!(
|
||||
FieldH(ItemPalette::G[128], label, format!("{:>+9.3}", value)),
|
||||
Fixed::xy(if value >= 0.0 { 13 }
|
||||
|
|
@ -598,7 +598,7 @@ fn view_meter <'a> (label: &'a str, value: f32) -> impl Content<TuiOut> + 'a {
|
|||
else { Green }, ())))
|
||||
}
|
||||
|
||||
fn view_meters (values: &[f32;2]) -> impl Content<TuiOut> + use<'_> {
|
||||
pub(crate) fn view_meters (values: &[f32;2]) -> impl Content<TuiOut> + use<'_> {
|
||||
Bsp::s(
|
||||
format!("L/{:>+9.3}", values[0]),
|
||||
format!("R/{:>+9.3}", values[1]),
|
||||
|
|
@ -784,7 +784,7 @@ impl ViewCache {
|
|||
pub const TIME_EMPTY: &'static str = "-.---s";
|
||||
pub const BPM_EMPTY: &'static str = "---.---";
|
||||
|
||||
pub(crate) fn track_counter (cache: &Arc<RwLock<Self>>, track: usize, tracks: usize)
|
||||
pub fn track_counter (cache: &Arc<RwLock<Self>>, track: usize, tracks: usize)
|
||||
-> Arc<RwLock<String>>
|
||||
{
|
||||
let data = (track, tracks);
|
||||
|
|
@ -792,7 +792,7 @@ impl ViewCache {
|
|||
cache.read().unwrap().trks.view.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn scene_add (cache: &Arc<RwLock<Self>>, scene: usize, scenes: usize, is_editing: bool)
|
||||
pub fn scene_add (cache: &Arc<RwLock<Self>>, scene: usize, scenes: usize, is_editing: bool)
|
||||
-> impl Content<TuiOut>
|
||||
{
|
||||
let data = (scene, scenes);
|
||||
|
|
@ -800,7 +800,7 @@ impl ViewCache {
|
|||
button_3("S", "add scene", cache.read().unwrap().scns.view.clone(), is_editing)
|
||||
}
|
||||
|
||||
pub(crate) fn update_clock (cache: &Arc<RwLock<Self>>, clock: &Clock, compact: bool) {
|
||||
pub fn update_clock (cache: &Arc<RwLock<Self>>, clock: &Clock, compact: bool) {
|
||||
let rate = clock.timebase.sr.get();
|
||||
let chunk = clock.chunk.load(Relaxed) as f64;
|
||||
let lat = chunk / rate * 1000.;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue