Android Open Source - akuplayer Player Command






From Project

Back to project page akuplayer.

License

The source code is released under:

Copyright (c) 2014, Dmitry Kuznetsov aka kudzmi All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditi...

If you think the Android project akuplayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
Copyright (c) 2014, Dmitry Kuznetsov aka kudzmi
All rights reserved.//from  w w  w. j  ava2 s .  c  om

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.kudzmi.akuplayer.player;

import java.io.Serializable;

/**
 * Created by Dmitry Kuznetsov on 08.04.14.
 * Message with commant for player
 * Sent from UI to service
 */
public class PlayerCommand   implements Serializable {

    private boolean toPlay = false;
    private boolean toPause = false;
    private boolean toPrev = false;
    private boolean toNext = false;

    private boolean isShuffle = false;
    private boolean isRepeat = false;

    private boolean isSeeking = false;
    private int seekpos = 0;

    private long startTrackId = -1L;

    public PlayerCommand() {}

    public PlayerCommand(boolean shuffle, boolean repeat) {
        this.isShuffle = shuffle;
        this.isRepeat = repeat;
    }

    public PlayerCommand(boolean toPlay, long startTrackId, boolean shuffle, boolean repeat) {
        this.toPlay = toPlay;
        this.startTrackId = startTrackId;
        this.isShuffle = shuffle;
        this.isRepeat = repeat;
    }

    public Long getStartTrackId() {
        return startTrackId;
    }

    public PlayerCommand setStartTrackId(long startTrackId) {
        this.startTrackId = startTrackId;
        return this;
    }

    public PlayerCommand setToPlay(){
        toPlay = true;
        toPause = false;
        return this;
    }

    public PlayerCommand setToPause() {
        toPlay = false;
        toPause = true;
        return this;
    }

    public PlayerCommand setToPrev() {
        toPrev = true;
        toNext = false;
        return this;
    }

    public PlayerCommand setToNext() {
        toPrev = false;
        toNext = true;
        return this;
    }

    public boolean isToPlay(){
        return toPlay;
    }

    public boolean isToPause(){
        return toPause;
    }

    public boolean isToNext() {
        return toNext;
    }

    public boolean isToPrev() {
        return toPrev;
    }

    public boolean isShuffle() {
        return isShuffle;
    }

    public PlayerCommand setShuffle(boolean isShuffle) {
        this.isShuffle = isShuffle;
        return this;
    }

    public boolean isRepeat() {
        return isRepeat;
    }

    public PlayerCommand setRepeat(boolean isRepeat) {
        this.isRepeat = isRepeat;
        return this;
    }

    public boolean isSeeking() {
        return isSeeking;
    }

    public PlayerCommand setSeeking(boolean isSeeking) {
        this.isSeeking = isSeeking;
        return this;
    }

    public int getSeekpos() {
        return seekpos;
    }

    public PlayerCommand setSeekpos(int seekpos) {
        this.seekpos = seekpos;
        return this;
    }
}




Java Source Code List

com.kudzmi.akuplayer.Audio.java
com.kudzmi.akuplayer.MainActivity.java
com.kudzmi.akuplayer.PrefStorage.java
com.kudzmi.akuplayer.SimpleListAdapter.java
com.kudzmi.akuplayer.TrackListAdapter.java
com.kudzmi.akuplayer.player.AKuPlayerService.java
com.kudzmi.akuplayer.player.BroadcastCommander.java
com.kudzmi.akuplayer.player.ItemHighlighter.java
com.kudzmi.akuplayer.player.PlayerCommand.java
com.kudzmi.akuplayer.player.PlayerSeekCommand.java
com.kudzmi.akuplayer.player.PlayerStatus.java
com.kudzmi.akuplayer.player.TrackList.java