Package com.groovesquid.model

Examples of com.groovesquid.model.Song


        downloadTable.getSelectionModel().clearSelection();
    }
   
   
    public void play(List<Song> songs) {
        final Song song = songs.get(0);
        Track track = Services.getPlayService().getCurrentTrack();
       
        if(track != null && track.getSong().equals(song) && Services.getPlayService().isPaused()) {
            Services.getPlayService().resume();
        } else {
View Full Code Here


        if (addMode == AddMode.REPLACE) {
            clearPlaylist();
        }
        int insertIdx = (addMode == AddMode.LAST ? playlist.size() : currentSongIndex + 1);
        for (int i = 0; i < songs.size(); i++) {
            Song song = songs.get(i);
            log.info("adding: " + song);
            if (insertIdx <= playlist.size()) {
                playlist.add(insertIdx, song);
            } else {
                insertIdx = playlist.indexOf(song);
            }
            if (i == 0 && (addMode == AddMode.NOW || addMode == AddMode.REPLACE)) {
                currentSongIndex = insertIdx;
            }
            insertIdx++;
        }
        if (addMode == AddMode.NOW || addMode == AddMode.REPLACE) {
            Song song = songs.get(0);
            stopPlaying();
            startPlaying(song, 0, 0);
        }
    }
View Full Code Here

    }

    public synchronized void play() {
        if (currentSongIndex < 0 && !playlist.isEmpty())
            currentSongIndex = 0;
        Song currentSong = getCurrentSong();
        if (currentSong != null) {
            log.info("starting: " + currentSong);
            startPlaying(currentSong, 0, 0);
        } else {
            log.info("no current song");
View Full Code Here

            log.info("no current song");
        }
    }

    public synchronized void stop() {
        Song currentSong = getCurrentSong();
        if (currentSong != null) log.info("stopping: " + currentSong);
        stopPlaying();
    }
View Full Code Here

        if (currentSong != null) log.info("stopping: " + currentSong);
        stopPlaying();
    }

    public synchronized void skipForward() {
        Song currentSong = getCurrentSong();
        if (currentSong != null) log.info("stopping because of skip: " + currentSong);
        stopPlaying();
        skipToNext();
    }
View Full Code Here

        stopPlaying();
        skipToNext();
    }

    public synchronized void skipBackward() {
        Song currentSong = getCurrentSong();
        if (currentSong != null) log.info("stopping because of skip: " + currentSong);
        stopPlaying();
        skipToPrevious();
    }
View Full Code Here

        stopPlaying();
        skipToPrevious();
    }

    public synchronized void pause() {
        Song currentSong = getCurrentSong();
        if (currentSong != null && !playThread.isStopForced()) {
            log.info("pausing: " + currentSong);
            pausedAudioPosition = playThread.getCurrentPosition();
            pausedFrame = playThread.forceStop();
            try {
View Full Code Here

            log.info(currentSong);
        }
    }

    public synchronized void resume() {
        Song currentSong = getCurrentSong();
        if (currentSong != null && pausedFrame != -1) {
            log.info("resuming from frame: " + pausedFrame + ", audioPosition: " + pausedAudioPosition + ": " + currentSong);
            startPlaying(currentSong, pausedFrame, pausedAudioPosition);
            pausedFrame = -1;
        }
View Full Code Here

            return;
        if (songIndex < 0 || songIndex >= playlist.size()) {
            log.error("playSong: index out of bounds: " + songIndex + "; must be in range [0," + playlist.size() + ")");
            return;
        }
        Song currentSong = getCurrentSong();
        if (currentSong != null)
            log.info("stopping because of song index change to " + songIndex + ": " + currentSong);
        stopPlaying();
        currentSongIndex = songIndex;
        currentSong = getCurrentSong();
View Full Code Here

    }

    private void skipToNext() {
        if (currentSongIndex < playlist.size() - 1) {
            currentSongIndex++;
            Song currentSong = getCurrentSong();
            log.info("skipping forward to: " + currentSong);
            startPlaying(currentSong, 0, 0);
        } else {
            log.info("skipped beyond end of playlist");
            if (radio) {
View Full Code Here

TOP

Related Classes of com.groovesquid.model.Song

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.