View Javadoc
1   /*
2    * Copyright (C) 2013 4th Line GmbH, Switzerland
3    *
4    * The contents of this file are subject to the terms of either the GNU
5    * Lesser General Public License Version 2 or later ("LGPL") or the
6    * Common Development and Distribution License Version 1 or later
7    * ("CDDL") (collectively, the "License"). You may not use this file
8    * except in compliance with the License. See LICENSE.txt for more
9    * information.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14   */
15  
16  package org.fourthline.cling.support.model;
17  
18  import org.fourthline.cling.model.types.UnsignedIntegerFourBytes;
19  import org.fourthline.cling.support.lastchange.LastChange;
20  
21  /**
22   * State of one logical instance of the AV Transport service.
23   *
24   * @author Christian Bauer
25   */
26  public class AVTransport {
27  
28      final protected UnsignedIntegerFourBytes instanceID;
29      final protected LastChange lastChange;
30      protected MediaInfo mediaInfo;
31      protected TransportInfo transportInfo;
32      protected PositionInfo positionInfo;
33      protected DeviceCapabilities deviceCapabilities;
34      protected TransportSettings transportSettings;
35  
36      public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium possiblePlayMedium) {
37          this(instanceID, lastChange, new StorageMedium[]{possiblePlayMedium});
38      }
39  
40      public AVTransport(UnsignedIntegerFourBytes instanceID, LastChange lastChange, StorageMedium[] possiblePlayMedia) {
41          this.instanceID = instanceID;
42          this.lastChange = lastChange;
43          setDeviceCapabilities(new DeviceCapabilities(possiblePlayMedia));
44          setMediaInfo(new MediaInfo());
45          setTransportInfo(new TransportInfo());
46          setPositionInfo(new PositionInfo());
47          setTransportSettings(new TransportSettings());
48      }
49  
50      public UnsignedIntegerFourBytes getInstanceId() {
51          return instanceID;
52      }
53  
54      public LastChange getLastChange() {
55          return lastChange;
56      }
57  
58      public MediaInfo getMediaInfo() {
59          return mediaInfo;
60      }
61  
62      public void setMediaInfo(MediaInfo mediaInfo) {
63          this.mediaInfo = mediaInfo;
64      }
65  
66      public TransportInfo getTransportInfo() {
67          return transportInfo;
68      }
69  
70      public void setTransportInfo(TransportInfo transportInfo) {
71          this.transportInfo = transportInfo;
72      }
73  
74      public PositionInfo getPositionInfo() {
75          return positionInfo;
76      }
77  
78      public void setPositionInfo(PositionInfo positionInfo) {
79          this.positionInfo = positionInfo;
80      }
81  
82      public DeviceCapabilities getDeviceCapabilities() {
83          return deviceCapabilities;
84      }
85  
86      public void setDeviceCapabilities(DeviceCapabilities deviceCapabilities) {
87          this.deviceCapabilities = deviceCapabilities;
88      }
89  
90      public TransportSettings getTransportSettings() {
91          return transportSettings;
92      }
93  
94      public void setTransportSettings(TransportSettings transportSettings) {
95          this.transportSettings = transportSettings;
96      }
97  
98  }