Java源码示例:org.fourthline.cling.support.lastchange.LastChange

示例1
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {

    MediaInfo mediaInfo = getMediaInfo(instanceId);
    TransportInfo transportInfo = getTransportInfo(instanceId);
    TransportSettings transportSettings = getTransportSettings(instanceId);
    PositionInfo positionInfo = getPositionInfo(instanceId);
    DeviceCapabilities deviceCaps = getDeviceCapabilities(instanceId);

    lc.setEventedValue(
            instanceId,
            new AVTransportVariable.AVTransportURI(URI.create(mediaInfo.getCurrentURI())),
            new AVTransportVariable.AVTransportURIMetaData(mediaInfo.getCurrentURIMetaData()),
            new AVTransportVariable.CurrentMediaDuration(mediaInfo.getMediaDuration()),
            new AVTransportVariable.CurrentPlayMode(transportSettings.getPlayMode()),
            new AVTransportVariable.CurrentRecordQualityMode(transportSettings.getRecQualityMode()),
            new AVTransportVariable.CurrentTrack(positionInfo.getTrack()),
            new AVTransportVariable.CurrentTrackDuration(positionInfo.getTrackDuration()),
            new AVTransportVariable.CurrentTrackMetaData(positionInfo.getTrackMetaData()),
            new AVTransportVariable.CurrentTrackURI(URI.create(positionInfo.getTrackURI())),
            new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions(instanceId)),
            new AVTransportVariable.NextAVTransportURI(URI.create(mediaInfo.getNextURI())),
            new AVTransportVariable.NextAVTransportURIMetaData(mediaInfo.getNextURIMetaData()),
            new AVTransportVariable.NumberOfTracks(mediaInfo.getNumberOfTracks()),
            new AVTransportVariable.PossiblePlaybackStorageMedia(deviceCaps.getPlayMedia()),
            new AVTransportVariable.PossibleRecordQualityModes(deviceCaps.getRecQualityModes()),
            new AVTransportVariable.PossibleRecordStorageMedia(deviceCaps.getRecMedia()),
            new AVTransportVariable.RecordMediumWriteStatus(mediaInfo.getWriteStatus()),
            new AVTransportVariable.RecordStorageMedium(mediaInfo.getRecordMedium()),
            new AVTransportVariable.TransportPlaySpeed(transportInfo.getCurrentSpeed()),
            new AVTransportVariable.TransportState(transportInfo.getCurrentTransportState()),
            new AVTransportVariable.TransportStatus(transportInfo.getCurrentTransportStatus())
    );
}
 
示例2
public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium[] possiblePlayMedia) {
    this.instanceID = instanceID;
    this.lastChange = lastChange;
    setDeviceCapabilities(new DeviceCapabilities(possiblePlayMedia));
    setMediaInfo(new MediaInfo());
    setTransportInfo(new TransportInfo());
    setPositionInfo(new PositionInfo());
    setTransportSettings(new TransportSettings());
}
 
示例3
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {
    for (Channel channel : getCurrentChannels()) {
        String channelString = channel.name();
        lc.setEventedValue(
                instanceId,
                new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))),
                new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))),
                new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())),
                new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))),
                new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name())
        );
    }
}
 
示例4
public ZxtMediaPlayer(UnsignedIntegerFourBytes instanceId,Context context,
                          LastChange avTransportLastChange,
                          LastChange renderingControlLastChange) {
        super();
        this.instanceId = instanceId;
        this.mContext = context;
        this.avTransportLastChange = avTransportLastChange;
        this.renderingControlLastChange = renderingControlLastChange;

        try {
            // Disconnect the old bus listener
            /* TODO: That doesn't work for some reason...
            getPipeline().getBus().disconnect(
                    (Bus.STATE_CHANGED) Reflections.getField(getClass(), "stateChanged").get(this)
            );
            */

            // Connect a fixed bus state listener
//            getPipeline().getBus().connect(busStateChanged);

            // Connect a bus tag listener
//            getPipeline().getBus().connect(busTag);

        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }

//        addMediaListener(new GstMediaListener());

//        setVideoSink(videoComponent.getElement());
    }
 
