File: Print%20Lyric.cs

package info (click to toggle)
cadencii 3.3.9%2Bsvn20110818.r1732-5
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 35,880 kB
  • sloc: cs: 160,836; java: 42,449; cpp: 7,605; ansic: 1,728; perl: 1,087; makefile: 236; php: 142; xml: 117; sh: 21
file content (25 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public static class Print_Lyric {
    public static bool Edit( org.kbinani.vsq.VsqFile Vsq ) {
        System.IO.StreamWriter sw = null;
        try {
            sw = new System.IO.StreamWriter( @"c:\lyrics.txt" );
            for ( int i = 0; i < Vsq.Track.get( 1 ).getEventCount(); i++ ) {
                org.kbinani.vsq.VsqEvent item = Vsq.Track.get( 1 ).getEvent( i );
                if ( item.ID.type == org.kbinani.vsq.VsqIDType.Anote ) {
                    int clStart = item.Clock;
                    int clEnd = clStart + item.ID.Length;
                    double secStart = Vsq.getSecFromClock( clStart );
                    double secEnd = Vsq.getSecFromClock( clEnd );
                    sw.WriteLine( secStart + "\t" + secEnd + "\t" + item.ID.LyricHandle.L0.Phrase + "\t" + item.ID.LyricHandle.L0.getPhoneticSymbol() );
                }
            }
        } catch {
            return false;
        } finally {
            if ( sw != null ) {
                sw.Close();
            }
        }
        return true;
    }
}