Package com.totalchange.jizz.data.entity

Examples of com.totalchange.jizz.data.entity.JizzSong


        return jizzDjDao.createOrUpdateDj(dj);
    }

    private JizzSong newSong(JizzStation station, JizzBroadcast broadcast,
            JizzDj dj) {
        JizzSong song = new JizzSong();
        song.setStation(station);
        song.setBroadcast(broadcast);
        song.setDj(dj);

        song.setArtist("Test");
        song.setTitle("Test");
        song.setMasterBlobRef("Test");
       
        Set<JizzSongEncoding> encodings = new HashSet<>();
        song.setEncodings(encodings);
       
        JizzSongEncoding encoding = new JizzSongEncoding();
        encoding.setSong(song);
        encoding.setFormat(JizzTrackAudioFormat.Format.MP3.name());
        encoding.setBitRateKbps(128);
View Full Code Here


                .createDefaultStation(jizzStationDao);

        JizzBroadcast broadcast = newBroadcast(station);
        JizzDj dj = newDj(station);

        JizzSong song1 = newSong(station, broadcast, dj);
        JizzSong song2 = newSong(station, broadcast, dj);

        JizzSong song = jizzSongJpaDao.findSongById(song1.getId());
        assertEquals(song1.getId(), song.getId());
       
        song = jizzSongJpaDao.findSongById(song2.getId());
        assertEquals(song2.getId(), song.getId());
    }
View Full Code Here

        JizzBroadcast broadcast2 = newBroadcast(station);

        JizzDj dj1 = newDj(station);
        JizzDj dj2 = newDj(station);

        JizzSong songB1D1 = newSong(station, broadcast1, dj1);
        JizzSong songB1D2 = newSong(station, broadcast1, dj2);
        JizzSong songB2D1 = newSong(station, broadcast2, dj1);
        JizzSong songB2D2 = newSong(station, broadcast2, dj2);

        List<JizzSong> songsB1 = jizzSongJpaDao
                .findSongsForBroadcast(broadcast1);
        assertContainsSongs(songsB1,
                new int[] { songB1D1.getId(), songB1D2.getId() });

        List<JizzSong> songsB2 = jizzSongJpaDao
                .findSongsForBroadcast(broadcast2);
        assertContainsSongs(songsB2,
                new int[] { songB2D1.getId(), songB2D2.getId() });

        List<JizzSong> songsB1D1 = jizzSongJpaDao.findSongsForBroadcast(
                broadcast1, dj1);
        assertContainsSongs(songsB1D1, new int[] { songB1D1.getId() });

        List<JizzSong> songsB1D2 = jizzSongJpaDao.findSongsForBroadcast(
                broadcast1, dj2);
        assertContainsSongs(songsB1D2, new int[] { songB1D2.getId() });

        List<JizzSong> songsB2D1 = jizzSongJpaDao.findSongsForBroadcast(
                broadcast2, dj1);
        assertContainsSongs(songsB2D1, new int[] { songB2D1.getId() });

        List<JizzSong> songsB2D2 = jizzSongJpaDao.findSongsForBroadcast(
                broadcast2, dj2);
        assertContainsSongs(songsB2D2, new int[] { songB2D2.getId() });
    }
View Full Code Here

        JizzBroadcast broadcast1 = newBroadcast(station);

        JizzDj dj1 = newDj(station);

        JizzSong song1 = newSong(station, broadcast1, dj1);
        JizzSong song2 = newSong(station, broadcast1, dj1);
        JizzSong song3 = newSong(station, broadcast1, dj1);
        JizzSong song4 = newSong(station, broadcast1, dj1);

        List<JizzSong> songs = jizzSongJpaDao.findSongsForBroadcast(broadcast1);
        assertContainsSongs(songs, new int[] { song1.getId(), song2.getId(),
                song3.getId(), song4.getId() });

        jizzSongJpaDao.deleteSong(song2);
        songs = jizzSongJpaDao.findSongsForBroadcast(broadcast1);
        assertContainsSongs(songs, new int[] { song1.getId(), song3.getId(),
                song4.getId() });
    }
View Full Code Here

        MockBroadcastStream bs = new MockBroadcastStream();
        for (int num = 0; num < numSourcesToCreate; num++) {
            JizzDj dj = new JizzDj();
            dj.setName("DJ Test" + (num + 1));

            JizzSong song = new JizzSong();
            song.setDj(dj);
            song.setArtist("Artist Test" + (num + 1));
            song.setTitle("Title Test" + (num + 1));

            bs.addSong(song);
        }
        return new BlockingBroadcastStream(bs);
    }
View Full Code Here

        // broadcast until at a later date add support for multiple formats.
        List<JizzSong> songs = jizzSongServices.getSongsForBroadcast(broadcast);

        JizzTrackAudioFormat format;
        if (songs.size() > 0) {
            JizzSong firstSong = songs.get(0);

            Iterator<JizzSongEncoding> encodings = firstSong.getEncodings()
                    .iterator();
            if (!encodings.hasNext()) {
                throw new RuntimeException("Song has no encodings");
            }
View Full Code Here

        JizzDj mockDj = new JizzDj();
        mockDj.setStation(mockStation);
        mockDj.setName("DJ Teste");
        mockDj.setEmail("test@test.com");

        JizzSong mockSong = new JizzSong();
        mockSong.setStation(mockStation);
        mockSong.setDj(mockDj);
        mockSong.setArtist("Spittle Donkey");
        mockSong.setTitle("Do the Monk Phat");

        for (Locale locale : Locale.getAvailableLocales()) {
            JizzEmailResponse response = renderer
                    .generateUnsupportedSongTypeEmail(locale, mockStation,
                            mockDj, mockSong);
View Full Code Here

    private JizzSong song;
    private JizzTrackAudioFormat format;

    OnHoldBroadcastStreamSource(JizzBroadcast broadcast,
            JizzTrackAudioFormat format) {
        song = new JizzSong();
        song.setArtist(broadcast.getStation().getName());
        song.setTitle("Broadcast starts at " + broadcast.getActualStart());

        this.format = format;
    }
View Full Code Here

    }

    public JizzSong encodeSong(int songId) throws FatalTaskException {
        logger.trace("Task utility encoding song with id {}", songId);

        JizzSong song = jizzSongServices.findSongById(songId);
        if (song == null) {
            throw new FatalTaskException("Cannot execute song encoding task "
                    + ": Song with ID " + songId + " could not be found");
        }

        return jizzSongServices.encodeSong(song.getStation(), song);
    }
View Full Code Here

        logger.trace("Committing blob for song");
        String blobId = blob.commit();

        logger.trace("Persisting new song instance");
        JizzSong song = new JizzSong();
        song.setStation(station);
        song.setDj(dj);
        song.setBroadcast(broadcast);
        song.setMasterBlobRef(blobId);

        song = jizzSongDao.createOrUpdateSong(song);

        // Now the song is safely persisted, look up its metadata (e.g. in an
        // id3 tag in the song stream)
View Full Code Here

TOP

Related Classes of com.totalchange.jizz.data.entity.JizzSong

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.