Expand description
§sdif-sys
Raw FFI bindings to the IRCAM SDIF (Sound Description Interchange Format) library.
This crate provides low-level, unsafe bindings to the SDIF C library. For a safe,
idiomatic Rust API, use the sdif-rs crate instead.
§Usage
These bindings are primarily intended for use by the sdif-rs crate. Direct usage
requires careful attention to:
- Calling
SdifGenInitbefore any other SDIF functions - Calling
SdifGenKillduring cleanup - Managing
SdifFileTpointer lifetimes - Following the correct sequence of read/write operations
§Example
use sdif_sys::*;
use std::ptr;
use std::ffi::CString;
unsafe {
// Initialize the library (required before any operations)
SdifGenInit(ptr::null());
// Open a file for reading
let path = CString::new("test.sdif").unwrap();
let file = SdifFOpen(path.as_ptr(), SdifFileModeET_eReadFile);
if !file.is_null() {
// Read general header
let bytes_read = SdifFReadGeneralHeader(file);
// Read ASCII chunks (NVT, type definitions, etc.)
let ascii_bytes = SdifFReadAllASCIIChunks(file);
// Close the file
SdifFClose(file);
}
// Cleanup
SdifGenKill();
}§Feature Flags
bundled: Compile SDIF from bundled source instead of linking to system librarystatic: Force static linking (impliesbundledon most systems)
Structs§
Constants§
- SIG_
1FQ0 - 1FQ0 - Fundamental Frequency
- SIG_
1HRM - 1HRM - Harmonic Partials
- SIG_
1RES - 1RES - Resonances
- SIG_
1STF - 1STF - Short-Time Fourier
- SIG_
1TRC - 1TRC - Sinusoidal Tracks (most common for additive synthesis)
- Sdif
Data TypeET_ eFloat4 - Sdif
Data TypeET_ eFloat8 - Sdif
Data TypeET_ eInt1 - Sdif
Data TypeET_ eInt2 - Sdif
Data TypeET_ eInt4 - Sdif
Data TypeET_ eText - Sdif
Data TypeET_ eUInt1 - Sdif
Data TypeET_ eUInt2 - Sdif
Data TypeET_ eUInt4 - Sdif
File ModeET_ eMode Mask - Sdif
File ModeET_ ePredefined Types - Sdif
File ModeET_ eRead File - Sdif
File ModeET_ eWrite File
Functions§
- Sdif
Create ⚠Frame Type - Sdif
Create ⚠Matrix Type - SdifF
Close ⚠ - SdifF
Curr ⚠Data Type - SdifF
Curr ⚠Frame Signature - SdifF
Curr ⚠Matrix Signature - SdifF
Curr ⚠NbCol - SdifF
Curr ⚠NbMatrix - SdifF
Curr ⚠NbRow - SdifF
Curr ⚠OneRow Data - SdifF
Curr ⚠Time - SdifF
GetFrame ⚠Types Table - SdifF
GetMatrix ⚠Types Table - SdifF
GetSignature ⚠ - SdifF
Name ⚠Value List - SdifF
Open ⚠ - SdifF
Read ⚠AllASCII Chunks - SdifF
Read ⚠Frame Header - SdifF
Read ⚠General Header - SdifF
Read ⚠Matrix Data - SdifF
Read ⚠Matrix Header - SdifF
Read ⚠OneRow - SdifF
SetCurr ⚠Frame Header - SdifF
SetCurr ⚠Matrix Header - SdifF
Skip ⚠Frame Data - SdifF
Skip ⚠Matrix Data - SdifF
Write ⚠AllASCII Chunks - SdifF
Write ⚠Frame AndOne Matrix - SdifF
Write ⚠Frame Header - SdifF
Write ⚠General Header - SdifF
Write ⚠Matrix Data - SdifF
Write ⚠Matrix Header - SdifF
Write ⚠Padding - Sdif
Frame ⚠Type PutComponent - Sdif
GenInit ⚠ - Sdif
GenKill ⚠ - Sdif
Matrix ⚠Type Insert Tail Column Def - Sdif
Name ⚠ValuesL NewTable - Sdif
Name ⚠ValuesL PutCurrNVT - Sdif
PutFrame ⚠Type - Sdif
PutMatrix ⚠Type - Sdif
Signature ⚠Const - Sdif
Signature ⚠ToString - Sdif
Sizeof ⚠Data Type - Sdif
String ⚠ToSignature - signature_
from_ str - Convert a 4-character string to an SDIF signature.
- signature_
to_ string - Convert an SDIF signature to a 4-character string.