added a labelbutton that displays the selected avi/quicktime codec.
This commit is contained in:
@@ -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 *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 *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);
|
typedef void (*uiIDPoinFuncFP) (char *str, struct ID **idpp);
|
||||||
void uiDefIDPoinBut(struct uiBlock *block,
|
void uiDefIDPoinBut(struct uiBlock *block,
|
||||||
uiIDPoinFuncFP func, int retval, char *str,
|
uiIDPoinFuncFP func, int retval, char *str,
|
||||||
@@ -93,6 +100,8 @@ void uiDefIDPoinBut(struct uiBlock *block,
|
|||||||
typedef uiBlock* (*uiBlockFuncFP) (void *arg1);
|
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 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 uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip);
|
||||||
|
|
||||||
void uiAutoBlock(struct uiBlock *block,
|
void uiAutoBlock(struct uiBlock *block,
|
||||||
|
@@ -40,5 +40,7 @@ void append_avi_codec(int frame);
|
|||||||
void end_avi_codec(void);
|
void end_avi_codec(void);
|
||||||
int get_avicodec_settings(void);
|
int get_avicodec_settings(void);
|
||||||
|
|
||||||
|
extern int have_avicodec;
|
||||||
|
extern char avicdname[128];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -88,6 +88,7 @@ DONE:
|
|||||||
#include <TextUtils.h>
|
#include <TextUtils.h>
|
||||||
#include <Movies.h>
|
#include <Movies.h>
|
||||||
#include <QuicktimeComponents.h>
|
#include <QuicktimeComponents.h>
|
||||||
|
#include <MoviesFormat.h>
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@@ -169,7 +170,8 @@ struct _QuicktimeCodecDataExt *qcdx;
|
|||||||
|
|
||||||
static int sframe;
|
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)
|
int get_qtcodec_settings(void)
|
||||||
{
|
{
|
||||||
OSErr err = noErr;
|
OSErr err = noErr;
|
||||||
// Component c = 0;
|
Component c = 0;
|
||||||
// ComponentDescription cd;
|
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) {
|
if(qcdx == NULL) {
|
||||||
qcdx = MEM_callocN(sizeof(QuicktimeCodecDataExt), "QuicktimeCodecDataExt");
|
qcdx = MEM_callocN(sizeof(QuicktimeCodecDataExt), "QuicktimeCodecDataExt");
|
||||||
@@ -584,18 +587,18 @@ Handle *theText;
|
|||||||
// configure the standard image compression dialog box
|
// configure the standard image compression dialog box
|
||||||
|
|
||||||
if (qcdx->theComponent == NULL) {
|
if (qcdx->theComponent == NULL) {
|
||||||
qcdx->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
|
// qcdx->theComponent = OpenDefaultComponent(StandardCompressionType, StandardCompressionSubType);
|
||||||
// c = FindNextComponent(c, &cd);
|
c = FindNextComponent(c, &cd);
|
||||||
// qcdx->theComponent = OpenComponent(c);
|
qcdx->theComponent = OpenComponent(c);
|
||||||
|
|
||||||
qcdx->gSpatialSettings.codecType = nil;
|
// qcdx->gSpatialSettings.codecType = nil;
|
||||||
qcdx->gSpatialSettings.codec = anyCodec;
|
qcdx->gSpatialSettings.codec = anyCodec;
|
||||||
// qcdx->gSpatialSettings.depth;
|
// qcdx->gSpatialSettings.depth;
|
||||||
qcdx->gSpatialSettings.spatialQuality = codecMaxQuality;
|
qcdx->gSpatialSettings.spatialQuality = codecMaxQuality;
|
||||||
|
|
||||||
qcdx->gTemporalSettings.temporalQuality = codecMaxQuality;
|
qcdx->gTemporalSettings.temporalQuality = codecMaxQuality;
|
||||||
// qcdx->gTemporalSettings.frameRate;
|
// qcdx->gTemporalSettings.frameRate;
|
||||||
qcdx->gTemporalSettings.keyFrameRate = 24;
|
qcdx->gTemporalSettings.keyFrameRate = 25;
|
||||||
|
|
||||||
qcdx->aDataRateSetting.dataRate = 90 * 1024;
|
qcdx->aDataRateSetting.dataRate = 90 * 1024;
|
||||||
// qcdx->aDataRateSetting.frameDuration;
|
// qcdx->aDataRateSetting.frameDuration;
|
||||||
@@ -612,12 +615,13 @@ Handle *theText;
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_renderbutton_framerate();
|
check_renderbutton_framerate();
|
||||||
|
|
||||||
// put up the dialog box
|
// put up the dialog box
|
||||||
|
|
||||||
err = SCRequestSequenceSettings(qcdx->theComponent);
|
err = SCRequestSequenceSettings(qcdx->theComponent);
|
||||||
|
|
||||||
if (err == scUserCancelled) {
|
|
||||||
|
if (err == scUserCancelled) {
|
||||||
G.afbreek = 1;
|
G.afbreek = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -630,9 +634,8 @@ Handle *theText;
|
|||||||
SCGetInfo(qcdx->theComponent, scSpatialSettingsType, &qcdx->gSpatialSettings);
|
SCGetInfo(qcdx->theComponent, scSpatialSettingsType, &qcdx->gSpatialSettings);
|
||||||
SCGetInfo(qcdx->theComponent, scDataRateSettingsType, &qcdx->aDataRateSetting);
|
SCGetInfo(qcdx->theComponent, scDataRateSettingsType, &qcdx->aDataRateSetting);
|
||||||
|
|
||||||
//GraphicsExportGetSettingsAsText (qcdx->theComponent,theText );
|
GetCodecInfo (&ci, qcdx->gSpatialSettings.codecType, 0);
|
||||||
|
sprintf(qtcdname,"Codec: %s", p2cstr(ci.typeName));
|
||||||
//printf("%s\n", theText);
|
|
||||||
|
|
||||||
// framerate jugglin'
|
// framerate jugglin'
|
||||||
|
|
||||||
|
@@ -46,6 +46,7 @@ void free_qtcodecdataExt(void); //usiblender.c
|
|||||||
void makeqtstring (char *string); //for playanim.c
|
void makeqtstring (char *string); //for playanim.c
|
||||||
|
|
||||||
extern int have_qtcodec;
|
extern int have_qtcodec;
|
||||||
|
extern char qtcdname[64];
|
||||||
|
|
||||||
#endif //(_WIN32) || (__APPLE__)
|
#endif //(_WIN32) || (__APPLE__)
|
||||||
|
|
||||||
|
@@ -6577,7 +6577,11 @@ void renderbuts(void)
|
|||||||
if(G.scene->r.imtype == R_QUICKTIME) {
|
if(G.scene->r.imtype == R_QUICKTIME) {
|
||||||
#ifdef WITH_QUICKTIME
|
#ifdef WITH_QUICKTIME
|
||||||
#if defined (_WIN32) || defined (__APPLE__)
|
#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 */
|
#else /* libquicktime */
|
||||||
if (!G.scene->r.qtcodecdata) G.scene->r.qtcodecdata = MEM_callocN(sizeof(QtCodecData), "QtCodecData");
|
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");
|
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 /* libquicktime */
|
||||||
#endif /* WITH_QUICKTIME */
|
#endif /* WITH_QUICKTIME */
|
||||||
} else {
|
} 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 {
|
} 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");
|
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");
|
||||||
|
@@ -227,16 +227,8 @@ int BIF_read_homefile(void)
|
|||||||
U.fontsize= 12;
|
U.fontsize= 12;
|
||||||
U.encoding= 0;
|
U.encoding= 0;
|
||||||
sprintf(U.fontname, ".bfont.ttf");
|
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)
|
if(U.transopts & TR_ALL)
|
||||||
set_ML_interface_font();
|
set_ML_interface_font();
|
||||||
else
|
else
|
||||||
|
@@ -64,6 +64,8 @@
|
|||||||
// the output video stream
|
// the output video stream
|
||||||
|
|
||||||
AVICOMPRESSOPTIONS opts;
|
AVICOMPRESSOPTIONS opts;
|
||||||
|
char avicdname[128];
|
||||||
|
int have_avicodec= 0;
|
||||||
|
|
||||||
static int sframe;
|
static int sframe;
|
||||||
static PAVIFILE pfile = NULL;
|
static PAVIFILE pfile = NULL;
|
||||||
@@ -345,7 +347,7 @@ HRESULT STDMETHODCALLTYPE AVIBallReadFormat (PAVISTREAM ps, LONG lPos,LPVOID l
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
*lpcbFormat = sizeof(BITMAPINFOHEADER);
|
*lpcbFormat = sizeof(BITMAPINFOHEADER);
|
||||||
|
|
||||||
return AVIERR_OK;
|
return AVIERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,6 +769,8 @@ int get_avicodec_settings(void)
|
|||||||
AVICOMPRESSOPTIONS *aopts[1] = {&opts};
|
AVICOMPRESSOPTIONS *aopts[1] = {&opts};
|
||||||
AviCodecData *acd = G.scene->r.avicodecdata;
|
AviCodecData *acd = G.scene->r.avicodecdata;
|
||||||
static PAVISTREAM psdummy;
|
static PAVISTREAM psdummy;
|
||||||
|
HIC hic;
|
||||||
|
ICINFO icinfo;
|
||||||
|
|
||||||
acd_to_opts(G.scene->r.avicodecdata);
|
acd_to_opts(G.scene->r.avicodecdata);
|
||||||
|
|
||||||
@@ -777,12 +781,27 @@ int get_avicodec_settings(void)
|
|||||||
} else {
|
} else {
|
||||||
if (!AVISaveOptions(NULL,
|
if (!AVISaveOptions(NULL,
|
||||||
ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE,
|
ICMF_CHOOSE_KEYFRAME | ICMF_CHOOSE_DATARATE,
|
||||||
|
// ICMF_CHOOSE_ALLCOMPRESSORS,
|
||||||
1,
|
1,
|
||||||
&psdummy,
|
&psdummy,
|
||||||
(LPAVICOMPRESSOPTIONS *) &aopts))
|
(LPAVICOMPRESSOPTIONS *) &aopts))
|
||||||
{
|
{
|
||||||
ret_val = 1;
|
ret_val = 1;
|
||||||
} else {
|
} 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) {
|
if (acd) {
|
||||||
free_avicodecdata(acd);
|
free_avicodecdata(acd);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user