Skip to content

Commit

Permalink
fix: reference to TeletextConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Aug 19, 2024
1 parent 23d4b4e commit e89dd74
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 109 deletions.
2 changes: 0 additions & 2 deletions src/rust/lib_ccxr/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
mod constants;
mod options;
mod teletext;

pub use constants::*;
pub use options::*;
pub use teletext::*;
87 changes: 0 additions & 87 deletions src/rust/lib_ccxr/src/common/teletext.rs

This file was deleted.

51 changes: 36 additions & 15 deletions src/rust/lib_ccxr/src/teletext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,31 +724,52 @@ pub struct TeletextPage {
}

/// Settings required to contruct a [`TeletextContext`].
#[allow(dead_code)]
#[derive(Debug)]
pub struct TeletextConfig {
/// should telxcc logging be verbose?
verbose: bool,
pub verbose: bool,
/// teletext page containing cc we want to filter
page: Cell<TeletextPageNumber>,
pub page: Cell<TeletextPageNumber>,
/// Page selected by user, which MIGHT be different to `page` depending on autodetection stuff
user_page: u16,
pub user_page: u16,
/// false = Don't attempt to correct errors
dolevdist: bool,
pub dolevdist: bool,
/// Means 2 fails or less is "the same"
levdistmincnt: u8,
pub levdistmincnt: u8,
/// Means 10% or less is also "the same"
levdistmaxpct: u8,
pub levdistmaxpct: u8,
/// Segment we actually process
extraction_start: Option<Timestamp>,
pub extraction_start: Option<Timestamp>,
/// Segment we actually process
extraction_end: Option<Timestamp>,
write_format: OutputFormat,
date_format: TimestampFormat,
pub extraction_end: Option<Timestamp>,
pub write_format: OutputFormat,
pub date_format: TimestampFormat,
/// Do NOT set time automatically?
noautotimeref: bool,
nofontcolor: bool,
nohtmlescape: bool,
latrusmap: bool,
pub noautotimeref: bool,
pub nofontcolor: bool,
pub nohtmlescape: bool,
pub latrusmap: bool,
}

impl Default for TeletextConfig {
fn default() -> Self {
Self {
verbose: true,
page: TeletextPageNumber(0).into(),
user_page: 0,
dolevdist: false,
levdistmincnt: 0,
levdistmaxpct: 0,
extraction_start: None,
extraction_end: None,
write_format: OutputFormat::default(),
date_format: TimestampFormat::default(),
noautotimeref: false,
nofontcolor: false,
nohtmlescape: false,
latrusmap: false,
}
}
}

/// Represents the possible states that [`TeletextContext`] can be in.
Expand Down
2 changes: 1 addition & 1 deletion src/rust/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ use lib_ccxr::common::OutputFormat;
use lib_ccxr::common::SelectCodec;
use lib_ccxr::common::StreamMode;
use lib_ccxr::common::StreamType;
use lib_ccxr::common::TeletextConfig;
use lib_ccxr::hardsubx::ColorHue;
use lib_ccxr::hardsubx::OcrMode;
use lib_ccxr::teletext::TeletextConfig;
use lib_ccxr::time::units::Timestamp;
use lib_ccxr::time::units::TimestampFormat;
use lib_ccxr::util::encoding::Encoding;
Expand Down
5 changes: 1 addition & 4 deletions src/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ use bindings::*;
use clap::{error::ErrorKind, Parser};
use common::{CType2, FromRust};
use decoder::Dtvcc;
use lib_ccxr::{
common::{Options, TeletextConfig},
util::log::ExitCause,
};
use lib_ccxr::{common::Options, teletext::TeletextConfig, util::log::ExitCause};
use parser::OptionsExt;
use utils::is_true;

Expand Down
1 change: 1 addition & 0 deletions src/rust/src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use args::{Args, OutFormat};
use lib_ccxr::teletext::{TeletextConfig, TeletextPageNumber};
use lib_ccxr::time::units::{Timestamp, TimestampFormat};
use lib_ccxr::util::encoding::Encoding;
use lib_ccxr::util::log::{DebugMessageFlag, DebugMessageMask, ExitCause, OutputTarget};
Expand Down

0 comments on commit e89dd74

Please sign in to comment.