1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.support.avtransport.impl.state;
17
18 import java.net.URI;
19 import java.util.logging.Logger;
20
21 import org.fourthline.cling.support.avtransport.lastchange.AVTransportVariable;
22 import org.fourthline.cling.support.model.AVTransport;
23 import org.fourthline.cling.support.model.TransportAction;
24 import org.fourthline.cling.support.model.TransportInfo;
25 import org.fourthline.cling.support.model.TransportState;
26
27
28
29
30 public abstract class PausedPlay<T extends AVTransport> extends AbstractState<T>
31 {
32
33 final private static Logger log = Logger.getLogger(PausedPlay.class.getName());
34
35 public PausedPlay(T transport) {
36 super(transport);
37 }
38
39 public void onEntry() {
40 log.fine("Setting transport state to PAUSED_PLAYBACK");
41 getTransport().setTransportInfo(
42 new TransportInfo(
43 TransportState.PAUSED_PLAYBACK,
44 getTransport().getTransportInfo().getCurrentTransportStatus(),
45 getTransport().getTransportInfo().getCurrentSpeed()
46 )
47 );
48 getTransport().getLastChange().setEventedValue(
49 getTransport().getInstanceId(),
50 new AVTransportVariable.TransportState(TransportState.PAUSED_PLAYBACK),
51 new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions())
52 );
53 }
54
55 public abstract Class<? extends AbstractState<?>> setTransportURI(URI uri, String metaData);
56 public abstract Class<? extends AbstractState<?>> stop();
57 public abstract Class<? extends AbstractState<?>> play(String speed);
58
59 public TransportAction[] getCurrentTransportActions() {
60 return new TransportAction[] {
61 TransportAction.Stop,
62 TransportAction.Play
63 };
64 }
65
66 }