musikr: add wav files
This commit is contained in:
parent
a3f01f152b
commit
da43ebda96
3 changed files with 24 additions and 0 deletions
|
@ -132,6 +132,8 @@ mod bridge_impl {
|
|||
#[namespace = "TagLib::RIFF::WAV"]
|
||||
#[cxx_name = "File"]
|
||||
type CPPWAVFile;
|
||||
#[cxx_name = "ID3v2Tag"]
|
||||
fn WAVID3v2Tag(self: &CPPWAVFile) -> *mut CPPID3v2Tag;
|
||||
|
||||
#[namespace = "TagLib::FLAC"]
|
||||
#[cxx_name = "Picture"]
|
||||
|
|
|
@ -12,3 +12,4 @@ pub mod tk;
|
|||
pub mod id3v2;
|
||||
pub mod id3v1;
|
||||
pub mod mp4;
|
||||
pub mod riff;
|
21
musikr/src/main/jni/src/taglib/riff.rs
Normal file
21
musikr/src/main/jni/src/taglib/riff.rs
Normal file
|
@ -0,0 +1,21 @@
|
|||
use super::bridge::{self, CPPWAVFile};
|
||||
use super::id3v2::ID3v2Tag;
|
||||
use super::this::{RefThisMut, This, ThisMut};
|
||||
use std::pin::Pin;
|
||||
|
||||
pub struct WAVFile<'file_ref> {
|
||||
this: RefThisMut<'file_ref, CPPWAVFile>,
|
||||
}
|
||||
|
||||
impl<'file_ref> WAVFile<'file_ref> {
|
||||
pub(super) fn new(this: RefThisMut<'file_ref, CPPWAVFile>) -> Self {
|
||||
Self { this }
|
||||
}
|
||||
|
||||
pub fn id3v2_tag(&mut self) -> Option<ID3v2Tag<'file_ref>> {
|
||||
let tag = self.this.as_ref().WAVID3v2Tag();
|
||||
let tag_ref = unsafe { tag.as_mut() };
|
||||
let tag_this = tag_ref.map(|tag| unsafe { RefThisMut::new(tag) });
|
||||
tag_this.map(|this| ID3v2Tag::new(this))
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue