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 org.fourthline.cling.support.avtransport.lastchange.AVTransportVariable;
19 import org.fourthline.cling.support.model.AVTransport;
20 import org.fourthline.cling.support.model.TransportAction;
21 import org.fourthline.cling.support.model.TransportInfo;
22 import org.fourthline.cling.support.model.TransportState;
23
24 import java.net.URI;
25 import java.util.logging.Logger;
26
27
28
29
30 public abstract class NoMediaPresent<T extends AVTransport> extends AbstractState<T> {
31
32 final private static Logger log = Logger.getLogger(Stopped.class.getName());
33
34 public NoMediaPresent(T transport) {
35 super(transport);
36 }
37
38 public void onEntry() {
39 log.fine("Setting transport state to NO_MEDIA_PRESENT");
40 getTransport().setTransportInfo(
41 new TransportInfo(
42 TransportState.NO_MEDIA_PRESENT,
43 getTransport().getTransportInfo().getCurrentTransportStatus(),
44 getTransport().getTransportInfo().getCurrentSpeed()
45 )
46 );
47 getTransport().getLastChange().setEventedValue(
48 getTransport().getInstanceId(),
49 new AVTransportVariable.TransportState(TransportState.NO_MEDIA_PRESENT),
50 new AVTransportVariable.CurrentTransportActions(getCurrentTransportActions())
51 );
52 }
53
54 public abstract Class<? extends AbstractState> setTransportURI(URI uri, String metaData);
55
56 public TransportAction[] getCurrentTransportActions() {
57 return new TransportAction[] {
58 TransportAction.Stop
59 };
60 }
61 }