Package com.tulskiy.musique.audio.player

Examples of com.tulskiy.musique.audio.player.Player


        return null;
    }

    public String playingTime(Track track, ArrayList<Expression> args) {
        Player player = app.getPlayer();
        if (player.isPlaying()) {
            return Util.samplesToTime(player.getCurrentSample(), player.getTrack().getTrackData().getSampleRate(), 0);
        } else {
            return null;
        }
    }
View Full Code Here


                if (index != -1)
                    table.setRowSelectionInterval(index, index);
            }
        }

        final Player player = app.getPlayer();

        final Timer update = new Timer(1000, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (player.isPlaying()) {
                    PlaylistTable table = tabs.getSelectedTable();
                    if (table != null) {
                        int index = table.getPlaylist().indexOf(player.getTrack());
                        ((AbstractTableModel) table.getModel()).fireTableRowsUpdated(index, index);
                    }
                }
            }
        });

        player.addListener(new PlayerListener() {
            @Override
            public void onEvent(PlayerEvent e) {
                Track track = player.getTrack();
                if (track != null && track.getTrackData().isStream()) {
                    update.start();
                } else {
                    update.stop();
                }
View Full Code Here

            public void actionPerformed(ActionEvent e) {
                playlistTable.runAction("playSelected");
            }
        });

        final Player player = Application.getInstance().getPlayer();
        table.getActionMap().put("enqueue", new AbstractAction("Add to Queue  ") {
            @Override
            public void actionPerformed(ActionEvent e) {
                for (Track track : table.getSelectedSongs()) {
                    PlaybackOrder order = player.getPlaybackOrder();
                    order.enqueue(track, playlist);
                }
                table.update();
                playlistTable.update();
            }
View Full Code Here

    public LyricsPanel() {
        setLayout(new BorderLayout());
        final JTextPane textPane = new TextPane();

        final Player player = app.getPlayer();
        timer = new Timer(200, new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                Track track = player.getTrack();

                try {
                    textPane.setText("");
                    StyledDocument doc = textPane.getStyledDocument();
                    doc.insertString(doc.getLength(), track.getTrackData().getArtist() + "\n", textPane.getStyle("artist"));
                    doc.insertString(doc.getLength(), track.getTrackData().getTitle() + "\n\n", textPane.getStyle("title"));
                } catch (BadLocationException e1) {
                    e1.printStackTrace();
                }

                if (search != null && !search.isDone())
                    search.cancel(true);

                search = new Search(textPane, track);
                search.execute();
                timer.stop();
            }
        });

        player.addListener(new PlayerListener() {
            @Override
            public void onEvent(PlayerEvent e) {
                switch (e.getEventCode()) {
                    case FILE_OPENED:
                        timer.restart();
View Full Code Here

        if (configuration.getBoolean("system.oneInstance", false)
                && !tryLock()) {
            JOptionPane.showMessageDialog(null, "Only one instance of Musique can be run at a time", VERSION, JOptionPane.ERROR_MESSAGE);
            System.exit(0);
        }
        player = new Player();
        Scrobbler scrobbler = new Scrobbler();
        scrobbler.start();

        playlistManager = new PlaylistManager();
        playlistManager.loadPlaylists();
View Full Code Here

                    track = (Track) evt.getNewValue();
                    timer.restart();
                }
            }
        });
        final Player player = app.getPlayer();
        player.addListener(new PlayerListener() {
            @Override
            public void onEvent(PlayerEvent e) {
                if (nowPlayingOnly && e.getEventCode() == PlayerEvent.PlayerEventCode.FILE_OPENED) {
                    track = player.getTrack();
                    timer.restart();
                }
            }
        });
View Full Code Here

TOP

Related Classes of com.tulskiy.musique.audio.player.Player

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.