diff --git a/app/src/main/java/org/ntlab/amaryllis/client/entities/AmaryllisBackgroundService.java b/app/src/main/java/org/ntlab/amaryllis/client/entities/AmaryllisBackgroundService.java new file mode 100644 index 0000000..f1ac86e --- /dev/null +++ b/app/src/main/java/org/ntlab/amaryllis/client/entities/AmaryllisBackgroundService.java @@ -0,0 +1,40 @@ +package org.ntlab.amaryllis.client.entities; + +import android.app.IntentService; +import android.content.Intent; +import android.content.Context; + +import org.ntlab.amaryllis.client.voiceservice.PlayListManager; + +import java.util.ArrayList; + + +public class AmaryllisBackgroundService extends IntentService { + private ArrayList playListListeners; + private PlayListManager playListManager; + public AmaryllisBackgroundService() { + super("AmaryllisBackgroundService"); + playListListeners=new ArrayList<>(); + } + + @Override + protected void onHandleIntent(Intent intent) { + + } + + public void subscribe(PlayListListener playListListener){ + playListListeners.add(playListListener); + } + public PlayListManager getPlayListManager(){ + return playListManager; + } + + private void callPlayNext(Voicememo voicememo){ + for(PlayListListener pl:playListListeners)pl.onPlayNext(voicememo); + } + private void callPlayEnd(){ + for(PlayListListener pl:playListListeners)pl.onPlayEnd(); + } + + +}