Class BeaTunes

    • Field Detail

      • BEATUNES_PROPERTIES

        public static BeaTunesProperties BEATUNES_PROPERTIES
        Essential properties (special folders, user-agent, ...).
      • DEFAULT_LOCALE

        public static final Locale DEFAULT_LOCALE
      • STRINGS_LOCALE

        public static final Locale STRINGS_LOCALE
      • REQUIRED_ITUNES_VERSION

        public static final Version REQUIRED_ITUNES_VERSION
    • Constructor Detail

      • BeaTunes

        public BeaTunes()
        Constructor.
    • Method Detail

      • play

        public void play​(AudioSongLocation location)
        Start playing the given file/resource.
        Parameters:
        location - location describing a file/stream or a playlist
      • isEarlyAccess

        public static boolean isEarlyAccess()
        Are we in early-access mode?
        Returns:
        true or false
      • getResource

        public URL getResource​(String resourceName)
        Resolves a resource name to a URL. If a Theme is set, the theme is asked first to resolve it. If that fails the resource is resolved relative to the BeaTunes class.
        Parameters:
        resourceName - resource name
        Returns:
        resource url or null
        See Also:
        Class.getResource(String), Theme.getResource(String)
      • getImage

        public static Image getImage​(String resourceName)
        Loads an image from BeaTunes's package (or the resource folder in a Mac App Bundle).
        Parameters:
        resourceName - resource name
        Returns:
        image, if found
      • getIcon

        public Icon getIcon​(PlayList playList)
        Provides a PlayList icon.
        Parameters:
        playList - playlist
        Returns:
        icon
      • getSmallIcon

        public Icon getSmallIcon​(PlayList playList)
        Provides a small PlayList icon.
        Parameters:
        playList - playlist
        Returns:
        icon
      • getLightnessAdjustedIcon

        public Icon getLightnessAdjustedIcon​(PlayList playList)
        Provides a PlayList icon that has been adjusted to the theme's lightness.
        Parameters:
        playList - playlist
        Returns:
        icon
        See Also:
        Theme.isLight()
      • getLightnessAdjustedSmallIcon

        public Icon getLightnessAdjustedSmallIcon​(PlayList playList)
        Provides a PlayList icon that has been adjusted to the theme's lightness.
        Parameters:
        playList - playlist
        Returns:
        icon
        See Also:
        Theme.isLight()
      • getGrayIcon

        public Icon getGrayIcon​(String resourceName)
        Uses getResource(String) to look up an ImageIcon and transform it to gray.
        Parameters:
        resourceName - resource name
        Returns:
        Icon or null if the resource can't be found
      • getDisabledIcon

        public Icon getDisabledIcon​(String resourceName)
        Uses getResource(String) to look up an ImageIcon and transform it to a light gray.
        Parameters:
        resourceName - resource name
        Returns:
        Icon or null if the resource can't be found
      • getNegativeIcon

        public Icon getNegativeIcon​(String resourceName)
        Uses getResource(String) to look up an ImageIcon and transform it to an inverted (negative) version.
        Parameters:
        resourceName - resource name
        Returns:
        Icon or null if the resource can't be found
      • getIcon

        public static Icon getIcon​(String resourceName,
                                   Theme theme)
        Parameters:
        resourceName - resource name
        Returns:
        Icon or null if the resource can't be found
      • getIcon

        public Icon getIcon​(String resourceName)
        Uses getResource(String) to look up an ImageIcon.
        Parameters:
        resourceName - resource name
        Returns:
        Icon or null if the resource can't be found
      • getTheme

        public Theme getTheme()
        Get the UI customization theme.
        Returns:
        theme
        See Also:
        setTheme(Theme)
      • addShutdownHook

        public void addShutdownHook​(Callable<Boolean> shutdownHook)
        Allows you to register some code that is to be executed before the actual shut down of the software.
        Parameters:
        shutdownHook - callable that returns a boolean - true, if the shut down should continue, false, if the shut down should be aborted.
      • getUserId

        public static long getUserId()
        Persistent and unique user id.
        Returns:
        id
      • getVersion

        public static String getVersion()
        beaTunes version (see Timestamp.V).
        Returns:
        version string
      • getMajorVersion

        public static int getMajorVersion()
        Major application version. For beaTunes 4.5.6, this method would return 4.
        Returns:
        major version
      • getMinorVersion

        public static int getMinorVersion()
        Minor application version. For beaTunes 4.5.6, this method would return 5.
        Returns:
        minor version
      • getMicroVersion

        public static int getMicroVersion()
        Minor application version. For beaTunes 4.5.6, this method would return 6.
        Returns:
        micro version
      • getBuildDate

        public static long getBuildDate()
        Returns the build date in ms since 1970.
        Returns:
        build date in ms since 1970
      • getRName

        public static String getRName()
      • getREmail

        public static String getREmail()
      • getRKey

        public static String getRKey()
      • getPlayer

        public PlayListPlayer getPlayer()
        Current playlist player.
        Returns:
        current player of this instance of beaTunes.
      • setPlayer

        public void setPlayer​(PlayListPlayer player)
        Sets a new playlist player.
        Parameters:
        player - player, must not be null
      • getLocale

        public Locale getLocale()
        The application locale. This means the language the UI is localized to, not the system default locale.
        Returns:
        current application locale
      • setLocale

        public void setLocale​(Locale locale)
        Sets the application locale.
        Parameters:
        locale - locale
      • loadPreferences

        public void loadPreferences()
        Re-loads the application component's preferences.
        See Also:
        ConfigurableComponent
      • storePreferences

        public void storePreferences()
        Stores the application component's preferences asynchronously.
        See Also:
        ConfigurableComponent
      • getPluginManager

        public PluginManager<BeaTunes> getPluginManager()

        Provides access to all dynamically loaded components. See PluginManager for details.

        As an example, to access the LastFM component/plugin, simply call getPluginManager().getImplmentation(LastFM.class).

        Returns:
        plugin manager
        See Also:
        getActionManager()
      • getAnalysisQueue

        public AnalysisQueue getAnalysisQueue()
        The AnalysisQueue is the central component for queue based analysis of songs.
        Returns:
        queue
      • getTunes

        public ITunes getTunes()
        Remote access to the ITunes applications.
        Returns:
        iTunes application
      • getAmazon

        public Amazon getAmazon()

        Component that allows accessing Amazon. This is basically the same as calling:

        getPluginManager().getImplementation(Amazon.class);
        Returns:
        amazon
      • getiTunesMusicLibrary

        @Deprecated
        public MediaLibrary getiTunesMusicLibrary()
        Deprecated.
        Access to beaTunes' central internal database. Changes may be propagated transparently to iTunes or the file system. Use getMediaLibrary() instead.
        Returns:
        library
      • getMediaLibrary

        public MediaLibrary getMediaLibrary()
        Access to beaTunes' central internal database. Changes may be propagated transparently to iTunes or the file system.
        Returns:
        library
      • getMainWindow

        public MainWindow getMainWindow()
        Returns beaTunes' main application window, which provides access to other (visual) sub-components.
        Returns:
        main window
      • main

        public static void main​(String[] args)
                         throws IOException
        Starts this application in the Swing UI thread. Potential arguments are interpreted as audio files that should be played.
        Parameters:
        args - audio files that should be played
        Throws:
        IOException
      • x

        public boolean x()
      • getRemainingTrialDays

        public int getRemainingTrialDays()
      • getNewPlaylistParentId

        public long getNewPlaylistParentId()
      • handleOutOfMemoryError

        public static void handleOutOfMemoryError​(OutOfMemoryError e)
        React to OutOfMemoryError, i.e. logging etc.
        Parameters:
        e - OutOfMemoryError
      • handleOutOfMemoryError

        public static void handleOutOfMemoryError()
        React to OutOfMemoryError, i.e. logging etc. Heap memory correction.