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  package example.mediarenderer;
16  
17  import org.fourthline.cling.support.avtransport.impl.state.AbstractState;
18  import org.fourthline.cling.support.avtransport.impl.state.Playing;
19  import org.fourthline.cling.support.model.AVTransport;
20  import org.fourthline.cling.support.model.SeekMode;
21  
22  import java.net.URI;
23  
24  /**
25   * <p>
26   * Usually you'd start playback when the <code>onEntry()</code> method of
27   * the Playing state is called:
28   * </p>
29   * <a class="citation" href="javacode://this" style="include: INC1"/>
30   */
31  public class MyRendererPlaying extends Playing { // DOC:INC1
32  
33      public MyRendererPlaying(AVTransport transport) {
34          super(transport);
35      }
36  
37      @Override
38      public void onEntry() {
39          super.onEntry();
40          // Start playing now!
41      }
42  
43      @Override
44      public Class<? extends AbstractState> setTransportURI(URI uri, String metaData) {
45          // Your choice of action here, and what the next state is going to be!
46          return MyRendererStopped.class;
47      }
48  
49      @Override
50      public Class<? extends AbstractState> stop() {
51          // Stop playing!
52          return MyRendererStopped.class;
53      } // DOC:INC1
54  
55      @Override
56      public Class<? extends AbstractState> play(String speed) {
57          return null;
58      }
59  
60      @Override
61      public Class<? extends AbstractState> pause() {
62          return null;
63      }
64  
65      @Override
66      public Class<? extends AbstractState> next() {
67          return null;
68      }
69  
70      @Override
71      public Class<? extends AbstractState> previous() {
72          return null;
73      }
74  
75      @Override
76      public Class<? extends AbstractState> seek(SeekMode unit, String target) {
77          return null;
78      }
79  }