musikr: make id3v2 naming consistent

This commit is contained in:
Alexander Capehart 2025-02-15 15:47:33 -07:00
parent f7d61cd1dc
commit 59f66978ff
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
4 changed files with 7 additions and 7 deletions

View file

@ -5,7 +5,7 @@ use super::mpeg::MPEGFile;
use super::ogg::OpusFile; use super::ogg::OpusFile;
use super::ogg::VorbisFile; use super::ogg::VorbisFile;
use super::flac::FLACFile; use super::flac::FLACFile;
use super::id3::Tag; use super::id3v2::ID3v2Tag;
pub struct File<'file_ref> { pub struct File<'file_ref> {
this: Pin<&'file_ref mut CPPFile> this: Pin<&'file_ref mut CPPFile>

View file

@ -5,11 +5,11 @@ use super::bridge::{
use super::tk::{ByteVector, StringList}; use super::tk::{ByteVector, StringList};
use std::pin::Pin; use std::pin::Pin;
pub struct Tag<'file_ref> { pub struct ID3v2Tag<'file_ref> {
this: Pin<&'file_ref CPPID3v2Tag> this: Pin<&'file_ref CPPID3v2Tag>
} }
impl<'file_ref> Tag<'file_ref> { impl<'file_ref> ID3v2Tag<'file_ref> {
pub(super) fn new(this: Pin<&'file_ref CPPID3v2Tag>) -> Self { pub(super) fn new(this: Pin<&'file_ref CPPID3v2Tag>) -> Self {
Self { this } Self { this }
} }

View file

@ -9,4 +9,4 @@ pub mod flac;
pub mod xiph; pub mod xiph;
pub mod mpeg; pub mod mpeg;
pub mod tk; pub mod tk;
pub mod id3; pub mod id3v2;

View file

@ -1,6 +1,6 @@
use std::pin::Pin; use std::pin::Pin;
use super::bridge::{self, CPPMPEGFile}; use super::bridge::{self, CPPMPEGFile};
use super::id3::Tag; use super::id3v2::ID3v2Tag;
pub struct MPEGFile<'file_ref> { pub struct MPEGFile<'file_ref> {
this: Pin<&'file_ref mut CPPMPEGFile> this: Pin<&'file_ref mut CPPMPEGFile>
@ -11,10 +11,10 @@ impl<'file_ref> MPEGFile<'file_ref> {
Self { this } Self { this }
} }
pub fn id3v2_tag(&mut self) -> Option<Tag<'file_ref>> { pub fn id3v2_tag(&mut self) -> Option<ID3v2Tag<'file_ref>> {
let tag = self.this.as_mut().ID3v2Tag(false); let tag = self.this.as_mut().ID3v2Tag(false);
let tag_ref = unsafe { tag.as_ref() }; let tag_ref = unsafe { tag.as_ref() };
let tag_pin = tag_ref.map(|tag| unsafe { Pin::new_unchecked(tag) }); let tag_pin = tag_ref.map(|tag| unsafe { Pin::new_unchecked(tag) });
tag_pin.map(|tag| Tag::new(tag)) tag_pin.map(|tag| ID3v2Tag::new(tag))
} }
} }