Android Open Source - musicpractice Song Content






From Project

Back to project page musicpractice.

License

The source code is released under:

Apache License

If you think the Android project musicpractice listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package us.marsware.musicpractice.Util;
/*  w w w. ja v  a 2 s.c  o m*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SongContent {

    /**
     * An array of song items.
     */
    public static List<SongItem> ITEMS = new ArrayList<SongItem>();

    /**
     * A map of song items, by ID.
     */
    public static Map<String, SongItem> ITEM_MAP = new HashMap<String, SongItem>();

    static {
        // Add 3 sample items.
        addItem(new SongItem("1", "Snare Drum", "Seven Nation Army", "Dallas C. Burke", "\\sdcard\\0\\.mars\\MusicPractice\\artwork\\sevennationarmy.png", "4/4", "C", 144));
        addItem(new SongItem("2", "Snare Drum", "Land of 1000 Dances", "Dallas C. Burke", "\\sdcard\\0\\.mars\\MusicPractice\\artwork\\landof1000dances.png", "4/4", "C", 144));
        addItem(new SongItem("3", "Snare Drum", "Crazy Train", "Dallas C. Burke", "\\sdcard\\0\\.mars\\MusicPractice\\artwork\\crazytrain.png", "4/4", "C", 144));
    }

    private static void addItem(SongItem item) {
        ITEMS.add(item);
        ITEM_MAP.put(item.id, item);
    }

    /**
     * A SongItem contains all of the information about the songs.
     */
    public static class SongItem {
        public String id;
        public String part;
        public String title;
        public String arranger;
        public String photoPath;
        public String timeSig;
        public String keySig;
        public Integer bpm;

        public SongItem(String id, String part, String title, String arranger, String photoPath, String timeSig, String keySig, Integer bpm) {
            this.id = id;
            this.part = part;
            this.title = title;
            this.arranger = arranger;
            this.photoPath = photoPath;
            this.timeSig = timeSig;
            this.keySig = keySig;
            this.bpm = bpm;
        }

        @Override
        public String toString() {
            return title;
        }
    }
}




Java Source Code List

us.marsware.musicpractice.SongDetailActivity.java
us.marsware.musicpractice.SongDetailFragment.java
us.marsware.musicpractice.SongListActivity.java
us.marsware.musicpractice.SongListFragment.java
us.marsware.musicpractice.Util.SongContent.java