From 017d39f60a4831e5a883b99cb37eacace44cf435 Mon Sep 17 00:00:00 2001 From: angel Date: Sat, 23 Apr 2005 13:26:24 +0000 Subject: [PATCH] 'pat_file' and 'wav_file' variables in events renamed to 'file'. git-svn-id: file:///home/angel/tmp/svn-triptico/ahxm/trunk@465 c87de0a0-a11c-0410-a1e5-866214bc28b2 --- compiler.y | 4 ++-- song.h | 4 ++-- ss_song.c | 30 +++++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/compiler.y b/compiler.y index 2fbf572..e3e59ce 100644 --- a/compiler.y +++ b/compiler.y @@ -441,7 +441,7 @@ static void _add_ss_wav_event(char * wav_file, int base, int min, int max) e.ss_wav.type=SONG_EV_SS_WAV; e.ss_wav.time=_cur_time; e.ss_wav.trk_id=_track; - e.ss_wav.wav_file=wav_file; + e.ss_wav.file=wav_file; e.ss_wav.base=base; e.ss_wav.min=min; e.ss_wav.max=max; @@ -457,7 +457,7 @@ static void _add_ss_pat_event(char * pat_file) e.ss_pat.type=SONG_EV_SS_PAT; e.ss_pat.time=_cur_time; e.ss_pat.trk_id=_track; - e.ss_pat.pat_file=pat_file; + e.ss_pat.file=pat_file; add_song_ev(&e); } diff --git a/song.h b/song.h index 798266f..456db66 100644 --- a/song.h +++ b/song.h @@ -104,7 +104,7 @@ struct song_ev_ss_wav song_ev_type type; /* SONG_EV_SS_WAV */ double time; int trk_id; - char * wav_file; /* path to .wav file */ + char * file; /* path to .wav file */ int base; /* MIDI-like base note */ int min; /* MIDI-like minimum note */ int max; /* MIDI-like maximum note */ @@ -115,7 +115,7 @@ struct song_ev_ss_pat song_ev_type type; /* SONG_EV_SS_PAT */ double time; int trk_id; - char * pat_file; /* path to .pat file */ + char * file; /* path to .pat file */ }; union song_ev diff --git a/ss_song.c b/ss_song.c index d2377a8..88017d3 100644 --- a/ss_song.c +++ b/ss_song.c @@ -109,12 +109,23 @@ struct ss_ev_ss_channel_map float vol[CHANNELS]; /* volumes for each channel */ }; +struct ss_ev_ss_wav +{ + ss_ev_type type; /* EV_SS_WAV */ + int frame; + int trk_id; + char * file; /* path to .wav file */ + int base; /* MIDI-like base note */ + int min; /* MIDI-like minimum note */ + int max; /* MIDI-like maximum note */ +}; + struct ss_ev_ss_pat { ss_ev_type type; /* EV_SS_PAT */ int frame; int trk_id; - char * pat_file; /* path to .pat file */ + char * file; /* path to .pat file */ }; union ss_ev @@ -125,6 +136,7 @@ union ss_ev struct ss_ev_ss_note_on_by_time ss_note_on_by_time; struct ss_ev_ss_sustain ss_sustain; struct ss_ev_ss_channel_map ss_channel_map; + struct ss_ev_ss_wav ss_wav; struct ss_ev_ss_pat ss_pat; }; @@ -278,12 +290,24 @@ static void _ss_song_convert_events(void) break; + case SONG_EV_SS_WAV: + + sse.ss_wav.type=EV_SS_WAV; + sse.ss_wav.frame=frame; + sse.ss_wav.trk_id=e->ss_wav.trk_id; + sse.ss_wav.file=e->ss_wav.file; + sse.ss_wav.base=e->ss_wav.base; + sse.ss_wav.min=e->ss_wav.min; + sse.ss_wav.max=e->ss_wav.max; + + add_ss_ev(&sse); + case SONG_EV_SS_PAT: sse.ss_pat.type=EV_SS_PAT; sse.ss_pat.frame=frame; sse.ss_pat.trk_id=e->ss_pat.trk_id; - sse.ss_pat.pat_file=e->ss_pat.pat_file; + sse.ss_pat.file=e->ss_pat.file; add_ss_ev(&sse); } @@ -358,7 +382,7 @@ int generate_ss_song(void) case EV_SS_PAT: load_pat_file(&song_ins[e->ss_pat.trk_id], - e->ss_pat.pat_file); + e->ss_pat.file); break; case EV_END: -- 2.11.4.GIT