use std::path::Path;
use dspk_core::{DspResult, RecordingSource};
use dspk_io::{Format, SourceEntry};
pub mod mtscomp;
pub mod nwb;
pub mod phy;
pub mod probe;
mod sorting_format;
pub mod sorting_zarr;
pub mod spikeglx;
pub mod synthetic;
pub mod templates;
pub use mtscomp::MtscompRecording;
pub use nwb::NwbZarrRecording;
pub use probe::{probe_of, Position3D, SensorLayout, SensorSite};
pub use sorting_format::{detect_sorting, SortingFormat};
pub use spikeglx::SpikeGlxMeta;
pub use synthetic::{SyntheticParams, SyntheticRecording};
static FORMATS: &[&dyn Format] = &[
&nwb::Nwb,
&dspk_io::generic::zarr_traces::ZarrTraces,
&spikeglx::SpikeGlx,
&mtscomp::Mtscomp,
&dspk_io::generic::raw::Raw,
];
pub fn formats() -> &'static [&'static dyn Format] {
FORMATS
}
pub fn detect(path: &Path) -> DspResult<&'static dyn Format> {
dspk_io::core::detect_in(formats(), path)
}
pub fn open(path: &Path) -> DspResult<Box<dyn RecordingSource>> {
detect(path)?.open_default(path)
}
pub fn sources(path: &Path) -> DspResult<Vec<SourceEntry>> {
detect(path)?.sources(path)
}
pub fn open_source(path: &Path, id: &str) -> DspResult<Box<dyn RecordingSource>> {
detect(path)?.open(path, id)
}