diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28e47f7a..bf2e1796 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,55 +10,12 @@ on: type: string default: "" -permissions: - contents: write - concurrency: group: release-${{ github.ref }} cancel-in-progress: false jobs: - git-sources: - name: Git dependencies come from storytold - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Git dependencies come from storytold - run: | - set -euo pipefail - test -f Cargo.lock || { echo "Cargo.lock is missing"; exit 1; } - # Source replacement, patches and path overrides in cargo config never show up - # in Cargo.lock. Parsed rather than grepped: TOML has many spellings of one key. - # Cargo still reads the legacy .cargo/config. - python3 - <<'PY' - import os, sys, tomllib - for path in (".cargo/config", ".cargo/config.toml"): - if not os.path.exists(path): - continue - config = tomllib.load(open(path, "rb")) - replaced = [name for name, source in config.get("source", {}).items() - if isinstance(source, dict) and "replace-with" in source] - if replaced or "patch" in config or "paths" in config: - print(f"{path} replaces, patches or overrides a source") - sys.exit(1) - PY - # Fails when Cargo.lock is out of date with the manifests. - cargo metadata --locked --format-version 1 > /dev/null - python3 - <<'PY' - import sys, tomllib - lock = tomllib.load(open("Cargo.lock", "rb")) - bad = sorted({p["source"] for p in lock.get("package", []) - if p.get("source", "").startswith("git+") - and not p["source"].startswith("git+https://github.com/storytold/")}) - if bad: - print("Git dependencies outside github.com/storytold:", *bad, sep="\n") - sys.exit(1) - PY - release: - needs: git-sources # Intentionally tracked at @main (not SHA-pinned) so org-wide CI improvements, security fixes, and build optimizations propagate without PR churn across all craftapp repos. uses: storytold/craft-common-actions/.github/workflows/release.yml@main with: diff --git a/crates/au-host/src/lib.rs b/crates/au-host/src/lib.rs index 39172c0b..3a664a4d 100644 --- a/crates/au-host/src/lib.rs +++ b/crates/au-host/src/lib.rs @@ -192,7 +192,7 @@ pub enum AuError { #[cfg(target_os = "macos")] mod api { - use super::*; + use super::{AuDescriptor, AuError, Plugin, PluginInfo}; pub fn scan() -> Vec { registry::scan() @@ -210,7 +210,7 @@ mod api { #[cfg(not(target_os = "macos"))] mod api { - use super::*; + use super::{AuDescriptor, AuError, Plugin, PluginInfo}; pub fn scan() -> Vec { Vec::new() diff --git a/crates/clap-host/src/lib.rs b/crates/clap-host/src/lib.rs index 955b6614..a5e042a3 100644 --- a/crates/clap-host/src/lib.rs +++ b/crates/clap-host/src/lib.rs @@ -88,7 +88,7 @@ pub enum ClapError { #[cfg(not(target_arch = "wasm32"))] mod api { - use super::*; + use super::{ClapDescriptor, ClapError, Path, PathBuf, Plugin, PluginInfo, registry}; pub fn cached() -> Option> { registry::cached() @@ -118,7 +118,7 @@ mod api { #[cfg(target_arch = "wasm32")] mod api { - use super::*; + use super::{ClapDescriptor, ClapError, Path, PathBuf, Plugin, PluginInfo}; pub fn cached() -> Option> { Some(Vec::new()) diff --git a/crates/engine/src/cmd/audio_midi.rs b/crates/engine/src/cmd/audio_midi.rs index 218e3953..267f4789 100644 --- a/crates/engine/src/cmd/audio_midi.rs +++ b/crates/engine/src/cmd/audio_midi.rs @@ -1,9 +1,9 @@ //! Edit › Copy Special › Audio as MIDI: pitch-track the selected audio into MIDI notes on the //! clipboard (paste them onto a MIDI or instrument track). +use super::{CommandSpec, bad, has_range, range_param, tracks_required}; -use super::*; -use crate::{Clipboard, cmd}; -use serde_json::json; +use crate::{Clipboard, Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_midi::{Note, Sequence}; use soundcraft_model::{Clip, ClipId}; diff --git a/crates/engine/src/cmd/audiosuite.rs b/crates/engine/src/cmd/audiosuite.rs index 911ccca5..302d1eb3 100644 --- a/crates/engine/src/cmd/audiosuite.rs +++ b/crates/engine/src/cmd/audiosuite.rs @@ -1,8 +1,9 @@ //! AudioSuite-style offline processing of selected clips. +use super::{CommandSpec, bad, clip_ids_param, has_selection, range_param, str_param, tracks_param}; +use soundcraft_time::Range; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_audio_io::{AudioBuffer, FileFormat}; use soundcraft_model::{Clip, ClipContent, TrackKind}; diff --git a/crates/engine/src/cmd/clap.rs b/crates/engine/src/cmd/clap.rs index 15ddcd74..4dfade07 100644 --- a/crates/engine/src/cmd/clap.rs +++ b/crates/engine/src/cmd/clap.rs @@ -1,9 +1,9 @@ //! Third-party CLAP plugins: discovery (`engine.clap_plugins`) and id lookup shared by the mixer //! commands. Hosting itself lives in `soundcraft-clap-host`. +use super::{CommandSpec, always}; -use super::*; use crate::cmd; -use serde_json::json; +use serde_json::{Value, json}; use soundcraft_dsp::PluginInfo; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/clip.rs b/crates/engine/src/cmd/clip.rs index aff6d8cc..916c439e 100644 --- a/crates/engine/src/cmd/clip.rs +++ b/crates/engine/src/cmd/clip.rs @@ -1,8 +1,10 @@ //! Clip menu commands. +use super::{CommandSpec, always, bad, clip_ids_param, f64_or, has_range, has_selection, i64_or, position_param, str_param, track_param}; +use soundcraft_model::ClipId; +use soundcraft_time::Samples; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; pub fn specs() -> Vec { vec![ diff --git a/crates/engine/src/cmd/clip_list.rs b/crates/engine/src/cmd/clip_list.rs index a8529881..ae9cd499 100644 --- a/crates/engine/src/cmd/clip_list.rs +++ b/crates/engine/src/cmd/clip_list.rs @@ -1,9 +1,9 @@ //! Clip List commands. +use super::{CommandSpec, bad, bool_or}; -use super::*; -use crate::cmd; -use serde_json::json; -use soundcraft_model::SourceId; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{ClipId, SourceId}; use std::collections::BTreeSet; const CLEAR: &str = "clip.clear"; diff --git a/crates/engine/src/cmd/clip_more.rs b/crates/engine/src/cmd/clip_more.rs index 59e57179..98bed8c7 100644 --- a/crates/engine/src/cmd/clip_more.rs +++ b/crates/engine/src/cmd/clip_more.rs @@ -1,10 +1,10 @@ //! More Clip menu commands: Regroup, Unloop, Clip Effects bypass/render, Conform to Tempo and //! Remove Pitch Shift. +use super::{CommandSpec, bad, clip_ids_param, has_selection, str_param}; use super::more_util::{render_stretched, replace_clip}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{Clip, ClipContent, ClipId, Session, TrackId}; use soundcraft_time::Samples; diff --git a/crates/engine/src/cmd/edit.rs b/crates/engine/src/cmd/edit.rs index 468170ca..5536668b 100644 --- a/crates/engine/src/cmd/edit.rs +++ b/crates/engine/src/cmd/edit.rs @@ -1,11 +1,15 @@ //! Edit menu commands. +use super::{ + CommandSpec, always, bad, bool_or, can_redo, can_undo, clip_id, clip_ids_param, f32_or, f64_or, has_clipboard, has_range, has_selection, + has_tracks, i64_or, position_param, range_param, str_param, track_param, tracks_param, tracks_required, +}; +use soundcraft_time::Samples; use super::more_util::toggle_flag; -use super::*; use crate::edit as ops; -use crate::{Clipboard, cmd}; -use serde_json::json; -use soundcraft_model::{EditMode, Fade, FadeShape, Session}; +use crate::{Clipboard, Engine, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{ClipId, EditMode, Fade, FadeShape, Session, TrackId}; pub fn specs() -> Vec { vec![ diff --git a/crates/engine/src/cmd/edit_more.rs b/crates/engine/src/cmd/edit_more.rs index fdd265c1..57e134aa 100644 --- a/crates/engine/src/cmd/edit_more.rs +++ b/crates/engine/src/cmd/edit_more.rs @@ -1,11 +1,13 @@ //! More Edit menu commands: Cut/Copy/Clear Special variants, Paste Special, selection helpers, //! Space Clips, Snap to, Copy/Move Selection to playlists, TCE, and automation coalesce/trim/glide. +use super::{ + CommandSpec, always, bad, clip_ids_param, has_clipboard, has_range, has_selection, position_param, range_param, str_param, tracks_required, +}; use super::more_util::{clip_db, render_stretched, replace_clip, set_clip_env, target_playlist}; -use super::*; use crate::edit as ops; -use crate::{Clipboard, TransportRequest, cmd}; -use serde_json::json; +use crate::{Clipboard, Engine, Result, TransportRequest, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{AutoParam, AutomationLane, Clip, ClipContent, ClipId, EditMode, Playlist, Session}; use soundcraft_time::{Range, Samples}; diff --git a/crates/engine/src/cmd/event.rs b/crates/engine/src/cmd/event.rs index 80af311f..018209b6 100644 --- a/crates/engine/src/cmd/event.rs +++ b/crates/engine/src/cmd/event.rs @@ -1,8 +1,8 @@ //! Event menu: time/tempo operations, MIDI operations, markers. +use super::{CommandSpec, always, bad, clip_ids_param, f32_or, f64_or, has_selection, has_tracks, i64_or, position_param, range_param, str_param}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_midi::ops::{DurationOp, QuantizeOptions, VelocityOp}; use soundcraft_model::{ClipContent, MarkerKind}; use soundcraft_time::TICKS_PER_QUARTER; diff --git a/crates/engine/src/cmd/event_more.rs b/crates/engine/src/cmd/event_more.rs index 7e7d3e86..51016627 100644 --- a/crates/engine/src/cmd/event_more.rs +++ b/crates/engine/src/cmd/event_more.rs @@ -2,15 +2,18 @@ //! operations (split notes, input quantize, step input, restore/flatten performance), MIDI track //! offsets and real-time properties, chord extraction, Beat Detective, Identify Beat and //! Retrospective Record. +use super::{ + CommandSpec, always, bad, bool_or, clip_ids_param, f32_or, f64_or, has_range, has_selection, has_tracks, i64_or, position_param, range_param, + str_param, track_param, tracks_param, tracks_required, +}; use super::more_util::{store_value, track_key, values_with_prefix}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_midi::Note; use soundcraft_midi::ops::QuantizeOptions; use soundcraft_model::{ChannelFormat, Clip, ClipContent, ClipId, MarkerKind, Session, TrackId, TrackKind}; -use soundcraft_time::{Range, Samples, TICKS_PER_QUARTER, TempoMap}; +use soundcraft_time::{MAX_POSITION, Range, Samples, TICKS_PER_QUARTER, TempoMap}; /// Most tempo events one curve may write. const MAX_TEMPO_EVENTS: i64 = 10_000; @@ -782,7 +785,6 @@ fn retro_record(e: &mut Engine, p: &Value) -> Result { #[cfg(test)] mod tests { use super::*; - fn midi_engine() -> (Engine, TrackId) { let mut e = Engine::default(); e.execute("track.new", &json!({"kind": "midi"})).unwrap(); diff --git a/crates/engine/src/cmd/file.rs b/crates/engine/src/cmd/file.rs index 87bba997..40e3d3db 100644 --- a/crates/engine/src/cmd/file.rs +++ b/crates/engine/src/cmd/file.rs @@ -1,9 +1,12 @@ //! File menu commands. +use super::{ + CommandSpec, always, bad, bool_or, clip_ids_param, has_selection, has_tracks, i64_or, position_param, range_param, str_param, track_param, + tracks_param, tracks_required, +}; -use super::*; -use crate::cmd; -use serde_json::json; -use soundcraft_model::{Session, TrackKind}; +use crate::{Engine, EngineError, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{Session, TrackId, TrackKind}; use soundcraft_time::SampleRate; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/health.rs b/crates/engine/src/cmd/health.rs index d2971e48..260503ec 100644 --- a/crates/engine/src/cmd/health.rs +++ b/crates/engine/src/cmd/health.rs @@ -1,8 +1,8 @@ //! Media availability checks without decoding files or changing the session. +use super::{CommandSpec, always}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::ClipContent; use std::collections::BTreeMap; diff --git a/crates/engine/src/cmd/instrument.rs b/crates/engine/src/cmd/instrument.rs index c7e51f11..2a71ba50 100644 --- a/crates/engine/src/cmd/instrument.rs +++ b/crates/engine/src/cmd/instrument.rs @@ -1,10 +1,10 @@ //! An instrument track's instrument (`mix.instrument`): the plugin that turns the track's MIDI //! into audio, built in or hosted (CLAP, VST3, Audio Units). The mixer plays `Track::instrument`; //! the instrument is otherwise only set when the track is created (`track.new`). +use super::{CommandSpec, bad, has_selection, str_param, tracks_required}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{Insert, TrackKind}; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/midi.rs b/crates/engine/src/cmd/midi.rs index 129fd070..1d2584e4 100644 --- a/crates/engine/src/cmd/midi.rs +++ b/crates/engine/src/cmd/midi.rs @@ -1,8 +1,8 @@ //! MIDI note editing (MIDI Editor, pencil on MIDI tracks). +use super::{CommandSpec, always, bad, clip_id, has_tracks, i64_or, range_param, tracks_required}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_midi::{Note, Sequence}; use soundcraft_model::{Clip, ClipContent, ClipId}; use soundcraft_time::TICKS_PER_QUARTER; diff --git a/crates/engine/src/cmd/mix.rs b/crates/engine/src/cmd/mix.rs index 7502b4f2..8fb5f1f4 100644 --- a/crates/engine/src/cmd/mix.rs +++ b/crates/engine/src/cmd/mix.rs @@ -1,8 +1,10 @@ //! Mixer, insert, send and automation commands. +use super::{ + CommandSpec, always, bad, bool_or, f32_or, has_range, has_selection, has_tracks, i64_or, position_param, range_param, str_param, tracks_required, +}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, EngineError, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{AutoParam, AutomationMode, INSERT_SLOTS, Insert, SEND_SLOTS, SendSlot, Session, TrackId}; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/more_util.rs b/crates/engine/src/cmd/more_util.rs index bf169821..3d68b6c0 100644 --- a/crates/engine/src/cmd/more_util.rs +++ b/crates/engine/src/cmd/more_util.rs @@ -1,8 +1,9 @@ //! Helpers shared by the newer command modules: settings kept in `EditState.flags`/`values`, //! per-track settings, target playlists, clip-gain envelopes and stretch rendering. +use super::bad; +use crate::{Engine, Result}; -use super::*; -use serde_json::json; +use serde_json::{Value, json}; use soundcraft_audio_io::{AudioBuffer, FileFormat}; use soundcraft_model::{Clip, ClipContent, EditState, Session, SourceId, TrackId}; use soundcraft_time::Samples; @@ -187,7 +188,6 @@ pub fn replace_clip(s: &mut Session, t: TrackId, old: soundcraft_model::ClipId, #[cfg(test)] mod tests { use super::*; - #[test] fn text_settings_round_trip() { let mut ed = EditState::default(); diff --git a/crates/engine/src/cmd/options.rs b/crates/engine/src/cmd/options.rs index 47356f54..45c4b63a 100644 --- a/crates/engine/src/cmd/options.rs +++ b/crates/engine/src/cmd/options.rs @@ -1,8 +1,8 @@ //! Options menu toggles and Setup › Session settings. +use super::{CommandSpec, always, bad, bool_or, position_param, str_param}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{BitDepthSetting, EditState}; use soundcraft_time::FrameRate; diff --git a/crates/engine/src/cmd/plugin_state.rs b/crates/engine/src/cmd/plugin_state.rs index e999c863..bc86ff17 100644 --- a/crates/engine/src/cmd/plugin_state.rs +++ b/crates/engine/src/cmd/plugin_state.rs @@ -1,9 +1,10 @@ //! Third-party plugin state in the session (`mix.insert_state`): the UI reads each live plugin's //! state right before saving and stores it on its insert (base64), from where the mixer restores //! it into new instances. +use super::{CommandSpec, bad, has_tracks, track_param}; +use crate::{Engine, Result}; -use super::*; -use serde_json::json; +use serde_json::{Value, json}; use soundcraft_model::{INSERT_SLOTS, b64}; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/query.rs b/crates/engine/src/cmd/query.rs index 72eb09ea..3aefa852 100644 --- a/crates/engine/src/cmd/query.rs +++ b/crates/engine/src/cmd/query.rs @@ -1,8 +1,8 @@ //! Read-only queries for agents. +use super::{CommandInfo, CommandSpec, always, bad, command_specs, has_tracks, position_param, str_param, track_param}; -use super::*; use crate::cmd; -use serde_json::json; +use serde_json::{Value, json}; pub fn specs() -> Vec { vec![ diff --git a/crates/engine/src/cmd/sampler.rs b/crates/engine/src/cmd/sampler.rs index fc3bf182..eb401bbd 100644 --- a/crates/engine/src/cmd/sampler.rs +++ b/crates/engine/src/cmd/sampler.rs @@ -4,11 +4,11 @@ //! The source is saved in `Audio Files/` with the session like any other audio, so a session that //! uses a sample reopens with it. Sampler parameters (root note, key range, ADSR, loop…) are set //! with `mix.instrument_param`, or all at once with `params` here. +use super::{CommandSpec, bad, has_selection, str_param, tracks_required}; -use super::*; -use crate::cmd; -use serde_json::json; -use soundcraft_model::{Insert, TrackKind}; +use crate::{Engine, EngineError, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{Insert, TrackId, TrackKind}; use std::path::Path; const SAMPLER: &str = "sampler"; diff --git a/crates/engine/src/cmd/setup_more.rs b/crates/engine/src/cmd/setup_more.rs index aee13ba1..369e1542 100644 --- a/crates/engine/src/cmd/setup_more.rs +++ b/crates/engine/src/cmd/setup_more.rs @@ -1,10 +1,10 @@ //! More Options toggles, the Setup menu (hardware, playback engine, I/O, timecode, click, //! shortcuts, MIDI setup) and File › Import › Session Data. +use super::{CommandSpec, always, bad, command_specs, i64_or, str_param, track_param, tracks_param}; use super::more_util::{set_text, store_value, text, toggle_flag, values_with_prefix}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, EngineError, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{BusId, ChannelFormat, ClipContent, OutputPath, Route, Session, SourceId, TrackId, TrackKind}; use soundcraft_time::Timecode; use std::path::Path; @@ -503,7 +503,6 @@ fn import_session_data(e: &mut Engine, p: &Value) -> Result { #[cfg(test)] mod tests { use super::*; - #[test] fn option_flags_toggle() { let mut e = Engine::default(); diff --git a/crates/engine/src/cmd/surround.rs b/crates/engine/src/cmd/surround.rs index bd23be54..6d6f2138 100644 --- a/crates/engine/src/cmd/surround.rs +++ b/crates/engine/src/cmd/surround.rs @@ -1,8 +1,8 @@ //! Surround mixing: the main output format and the surround panners of tracks and sends. +use super::{CommandSpec, always, bad, bool_or, f32_or, has_selection, str_param, tracks_required}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{ChannelFormat, Mixer, OutputPath, Route, SEND_SLOTS, Session, SurroundPan, TrackKind}; pub fn specs() -> Vec { diff --git a/crates/engine/src/cmd/tab.rs b/crates/engine/src/cmd/tab.rs index af4c783e..432a6386 100644 --- a/crates/engine/src/cmd/tab.rs +++ b/crates/engine/src/cmd/tab.rs @@ -1,10 +1,10 @@ //! Tab and Tab to Transient: the insertion point or selection end to the next or previous clip boundary, transient or note. +use super::{CommandSpec, always, bool_or}; -use super::*; -use crate::{TransportRequest, cmd}; -use serde_json::json; -use soundcraft_model::{Clip, ClipContent, Session, SourceAudio}; -use soundcraft_time::SampleRate; +use crate::{Engine, Result, TransportRequest, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{Clip, ClipContent, Session, SourceAudio, TrackId}; +use soundcraft_time::{Range, SampleRate, Samples}; use std::sync::{Arc, Mutex, PoisonError, Weak}; /// Transients are found in fixed blocks of each clip, so a long clip costs a block per press and diff --git a/crates/engine/src/cmd/track.rs b/crates/engine/src/cmd/track.rs index 4929b468..f76664a0 100644 --- a/crates/engine/src/cmd/track.rs +++ b/crates/engine/src/cmd/track.rs @@ -1,9 +1,11 @@ //! Track menu commands. +use super::{ + CommandSpec, always, bad, bool_or, has_selection, has_tracks, i64_or, range_param, str_param, track_param, tracks_param, tracks_required, +}; -use super::*; -use crate::cmd; -use serde_json::json; -use soundcraft_model::{ChannelFormat, Group, GroupId, Playlist, Route, Session, Track, TrackHeight, TrackKind}; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_model::{ChannelFormat, Group, GroupId, Playlist, Route, Session, Track, TrackHeight, TrackId, TrackKind}; pub fn specs() -> Vec { vec![ @@ -944,7 +946,6 @@ fn route(e: &mut Engine, p: &Value, input: bool) -> Result { #[cfg(test)] mod tests { use super::*; - #[test] fn comp_from_alternate_playlist() { let mut e = crate::demo::demo_engine(); diff --git a/crates/engine/src/cmd/track_more.rs b/crates/engine/src/cmd/track_more.rs index 9f547597..99255344 100644 --- a/crates/engine/src/cmd/track_more.rs +++ b/crates/engine/src/cmd/track_more.rs @@ -1,10 +1,10 @@ //! More Track menu commands: Convert Aux to Routing Folder, Extract MIDI, track presets, insert / //! send bypass subsets, MIDI real-time properties, trim/VCA coalescing and target playlists. +use super::{CommandSpec, bad, has_selection, has_tracks, range_param, str_param, tracks_param, tracks_required}; use super::more_util::{activate_playlist, target_playlist, track_key}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, EngineError, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_dsp::Category; use soundcraft_model::{AutoParam, AutomationLane, ChannelFormat, Clip, ClipContent, Insert, Route, Session, Track, TrackId, TrackKind}; use soundcraft_time::Samples; @@ -547,7 +547,6 @@ fn toggle_recent(e: &mut Engine, p: &Value) -> Result { #[cfg(test)] mod tests { use super::*; - #[test] fn bypass_by_category_and_range() { let mut e = crate::demo::demo_engine(); diff --git a/crates/engine/src/cmd/transport.rs b/crates/engine/src/cmd/transport.rs index 5fbd48c0..50827802 100644 --- a/crates/engine/src/cmd/transport.rs +++ b/crates/engine/src/cmd/transport.rs @@ -1,9 +1,9 @@ //! Transport commands. They update the session's stopped playhead and queue requests for the //! host's audio engine (which may be absent when headless). +use super::{CommandSpec, always, bad, f64_or, position_param}; -use super::*; -use crate::{TransportRequest, cmd}; -use serde_json::json; +use crate::{Engine, Result, TransportRequest, cmd}; +use serde_json::{Value, json}; pub fn specs() -> Vec { vec![ diff --git a/crates/engine/src/cmd/video.rs b/crates/engine/src/cmd/video.rs index c65e40d6..b3a6402a 100644 --- a/crates/engine/src/cmd/video.rs +++ b/crates/engine/src/cmd/video.rs @@ -2,10 +2,11 @@ //! //! Movies are imported with `file.import_video`; the session only references them //! (`Session::videos`). Decoding happens in the UI (`soundcraft-video`), never in the engine. +use super::{CommandSpec, always, bad, position_param, track_param}; +use soundcraft_time::MAX_POSITION; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; use soundcraft_model::{ClipContent, TrackKind}; /// `edit.flags` key set while the Video track is offline (online is the default). diff --git a/crates/engine/src/cmd/view.rs b/crates/engine/src/cmd/view.rs index 6dee816c..b214a81f 100644 --- a/crates/engine/src/cmd/view.rs +++ b/crates/engine/src/cmd/view.rs @@ -1,9 +1,10 @@ //! View menu commands that change saved view state (zoom, rulers, counters, grid/nudge). +use super::{CommandSpec, always, bad, bool_or, f32_or, f64_or, i64_or, position_param, str_param}; -use super::*; -use crate::cmd; -use serde_json::json; -use soundcraft_time::{GridValue, NoteValue, TimeFormat}; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; +use soundcraft_time::TimeFormat; +use soundcraft_time::{GridValue, MAX_POSITION, NoteValue}; pub fn specs() -> Vec { vec![ @@ -160,7 +161,7 @@ pub fn grid_param(p: &Value, key: &str) -> Option { #[cfg(test)] mod tests { use super::*; - + use soundcraft_time::Samples; #[test] fn grid_values_parse() { assert_eq!(grid_param(&json!({"v": "1/16"}), "v"), Some(GridValue::Note { value: NoteValue::Sixteenth, dotted: false, triplet: false })); diff --git a/crates/engine/src/cmd/view_more.rs b/crates/engine/src/cmd/view_more.rs index 79997ed2..e5bd9313 100644 --- a/crates/engine/src/cmd/view_more.rs +++ b/crates/engine/src/cmd/view_more.rs @@ -1,11 +1,11 @@ //! More View menu commands: Edit-window column views, extra rulers, marker displays, clip //! display options, waveform styles, expanded sends, transport views and other view toggles. //! Every setting is saved with the session in `edit.flags` (or `edit.rulers` for rulers). +use super::{CommandSpec, always, str_param}; use super::more_util::{exclusive_flag, set_flags, toggle_flag}; -use super::*; -use crate::cmd; -use serde_json::json; +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; /// A view toggle: `{value?: bool}` sets it, otherwise it flips. macro_rules! flag { @@ -219,7 +219,6 @@ fn toggle_ruler(e: &mut Engine, p: &Value, id: &str) -> Result { #[cfg(test)] mod tests { use super::*; - #[test] fn flags_toggle_and_persist() { let mut e = Engine::default(); diff --git a/crates/engine/src/cmd/vst3.rs b/crates/engine/src/cmd/vst3.rs index 927bb433..338c466c 100644 --- a/crates/engine/src/cmd/vst3.rs +++ b/crates/engine/src/cmd/vst3.rs @@ -1,10 +1,10 @@ //! Third-party VST3 plugins: discovery (`engine.vst3_plugins`). Hosting itself lives in //! `soundcraft-vst3-host`; id lookup for the mixer commands is shared with CLAP in //! `cmd::clap::plugin_info`. +use super::{CommandSpec, always}; -use super::*; use crate::cmd; -use serde_json::json; +use serde_json::{Value, json}; pub fn specs() -> Vec { vec![cmd!( diff --git a/crates/engine/src/cmd/zoom_toggle.rs b/crates/engine/src/cmd/zoom_toggle.rs index d91d515e..24781759 100644 --- a/crates/engine/src/cmd/zoom_toggle.rs +++ b/crates/engine/src/cmd/zoom_toggle.rs @@ -1,9 +1,10 @@ //! Zoom Toggle: zoom in on the edit selection, then back out to the view before. - -use super::*; -use crate::cmd; -use serde_json::json; +use super::{CommandSpec, always, f64_or}; use soundcraft_model::{TrackHeight, ZoomToggle}; +use soundcraft_time::MAX_POSITION; + +use crate::{Engine, Result, cmd}; +use serde_json::{Value, json}; pub fn specs() -> Vec { vec![cmd!(noundo "view.zoom_toggle", "Zoom Toggle", [], None, "{width_px?: 1200, height_px?: 600}", always, toggle)] @@ -37,8 +38,10 @@ fn toggle(e: &mut Engine, p: &Value) -> Result { #[cfg(test)] mod tests { + use super::TrackHeight::{Fit, Large, Medium}; use super::*; - use TrackHeight::{Fit, Large, Medium}; + use soundcraft_model::TrackId; + use soundcraft_time::Samples; fn engine(select: Value) -> Engine { let mut e = Engine::default(); diff --git a/crates/mix/src/lib.rs b/crates/mix/src/lib.rs index c04559af..f73f0a71 100644 --- a/crates/mix/src/lib.rs +++ b/crates/mix/src/lib.rs @@ -1360,7 +1360,9 @@ fn receives_solo(s: &Session, t: &Track) -> bool { /// Metronome: a short synthesized blip on every beat of the tempo map, accented on beat 1 of /// each bar. Settings come from `setup.click_countoff` (`click.*` values). mod click { - use super::*; + use super::db_to_gain; + use soundcraft_model::Session; + use soundcraft_time::Samples; /// Blip length in seconds. const LEN_S: f64 = 0.03; diff --git a/crates/video/src/h264/cabac_mb.rs b/crates/video/src/h264/cabac_mb.rs index 4a3125e5..76c9c9a5 100644 --- a/crates/video/src/h264/cabac_mb.rs +++ b/crates/video/src/h264/cabac_mb.rs @@ -3,7 +3,7 @@ use crate::h264::cabac::Cabac; use crate::h264::error::{Result, ensure, invalid}; -use crate::h264::mbtypes::*; +use crate::h264::mbtypes::{MbTypeInfo, Part, SubMbInfo, b_mb_type, b_sub_mb_type, intra_mb_type, p_mb_type, p_sub_mb_type}; use crate::h264::picture::MbKind; use crate::h264::slice::SliceType; use crate::h264::slicedec::{MbCur, SliceDecoder}; diff --git a/crates/video/src/h264/cavlc.rs b/crates/video/src/h264/cavlc.rs index 2126a451..9611868e 100644 --- a/crates/video/src/h264/cavlc.rs +++ b/crates/video/src/h264/cavlc.rs @@ -1,7 +1,7 @@ //! CAVLC residual block parsing (9.2). use crate::bitstream::BitReader; -use crate::h264::cavlc_tables::*; +use crate::h264::cavlc_tables::{COEFF_TOKEN, RUN_BEFORE, TOTAL_ZEROS_2X2, TOTAL_ZEROS_2X4, TOTAL_ZEROS_4X4}; use crate::h264::error::{Result, ensure}; use std::sync::OnceLock; diff --git a/crates/video/src/h264/params.rs b/crates/video/src/h264/params.rs index 583c96bd..99232ac7 100644 --- a/crates/video/src/h264/params.rs +++ b/crates/video/src/h264/params.rs @@ -2,7 +2,7 @@ use crate::bitstream::BitReader; use crate::h264::error::{Error, Result, ensure, unsupported}; -use crate::h264::tables::*; +use crate::h264::tables::{DEFAULT_4X4_INTER, DEFAULT_4X4_INTRA, DEFAULT_8X8_INTER, DEFAULT_8X8_INTRA, ZIGZAG4, ZIGZAG8}; /// `v + k` for a coded `*_minus*` field, or the error its range check gives. fn plus(v: u32, k: u32, err: &str) -> Result { diff --git a/crates/video/src/h264/slicedec.rs b/crates/video/src/h264/slicedec.rs index a71a6b4e..dfab85b5 100644 --- a/crates/video/src/h264/slicedec.rs +++ b/crates/video/src/h264/slicedec.rs @@ -6,11 +6,11 @@ use crate::h264::deblock; use crate::h264::error::{Result, ensure, invalid}; use crate::h264::inter::{self, Weight}; use crate::h264::intra::{self, Avail}; -use crate::h264::mbtypes::*; +use crate::h264::mbtypes::{CBP_ME, MbTypeInfo, Part, SubMbInfo, SubPart, b_mb_type, b_sub_mb_type, intra_mb_type, p_mb_type, p_sub_mb_type}; use crate::h264::params::{Pps, Sps}; -use crate::h264::picture::*; +use crate::h264::picture::{Frame, FrameRef, MbKind, MbState, Planes, RefPic}; use crate::h264::slice::{SliceHeader, SliceType}; -use crate::h264::tables::*; +use crate::h264::tables::{BLK4_XY, QPC_TABLE, RASTER_TO_BLK4, ZIGZAG4, ZIGZAG8}; use crate::h264::transform::{self, LevelScale}; /// Per-slice data kept with the picture (deblocking, motion field export). diff --git a/crates/video/src/prores/decode.rs b/crates/video/src/prores/decode.rs index 305a5b1b..fcb8b07f 100644 --- a/crates/video/src/prores/decode.rs +++ b/crates/video/src/prores/decode.rs @@ -3,7 +3,9 @@ use crate::prores::bits::Reader; use crate::prores::dct::idct8x8; use crate::prores::header::{FrameHeader, PictureHeader, row_slice_widths}; -use crate::prores::tables::*; +use crate::prores::tables::{ + DC_CB, DC_CTX_INIT, FIRST_DC_CB, LEVEL_CB, LEVEL_CTX_INIT, RUN_CB, RUN_CTX_INIT, SCAN_INTERLACED, SCAN_PROGRESSIVE, qscale, +}; use crate::prores::{AlphaType, ChromaFormat, Error, Frame, Interlace, Result}; /// Decoder options. diff --git a/crates/video/src/prores/encode.rs b/crates/video/src/prores/encode.rs index 3e5a1f4e..fd4d931a 100644 --- a/crates/video/src/prores/encode.rs +++ b/crates/video/src/prores/encode.rs @@ -3,7 +3,7 @@ use crate::prores::bits::{Counter, Sink, Writer}; use crate::prores::dct::fdct8x8; use crate::prores::header::{FRAME_ID, FrameHeader, PictureHeader, row_slice_widths}; -use crate::prores::tables::*; +use crate::prores::tables::{DC_CB, DC_CTX_INIT, FIRST_DC_CB, LEVEL_CB, LEVEL_CTX_INIT, RUN_CB, RUN_CTX_INIT, SCAN_PROGRESSIVE, qscale}; use crate::prores::{AlphaType, ChromaFormat, ColorInfo, Error, Frame, Interlace, Profile, Result}; /// Encoder configuration. diff --git a/crates/vst3-host/src/lib.rs b/crates/vst3-host/src/lib.rs index b78e932d..9c76446c 100644 --- a/crates/vst3-host/src/lib.rs +++ b/crates/vst3-host/src/lib.rs @@ -114,7 +114,7 @@ pub enum Vst3Error { #[cfg(not(target_arch = "wasm32"))] mod api { - use super::*; + use super::{Path, PathBuf, Plugin, PluginInfo, Vst3Descriptor, Vst3Error, ffi, registry}; pub fn cached() -> Option> { registry::cached() @@ -147,7 +147,7 @@ mod api { #[cfg(target_arch = "wasm32")] mod api { - use super::*; + use super::{Path, PathBuf, Plugin, PluginInfo, Vst3Descriptor, Vst3Error}; pub fn cached() -> Option> { Some(Vec::new())