示例5
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);
    }
}
 
示例6
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {

    MediaInfo mediaInfo = getMediaInfo(instanceId);
    TransportInfo transportInfo = getTransportInfo(instanceId);
    TransportSettings transportSettings = getTransportSettings(instanceId);
    PositionInfo positionInfo = getPositionInfo(instanceId);
    DeviceCapabilities deviceCaps = getDeviceCapabilities(instanceId);

    lc.setEventedValue(
            instanceId,
            new AVTransportVariable.AVTransportURI(URI.create(mediaInfo.getCurrentURI())),
            new AVTransportVariable.AVTransportURIMetaData(mediaInfo.getCurrentURIMetaData()),
            new AVTransportVariable.CurrentMediaDuration(mediaInfo.getMediaDuration()),
            new AVTransportVariable.CurrentPlayMode(transportSettings.getPlayMode()),
            new AVTransportVariable.CurrentRecordQualityMode(transportSettings.getRecQualityMode()),
            new AVTransportVariable.CurrentTrack(positionInfo.getTrack()),
            new AVTransportVariable.CurrentTrackDuration(positionInfo.getTrackDuration()),
            new AVTransportVariable.CurrentTrackMetaData(positionInfo.getTrackMetaData()),
            new AVTransportVariable.CurrentTrackURI(URI.create(positionInfo.getTrackURI())),
            new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions(instanceId)),
            new AVTransportVariable.NextAVTransportURI(URI.create(mediaInfo.getNextURI())),
            new AVTransportVariable.NextAVTransportURIMetaData(mediaInfo.getNextURIMetaData()),
            new AVTransportVariable.NumberOfTracks(mediaInfo.getNumberOfTracks()),
            new AVTransportVariable.PossiblePlaybackStorageMedia(deviceCaps.getPlayMedia()),
            new AVTransportVariable.PossibleRecordQualityModes(deviceCaps.getRecQualityModes()),
            new AVTransportVariable.PossibleRecordStorageMedia(deviceCaps.getRecMedia()),
            new AVTransportVariable.RecordMediumWriteStatus(mediaInfo.getWriteStatus()),
            new AVTransportVariable.RecordStorageMedium(mediaInfo.getRecordMedium()),
            new AVTransportVariable.TransportPlaySpeed(transportInfo.getCurrentSpeed()),
            new AVTransportVariable.TransportState(transportInfo.getCurrentTransportState()),
            new AVTransportVariable.TransportStatus(transportInfo.getCurrentTransportStatus())
    );
}
 
示例7
public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium[] possiblePlayMedia) {
    this.instanceID = instanceID;
    this.lastChange = lastChange;
    setDeviceCapabilities(new DeviceCapabilities(possiblePlayMedia));
    setMediaInfo(new MediaInfo());
    setTransportInfo(new TransportInfo());
    setPositionInfo(new PositionInfo());
    setTransportSettings(new TransportSettings());
}
 
示例8
@Override
public void appendCurrentState(LastChange lc, UnsignedIntegerFourBytes instanceId) throws Exception {
    for (Channel channel : getCurrentChannels()) {
        String channelString = channel.name();
        lc.setEventedValue(
                instanceId,
                new RenderingControlVariable.Mute(new ChannelMute(channel, getMute(instanceId, channelString))),
                new RenderingControlVariable.Loudness(new ChannelLoudness(channel, getLoudness(instanceId, channelString))),
                new RenderingControlVariable.Volume(new ChannelVolume(channel, getVolume(instanceId, channelString).getValue().intValue())),
                new RenderingControlVariable.VolumeDB(new ChannelVolumeDB(channel, getVolumeDB(instanceId, channelString))),
                new RenderingControlVariable.PresetNameList(PresetName.FactoryDefaults.name())
        );
    }
}
 
