mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
wip(p67,e0): whew!
This commit is contained in:
parent
faf7576ad8
commit
132093f14a
8 changed files with 64 additions and 59 deletions
|
|
@ -8,21 +8,21 @@ tek_core = { path = "../tek_core" }
|
|||
tek_api = { path = "../tek_api" }
|
||||
tek_tui = { path = "../tek_tui" }
|
||||
|
||||
[[bin]]
|
||||
name = "tek_mixer"
|
||||
path = "src/cli_mixer.rs"
|
||||
#[[bin]]
|
||||
#name = "tek_mixer"
|
||||
#path = "src/cli_mixer.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tek_track"
|
||||
path = "src/cli_track.rs"
|
||||
#[[bin]]
|
||||
#name = "tek_track"
|
||||
#path = "src/cli_track.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tek_sampler"
|
||||
path = "src/cli_sampler.rs"
|
||||
#[[bin]]
|
||||
#name = "tek_sampler"
|
||||
#path = "src/cli_sampler.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tek_plugin"
|
||||
path = "src/cli_plugin.rs"
|
||||
#[[bin]]
|
||||
#name = "tek_plugin"
|
||||
#path = "src/cli_plugin.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "tek_sequencer"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_api::{JackActivate, ArrangerTracksApi, HasScenes};
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
ArrangerCli::parse().run()
|
||||
|
|
@ -22,14 +23,14 @@ impl ArrangerCli {
|
|||
/// Run the arranger TUI from CLI arguments.
|
||||
fn run (&self) -> Usually<()> {
|
||||
Tui::run(JackClient::new("tek_arranger")?.activate_with(|jack|{
|
||||
let mut app = TransportApp::try_from(jack)?;
|
||||
let mut app = tek_tui::ArrangerTui::try_from(jack)?;
|
||||
if let Some(name) = self.name.as_ref() {
|
||||
*arrangement.name.write().unwrap() = name.clone();
|
||||
*app.name.write().unwrap() = name.clone();
|
||||
}
|
||||
let track_color_1 = ItemColor::random();
|
||||
let track_color_2 = ItemColor::random();
|
||||
for i in 0..self.tracks {
|
||||
let _track = arrangement.track_add(
|
||||
let _track = app.track_add(
|
||||
None,
|
||||
Some(track_color_1.mix(track_color_2, i as f32 / self.tracks as f32))
|
||||
)?;
|
||||
|
|
@ -37,13 +38,13 @@ impl ArrangerCli {
|
|||
let scene_color_1 = ItemColor::random();
|
||||
let scene_color_2 = ItemColor::random();
|
||||
for i in 0..self.scenes {
|
||||
let _scene = arrangement.scene_add(
|
||||
let _scene = app.scene_add(
|
||||
None,
|
||||
Some(scene_color_1.mix(scene_color_2, i as f32 / self.scenes as f32))
|
||||
)?;
|
||||
}
|
||||
Ok(app)
|
||||
})?)?
|
||||
})?)?;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_api::JackActivate;
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
SequencerCli::parse().run()
|
||||
|
|
@ -20,7 +21,7 @@ pub struct SequencerCli {
|
|||
impl SequencerCli {
|
||||
fn run (&self) -> Usually<()> {
|
||||
Tui::run(JackClient::new("tek_sequencer")?.activate_with(|jack|{
|
||||
let mut app = SequencerApp::try_from(jack)?;
|
||||
let mut app = tek_tui::SequencerTui::try_from(jack)?;
|
||||
if let Some(_) = self.name.as_ref() {
|
||||
// TODO: sequencer.name = Arc::new(RwLock::new(name.clone()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_api::JackActivate;
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
/// Application entrypoint.
|
||||
pub fn main () -> Usually<()> {
|
||||
Tui::run(JackClient::new("tek_transport")?.activate_with(TransportApp::try_from)?)?
|
||||
Tui::run(JackClient::new("tek_transport")?.activate_with(|jack|{
|
||||
tek_tui::TransportTui::try_from(jack)
|
||||
})?)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
MixerCli::parse().run()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
PluginCli::parse().run()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use tek_core::clap::{self, Parser};
|
||||
use tek_core::{*, clap::{self, Parser}};
|
||||
|
||||
pub fn main () -> Usually<()> {
|
||||
SamplerCli::parse().run()
|
||||
|
|
@ -2,51 +2,51 @@ use crate::*;
|
|||
|
||||
/// Stores and displays time-related info.
|
||||
pub struct TransportTui {
|
||||
pub(crate) jack: Arc<RwLock<JackClient>>,
|
||||
pub(crate) state: TransportModel,
|
||||
pub(crate) size: Measure<Tui>,
|
||||
pub(crate) cursor: (usize, usize),
|
||||
pub jack: Arc<RwLock<JackClient>>,
|
||||
pub state: TransportModel,
|
||||
pub size: Measure<Tui>,
|
||||
pub cursor: (usize, usize),
|
||||
}
|
||||
|
||||
/// Root view for standalone `tek_sequencer`.
|
||||
pub struct SequencerTui {
|
||||
pub(crate) jack: Arc<RwLock<JackClient>>,
|
||||
pub(crate) transport: TransportModel,
|
||||
pub(crate) phrases: PhrasesModel,
|
||||
pub(crate) player: PhrasePlayerModel,
|
||||
pub(crate) editor: PhraseEditorModel,
|
||||
pub(crate) size: Measure<Tui>,
|
||||
pub(crate) cursor: (usize, usize),
|
||||
pub(crate) split: u16,
|
||||
pub(crate) entered: bool,
|
||||
pub jack: Arc<RwLock<JackClient>>,
|
||||
pub transport: TransportModel,
|
||||
pub phrases: PhrasesModel,
|
||||
pub player: PhrasePlayerModel,
|
||||
pub editor: PhraseEditorModel,
|
||||
pub size: Measure<Tui>,
|
||||
pub cursor: (usize, usize),
|
||||
pub split: u16,
|
||||
pub entered: bool,
|
||||
/// MIDI output buffer
|
||||
pub(crate) note_buf: Vec<u8>,
|
||||
pub note_buf: Vec<u8>,
|
||||
/// MIDI output buffer
|
||||
pub(crate) midi_buf: Vec<Vec<Vec<u8>>>,
|
||||
pub midi_buf: Vec<Vec<Vec<u8>>>,
|
||||
}
|
||||
|
||||
/// Root view for standalone `tek_arranger`
|
||||
pub struct ArrangerTui {
|
||||
pub(crate) jack: Arc<RwLock<JackClient>>,
|
||||
pub(crate) transport: TransportModel,
|
||||
pub(crate) phrases: PhrasesModel,
|
||||
pub(crate) tracks: Vec<ArrangerTrack>,
|
||||
pub(crate) scenes: Vec<ArrangerScene>,
|
||||
pub(crate) name: Arc<RwLock<String>>,
|
||||
pub(crate) splits: [u16;2],
|
||||
pub(crate) selected: ArrangerSelection,
|
||||
pub(crate) mode: ArrangerMode,
|
||||
pub(crate) color: ItemColor,
|
||||
pub(crate) entered: bool,
|
||||
pub(crate) size: Measure<Tui>,
|
||||
pub(crate) cursor: (usize, usize),
|
||||
pub(crate) menu_bar: Option<MenuBar<Tui, Self, ArrangerCommand>>,
|
||||
pub(crate) status_bar: Option<ArrangerStatus>,
|
||||
pub(crate) history: Vec<ArrangerCommand>,
|
||||
pub jack: Arc<RwLock<JackClient>>,
|
||||
pub transport: TransportModel,
|
||||
pub phrases: PhrasesModel,
|
||||
pub tracks: Vec<ArrangerTrack>,
|
||||
pub scenes: Vec<ArrangerScene>,
|
||||
pub name: Arc<RwLock<String>>,
|
||||
pub splits: [u16;2],
|
||||
pub selected: ArrangerSelection,
|
||||
pub mode: ArrangerMode,
|
||||
pub color: ItemColor,
|
||||
pub entered: bool,
|
||||
pub size: Measure<Tui>,
|
||||
pub cursor: (usize, usize),
|
||||
pub menu_bar: Option<MenuBar<Tui, Self, ArrangerCommand>>,
|
||||
pub status_bar: Option<ArrangerStatus>,
|
||||
pub history: Vec<ArrangerCommand>,
|
||||
/// MIDI output buffer
|
||||
pub(crate) note_buf: Vec<u8>,
|
||||
pub note_buf: Vec<u8>,
|
||||
/// MIDI output buffer
|
||||
pub(crate) midi_buf: Vec<Vec<Vec<u8>>>,
|
||||
pub midi_buf: Vec<Vec<Vec<u8>>>,
|
||||
/// MIDI editor state
|
||||
pub(crate) editor: PhraseEditorModel,
|
||||
pub editor: PhraseEditorModel,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue