Package ID3Editor

Source Code of ID3Editor.FileEditor

package ID3Editor;

import jMp3Tag.Tag;

import java.io.*;

import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.TextField;

public class FileEditor extends Form {
  Tag t = null;
  public FileEditor(String title) {
    super(title);
    t = new Tag(title);
    try {
      t.Read();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    this.append(new TextField("Titulo", t.getTitile(), 30, TextField.ANY));
    this.append(new TextField("Album", t.getAlbum(), 30, TextField.ANY));
    this.append(new TextField("Compositor", t.getComposer(), 30, TextField.ANY));
    this.append(new TextField("Artista", t.getArtist(), 30, TextField.ANY));
    this.append(new TextField("A�o", t.getYear(), 4, TextField.ANY));
  }
 
  public void saveTag(){
    System.out.println("Comienza guadado");
    TextField text;
    text = (TextField)this.get(0);
    t.setTitile(text.getString());
    System.out.println("Title <= " + text.getString());
   
    text = (TextField)this.get(1);
    t.setAlbum(text.getString());
    System.out.println("Album <= " + text.getString());
   
    text = (TextField)this.get(2);
    t.setComposer(text.getString());
    System.out.println("Composer <= " + text.getString());
   
    text = (TextField)this.get(3);
    t.setArtist(text.getString());
    System.out.println("Artist <= " + text.getString());
   
    text = (TextField)this.get(4);
    t.setYear(text.getString());
    System.out.println("Year <= " + text.getString());
   
    try {
      t.Save(true);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}
TOP

Related Classes of ID3Editor.FileEditor

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.