示例#1
0
        public void write(string file, bool print_track_end)
        {
            UstFileWriteOptions opt = new UstFileWriteOptions();

            opt.settingCacheDir    = true;
            opt.settingOutFile     = true;
            opt.settingProjectName = true;
            opt.settingTempo       = true;
            opt.settingTool1       = true;
            opt.settingTool2       = true;
            opt.settingTracks      = true;
            opt.settingVoiceDir    = true;
            opt.trackEnd           = print_track_end;
            write(file, opt);
        }
示例#2
0
        public void write(string file, UstFileWriteOptions options)
        {
            InternalStreamWriter sw = null;

            try {
                sw = new InternalStreamWriter(file, "Shift_JIS");
                sw.write("[#SETTING]"); sw.newLine();
                if (options.settingTempo)
                {
                    sw.write("Tempo=" + m_tempo); sw.newLine();
                }
                if (options.settingTracks)
                {
                    sw.write("Tracks=1"); sw.newLine();
                }
                if (options.settingProjectName)
                {
                    sw.write("ProjectName=" + m_project_name); sw.newLine();
                }
                if (options.settingVoiceDir)
                {
                    sw.write("VoiceDir=" + m_voice_dir); sw.newLine();
                }
                if (options.settingOutFile)
                {
                    sw.write("OutFile=" + m_out_file); sw.newLine();
                }
                if (options.settingCacheDir)
                {
                    sw.write("CacheDir=" + m_cache_dir); sw.newLine();
                }
                if (options.settingTool1)
                {
                    sw.write("Tool1=" + m_tool1); sw.newLine();
                }
                if (options.settingTool2)
                {
                    sw.write("Tool2=" + m_tool2); sw.newLine();
                }
                UstTrack target = m_tracks[0];
                int      count  = target.getEventCount();
                for (int i = 0; i < count; i++)
                {
                    target.getEvent(i).print(sw);
                }
                if (options.trackEnd)
                {
                    sw.write("[#TRACKEND]");
                }
                sw.newLine();
            } catch (Exception ex) {
                serr.println("UstFile#write; ex=" + ex);
            } finally {
                if (sw != null)
                {
                    try {
                        sw.close();
                    } catch (Exception ex2) {
                        serr.println("UstFile#write; ex2=" + ex2);
                    }
                }
            }
        }