CI / Build & test (Windows) (push) Failing after 7s
All crates take the oak-* kebab-case naming (oak-audio, oak-codec, oak-common, oak-core, oak-ffmpeg-link, oak-node, oak-otio, oak-plugin, oak-render, oak-storage, oak-task, oak-timeline, oak-undo), with the lib identifiers rewritten (oakrender:: -> oak_render::, oakcore_rs:: -> oak_core::, ...) across all 226 referencing files. The GUI application moves from the workspace root into crates/oak-app/: src/, build.rs (paths fixed for the new location) and tests/ travel with it, the root Cargo.toml becomes workspace-only ([workspace] + workspace.package + profiles), and the app package inherits the workspace version. The screenshots example becomes a standalone crate examples/simple_player/ with its own Cargo.toml. Every crate now inherits the single workspace version (version.workspace = true), and the workflows' crate paths and the build docs follow the renames. Validated with a clean cargo check --workspace.
106 lines
3.4 KiB
Rust
106 lines
3.4 KiB
Rust
// Oak Video Editor - Non-Linear Video Editor
|
|
// Copyright (C) 2026 Oak Team
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//! The shared `Timeline` namespace (`src/timeline/src/timelinecommon.h`):
|
|
//! movement/thumbnail/waveform modes and the `EditToInfo` struct.
|
|
//!
|
|
//! Enum discriminants are value-compatible with both `include/timeline/edit.h`
|
|
//! (`OAKTIMELINE_MOVEMENT_*`) and `include/timeline/displaymode.h`
|
|
//! (`OAK_TIMELINE_THUMBNAIL_*` / `OAK_TIMELINE_WAVEFORMS_*`); the deleted C
|
|
//! ABI export layer used to map between them mechanically.
|
|
|
|
use oak_core::Rational;
|
|
|
|
/// `Timeline::MovementMode` (timelinecommon.h).
|
|
///
|
|
/// `OAKTIMELINE_MOVEMENT_NONE = 0`, `MOVE = 1`, `TRIM_IN = 2`,
|
|
/// `TRIM_OUT = 3` (include/timeline/edit.h).
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum MovementMode {
|
|
/// `k_none`: no movement.
|
|
None,
|
|
/// `k_move`: slide/position move.
|
|
Move,
|
|
/// `k_trim_in`: trim the in point.
|
|
TrimIn,
|
|
/// `k_trim_out`: trim the out point.
|
|
TrimOut,
|
|
}
|
|
|
|
impl MovementMode {
|
|
/// `Timeline::is_a_trim_mode`: true for `TrimIn`/`TrimOut`.
|
|
pub fn is_a_trim_mode(self) -> bool {
|
|
matches!(self, MovementMode::TrimIn | MovementMode::TrimOut)
|
|
}
|
|
|
|
/// Map to the `OAKTIMELINE_MOVEMENT_*` C enum value.
|
|
pub fn to_c_int(self) -> i32 {
|
|
match self {
|
|
MovementMode::None => 0,
|
|
MovementMode::Move => 1,
|
|
MovementMode::TrimIn => 2,
|
|
MovementMode::TrimOut => 3,
|
|
}
|
|
}
|
|
|
|
/// Map a `OAKTIMELINE_MOVEMENT_*` C enum value back; `None` when the
|
|
/// integer is out of range.
|
|
pub fn from_c_int(v: i32) -> Option<MovementMode> {
|
|
match v {
|
|
0 => Some(MovementMode::None),
|
|
1 => Some(MovementMode::Move),
|
|
2 => Some(MovementMode::TrimIn),
|
|
3 => Some(MovementMode::TrimOut),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
|
|
/// `Timeline::ThumbnailMode` (timelinecommon.h). Discriminants match
|
|
/// `OAK_TIMELINE_THUMBNAIL_OFF/IN_OUT/ON` (include/timeline/displaymode.h).
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum ThumbnailMode {
|
|
/// `k_thumbnail_off`: no thumbnails.
|
|
Off,
|
|
/// `k_thumbnail_in_out`: thumbnail at in/out.
|
|
InOut,
|
|
/// `k_thumbnail_on`: thumbnails on.
|
|
On,
|
|
}
|
|
|
|
/// `Timeline::WaveformMode` (timelinecommon.h). Discriminants match
|
|
/// `OAK_TIMELINE_WAVEFORMS_DISABLED/ENABLED` (include/timeline/displaymode.h).
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub enum WaveformMode {
|
|
/// `k_waveforms_disabled`.
|
|
Disabled,
|
|
/// `k_waveforms_enabled`.
|
|
Enabled,
|
|
}
|
|
|
|
/// `Timeline::EditToInfo` (timelinecommon.h): where the nearest block edge
|
|
/// falls for a pointer edit. The node references are the single-lib
|
|
/// domain handles ([`crate::util::NodeRef`] — `None` where the C ABI
|
|
/// used a null handle).
|
|
pub struct EditToInfo {
|
|
/// Owning track of the nearest block.
|
|
pub track: Option<crate::util::NodeRef>,
|
|
/// Nearest edit point time.
|
|
pub nearest_time: Rational,
|
|
/// Nearest block.
|
|
pub nearest_block: Option<crate::util::NodeRef>,
|
|
}
|