Examples of ISong


Examples of huu.phong.musiconline.model.ISong

     
      public void actionPerformed(ActionEvent arg0) {
        if (frameLyric == null) frameLyric = new FrameLyric();
        new Thread(){
          public void run(){
            ISong song = configure.songs.get(songs.getSelectedIndex());
            frameLyric.setTitle("Lyric - " + song.getFullTitle());
            frameLyric.setLyric(song);
          }
        }.start();
        frameLyric.setVisible(true);
      }
View Full Code Here

Examples of huu.phong.musiconline.model.ISong

          int[] lists = songs.getSelectedIndices();
          setStatus("SAVING");
          out.write("#EXTM3U");
          out.newLine();
          for (int i = 0; i < lists.length; i++) {
            ISong song = listSongs.get(lists[i]);
            out.write("#EXTINF:-1," + song.getTitle());
            out.newLine();
            out.write(song.getDirectLink(configure.format));
            out.newLine();
            setStatus("SAVING: " + (i + 1) + "/" + lists.length);
          }
          out.flush();
          out.close();
View Full Code Here

Examples of huu.phong.musiconline.model.ISong

          List<ISong> listSongs = configure.songs;
          BufferedWriter out = new BufferedWriter(new FileWriter(str));
          int[] lists = songs.getSelectedIndices();
          setStatus("SAVING");
          for (int i = 0; i < lists.length; i++) {
            ISong song = listSongs.get(lists[i]);
            out.write(song.getDirectLink());
            out.newLine();
            setStatus("SAVING: " + (i + 1) + "/" + lists.length);
          }
          out.flush();
          out.close();
View Full Code Here

Examples of huu.phong.musiconline.model.ISong

          public void progressing(int length, int offset) {
            setStatus(offset * 100 / length + " % | " + builder.toString());
          }
        };
        for (i = 0; i < lists.length; i++) {
          ISong song = listSongs.get(lists[i]);
          String extension = configure.format.equals(Format.LOSSLESS) ? ".flac" : ".mp3";
          String file = dir + File.separator + Utils.toANSI(song.getFullTitle()) + extension;
          info.setToolTipText(String.format("<html><b>Saving file %s</b></html>", file));
          if(new File(file).exists() || song.getDirectLinks() == null) continue;
          try {
            FileUtils.songToFile(song, new File(file), streaming);
          } catch (Exception e) {
            out.println(String.format("Can not save link %s", song.getDirectLinks()));
          }
          builder.delete(0, builder.length());
          builder.append(String.format("%d / %d", i + 1, lists.length));
        }
        setStatus(String.format("SAVED: %d / %d", i, lists.length));
View Full Code Here

Examples of huu.phong.musiconline.model.ISong

 
  private void play(int index){
    if (configure.songs.isEmpty() || index >= configure.songs.size()) return;
    currentIndex = index;
    setCurrentSong(index);
    ISong song = configure.songs.get(currentIndex);
    currentTitle = song.getTitle();
    try {
      if (configure.defaultMediaPlayer == null || configure.defaultMediaPlayer.equals("")
          || !(new File(configure.defaultMediaPlayer).exists())) {
        setTitle("Getting: '" + currentTitle +"'...");
        player.play(song);
      } else {
        setTitle("Sending: '" + currentTitle + "'...");
        runtime.exec(configure.defaultMediaPlayer + " " + song.getDirectLink(configure.format));
        setTitle("Sended '" + song.getTitle() + "' - " + configure.title);
      }
    } catch (Exception e) {
      setTitle(e.toString());
      e.printStackTrace();
    }
View Full Code Here

Examples of huu.phong.musiconline.model.ISong

      updateSong();
    }
    if (frameLyric != null && frameLyric.isVisible()){
      new Thread(){
        public void run(){
          ISong song = configure.songs.get(index);
          frameLyric.setTitle("Lyric - " + song.getTitle());
          frameLyric.setLyric(song);
        }
      }.start();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.