⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3infos.java

📁 eclise rcp 项目,是非常好的学习源码
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2007 Siemens AG
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Kai T鰀ter - initial API and implementation
 *******************************************************************************/

package com.siemens.ct.mp3m.model;

import java.util.ArrayList;
import java.util.List;

import com.siemens.ct.mp3m.model.logical.Artists;

/**
 * A simple List of MP3s
 */
public class MP3Infos {
    private static List<IMP3Info> list = new ArrayList<IMP3Info>();

    /*
    public MP3Infos() {
        list = new ArrayList<IMP3Info>();
        
        // Test data
        IMP3Info info = MP3InfoProviderFactory.getInstance().getMP3Info();
        info.setMP3File("E:/music/Philippe Saisse/Halfway 'til Dawn/01 - Fusionesque.mp3");
        addMP3Info(info);
        
        info = MP3InfoProviderFactory.getInstance().getMP3Info();
        info.setMP3File("E:/music/Philippe Saisse/Halfway 'til Dawn/02 - The Girl With Botticelli Eyes.mp3");
        addMP3Info(info);
        
        info = MP3InfoProviderFactory.getInstance().getMP3Info();
        info.setMP3File("E:/kai/music/queen/A Kind Of Magic/01 - Queen (A Kind Of Magic) One Vision.mp3");
        addMP3Info(info);
    }
    */
    
    public static void addMP3Info(IMP3Info info) {
        list.add(info);
    }

    public static void addMP3File(String fullPath) {
        IMP3Info info = MP3InfoProviderFactory.getInstance().getMP3Info();
        info.setMP3File(fullPath);
        addMP3Info(info);
        Artists.addMP3Info(info);
    }

    public static List<IMP3Info> getMP3Infos() {
        return list;
    }

    public static IMP3Info getMP3Info(String fullPath) {
        for(IMP3Info info: list){
        	if(info.getMP3File().equals(fullPath)) {
        		return info;
        	}
        }
        return null;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -