2
* Entagged Audio Tag library
3
* Copyright (c) 2003-2005 Christian Laireiter <liree@web.de>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
package org.jaudiotagger.audio.generic;
21
import org.jaudiotagger.audio.AudioFile;
22
import org.jaudiotagger.audio.exceptions.ModifyVetoException;
27
* Classes implementing this interface will be notified on audio file's
30
* <p>It will be notified on several occasions:<br>
32
* <li>An audio file is about to be modified
33
* {@link #fileWillBeModified(AudioFile,boolean)}<br>
34
* Here one can modify the tag data because of global settings.</li>
35
* <li>The write process has just finished. But if a copy was created the
36
* original has not been replaced yet. ({@link #fileModified(AudioFile,File)}).</li>
37
* <li>The operation has been finished. {@link #fileOperationFinished(File)}</li>
40
* @author Christian Laireiter <liree@web.de>
42
public interface AudioFileModificationListener
46
* Notifies that <code>original</code> has been processed.<br>
47
* Because the audiolibrary allows format implementors to either change the
48
* original file or create a copy, it is possible that the real result is
49
* located in the original and <code>temporary</code> is of zero size
50
* <b>or</b> the original will be deleted and replaced by temporary.<br>
52
* @param original The original file on which the operation was started.
53
* @param temporary The modified copy. (It may be of zero size if the original was
55
* @throws ModifyVetoException If the Results doesn't fit the expectations of the listener,
56
* it can prevent the replacement of the original by temporary.<br>
57
* If the original is already modified, this exception results
60
public void fileModified(AudioFile original, File temporary) throws ModifyVetoException;
63
* Informs the listener that the process has been finished.<br>
64
* The given file is either the original file or the modified copy.<br>
66
* @param result The remaining file. It's not of {@link AudioFile} since it may
67
* be possible that a new file was created. In that case the
68
* audiolibs would need to parse the file again, which leads to
69
* long and unnecessary operation time, if the tag data is not
72
public void fileOperationFinished(File result);
75
* Notifies that the <code>file</code> is about to be modified.
77
* @param file The file that will be modified.
78
* @param delete <code>true</code> if the deletion of tag data will be
80
* @throws ModifyVetoException Thrown if the listener wants to prevent the process.
82
public void fileWillBeModified(AudioFile file, boolean delete) throws ModifyVetoException;
85
* This method notifies about a veto exception that has been thrown by
86
* another listener.<br>
88
* @param cause The instance which caused the veto.
89
* @param original The original file, that was about to be modified.
90
* @param veto The thrown exception.
92
public void vetoThrown(AudioFileModificationListener cause, AudioFile original, ModifyVetoException veto);
2
* Entagged Audio Tag library
3
* Copyright (c) 2003-2005 Christian Laireiter <liree@web.de>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
package org.jaudiotagger.audio.generic;
21
import org.jaudiotagger.audio.AudioFile;
22
import org.jaudiotagger.audio.exceptions.ModifyVetoException;
27
* Classes implementing this interface will be notified on audio file's
30
* <p>It will be notified on several occasions:<br>
32
* <li>An audio file is about to be modified
33
* {@link #fileWillBeModified(AudioFile,boolean)}<br>
34
* Here one can modify the tag data because of global settings.</li>
35
* <li>The write process has just finished. But if a copy was created the
36
* original has not been replaced yet. ({@link #fileModified(AudioFile,File)}).</li>
37
* <li>The operation has been finished. {@link #fileOperationFinished(File)}</li>
40
* @author Christian Laireiter <liree@web.de>
42
public interface AudioFileModificationListener
46
* Notifies that <code>original</code> has been processed.<br>
47
* Because the audiolibrary allows format implementors to either change the
48
* original file or create a copy, it is possible that the real result is
49
* located in the original and <code>temporary</code> is of zero size
50
* <b>or</b> the original will be deleted and replaced by temporary.<br>
52
* @param original The original file on which the operation was started.
53
* @param temporary The modified copy. (It may be of zero size if the original was
55
* @throws ModifyVetoException If the Results doesn't fit the expectations of the listener,
56
* it can prevent the replacement of the original by temporary.<br>
57
* If the original is already modified, this exception results
60
public void fileModified(AudioFile original, File temporary) throws ModifyVetoException;
63
* Informs the listener that the process has been finished.<br>
64
* The given file is either the original file or the modified copy.<br>
66
* @param result The remaining file. It's not of {@link AudioFile} since it may
67
* be possible that a new file was created. In that case the
68
* audiolibs would need to parse the file again, which leads to
69
* long and unnecessary operation time, if the tag data is not
72
public void fileOperationFinished(File result);
75
* Notifies that the <code>file</code> is about to be modified.
77
* @param file The file that will be modified.
78
* @param delete <code>true</code> if the deletion of tag data will be
80
* @throws ModifyVetoException Thrown if the listener wants to prevent the process.
82
public void fileWillBeModified(AudioFile file, boolean delete) throws ModifyVetoException;
85
* This method notifies about a veto exception that has been thrown by
86
* another listener.<br>
88
* @param cause The instance which caused the veto.
89
* @param original The original file, that was about to be modified.
90
* @param veto The thrown exception.
92
public void vetoThrown(AudioFileModificationListener cause, AudioFile original, ModifyVetoException veto);