Java Code Examples for org.fourthline.cling.support.model.TransportState#equals()

The following examples show how to use org.fourthline.cling.support.model.TransportState#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ZxtMediaPlayers.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
public ZxtMediaPlayers(int numberOfPlayers,
                       Context context,
                       LastChange avTransportLastChange,
                       LastChange renderingControlLastChange) {
    super(numberOfPlayers);
    this.mContext = context;
    this.avTransportLastChange = avTransportLastChange;
    this.renderingControlLastChange = renderingControlLastChange;

    for (int i = 0; i < numberOfPlayers; i++) {

        ZxtMediaPlayer player =
                new ZxtMediaPlayer(
                        new UnsignedIntegerFourBytes(i),
                        mContext,
                        avTransportLastChange,
                        renderingControlLastChange
                ) {
                    @Override
                    protected void transportStateChanged(TransportState newState) {
                        super.transportStateChanged(newState);
                        if (newState.equals(TransportState.PLAYING)) {
                            onPlay(this);
                        } else if (newState.equals(TransportState.STOPPED)) {
                            onStop(this);
                        }
                    }
                };
        put(player.getInstanceId(), player);
    }
}
 
Example 2
Source File: ZxtMediaRenderer.java    From TVRemoteIME with GNU General Public License v2.0 5 votes vote down vote up
synchronized public void stopAllMediaPlayers() {
        for (ZxtMediaPlayer mediaPlayer : mediaPlayers.values()) {
            TransportState state =
                mediaPlayer.getCurrentTransportInfo().getCurrentTransportState();
            if (!state.equals(TransportState.NO_MEDIA_PRESENT) ||
                    state.equals(TransportState.STOPPED)) {
                Log.i(TAG, "Stopping player instance: " + mediaPlayer.getInstanceId());
//                mediaPlayer.stop();
            }
        }
    }
 
Example 3
Source File: ZxtMediaPlayers.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
public ZxtMediaPlayers(int numberOfPlayers,
                       Context context,
                       LastChange avTransportLastChange,
                       LastChange renderingControlLastChange) {
    super(numberOfPlayers);
    this.mContext = context;
    this.avTransportLastChange = avTransportLastChange;
    this.renderingControlLastChange = renderingControlLastChange;

    for (int i = 0; i < numberOfPlayers; i++) {

        ZxtMediaPlayer player =
                new ZxtMediaPlayer(
                        new UnsignedIntegerFourBytes(i),
                        mContext,
                        avTransportLastChange,
                        renderingControlLastChange
                ) {
                    @Override
                    protected void transportStateChanged(TransportState newState) {
                        super.transportStateChanged(newState);
                        if (newState.equals(TransportState.PLAYING)) {
                            onPlay(this);
                        } else if (newState.equals(TransportState.STOPPED)) {
                            onStop(this);
                        }
                    }
                };
        put(player.getInstanceId(), player);
    }
}
 
Example 4
Source File: ZxtMediaRenderer.java    From DroidDLNA with GNU General Public License v3.0 5 votes vote down vote up
synchronized public void stopAllMediaPlayers() {
        for (ZxtMediaPlayer mediaPlayer : mediaPlayers.values()) {
            TransportState state =
                mediaPlayer.getCurrentTransportInfo().getCurrentTransportState();
            if (!state.equals(TransportState.NO_MEDIA_PRESENT) ||
                    state.equals(TransportState.STOPPED)) {
                Log.i(TAG, "Stopping player instance: " + mediaPlayer.getInstanceId());
//                mediaPlayer.stop();
            }
        }
    }