Skip to content

Package: AudioFile

AudioFile

Coverage

1: /*
2: * *********************************************************************************************************************
3: *
4: * blueMarine II: Semantic Media Centre
5: * http://tidalwave.it/projects/bluemarine2
6: *
7: * Copyright (C) 2015 - 2021 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/bluemarine2-src
23: * git clone https://github.com/tidalwave-it/bluemarine2-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.bluemarine2.model.audio;
28:
29: import javax.annotation.Nonnegative;
30: import javax.annotation.Nonnull;
31: import java.util.Optional;
32: import java.io.IOException;
33: import org.springframework.core.io.Resource;
34: import it.tidalwave.role.Identifiable;
35: import it.tidalwave.bluemarine2.model.MediaItem;
36: import it.tidalwave.bluemarine2.model.finder.audio.MusicArtistFinder;
37:
38: /***********************************************************************************************************************
39: *
40: * Represents an audio file. Maps the homonymous concept from the Music Ontology.
41: *
42: * @stereotype Datum
43: *
44: * @author Fabrizio Giudici
45: *
46: **********************************************************************************************************************/
47: public interface AudioFile extends MediaItem, Identifiable // FIXME: MediaItem should not be statically Parentable
48: {
49: /*******************************************************************************************************************
50: *
51: * Returns the makers of this audio file.
52: *
53: * FIXME: shouldn't be here - should be in getTrack().findMakers().
54: *
55: * @return the makers
56: *
57: ******************************************************************************************************************/
58: @Nonnull
59: public MusicArtistFinder findMakers();
60:
61: /*******************************************************************************************************************
62: *
63: * Returns the composers of the musical expression related to this audio file.
64: *
65: * FIXME: shouldn't be here - should be in getSignal().findMakers() or such
66: *
67: * @return the composer
68: *
69: ******************************************************************************************************************/
70: @Nonnull
71: public MusicArtistFinder findComposers();
72:
73: /*******************************************************************************************************************
74: *
75: * Returns the record related to this audio file.
76: *
77: * FIXME: shouldn't be here - should be in getTrack().getRecord() or such
78: *
79: * @return the composer
80: *
81: ******************************************************************************************************************/
82: @Nonnull
83: public Optional<Record> getRecord();
84:
85: /*******************************************************************************************************************
86: *
87: * Returns the size of this file.
88: *
89: * @return the size
90: * @throws IOException if there was an I/O problem
91: *
92: ******************************************************************************************************************/
93: @Nonnegative
94: public long getSize()
95: throws IOException;
96:
97: /*******************************************************************************************************************
98: *
99: * Returns the a {@link Resource} representing this file's contents, if available.
100: *
101: * FIXME: not good to use Spring Resource...
102: *
103: * @return the contents
104: * @throws IOException if there was an I/O problem
105: *
106: ******************************************************************************************************************/
107: @Nonnull
108: public Optional<Resource> getContent()
109: throws IOException;
110: }