001/*******************************************************************************
002 * Copyright (c) 2024, 2026, Olivier Ayache.  All rights reserved.
003 *
004 * This file is part of AVPKit.
005 *
006 * AVPKit is free software: you can redistribute it and/or modify
007 * it under the terms of the GNU Lesser General Public License as published by
008 * the Free Software Foundation, either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * AVPKit is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014 * GNU Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public License
017 * along with AVPKit.  If not, see <http://www.gnu.org/licenses/>.
018 *******************************************************************************/
019
020package com.avpkit.mediatool;
021
022import java.util.Collection;
023
024/**
025 * Generates events that {@link IMediaListener} objects can
026 * subscribe to and react to.
027 * <p>
028 * This is the interface that defines how you
029 * {@link #addListener(IMediaListener)} s and
030 * {@link #removeListener(IMediaListener)}s from different
031 * {@link IMediaGenerator} objects such as {@link IMediaReader}.
032 * 
033 * </p>
034 */
035
036public interface IMediaGenerator
037{
038  /**
039   * Add a media tool listener.
040   *
041   * @param listener the listener to add
042   *
043   * @return true if the set of listeners changed as a result of the call
044   */
045  
046  public abstract boolean addListener(IMediaListener listener);
047  
048  /**
049   * Remove a media tool listener.
050   *
051   * @param listener the listener to remove
052   *
053   * @return true if the set of listeners changed as a result of the call
054   */
055  
056  public abstract boolean removeListener(IMediaListener listener);
057  
058  /**
059   * Get the list of existing media tools listeners.
060   *
061   * @return an unmodifiable collection of listeners
062   */
063  
064  public abstract Collection<IMediaListener> getListeners();
065  
066
067}