MCPcopy Index your code
hub / github.com/LabyStudio/java-spotify-api / isPlaying

Function isPlaying

rust/src/lib.rs:118–139  ·  view source on GitHub ↗
(_env: JNIEnv, _class: JClass)

Source from the content-addressed store, hash-verified

116
117#[no_mangle]
118pub extern "system" fn isPlaying(_env: JNIEnv, _class: JClass) -> jint {
119 let result = std::panic::catch_unwind(|| {
120 block_on(async {
121 match get_spotify_session()? {
122 Some(session) => {
123 let playback_info = session.GetPlaybackInfo()?;
124 let status = playback_info.PlaybackStatus()?;
125 Ok(
126 (status == GlobalSystemMediaTransportControlsSessionPlaybackStatus::Playing)
127 as jint,
128 )
129 }
130 _ => Err(Error::new(E_FAIL, "Spotify session not found")),
131 }
132 })
133 });
134
135 match result {
136 Ok(Ok(val)) => val,
137 _ => -1,
138 }
139}
140
141#[no_mangle]
142pub extern "system" fn getCoverArt(out_ptr: *mut *mut u8, out_len: *mut usize) -> i32 {

Callers

nothing calls this directly

Calls 1

get_spotify_sessionFunction · 0.85

Tested by

no test coverage detected