Package plugins.audioPlayer.javazoom.jlgui.player.amp.playlist

Examples of plugins.audioPlayer.javazoom.jlgui.player.amp.playlist.PlaylistItem


            popupFileInfo();
        }
        else if (cmd.equals(PlayerActionEvent.ACPLPLAY))
        {
            int n0 = playlist.getPlaylistSize();
            PlaylistItem pli = null;
            for (int i = n0 - 1; i >= 0; i--)
            {
                pli = playlist.getItemAt(i);
                if (pli.isSelected()) break;
            }
            // Play.
            if ((pli != null) && (pli.getTagInfo() != null))
            {
                player.pressStop();
                player.setCurrentSong(pli);
                playlist.setCursor(playlist.getIndex(pli));
                player.pressStart();
            }
        }
        else if (cmd.equals(PlayerActionEvent.ACPLREMOVE))
        {
            delSelectedItems();
        }
        else if (cmd.equals(PlayerActionEvent.ACPLADDFILE))
        {
            ui.getAcPlAddPopup().setVisible(false);
            ui.getAcPlAdd().setVisible(true);
            File[] file = FileSelector.selectFile(player.getLoader(), FileSelector.OPEN, true, config.getExtensions(), ui.getResource("playlist.popup.add.file"), new File(config.getLastDir()));
            if (FileSelector.getInstance().getDirectory() != null) config.setLastDir(FileSelector.getInstance().getDirectory().getPath());
            addFiles(file);
        }
        else if (cmd.equals(PlayerActionEvent.ACPLADDURL))
        {
            ui.getAcPlAddPopup().setVisible(false);
            ui.getAcPlAdd().setVisible(true);
            UrlDialog UD = new UrlDialog(config.getTopParent(), ui.getResource("playlist.popup.add.url"), player.getLoader().getLocation().x, player.getLoader().getLocation().y + player.getHeight(), null);
            UD.show();
            if (UD.getFile() != null)
            {
                PlaylistItem pli = new PlaylistItem(UD.getFile(), UD.getURL(), -1, false);
                playlist.appendItem(pli);
                resetScrollBar();
                repaint();
            }
        }
View Full Code Here


     * Display file info.
     */
    public void popupFileInfo()
    {
        int n0 = playlist.getPlaylistSize();
        PlaylistItem pli = null;
        for (int i = n0 - 1; i >= 0; i--)
        {
            pli = playlist.getItemAt(i);
            if (pli.isSelected()) break;
        }
        // Display Tag Info.
        if (pli != null)
        {
            TagInfo taginfo = pli.getTagInfo();
            TagInfoFactory factory = TagInfoFactory.getInstance();
            TagInfoDialog dialog = factory.getTagInfoDialog(taginfo);
            dialog.setLocation(player.getLoader().getLocation().x, player.getLoader().getLocation().y + player.getHeight());
            dialog.show();           
        }
View Full Code Here

    {
        int n0 = playlist.getPlaylistSize();
        if (n0 == 0) return;
        for (int i = 0; i < n0; i++)
        {
            PlaylistItem pli = playlist.getItemAt(i);
            if (pli == null) break;
            if (mode == -1)
            { // inverse selection
                pli.setSelected(!pli.isSelected());
            }
            else if (mode == 0)
            { // select none
                pli.setSelected(false);
            }
            else if (mode == 1)
            { // select all
                pli.setSelected(true);
            }
        }
        repaint();
    }
View Full Code Here

            for (int i = 0; i < file.length; i++)
            {
                String fsFile = file[i].getName();
                if ((!fsFile.toLowerCase().endsWith(ui.getResource("skin.extension"))) && (!fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.m3u"))) && (!fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.pls"))))
                {
                    PlaylistItem pli = new PlaylistItem(fsFile, file[i].getAbsolutePath(), -1, true);
                    playlist.appendItem(pli);
                    resetScrollBar();
                    repaint();
                }
            }
