pub mod fm;
pub mod mfm;
use crate::{
io::{Read, Seek},
DiskDataEncoding,
};
use bit_vec::BitVec;
use std::ops::Index;
pub enum EncodingVariant {
Data,
AddressMark,
}
pub trait TrackCodec {
fn encoding(&self) -> DiskDataEncoding;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
fn replace(&mut self, new_bits: BitVec);
fn data_bits(&self) -> &BitVec;
fn data(&self) -> Vec<u8>;
fn set_clock_map(&mut self, clock_map: BitVec);
fn clock_map(&self) -> &BitVec;
fn clock_map_mut(&mut self) -> &mut BitVec;
fn enable_weak(&mut self, enable: bool);
fn weak_mask(&self) -> &BitVec;
fn has_weak_bits(&self) -> bool;
fn weak_data(&self) -> Vec<u8>;
fn set_track_padding(&mut self);
fn read_raw_byte(&self, index: usize) -> Option<u8>;
fn read_decoded_byte(&self, index: usize) -> Option<u8>;
fn write_buf(&mut self, buf: &[u8], offset: usize) -> Option<usize>;
fn write_raw_buf(&mut self, buf: &[u8], offset: usize) -> usize;
fn encode(&self, data: &[u8], prev_bit: bool, encoding_type: EncodingVariant) -> BitVec;
fn find_marker(&self, marker: u64, mask: Option<u64>, start: usize, limit: Option<usize>) -> Option<(usize, u16)>;
fn set_data_ranges(&mut self, ranges: Vec<(usize, usize)>);
fn is_data(&self, index: usize, wrapping: bool) -> bool;
fn debug_marker(&self, index: usize) -> String;
fn debug_decode(&self, index: usize) -> String;
}
pub trait TrackDataStreamT: TrackCodec + Read + Seek + Index<usize> {}
pub type TrackDataStream = Box<dyn TrackDataStreamT<Output = bool> + Send + Sync>;