示例9
public ZxtMediaPlayer(UnsignedIntegerFourBytes instanceId,Context context,
                          LastChange avTransportLastChange,
                          LastChange renderingControlLastChange) {
        super();
        this.instanceId = instanceId;
        this.mContext = context;
        this.avTransportLastChange = avTransportLastChange;
        this.renderingControlLastChange = renderingControlLastChange;

        try {
            // Disconnect the old bus listener
            /* TODO: That doesn't work for some reason...
            getPipeline().getBus().disconnect(
                    (Bus.STATE_CHANGED) Reflections.getField(getClass(), "stateChanged").get(this)
            );
            */

            // Connect a fixed bus state listener
//            getPipeline().getBus().connect(busStateChanged);

            // Connect a bus tag listener
//            getPipeline().getBus().connect(busTag);

        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }

//        addMediaListener(new GstMediaListener());

//        setVideoSink(videoComponent.getElement());
    }
 
示例10
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);
    }
}
 
示例11
protected AbstractAVTransportService() {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = new LastChange(new AVTransportLastChangeParser());
}
 
示例12
protected AbstractAVTransportService(LastChange lastChange) {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = lastChange;
}
 
示例13
protected AbstractAVTransportService(PropertyChangeSupport propertyChangeSupport) {
    this.propertyChangeSupport = propertyChangeSupport;
    this.lastChange = new LastChange(new AVTransportLastChangeParser());
}
 
示例14
protected AbstractAVTransportService(PropertyChangeSupport propertyChangeSupport, LastChange lastChange) {
    this.propertyChangeSupport = propertyChangeSupport;
    this.lastChange = lastChange;
}
 
示例15
@Override
public LastChange getLastChange() {
    return lastChange;
}
 
示例16
protected AVTransport createTransport(UnsignedIntegerFourBytes instanceId, LastChange lastChange) {
    return new AVTransport(instanceId, lastChange, StorageMedium.NETWORK);
}
 
示例17
public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium possiblePlayMedium) {
    this(instanceID, lastChange, new StorageMedium[]{possiblePlayMedium});
}
 
示例18
public LastChange getLastChange() {
    return lastChange;
}
 
示例19
protected AbstractAudioRenderingControl() {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = new LastChange(new RenderingControlLastChangeParser());
}
 
示例20
protected AbstractAudioRenderingControl(LastChange lastChange) {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = lastChange;
}
 
示例21
protected AbstractAudioRenderingControl(PropertyChangeSupport propertyChangeSupport) {
    this.propertyChangeSupport = propertyChangeSupport;
    this.lastChange = new LastChange(new RenderingControlLastChangeParser());
}
 
示例22
protected AbstractAudioRenderingControl(PropertyChangeSupport propertyChangeSupport, LastChange lastChange) {
    this.propertyChangeSupport = propertyChangeSupport;
    this.lastChange = lastChange;
}
 
示例23
@Override
public LastChange getLastChange() {
    return lastChange;
}
 
示例24
public LastChange getAvTransportLastChange() {
    return avTransportLastChange;
}
 
示例25
public LastChange getRenderingControlLastChange() {
    return renderingControlLastChange;
}
 
示例26
protected AVTransportService(LastChange lastChange, Map<UnsignedIntegerFourBytes, ZxtMediaPlayer> players) {
    super(lastChange);
    this.players = players;
}
 
示例27
protected AudioRenderingControl(LastChange lastChange, Map<UnsignedIntegerFourBytes, ZxtMediaPlayer> players) {
    super(lastChange);
    this.players = players;
}
 
示例28
protected AbstractAVTransportService() {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = new LastChange(new AVTransportLastChangeParser());
}
 
示例29
protected AbstractAVTransportService(LastChange lastChange) {
    this.propertyChangeSupport = new PropertyChangeSupport(this);
    this.lastChange = lastChange;
}
 
示例30
protected AbstractAVTransportService(PropertyChangeSupport propertyChangeSupport) {
    this.propertyChangeSupport = propertyChangeSupport;
    this.lastChange = new LastChange(new AVTransportLastChangeParser());
}