pub struct Player {
pub media_type: MediaType,
pub file_input: InputMode,
pub player_size: Vec2,
pub player_scale: f32,
pub player_state: PlayerState,
pub elapsed_time: Duration,
pub total_time: Duration,
pub start_time: Duration,
pub volume: Arc<AtomicI32>,
pub transcript: Vec<TranscriptionData>,
pub model_path: ModelPath,
pub transcription_progress: TranscriptionProgress,
/* private fields */
}Expand description
Holds relevant info to run the player
Fields§
§media_type: MediaTypeMeta data information
file_input: InputMode§player_size: Vec2Player settings
player_scale: f32§player_state: PlayerState§elapsed_time: DurationInfo related to control bar
total_time: Duration§start_time: Duration§volume: Arc<AtomicI32>Audio related info
transcript: Vec<TranscriptionData>§model_path: ModelPath§transcription_progress: TranscriptionProgressImplementations§
Source§impl Player
impl Player
Sourcepub fn from_path(file_path: &str) -> Self
pub fn from_path(file_path: &str) -> Self
Initializes the Player
Takes an InputMode
To initialize with a filepath:
Player::new(InputMode::FilePath("your_path_here".to_string()))Use the Player.ui() function to display it
Look at the README to have a more in depth approach to adding a Player to your egui project
Or look at the example in examples/main.rs
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Self
pub fn from_bytes(bytes: Vec<u8>) -> Self
Sourcepub fn set_transcript_settings(&mut self, setting: TranscriptionSettings)
pub fn set_transcript_settings(&mut self, setting: TranscriptionSettings)
Configure transcription settings by changing the TranscriptionSettings enum
Sourcepub fn set_model_download_path(&mut self, file_path: String)
pub fn set_model_download_path(&mut self, file_path: String)
Configure where model is downloaded
Sourcepub fn set_player_scale(&mut self, scale: f32)
pub fn set_player_scale(&mut self, scale: f32)
Allows you to rescale the player (Note: Currently non-functional)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Player
impl RefUnwindSafe for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnwindSafe for Player
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more