From: kramm Date: Sat, 24 Jan 2004 19:08:05 +0000 (+0000) Subject: added -S (--stop) parameter. X-Git-Tag: release-0-5-0~100 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=5ea070f8048a01530e6ebefc48ae551c4db69c04 added -S (--stop) parameter. --- diff --git a/src/wav2swf.c b/src/wav2swf.c index 0b1cf36..6bc59cd 100644 --- a/src/wav2swf.c +++ b/src/wav2swf.c @@ -29,6 +29,7 @@ char * filename = 0; char * outputname = "output.swf"; int verbose = 2; +int stopframe0 = 0; #define DEFINESOUND_MP3 1 //define sound uses mp3?- undefine for raw sound. @@ -43,6 +44,7 @@ struct options_t options[] = {"b","bitrate"}, {"C","cgi"}, {"V","version"}, + {"S","stop"}, {0,0} }; @@ -79,6 +81,10 @@ int args_callback_option(char*name,char*val) verbose ++; return 0; } + else if(!strcmp(name, "S")) { + stopframe0 = 1; + return 0; + } else if(!strcmp(name, "C")) { do_cgi = 1; return 0; @@ -151,6 +157,8 @@ void args_callback_usage(char*name) printf("\t-b , --bitrate bps\t\t Set mp3 bitrate (default: 32)\n"); printf("\t-o , --output filename\t\t set output filename (default: output.swf)\n"); printf("\t-C , --cgi\t\t\t For use as CGI- prepend http header, write to stdout\n"); + printf("\t-S , --stop\t\t\t Stop the movie at frame 0\n"); + printf("\t \t\t\t (For use with flashsound.js)\n"); printf("\t-V , --version\t\t\t Print program version and exit\n"); } int args_callback_command(char*name,char*val) @@ -248,6 +256,17 @@ int main (int argc,char ** argv) rgb.g = 0xff; rgb.b = 0xff; swf_SetRGB(tag,&rgb); + + if(stopframe0) { + ActionTAG*action = 0; + tag = swf_InsertTag(tag, ST_DOACTION); + action = action_Stop(action); + action = action_End(action); + swf_ActionSet(tag, action); + swf_ActionFree(action); + + tag = swf_InsertTag(tag, ST_SHOWFRAME); + } swf_mp3_bitrate = bitrate; swf_mp3_out_samplerate = samplerate;