1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.fourthline.cling.support.model;
17
18 import org.fourthline.cling.model.action.ActionArgumentValue;
19
20 import java.util.Map;
21
22
23
24
25 public class TransportInfo {
26
27 private TransportState currentTransportState = TransportState.NO_MEDIA_PRESENT;
28 private TransportStatus currentTransportStatus = TransportStatus.OK;
29 private String currentSpeed = "1";
30
31 public TransportInfo() {
32 }
33
34 public TransportInfo(Map<String, ActionArgumentValue> args) {
35 this(
36 TransportState.valueOrCustomOf((String) args.get("CurrentTransportState").getValue()),
37 TransportStatus.valueOrCustomOf((String) args.get("CurrentTransportStatus").getValue()),
38 (String) args.get("CurrentSpeed").getValue()
39 );
40 }
41
42 public TransportInfo(TransportState currentTransportState) {
43 this.currentTransportState = currentTransportState;
44 }
45
46 public TransportInfo(TransportState currentTransportState, String currentSpeed) {
47 this.currentTransportState = currentTransportState;
48 this.currentSpeed = currentSpeed;
49 }
50
51 public TransportInfo(TransportState currentTransportState, TransportStatus currentTransportStatus) {
52 this.currentTransportState = currentTransportState;
53 this.currentTransportStatus = currentTransportStatus;
54 }
55
56 public TransportInfo(TransportState currentTransportState, TransportStatus currentTransportStatus, String currentSpeed) {
57 this.currentTransportState = currentTransportState;
58 this.currentTransportStatus = currentTransportStatus;
59 this.currentSpeed = currentSpeed;
60 }
61
62 public TransportState getCurrentTransportState() {
63 return currentTransportState;
64 }
65
66 public TransportStatus getCurrentTransportStatus() {
67 return currentTransportStatus;
68 }
69
70 public String getCurrentSpeed() {
71 return currentSpeed;
72 }
73 }