Java Code Examples for org.fourthline.cling.support.model.Channel#Master

The following examples show how to use org.fourthline.cling.support.model.Channel#Master . 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: ZxtMediaPlayer.java    From TVRemoteIME with GNU General Public License v2.0 6 votes vote down vote up
synchronized public void setVolume(double volume) {
    Log.i(TAG,"setVolume " + volume);
    storedVolume = getVolume();
    
    Intent intent = new Intent();
    intent.setAction(Action.DMR);
    intent.putExtra("helpAction", Action.SET_VOLUME);
    intent.putExtra("volume", volume);

    mContext.sendBroadcast(intent);        
    
    ChannelMute switchedMute =
            (storedVolume == 0 && volume > 0) || (storedVolume > 0 && volume == 0)
                    ? new ChannelMute(Channel.Master, storedVolume > 0 && volume == 0)
                    : null;

    getRenderingControlLastChange().setEventedValue(
            getInstanceId(),
            new RenderingControlVariable.Volume(
                    new ChannelVolume(Channel.Master, (int) (volume * 100))
            ),
            switchedMute != null
                    ? new RenderingControlVariable.Mute(switchedMute)
                    : null
    );
}
 
Example 2
Source File: ZxtMediaPlayer.java    From DroidDLNA with GNU General Public License v3.0 6 votes vote down vote up
synchronized public void setVolume(double volume) {
    Log.i(TAG,"setVolume " + volume);
    storedVolume = getVolume();
    
    Intent intent = new Intent();
    intent.setAction(Action.DMR);
    intent.putExtra("helpAction", Action.SET_VOLUME);
    intent.putExtra("volume", volume);

    mContext.sendBroadcast(intent);        
    
    ChannelMute switchedMute =
            (storedVolume == 0 && volume > 0) || (storedVolume > 0 && volume == 0)
                    ? new ChannelMute(Channel.Master, storedVolume > 0 && volume == 0)
                    : null;

    getRenderingControlLastChange().setEventedValue(
            getInstanceId(),
            new RenderingControlVariable.Volume(
                    new ChannelVolume(Channel.Master, (int) (volume * 100))
            ),
            switchedMute != null
                    ? new RenderingControlVariable.Mute(switchedMute)
                    : null
    );
}
 
Example 3
Source File: AudioRenderingControl.java    From TVRemoteIME with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Channel[] getCurrentChannels() {
    return new Channel[] {
            Channel.Master
    };
}
 
Example 4
Source File: AudioRenderingControl.java    From DroidDLNA with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected Channel[] getCurrentChannels() {
    return new Channel[] {
            Channel.Master
    };
}