Search in sources :

Example 1 with MusicList

use of main.music.entity.MusicList in project Eidolons by IDemiurge.

the class MC_ControlPanel method doFind.

public static void doFind(boolean alt) {
    String name = DialogMaster.inputText("Query...");
    MusicList list = MusicCore.findList(name);
    if (alt) {
        List<MusicList> musicLists = MusicCore.getMusicLists();
        Collection<MusicList> lists = new EntityFilter<>(musicLists, G_PROPS.NAME.toString(), name, AT_OBJ_TYPE.MUSIC_LIST, true).filter();
        name = ListChooser.chooseString(DataManager.toStringList(lists));
        list = MusicCore.findList(name);
    // choose
    } else {
    // list.play();
    }
    // list.getMouseListener().getClickMode()
    list.getMouseListener().handleClick(0, CLICK_MODE.PLAY);
// getOrCreate path for name
// add to selected?
// replace selected
// multiple results
}
Also used : MusicList(main.music.entity.MusicList)

Example 2 with MusicList

use of main.music.entity.MusicList in project Eidolons by IDemiurge.

the class M3uGenerator method repairM3uLists.

public static void repairM3uLists() {
    List<MusicList> lists = new ListObjChooser<MusicList>().selectMulti(MusicCore.getMusicLists());
    for (MusicList list : lists) {
        List<Track> tracks = list.getTracks();
        List<Track> cleanTracks = new ListMaster<Track>().getRemovedDuplicates(tracks);
        List<Track> differingElements = new ListMaster<Track>().getDifferingElements(tracks, cleanTracks);
        LogMaster.log(1, list + " has differingElements " + differingElements);
        LogMaster.log(1, list + " Clean Tracks: " + cleanTracks);
        list.setTracks(cleanTracks);
        MusicCore.saveList(list);
    }
}
Also used : MusicList(main.music.entity.MusicList) Track(main.music.entity.Track)

Example 3 with MusicList

use of main.music.entity.MusicList in project Eidolons by IDemiurge.

the class MusicCore method findList.

public static MusicList findList(String name) {
    // String list = new SearchMaster<String>().find(name,
    // listTypeMap.keySet());
    // if (list == null)
    // list = new SearchMaster<String>().findClosest(name,
    // listTypeMap.keySet());
    ObjType type = DataManager.findType(name, AT_OBJ_TYPE.MUSIC_LIST);
    MusicList list = getList(type.getName());
    if (list == null) {
        list = new MusicList(type);
    }
    return list;
}
Also used : ObjType(main.entity.type.ObjType) MusicList(main.music.entity.MusicList)

Example 4 with MusicList

use of main.music.entity.MusicList in project Eidolons by IDemiurge.

the class MusicCore method getList.

public static MusicList getList(String name, String keyPart, String funcPart) {
    MusicList list = listTypeMap.get(name);
    if (list != null) {
        return list;
    }
    ObjType type = DataManager.getOrAddType(name, AT_OBJ_TYPE.MUSIC_LIST);
    // DataManager.ge
    String tracks = getTrackStringFromList(funcPart);
    type.setProperty(AT_PROPS.TRACKS, tracks);
    type.setProperty(AT_PROPS.PATH, funcPart);
    type.setProperty(G_PROPS.HOTKEY, keyPart);
    // type, genre?
    list = new MusicList(type);
    listTypeMap.put(name, list);
    return list;
}
Also used : ObjType(main.entity.type.ObjType) MusicList(main.music.entity.MusicList)

Example 5 with MusicList

use of main.music.entity.MusicList in project Eidolons by IDemiurge.

the class MC_ControlPanel method actionPerformed.

@Override
public void actionPerformed(ActionEvent e) {
    if (e.getSource() == clickModeBox) {
        MusicMouseListener.setClickMode((CLICK_MODE) clickModeBox.getSelectedItem());
        return;
    }
    if (e.getSource() == sortBox) {
        doSort(e, (VALUE) sortBox.getSelectedItem());
        return;
    }
    if (e.getSource() == lastPlayed) {
        MusicList list = (MusicList) lastPlayed.getSelectedItem();
        list.getMouseListener().handleClick(e.getModifiers(), MusicMouseListener.getClickMode());
        return;
    }
    if (e.getSource() == playBox) {
        MusicMouseListener.setPlayMode((PLAY_MODE) playBox.getSelectedItem());
        return;
    }
    MusicList list = MusicMouseListener.getSelectedList();
    boolean alt = MathMaster.isMaskAlt(e.getModifiers());
    boolean shift = MathMaster.isShiftMask(e.getModifiers());
    boolean ctrl = MathMaster.isCtrlMask(e.getModifiers());
    List<ObjType> types;
    switch(e.getActionCommand()) {
        case "Filters":
            doAddRemoveFilters(alt, shift, ctrl, list, false);
            break;
        case "Dialog":
            doDialog(alt, shift, ctrl, list, false);
            break;
        case "Prioritize":
            prioritize(ctrl, shift);
            break;
        case "Repair":
            M3uGenerator.repairM3uLists();
            break;
        case "Find":
            doFind(alt);
            break;
        case "Filter":
            doFilter(alt, shift);
            break;
        case // 
        "Visual":
            if (alt) {
                MusicCore.newGroupView(0);
            } else {
                int choice = DialogMaster.optionChoice("Filtered by Music Type?", // , MusicCore.std_groups
                "Full", "Day", "Gym", "Night");
                if (choice > -1) {
                    MusicCore.newGroupView(choice);
                    break;
                }
                choice = DialogMaster.optionChoice("Filtered by Music Tag?", "Day", "Afternoon", "Dusk", "Night");
                if (choice > -1) {
                    MusicCore.newFilteredView(choice, MUSIC_TAGS.class);
                }
            }
            break;
        case "Random":
            doRandom(alt);
            break;
        case "New":
            // "put together similar tracks"
            // TODO from multiple selected lists?
            MusicListMaster.newList(list, alt);
            break;
        case "Save":
            if (!ctrl) {
                MusicCore.saveAll();
            }
            if (alt) {
                boolean export = DialogMaster.confirm("Export or process?");
                String inputText = DialogMaster.inputText("folder relative to " + AHK_Master.SYSTEM_LISTS_FOLDER) + "\\";
                String path = AHK_Master.SYSTEM_LISTS_FOLDER;
                VALUE p = export ? getMassFilterValue() : getMassEditValue();
                if (export) {
                    M3uMaster.exportListsIntoFolder(path + "export\\" + inputText, (PROPERTY) p, !shift);
                } else {
                    M3uMaster.processMetaListFolder(path + inputText, (PROPERTY) p);
                }
            }
            break;
        case "Edit":
            doEdit(list, alt);
            break;
        case "Mass Edit":
            // MusicMouseListener.setClickMode(CLICK_MODE.TAG);
            doMassEdit(alt);
            break;
    }
}
Also used : ObjType(main.entity.type.ObjType) VALUE(main.content.VALUE) MusicList(main.music.entity.MusicList)

Aggregations

MusicList (main.music.entity.MusicList)10 ObjType (main.entity.type.ObjType)7 Track (main.music.entity.Track)2 File (java.io.File)1 IOException (java.io.IOException)1 List (java.util.List)1 VALUE (main.content.VALUE)1 PROPERTY (main.content.values.properties.PROPERTY)1 XLinkedMap (main.data.XLinkedMap)1 MusicListPanel (main.music.gui.MusicListPanel)1 G_Panel (main.swing.generic.components.G_Panel)1