Package us.jyg.freshet.dao.model

Examples of us.jyg.freshet.dao.model.Song


                    log.error("Song manager is null!");
                    keepGoing = false;
                }
                while (keepGoing) {
                    if (songQ.isEmpty()) {
                        Song s = songManager.getRandomSong(lock);
                        if (s == null) {
                            log.info("No song for randomizer. Waiting a sec, maybe the database is building. ");
                            try {
                                Thread.sleep(1000);
                            } catch (InterruptedException iE) {
View Full Code Here


                            while( (f=miner.next()) != null) {
                                if (f.getName().matches(".*[mM][pP]3")) {
                                    if (!finalSongManager.songIsInDb(f)) {
                                        try {
                                            SongData songData = new SongData(f);
                                            Song song = finalSongManager.saveSong(songData);
                                            log.debug("Added: " + song.getName() + " ("+song.getId() +")"+
                                                    ", " + song.getAlbum().getName() +
                                                    ", " + song.getArtist().getName() +
                                                    ", " + song.getGenre().getName());
                                        } catch (SongDataException sdE) {
                                            log.error("Could not process file: " +f.getAbsolutePath() + ": "+ sdE.getMessage());
                                        } catch (Exception e) {
                                            log.error("Generic exception while building database: ", e);
                                        }
View Full Code Here

    if (q.size() > 0) {
      qs = (QSong)q.get(0);
      q.remove(0);
    }
    currentlyPlaying = qs;
    Song s = null;
    if (qs != null) {
      // add this song to the song history list
      history.add(0, qs);
      if (history.size() > Constants.SONGQ_MAX_HISTORY)
        history.remove(history.size()-1);
View Full Code Here

   * Get the last song given by <code>next()</code>, a.k.a the currently playing
   * song (or last played song if none is currently playing)
   * @return the last song taken from the queue
   */
   public Song getCurrentlyPlayingSong() {
     Song song = null;
     if (currentlyPlaying != null)
       song = currentlyPlaying.getSong();
     return song;
   }
View Full Code Here

   */
  public List getHistory() {
    List<Song> songs = new ArrayList<Song>();
    for (Iterator i=history.iterator(); i.hasNext();) {
      QSong qSong = (QSong)i.next();
      Song song = qSong.getSong();
      songs.add(song);
    }
    return songs;
  }
View Full Code Here

  public void flush() {
    q = new ArrayList<QSong>();
    }

    public void insertSong(int songId, int position, String username) {
        Song s = songManager.getSong(songId);
        insertSong(s, position, username);
    }
View Full Code Here

      } catch (InterruptedException iE) {
        log.error("Empty stack sleeper woken up... weird.");
      }
    }
   
    Song s = (Song)(songQ.next());
    try {
      String path = s.getPath();


      try {
        // make sure these things are set
        recoderCmdLine = System.getProperty("freshet.recoder.cmdLine");
View Full Code Here

    File f;
    while( (f=miner.next()) != null) {
      try {
        if (f.getName().matches(".*[mM][pP]3")) {
          SongData songData = new SongData(f);
          Song song = songManager.saveSong(songData);
          log.debug("Saved: " + song.getName() + " ("+song.getId() +")"+
              ", " + song.getAlbum().getName() + "("+song.getAlbum().getId()+")"+
              ", " + song.getArtist().getName() "("+song.getArtist().getId()+")"+
              ", " + song.getGenre().getName() + "("+song.getGenre().getId()+")" );
        }
      } catch (SongDataException sdE) {
        log.error("Could not process file: " +f.getAbsolutePath());
      }
    }
View Full Code Here

   
    public void testGetSongs() {
      log.debug("=============================================================");
      List songs = songManager.getSongs();
      for (Iterator itr=songs.iterator(); itr.hasNext();) {
        Song song = (Song)itr.next();
        log.debug(song.getName() + " ("+song.getId() +")"+
            ", " + song.getAlbum().getName() +
            ", " + song.getArtist().getName() +
            ", " + song.getGenre().getName())
      }
      log.debug("=============================================================");
    }
View Full Code Here

 
  public void setBrowseArtistDisplay(FreshetForm ff, User user) {
    log.debug("entering setBrowseArtistDisplay");
    Integer artistId = new Integer(ff.getBrowseId());
    ff.setBrowseArtist(artistManager.getArtist(artistId));
    Song song0 = (Song)songManager.getSongs(ff.getBrowseArtist()).get(0);
    ff.setBrowseGenre(song0.getGenre());
    ff.setBrowseItems(new ArrayList<SongAttribute>(albumManager.getAlbumsbyArtist(artistId)));
    ff.setBrowseType(Constants.BROWSE_ARTIST);
        ff.setUser((user==null)?new Guest():user);
        ff.setNextBrowseType(Constants.BROWSE_ALBUM);
  }
View Full Code Here

TOP

Related Classes of us.jyg.freshet.dao.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.