Package it.unipd.netmus.shared

Examples of it.unipd.netmus.shared.SongSummaryDTO


        List<String> playlists = new ArrayList<String>();
        for (PlaylistDTO tmp : current_user.getMusicLibrary().getPlaylists()) {
            int real_size = 0;
            for (String tmp2 : tmp.getSongList()) {
                SongSummaryDTO song = current_user.getMusicLibrary().getSongs()
                        .get(tmp2);
                if (song != null) {
                    if (!song.getTitle().equals("")) {
                        real_size++;
                    }
                }
            }
            playlists.add(tmp.getName() + " (" + real_size + ")");
View Full Code Here


        List<String> song_list = new ArrayList<String>();

        for (PlaylistDTO tmp : current_user.getMusicLibrary().getPlaylists()) {
            if (tmp.getName().equals(cleared_playlist_name)) {
                for (String tmp2 : tmp.getSongList()) {
                    SongSummaryDTO song = current_user.getMusicLibrary()
                            .getSongs().get(tmp2);
                    if (song != null) {
                        if (!song.getTitle().equals("")) {
                            song_list.add(song.getArtist());
                            song_list.add(song.getTitle());
                            song_list.add(song.getAlbum());
                        }
                    }
                }
            }
        }
View Full Code Here

            Map<String, SongSummaryDTO> songs = current_user.getMusicLibrary()
                    .getSongs();

            // caricamento dalla mappa della canzone selezionata
            final SongSummaryDTO current_song_summary_dto = songs
                    .get(FieldVerifier.generateSongId(title, artist, album));

            song_service_svc.getSongDTO(current_song_summary_dto,
                    new AsyncCallback<SongDTO>() {
                        @Override
View Full Code Here

        client_factory.getProfileView().startLoading();
        // sistemo subito il rating visivo poi arrivera' la library aggiornata
        client_factory.getProfileView().setRating(rate);
        client_factory.getProfileView().showStar(rate);

        SongSummaryDTO new_song_dto = new SongSummaryDTO(artist, title, album);

        song_service_svc.rateSong(current_user.getUser(), new_song_dto, rate,
                new AsyncCallback<Double>() {

                    @Override
                    public void onFailure(Throwable caught) {
                        client_factory.getProfileView().showError(
                                my_constants.rateSongError());
                        client_factory.getProfileView().stopLoading();
                    }

                    @Override
                    public void onSuccess(Double result) {
                        Map<String, SongSummaryDTO> songs = current_user
                                .getMusicLibrary().getSongs();
                        SongSummaryDTO song = songs.get(FieldVerifier
                                .generateSongId(title, artist, album));

                        song.setRatingForThisUser(rate);
                        song.setRating(result);
                        client_factory.getProfileView().showGlobalStar(result);

                        // Ricalcolo delle statistiche relative al rating delle
                        // canzoni del catalogo
                        List<String> song_statistics = calculateSongStatistics(current_user
View Full Code Here

    @Override
    public double setRating(String artist, String title, String album) {

        Map<String, SongSummaryDTO> songs = current_user.getMusicLibrary()
                .getSongs();
        SongSummaryDTO song = songs.get(FieldVerifier.generateSongId(title,
                artist, album));

        if (song != null) {
            client_factory.getProfileView().setRating(
                    song.getRatingForThisUser());
            client_factory.getProfileView().showStar(
                    song.getRatingForThisUser());
            client_factory.getProfileView().showGlobalStar(song.getRating());
            return song.getRating();
        } else {
            client_factory.getProfileView().showError(
                    my_constants.removeSongFromPlaylistError());
            return -1;
        }
View Full Code Here

            return;
        }

        Map<String, SongSummaryDTO> songs = current_user.getMusicLibrary()
                .getSongs();
        final SongSummaryDTO song = songs.get(FieldVerifier.generateSongId(
                title, artist, album));

        cover = "";

        song_service_svc.getCoverImage(song, new AsyncCallback<String>() {
View Full Code Here

            return;
        } else {
            Map<String, SongSummaryDTO> songs = current_user.getMusicLibrary()
                    .getSongs();
            final SongSummaryDTO current_song_summary_dto = songs.get(song_id);

            song_service_svc.getSongDTO(current_song_summary_dto,
                    new AsyncCallback<SongDTO>() {
                        @Override
                        public void onFailure(Throwable caught) {
View Full Code Here

        // artista preferito
        String preferred_artist = library.getPreferred_artist();

        // canzone più votata dall'utente
        String most_popular_song_for_this_user = "";
        SongSummaryDTO song = library.getSongs().get(
                library.getMostPopularSongForThisUser());
        if (song != null) {
            most_popular_song_for_this_user = song.getTitle() + " ("
                    + song.getArtist() + ")";
        } else {
            most_popular_song_for_this_user = my_constants
                    .noVoteForThisUserError();
        }

        // canzone più votata del catalogo
        String most_popular_song = "";
        song = library.getSongs().get(library.getMostPopularSong());
        if (song != null) {
            most_popular_song = song.getTitle() + " (" + song.getArtist() + ")";
        } else {
            most_popular_song = my_constants.noVoteError();
        }

        // Visualizzazione del pop-up delle statistiche
View Full Code Here

                                                .getSongs()
                                                .put(FieldVerifier.generateSongId(
                                                        tmp.getTitle(),
                                                        tmp.getArtist(),
                                                        tmp.getAlbum()),
                                                        new SongSummaryDTO(tmp
                                                                .getArtist(),
                                                                tmp.getTitle(),
                                                                tmp.getAlbum())) == null) {
                                            tmp_list.add(tmp.getArtist());
                                            tmp_list.add(tmp.getTitle());
View Full Code Here

     */
    private List<String> calculateSongStatistics(
            Map<String, SongSummaryDTO> all_songs_map) {
        client_factory.getProfileView().startLoading();

        SongSummaryDTO most_popular_song = null;
        SongSummaryDTO most_popular_song_for_this_user = null;
        double max1 = 0;
        int max2 = 0;

        for (SongSummaryDTO tmp : all_songs_map.values()) {
            if (tmp.getRating() > max1) {
                max1 = tmp.getRating();
                most_popular_song = tmp;
            }
            if (tmp.getRatingForThisUser() > max2) {
                max2 = tmp.getRatingForThisUser();
                most_popular_song_for_this_user = tmp;
            }
        }

        List<String> tmp = new ArrayList<String>(2);
        if (most_popular_song != null) {
            tmp.add(FieldVerifier.generateSongId(most_popular_song.getTitle(),
                    most_popular_song.getArtist(), most_popular_song.getAlbum()));
        } else {
            tmp.add("");
        }
        if (most_popular_song_for_this_user != null) {
            tmp.add(FieldVerifier.generateSongId(
                    most_popular_song_for_this_user.getTitle(),
                    most_popular_song_for_this_user.getArtist(),
                    most_popular_song_for_this_user.getAlbum()));
        } else {
            tmp.add("");
        }

        client_factory.getProfileView().stopLoading();
View Full Code Here

TOP

Related Classes of it.unipd.netmus.shared.SongSummaryDTO

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.