com.github.bjoernpetersen.jmusicbot.playback.Playback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of musicbot Show documentation
Show all versions of musicbot Show documentation
Core library of MusicBot, which plays music from various providers.
package com.github.bjoernpetersen.jmusicbot.playback;
import javax.annotation.Nonnull;
/**
* Playback for a single song. Playback should not start before {@link #play()} is called the first time.
*/
public interface Playback extends AutoCloseable {
/**
* Provides the playback with a PlaybackStateListener.
* The listener can be used to tell the player about external pause/resume events.
*
* @param listener a PlaybackStateListener
*/
default void setPlaybackStateListener(@Nonnull PlaybackStateListener listener) {
}
/**
* Resumes the playback. This might be called if the playback is already active.
*/
void play();
/**
* Pauses the playback. This might be called if the playback is already paused.
*/
void pause();
void waitForFinish() throws InterruptedException;
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy