Track.java

  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. import javax.annotation.Nonnull;
  29. import java.time.Duration;
  30. import java.util.Optional;
  31. import it.tidalwave.role.Identifiable;
  32. import it.tidalwave.bluemarine2.model.MediaItem.Metadata;
  33. import it.tidalwave.bluemarine2.model.spi.Entity;
  34. import it.tidalwave.bluemarine2.model.spi.SourceAware;

  35. /***********************************************************************************************************************
  36.  *
  37.  * Represents an audio track in a record. Maps the homonymous concept from the Music Ontology.
  38.  *
  39.  * NOTE: a Track is an abstract concept - it is associated to MediaItems (as AudioFiles), but it's not a MediaItem.
  40.  *
  41.  * @stereotype  Datum
  42.  *
  43.  * @author  Fabrizio Giudici
  44.  *
  45.  **********************************************************************************************************************/
  46. public interface Track extends Entity, SourceAware, Identifiable
  47.   {
  48.     public static final Class<Track> _Track_ = Track.class;

  49.     /*******************************************************************************************************************
  50.      *
  51.      * A {@link Record} property that it's handy to have here. See {@link Record#getDiskNumber()}.
  52.      *
  53.      * @see Record#getDiskNumber()
  54.      *
  55.      * @return  the disk number
  56.      *
  57.      ******************************************************************************************************************/
  58.     @Nonnull
  59.     public Optional<Integer> getDiskNumber();

  60.     /*******************************************************************************************************************
  61.      *
  62.      * A {@link Record} property that it's handy to have here. See {@link Record#getDiskCount()}.
  63.      *
  64.      * @see Record#getDiskCount()
  65.      *
  66.      * @return  the disk count
  67.      *
  68.      ******************************************************************************************************************/
  69.     @Nonnull
  70.     public Optional<Integer> getDiskCount();

  71.     /*******************************************************************************************************************
  72.      *
  73.      * The position of this track in the containing record
  74.      *
  75.      * @return  the track position
  76.      *
  77.      ******************************************************************************************************************/
  78.     @Nonnull
  79.     public Optional<Integer> getTrackNumber();

  80.     /*******************************************************************************************************************
  81.      *
  82.      * The duration of this track
  83.      *
  84.      * @return  the duration
  85.      *
  86.      ******************************************************************************************************************/
  87.     @Nonnull
  88.     public Optional<Duration> getDuration();

  89.     /*******************************************************************************************************************
  90.      *
  91.      * Returns the {@link Metadata}.
  92.      *
  93.      * @return  the metadata
  94.      *
  95.      ******************************************************************************************************************/
  96.     @Nonnull
  97.     public Metadata getMetadata();

  98.     /*******************************************************************************************************************
  99.      *
  100.      * Returns the {@link Record} that contains this track
  101.      *
  102.      * @return  the record
  103.      *
  104.      ******************************************************************************************************************/
  105.     @Nonnull
  106.     public Optional<Record> getRecord();

  107.     /*******************************************************************************************************************
  108.      *
  109.      * Returns the {@link Performance} that this track is a recording of.
  110.      *
  111.      * @return  the performance
  112.      *
  113.      ******************************************************************************************************************/
  114.     @Nonnull
  115.     public Optional<Performance> getPerformance();
  116.   }