コード例 #1
0
    //so PLAYMODE + REC pattern, REC pattern might not exist, we would want to load AUTO or CUstom selected pattern, without saving afterwards
    private void loadYT(SongData songData, SongReady songReady, int lanes, SongData.PatternType patternType, Settings.PlayMode playMode)// = Settings.PlayMode.PLAY)
    {
        patternType = SongData.PatternType.CUSTOM;
        Debug.Log("************* SONGLOADER.loadSong, youtube " + songData + ", " + patternType + " " + playMode);
        state             = State.PREPARING;
        this.songReady    = songReady;
        this.patternLanes = lanes;
        this.patternType  = patternType;
        this.playMode     = playMode;
        //this.recordingMode = playMode == Settings.PlayMode.RECORD_PATTERN;

        songFromFile = false;
        isLoading    = true;

        isLoading = false;
        Dictionary <string, string> patternFilePaths = new Dictionary <string, string>();

        SongData.findPatterns(patternFilePaths, songData.name);
        string suffix = SongData.getPatternSuffix(patternLanes, patternType);

        Debug.Log("youtube songloader, suffix " + suffix);
        Debug.Log("youtube songloader, suffix " + suffix.Length + " " + "4_".Length + " " + (suffix.Length - 1));

        foreach (string p in patternFilePaths.Keys)
        {
            Debug.Log("******* " + p + " " + patternFilePaths[p]);
        }
        //TODO non hardcoded
        //aaaa
        //Debug.Log("******* " + "4_" + patternFilePaths[suffix.Substring("4_".Length)]);
        loadPattern(patternFilePaths[suffix]);
        //loadPattern("/boxmaniaResources/patterns/QmXotvtA_po_4_CUSTOM.ptn");


        Dictionary <SongRow.Type, List <SongRow> > rows = new Dictionary <SongRow.Type, List <SongRow> >();

        rows.Add(SongRow.Type.BPM, rowsBpm);
        rows.Add(SongRow.Type.BOX, rowsBox);
        rows.Add(SongRow.Type.BEAT, rowsBeat);
        rows.Add(SongRow.Type.LANE_POS, rowsLanePositions);

        songData.rows = rows;

        bool patternExists = patternFilePaths.ContainsKey(suffix);

        if (!patternExists)
        {
            Debug.Log("No existing pattern (" + suffix + "), will create");
        }

        if (!Settings.instance.patternOverwriteAuto && patternExists)
        {
            songReady(songData);
        }
        else
        {
            Debug.Log("TODO switch to record mode when no yt pattern found");
            songReady(songData);
        }
    }
コード例 #2
0
 public void loadSong(SongData songData, SongReady songReady, int lanes, SongData.PatternType patternType, Settings.PlayMode playMode)
 {
     this.songData = songData;
     if (songData.isYoutube)
     {
         loadYT(songData, songReady, lanes, patternType, playMode);
     }
     else
     {
         loadIncluded(songData, songReady, lanes, patternType, playMode);
     }
 }
コード例 #3
0
    private void loadIncluded(SongData songData, SongReady songReady, int lanes, SongData.PatternType patternType, Settings.PlayMode playMode)// = Settings.PlayMode.PLAY)
    {
        Debug.Log("************* SONGLOADER.loadSong, clip " + songData + ", " + patternType + " " + playMode);
        state             = State.PREPARING;
        this.songReady    = songReady;
        this.patternLanes = lanes;
        this.patternType  = patternType;
        this.playMode     = playMode;
        //this.recordingMode = playMode == Settings.PlayMode.RECORD_PATTERN;

        songFromFile = false;
        isLoading    = true;
        songLoaded(songData.getClip());
    }
コード例 #4
0
    private void loadCustom(SongData songData, SongReady songReady, int lanes, SongData.PatternType patternType, Settings.PlayMode playMode)// = Settings.PlayMode.PLAY)
    {
        Debug.Log("************* SONGLOADER.loadSong, path " + songData + ", " + patternType + " " + playMode);
        state             = State.PREPARING;
        this.songReady    = songReady;
        this.patternLanes = lanes;
        this.patternType  = patternType;
        this.playMode     = playMode;
        //this.recordingMode = playMode == Settings.PlayMode.RECORD_PATTERN;

        songFromFile = true;
        isLoading    = true;
        importer.Import(songData.path);
    }