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 *******************************************************************************/ 019package com.avpkit.mediatool; 020 021import java.util.Collection; 022 023/** 024 * An implementation of {@link IMediaGenerator}. 025 * <p> 026 * This class manages all attached {@link IMediaListener} objects in a 027 * thread-safe set. The is fast to iterate over -- at the expense of a copy on 028 * {@link #addListener(IMediaListener)} and 029 * {@link #removeListener(IMediaListener)}. 030 * </p> 031 * <p> 032 * This can be useful if you want to implement your own version of 033 * {@link IMediaGenerator}, but want someone to declare support for it, and 034 * implement the interface. 035 * </p> 036 * 037 * @author trebor 038 * @author aclarke 039 * 040 */ 041public class MediaGeneratorAdapter extends AMediaGeneratorMixin implements 042 IMediaGenerator 043{ 044 /* 045 * Implementation note: We declare and forward to our parent every method in 046 * IMediaGenerator so that it shows up obviously in JavaDoc that these are the 047 * main methods people might override. 048 */ 049 050 /** 051 * Create a {@link MediaGeneratorAdapter}. 052 */ 053 public MediaGeneratorAdapter() 054 { 055 056 } 057 058 /** 059 * {@inheritDoc} 060 */ 061 public boolean addListener(IMediaListener listener) 062 { 063 do {} while(false); 064 return super.addListener(listener); 065 } 066 067 /** 068 * {@inheritDoc} 069 */ 070 public Collection<IMediaListener> getListeners() 071 { 072 do {} while(false); 073 return super.getListeners(); 074 } 075 076 /** 077 * {@inheritDoc} 078 */ 079 public boolean removeListener(IMediaListener listener) 080 { 081 do {} while(false); 082 return super.removeListener(listener); 083 } 084 085}