示例#1
0
 public boolean isControlAreaVisible() {
   boolean visible = this.housingViewManifestation.isControlAreaVisible();
   for (WeakReference<ControlProvider> controlArea : controlAreas) {
     ControlProvider cp = controlArea.get();
     if (cp != null) {
       visible |= cp.isControlShowing();
     }
   }
   return visible;
 }
示例#2
0
 @Override
 public void toggleControlAreas(boolean showing) {
   Iterator<WeakReference<ControlProvider>> it = controlAreas.iterator();
   while (it.hasNext()) {
     ControlProvider cp = it.next().get();
     if (cp == null) {
       it.remove();
     } else {
       cp.showControl(showing);
     }
   }
 }
  @Override
  public void messageReceived(NextFilter nextFilter, IoSession session, Object message)
      throws Exception {
    if (message instanceof RtspRequest) {
      for (ControlProvider provider : providers)
        provider.receivedRequest(session, (RtspRequest) message);
    } else if (message instanceof RtspResponse) {
      for (ControlProvider provider : providers)
        provider.receivedResponse(session, (RtspResponse) message);
    } else {
      log.error("Expecting a RtspRequest. Received a {}", message.getClass().getName());
    }

    // Forward message
    nextFilter.messageReceived(session, message);
  }
  /*
   * (non-Javadoc)
   *
   * @see org.apache.mina.common.IoFilterAdapter#sessionOpened(org.apache.mina.common.IoFilter.NextFilter,
   *      org.apache.mina.common.IoSession)
   */
  @Override
  public void sessionOpened(NextFilter nextFilter, IoSession session) throws Exception {
    for (ControlProvider provider : providers) provider.sessionOpened(session);

    nextFilter.sessionOpened(session);
  }