diff options
author | Rob Haarsma <phaseIV@zonnet.nl> | 2003-05-09 15:24:55 +0400 |
---|---|---|
committer | Rob Haarsma <phaseIV@zonnet.nl> | 2003-05-09 15:24:55 +0400 |
commit | f8803db66d2d407f7301996b587706fdf57edb0e (patch) | |
tree | 3fe3e8e9b31898c5d962a57b8dcdcc103b3a670c | |
parent | 81d2589d6a5af1e59125a7897e70638b420e5dc7 (diff) |
added a labelbutton that displays the selected avi/quicktime codec.
-rw-r--r-- | source/blender/include/BIF_interface.h | 9 | ||||
-rw-r--r-- | source/blender/include/BIF_writeavicodec.h | 2 | ||||
-rw-r--r-- | source/blender/quicktime/apple/quicktime_export.c | 41 | ||||
-rw-r--r-- | source/blender/quicktime/quicktime_export.h | 1 | ||||
-rw-r--r-- | source/blender/src/buttons.c | 12 | ||||
-rw-r--r-- | source/blender/src/usiblender.c | 8 | ||||
-rw-r--r-- | source/blender/src/writeavicodec.c | 21 |
7 files changed, 64 insertions, 30 deletions
diff --git a/source/blender/include/BIF_interface.h b/source/blender/include/BIF_interface.h index 0b57955be79..1ca049bb8ce 100644 --- a/source/blender/include/BIF_interface.h +++ b/source/blender/include/BIF_interface.h @@ -83,6 +83,13 @@ uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, s uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); +uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip); + +uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); +uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); +uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); +uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); + typedef void (*uiIDPoinFuncFP) (char *str, struct ID **idpp); void uiDefIDPoinBut(struct uiBlock *block, uiIDPoinFuncFP func, int retval, char *str, @@ -93,6 +100,8 @@ void uiDefIDPoinBut(struct uiBlock *block, typedef uiBlock* (*uiBlockFuncFP) (void *arg1); void uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip); +void uiDefIconBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, int icon, short x1, short y1, short x2, short y2, char *tip); + void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip); void uiAutoBlock(struct uiBlock *block, diff --git a/source/blender/include/BIF_writeavicodec.h b/source/blender/include/BIF_writeavicodec.h index ff347fe494c..98f7281644f 100644 --- a/source/blender/include/BIF_writeavicodec.h +++ b/source/blender/include/BIF_writeavicodec.h @@ -40,5 +40,7 @@ void append_avi_codec(int frame); void end_avi_codec(void); int get_avicodec_settings(void); +extern int have_avicodec; +extern char avicdname[128]; #endif diff --git a/source/blender/quicktime/apple/quicktime_export.c b/source/blender/quicktime/apple/quicktime_export.c index 5863a533900..29734ae13da 100644 --- a/source/blender/quicktime/apple/quicktime_export.c +++ b/source/blender/quicktime/apple/quicktime_export.c @@ -88,6 +88,7 @@ DONE: #include <TextUtils.h> #include <Movies.h> #include <QuicktimeComponents.h> +#include <MoviesFormat.h> #endif /* _WIN32 */ #ifdef __APPLE__ @@ -169,7 +170,8 @@ struct _QuicktimeCodecDataExt *qcdx; static int sframe; -int have_qtcodec; +int have_qtcodec; +char qtcdname[64]; /************************************************************ * * @@ -566,15 +568,16 @@ static void check_renderbutton_framerate(void) { int get_qtcodec_settings(void) { OSErr err = noErr; -// Component c = 0; -// ComponentDescription cd; + Component c = 0; + ComponentDescription cd; + CodecInfo ci; + + cd.componentType = StandardCompressionType; + cd.componentSubType = StandardCompressionSubType; + cd.componentManufacturer = 0; + cd.componentFlags = 0; + cd.componentFlagsMask = 0; -// cd.componentType = StandardCompressionType; -// cd.componentSubType = StandardCompressionSubType; -// cd.componentManufacturer = 0; -// cd.componentFlags = 0; -// cd.componentFlagsMask = 0; -Handle *theText; if(qcdx == NULL) { qcdx = MEM_callocN(sizeof(QuicktimeCodecDataExt), "QuicktimeCodecDataExt"); @@ -584,18 +587,18 @@ Handle *theText; // configure the standard image compression dialog box if (qcdx->theComponent == NULL) { - qcdx->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType); -// c = FindNextComponent(c, &cd); -// qcdx->theComponent = OpenComponent(c); +// qcdx->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType); + c = FindNextComponent(c, &cd); + qcdx->theComponent = OpenComponent(c); - qcdx->gSpatialSettings.codecType = nil; +// qcdx->gSpatialSettings.codecType = nil; qcdx->gSpatialSettings.codec = anyCodec; // qcdx->gSpatialSettings.depth; qcdx->gSpatialSettings.spatialQuality = codecMaxQuality; qcdx->gTemporalSettings.temporalQuality = codecMaxQuality; // qcdx->gTemporalSettings.frameRate; - qcdx->gTemporalSettings.keyFrameRate = 24; + qcdx->gTemporalSettings.keyFrameRate = 25; qcdx->aDataRateSetting.dataRate = 90 * 1024; // qcdx->aDataRateSetting.frameDuration; @@ -612,12 +615,13 @@ Handle *theText; } check_renderbutton_framerate(); - + // put up the dialog box err = SCRequestSequenceSettings(qcdx->theComponent); - if (err == scUserCancelled) { + + if (err == scUserCancelled) { G.afbreek = 1; return 0; } @@ -630,9 +634,8 @@ Handle *theText; SCGetInfo(qcdx->theComponent, scSpatialSettingsType, &qcdx->gSpatialSettings); SCGetInfo(qcdx->theComponent, scDataRateSettingsType, &qcdx->aDataRateSetting); -//GraphicsExportGetSettingsAsText (qcdx->theComponent,theText ); - -//printf("%s\n", theText); + GetCodecInfo (&ci, qcdx->gSpatialSettings.codecType, 0); + sprintf(qtcdname,"Codec: %s", p2cstr(ci.typeName)); // framerate jugglin' diff --git a/source/blender/quicktime/quicktime_export.h b/source/blender/quicktime/quicktime_export.h index fd2bfbfd577..8d9d4a835d6 100644 --- a/source/blender/quicktime/quicktime_export.h +++ b/source/blender/quicktime/quicktime_export.h @@ -46,6 +46,7 @@ void free_qtcodecdataExt(void); //usiblender.c void makeqtstring (char *string); //for playanim.c extern int have_qtcodec; +extern char qtcdname[64]; #endif //(_WIN32) || (__APPLE__) diff --git a/source/blender/src/buttons.c b/source/blender/src/buttons.c index 5c467a8dcd4..88ebcbff841 100644 --- a/source/blender/src/buttons.c +++ b/source/blender/src/buttons.c @@ -6577,7 +6577,11 @@ void renderbuts(void) if(G.scene->r.imtype == R_QUICKTIME) { #ifdef WITH_QUICKTIME #if defined (_WIN32) || defined (__APPLE__) - uiDefBut(block, BUT,B_SELECTCODEC, "Codec settings", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime Codec"); + if(!have_qtcodec) + uiDefBut(block, LABEL, 0, "Codec: undefined", 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); + else + uiDefBut(block, LABEL, 0, qtcdname, 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime"); #else /* libquicktime */ if (!G.scene->r.qtcodecdata) G.scene->r.qtcodecdata = MEM_callocN(sizeof(QtCodecData), "QtCodecData"); uiDefButI(block, MENU, B_SELECTCODEC, qtcodecs_pup(), 892,yofs, 112, 20, &qtcodec_idx, 0, 0, 0, 0, "Codec"); @@ -6595,7 +6599,11 @@ void renderbuts(void) #endif /* libquicktime */ #endif /* WITH_QUICKTIME */ } else { - uiDefBut(block, BUT,B_SELECTCODEC, "Codec settings", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI Codec"); + if(!have_avicodec) + uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); + else + uiDefBut(block, LABEL, 0, avicdname, 892,yofs+42,225,20, 0, 0, 0, 0, 0, ""); + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); } } else { uiDefButS(block, NUM,0, "Quality:", 892,yofs,112,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies"); diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c index 8b3254c346b..c366af6992d 100644 --- a/source/blender/src/usiblender.c +++ b/source/blender/src/usiblender.c @@ -227,16 +227,8 @@ int BIF_read_homefile(void) U.fontsize= 12; U.encoding= 0; sprintf(U.fontname, ".bfont.ttf"); - if( FTF_SetFont(".bfont.ttf", 12) ) { - FTF_SetLanguage("en"); - FTF_SetEncoding("ASCII"); - G.ui_international = TRUE; - } else { - G.ui_international = FALSE; - } } */ - if(U.transopts & TR_ALL) set_ML_interface_font(); else diff --git a/source/blender/src/writeavicodec.c b/source/blender/src/writeavicodec.c index cb3e98746be..95d69daaafb 100644 --- a/source/blender/src/writeavicodec.c +++ b/source/blender/src/writeavicodec.c @@ -64,6 +64,8 @@ // the output video stream AVICOMPRESSOPTIONS opts; +char avicdname[128]; +int have_avicodec= 0; static int sframe; static PAVIFILE pfile = NULL; @@ -345,7 +347,7 @@ HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos,LPVOID l */ *lpcbFormat = sizeof(BITMAPINFOHEADER); - + return AVIERR_OK; } @@ -767,6 +769,8 @@ int get_avicodec_settings(void) AVICOMPRESSOPTIONS *aopts[1] = {&opts}; AviCodecData *acd = G.scene->r.avicodecdata; static PAVISTREAM psdummy; + HIC hic; + ICINFO icinfo; acd_to_opts(G.scene->r.avicodecdata); @@ -777,12 +781,27 @@ int get_avicodec_settings(void) } else { if (!AVISaveOptions(NULL, ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE, +// ICMF_CHOOSE_ALLCOMPRESSORS, 1, &psdummy, (LPAVICOMPRESSOPTIONS *) &aopts)) { ret_val = 1; } else { + have_avicodec = 1; + + if ((hic=ICOpen(ICTYPE_VIDEO,opts.fccHandler,ICMODE_QUERY))!=NULL) { + icinfo.dwSize=sizeof(ICINFO); + if (ICGetInfo(hic,&icinfo,sizeof(ICINFO))) { + WideCharToMultiByte(CP_ACP,0,icinfo.szDescription,-1,avicdname,128,NULL,NULL); + } else + sprintf(avicdname, "undefined"); + if (ICClose(hic)!=ICERR_OK) + return 0; + } else { + sprintf(avicdname, "Full Frames (Uncompressed)"); //heh, nasty + } + if (acd) { free_avicodecdata(acd); } else { |