View Full Code Here

                {
                    if (fipopup != null) fipopup.show(this, x, y);
                }
                else
                {
                    PlaylistItem pli = playlist.getItemAt(index);
                    if (pli != null)
                    {
                        pli.setSelected(!pli.isSelected());
                        if ((evt.getClickCount() == 2) && (evt.getModifiers() == MouseEvent.BUTTON1_MASK))
                        {
                            player.pressStop();
                            player.setCurrentSong(pli);
                            playlist.setCursor(index);
View Full Code Here

            if (ff.isDirectory()) addMusicRecursive(ff, depth + 1);
            else
            {
                if (isMusicFile(list[i]))
                {
                    PlaylistItem pli = new PlaylistItem(list[i], rootDir + File.separator + list[i], -1, true);
                    playlist.appendItem(pli);
                }
            }
        }
    }
View Full Code Here

                String name = playlistName;
                if (!Config.startWithProtocol(playlistName))
                {
                    int indn = playlistName.lastIndexOf(java.io.File.separatorChar);
                    if (indn != -1) name = playlistName.substring(indn + 1);
                    PlaylistItem pli = new PlaylistItem(name, playlistName, -1, true);
                    playlist.appendItem(pli);
                    loaded = true;
                }
                else
                {
                    PlaylistItem pli = new PlaylistItem(name, playlistName, -1, false);
                    playlist.appendItem(pli);
                    loaded = true;
                }
            }
        }
View Full Code Here

                if (playlist != null)
                {
                    playlist.shuffle();
                    playlistUI.initPlayList();
                    // Play from the top
                    PlaylistItem pli = playlist.getCursor();
                    setCurrentSong(pli);
                }
            }
            else
            {
View Full Code Here

            }
            playerState = STOP;
        }
        if ((playerState == INIT) || (playerState == STOP) || (playerState == OPEN))
        {
            PlaylistItem pli = null;
            // Local File.
            if (modifiers == MouseEvent.BUTTON1_MASK)
            {
                File[] file = FileSelector.selectFile(loader, FileSelector.OPEN, false, config.getExtensions(), ui.getResource("button.eject.filedialog.filtername"), new File(config.getLastDir()));
                if (FileSelector.getInstance().getDirectory() != null) config.setLastDir(FileSelector.getInstance().getDirectory().getPath());
                if (file != null)
                {
                    String fsFile = file[0].getName();
                    if (fsFile != null)
                    {
                        // Loads a new playlist.
                        if ((fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.m3u"))) || (fsFile.toLowerCase().endsWith(ui.getResource("playlist.extension.pls"))))
                        {
                            if (loadPlaylist(config.getLastDir() + fsFile))
                            {
                                config.setPlaylistFilename(config.getLastDir() + fsFile);
                                playlist.begin();
                                playlistUI.initPlayList();
                                setCurrentSong(playlist.getCursor());
                                playlistUI.repaint();
                            }
                        }
                        else if (fsFile.toLowerCase().endsWith(ui.getResource("skin.extension")))
                        {
                            ui.setPath(config.getLastDir() + fsFile);
                            loadSkin();
                            config.setDefaultSkin(ui.getPath());
                        }
                        else pli = new PlaylistItem(fsFile, config.getLastDir() + fsFile, -1, true);
                    }
                }
            }
            // Remote File.
            else if (modifiers == MouseEvent.BUTTON3_MASK)
            {
                UrlDialog UD = new UrlDialog(config.getTopParent(), ui.getResource("button.eject.urldialog.title"), loader.getLocation().x, loader.getLocation().y + 10, config.getLastURL());
                UD.show();
                if (UD.getFile() != null)
                {
                    showTitle(ui.getResource("title.loading"));
                    // Remote playlist ?
                    if ((UD.getURL().toLowerCase().endsWith(ui.getResource("playlist.extension.m3u"))) || (UD.getURL().toLowerCase().endsWith(ui.getResource("playlist.extension.pls"))))
                    {
                        if (loadPlaylist(UD.getURL()))
                        {
                            config.setPlaylistFilename(UD.getURL());
                            playlist.begin();
                            playlistUI.initPlayList();
                            setCurrentSong(playlist.getCursor());
                            playlistUI.repaint();
                        }
                    }
                    // Remote file or stream.
                    else
                    {
                        pli = new PlaylistItem(UD.getFile(), UD.getURL(), -1, false);
                    }
                    config.setLastURL(UD.getURL());
                }
            }
            if ((pli != null) && (playlist != null))
View Full Code Here

     */
    protected void processPlay(int modifiers)
    {
        if (playlist.isModified()) // playlist has been modified since we were last there, must update our cursor pos etc.
        {
            PlaylistItem pli = playlist.getCursor();
            if (pli == null)
            {
                playlist.begin();
                pli = playlist.getCursor();
            }
View Full Code Here

TOP

Related Classes of plugins.audioPlayer.javazoom.jlgui.player.amp.playlist.PlaylistItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.