这篇教程C++ ADM_assert函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ADM_assert函数的典型用法代码示例。如果您正苦于以下问题:C++ ADM_assert函数的具体用法?C++ ADM_assert怎么用?C++ ADM_assert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了ADM_assert函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: printf//.........这里部分代码省略......... } fread(&_video_bih,sizeof(_video_bih),1,_fd);#ifdef ADM_BIG_ENDIAN Endian_BitMapInfo(&_video_bih);#endif if(extra>0) { _videoExtraLen=extra; _videoExtraData=new uint8_t [extra]; fread(_videoExtraData,extra,1,_fd); } _isvideopresent=1; //-------------------------------------------------- // Read audio trak info, select if there is // several //-------------------------------------------------- // and audio track if(_mainaviheader.dwStreams>=2) { // which one is the audio track, is there several ? if(!(_nbAudioTracks=countAudioTrack())) { printf("Weird, there is no audio track, but more than one stream.../n"); } else { uint32_t run=0,audio=0; odmlAudioTrack *track; _audioTracks=new odmlAudioTrack[_nbAudioTracks]; _audioStreams=new ADM_audioStream *[_nbAudioTracks]; while(audio<_nbAudioTracks) { ADM_assert(run<_nbTrack); track=&(_audioTracks[audio]); fseeko(_fd,_Tracks[run].strh.offset,SEEK_SET); if(_Tracks[run].strh.size != sizeof(_audiostream)) { printf("[AVI]Mmm(2) we have a bogey here, size mismatch : %"PRIu64"/n",_Tracks[run].strh.size); printf("[AVI]expected %d/n",(int)sizeof(_audiostream)); if(_Tracks[run].strh.size<sizeof(_audiostream)-8) { GUI_Error_HIG(QT_TR_NOOP("Malformed header"), NULL); return 0; } printf("[AVI]Trying to continue anyway/n"); } fread(track->avistream,sizeof(_audiostream),1,_fd);#ifdef ADM_BIG_ENDIAN Endian_AviStreamHeader(track->avistream);#endif if(track->avistream->fccType!=MKFCC('a','u','d','s')) { printf("Not an audio track!/n"); run++; continue; } // now read extra stuff fseeko(_fd,_Tracks[run].strf.offset,SEEK_SET); extra=_Tracks[run].strf.size-sizeof(WAVHeader); if(extra<0) { printf("[AVI]WavHeader is not big enough (%"PRIu64"/%d)!/n", _Tracks[run].strf.size,(int)sizeof(WAVHeader)); return 0;
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:67,
示例2: ADM_assert//___________________________________________________uint8_t ADM_ogmWrite::writeVideo(uint32_t frame){ ADM_assert(0); return 0;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:7,
示例3: switchuint8_t lavMuxer::open(const char *filename,uint32_t inbitrate, ADM_MUXER_TYPE type, aviInfo *info, uint32_t videoExtraDataSize, uint8_t *videoExtraData, WAVHeader *audioheader, uint32_t audioextraSize,uint8_t *audioextraData){ AVCodecContext *c; _type=type; _fps1000=info->fps1000; switch(_type) { case MUXER_TS: fmt=guess_format("mpegts", NULL, NULL); break; case MUXER_DVD: fmt = guess_format("dvd", NULL, NULL); break; case MUXER_VCD: fmt = guess_format("vcd", NULL, NULL); break; case MUXER_SVCD: fmt = guess_format("svcd", NULL, NULL); break; case MUXER_MP4: fmt = guess_format("mp4", NULL, NULL); break; case MUXER_PSP: fmt = guess_format("psp", NULL, NULL); break; case MUXER_FLV: fmt = guess_format("flv", NULL, NULL); break; case MUXER_MATROSKA: fmt = guess_format("matroska", NULL, NULL); break; default: fmt=NULL; } if (!fmt) { printf("Lav:Cannot guess format/n"); ADM_assert(0); return 0; } oc = av_alloc_format_context(); if (!oc) { printf("Lav:Cannot allocate context/n"); return 0; } oc->oformat = fmt; snprintf(oc->filename,1000,"file://%s",filename); // Video //________ video_st = av_new_stream(oc, 0); if (!video_st) { printf("Lav: new stream failed/n"); return 0; } c = video_st->codec; switch(_type) { case MUXER_FLV: c->codec=new AVCodec; memset(c->codec,0,sizeof(AVCodec)); if(fourCC::check(info->fcc,(uint8_t *)"FLV1")) { c->codec_id=CODEC_ID_FLV1; c->codec->name=ADM_strdup("FLV1"); }else { if(fourCC::check(info->fcc,(uint8_t *)"VP6F")) { c->codec_id=CODEC_ID_VP6F; c->codec->name=ADM_strdup("VP6F"); } else ADM_assert(0); } break; case MUXER_MATROSKA: strcpy(oc->title,"Avidemux"); strcpy(oc->author,"Avidemux"); c->sample_aspect_ratio.num=1; c->sample_aspect_ratio.den=1; if(isMpeg4Compatible(info->fcc)) { c->codec_id = CODEC_ID_MPEG4; c->has_b_frames=1; // in doubt... }else { if(isH264Compatible(info->fcc)) { c->has_b_frames=1; // in doubt... c->codec_id = CODEC_ID_H264; c->codec=new AVCodec;//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
示例4: ADM_assert//--------------------------------uint8_t EncoderFFMPEG::configure (AVDMGenericVideoStream * instream, int useExistingLogFile){ ADM_assert (instream); ADV_Info * info; uint32_t flag1, flag2, flag3; flag1 = flag2 = flag3 = 0; info = instream->getInfo (); _fps = info->fps1000; _w = info->width; _h = info->height; _vbuffer = new ADMImage (_w, _h); ADM_assert (_vbuffer); _in = instream; switch (_param.mode) { case COMPRESS_SAME: printf ("FFmpeg in follow quant mode/n"); _state = enc_Same; _codec = new ffmpegEncoderVBRExternal (_w, _h, _id); _codec->setConfig (&_settings); _codec->init (2, _fps, 0); break; case COMPRESS_CQ: printf ("ffmpeg cq mode: %ld/n", _param.qz); _state = enc_CQ; _codec = new ffmpegEncoderCQ (_w, _h, _id); _codec->setConfig (&_settings); _codec->init (_param.qz, _fps, 0); break; case COMPRESS_CBR: printf ("ffmpeg cbr mode: %ld/n", _param.bitrate); _state = enc_CBR; _codec = new ffmpegEncoderCBR (_w, _h, _id); _codec->setConfig (&_settings); _codec->init (_param.bitrate, _fps, flag1); break; case COMPRESS_2PASS: case COMPRESS_2PASS_BITRATE: ffmpegEncoderCQ * cdec; if(_param.mode==COMPRESS_2PASS) printf ("/n ffmpeg dual size: %lu", _param.finalsize); else printf ("/n ffmpeg dual bitrate: %lu", _param.avg_bitrate); _state = enc_Pass1; cdec = new ffmpegEncoderCQ (_w, _h, _id); // Pass1 cdec->setConfig (&_settings); // 1+ VBR stats required // no stats // force internal cdec->setLogFile (_logname); cdec->init (2, _fps, 1); _codec = cdec; if (flag1) _internal = 0; else _internal = 1; break; break; default: ADM_assert (0); } _in = instream; printf ("/n ffmpeg Encoder , w: %lu h:%lu mode:%d", _w, _h, _state); return 1;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:81,
示例5: printfuint8_t dmx_demuxerTS::sync( uint8_t *stream,uint64_t *abs,uint64_t *r,uint64_t *pts,uint64_t *dts){uint32_t val,hnt;retry: *r=0; val=0; hnt=0; // preload hnt=(read8i()<<16) + (read8i()<<8) +read8i(); if(_lastErr) { _lastErr=0; printf("/n io error , aborting sync/n"); return 0; } while((hnt!=0x00001)) { hnt<<=8; val=read8i(); hnt+=val; hnt&=0xffffff; if(_lastErr) { _lastErr=0; printf("/n io error , aborting sync/n"); return 0; } } *stream=read8i(); // Case 1 : assume we are still in the same packet if(_pesBufferIndex>=4) { *abs=_pesBufferStart; *r=_pesBufferIndex-4; *pts=_pesPTS; *dts=_pesDTS; } else { // pick what is needed from oldPesStart etc... // since the beginning in the previous packet uint32_t left=4-_pesBufferIndex; if(left>_oldPesLen) { // previous Packet which len is very shoty // Ignore _pesBufferIndex=0; printf("Ignoring too short packet"); goto retry; } left=_oldPesLen-left;#if 0 printf("Next packet : %I64X Len :%lu, using previous packet %I64X len:%u as pos=%lu/n", _pesBufferStart,_pesBufferLen,_oldPesStart,_oldPesLen,_pesBufferIndex);#endif if(left>_oldPesLen) { printf("Need %lu bytes from previous packet, which len is %lu/n",left,_oldPesLen); ADM_assert(0); } *abs=_oldPesStart; *r=left; *pts=_oldPTS; *dts=_oldDTS; } return 1;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:72,
示例6: GUI_FileSelWritevoid GUI_FileSelWrite(const char *label,char * * name) { ADM_assert(fileSelDescriptor); return fileSelDescriptor->fileWriteName(label,name); }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:5,
示例7: ADM_assert//________________________________________________// Init lame encoder// frequence : Impose frequency , 0 means reuse the incoming fq// mode : ADM_STEREO etc...// bitrate : Bitrate in kbps (96,192...)// return 0 : init failed// 1 : init succeeded//_______________________________________________uint8_t AUDMEncoder_Twolame::init(ADM_audioEncoderDescriptor *config){ int ret; TWOLAME_MPEG_mode mmode; uint32_t frequence; TWOLAME_encoderParam *lameConf=(TWOLAME_encoderParam *)config->param; ADM_assert(config->paramSize==sizeof(TWOLAME_encoderParam)); _twolameOptions = twolame_init(); if (_twolameOptions == NULL) return 0; if(_wavheader->channels>2) { printf("[TwoLame]Too many channels/n"); return 0; } _wavheader->byterate=(config->bitrate*1000)>>3; _chunk = 1152*_wavheader->channels; printf("[TwoLame]Incoming :fq : %lu, channel : %lu bitrate: %lu /n", _wavheader->frequency,_wavheader->channels,config->bitrate); twolame_set_in_samplerate(OPTIONS, _wavheader->frequency); twolame_set_out_samplerate (OPTIONS, _wavheader->frequency); twolame_set_num_channels(OPTIONS, _wavheader->channels); if(_wavheader->channels==1) mmode=TWOLAME_MONO; else switch (lameConf->mode) { case ADM_STEREO: mmode = TWOLAME_STEREO; break; case ADM_JSTEREO: mmode = TWOLAME_JOINT_STEREO; break; case ADM_MONO: mmode=TWOLAME_MONO; break; default: printf("/n **** unknown mode, going stereo ***/n"); mmode = TWOLAME_STEREO; break; } twolame_set_mode(OPTIONS,mmode); twolame_set_error_protection(OPTIONS,TRUE); //toolame_setPadding (options,TRUE); twolame_set_bitrate (OPTIONS,config->bitrate); twolame_set_verbosity(OPTIONS, 2); if(twolame_init_params(OPTIONS)) { printf("[TwoLame]Twolame init failed/n"); return 0; } printf("[TwoLame]Libtoolame successfully initialized/n"); return 1; }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:74,
示例8: update//*************************************void update( void ){uint32_t audioSize;uint32_t totalSize;char string[200];aviInfo info; video_body->getVideoInfo(&info); track1=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(GW(spinbuttonTrack1))); track2=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(GW(spinbuttonTrack2))); gtk_spin_button_set_value(GTK_SPIN_BUTTON(GW(spinbuttonTrack1)), track1); gtk_spin_button_set_value(GTK_SPIN_BUTTON(GW(spinbuttonTrack2)), track1); // kb->Byte audioSize=(track1+track2)*1000; audioSize/=8; audioSize*=videoDuration; audioSize>>=20; sprintf(string,"%"PRIu32,audioSize); gtk_label_set_text(GTK_LABEL(GW(labelAudio)),string); // Compute total size (for Avi) uint32_t s74,s80,dvd; // For avi/ogm int f = gtk_combo_box_get_active(GTK_COMBO_BOX(GW(comboboxFormat))); if(f==2) { // Mpeg s74=730; s80=790; dvd=4300; } else {//AVI or OGM s74=650; s80=700; dvd=4300; } int j=gtk_combo_box_get_active(GTK_COMBO_BOX(GW(comboboxMedium))); switch(j) { case 2: totalSize=1*s74;break; case 3: totalSize=2*s74;break; case 0: totalSize=1*s80;break; case 1: totalSize=2*s80;break; case 4: totalSize=dvd;break; case 5: totalSize=gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(GW(spinbuttonCustom))); if(totalSize<1) totalSize=1; break; default: ADM_assert(0); } sprintf(string,"%"PRIu32,totalSize); gtk_label_set_text(GTK_LABEL(GW(labelTotal)),string); // Compute muxing overhead size uint32_t muxingOverheadSize; int numberOfAudioTracks = 0; int numberOfChunks; switch (f) { case 0: // AVI /* Muxing overhead is 8 + 32 = 40 bytes per chunk. More or less: numberOfChunks = (x + 1) * numberOfVideoFrames, where x - the number of audio tracks */ if (track1 != 0) { numberOfAudioTracks++; } if (track2 != 0) { numberOfAudioTracks++; } numberOfChunks = (numberOfAudioTracks + 1) * numberOfVideoFrames; muxingOverheadSize = (uint32_t) ceil((numberOfChunks * 40) / 1048576.0);; break; case 1: // OGM // Muxing overhead is 1.1% to 1.2% of (videoSize + audioSize) muxingOverheadSize = (uint32_t) ceil(totalSize - totalSize / 1.012); break; case 2: // MPEG // Muxing overhead is 1% to 2% of (videoSize + audioSize) muxingOverheadSize = (uint32_t) ceil(totalSize - totalSize / 1.02); break; default: ADM_assert(0); } //sprintf(string,"%lu",muxingOverheadSize); //gtk_label_set_text(GTK_LABEL(GW(labelMux)),string);//.........这里部分代码省略.........
开发者ID:AlexanderStohr,项目名称:avidemux2,代码行数:101,
示例9: ADM_assert/** /fn decodeSEI /brief decode SEI to get short ref I @param recoveryLength # of recovery frame /return true if recovery found*/bool TsIndexer::decodeSEI(uint32_t nalSize, uint8_t *org,uint32_t *recoveryLength, pictureStructure *picStruct){ ADM_assert(nalSize+16<ADM_NAL_BUFFER_SIZE) uint8_t *payload=payloadBuffer; bool r=false; nalSize=ADM_unescapeH264(nalSize,org,payload); uint8_t *tail=payload+nalSize; *picStruct=pictureFrame; // frame while( payload<tail-2) { uint32_t sei_type=0,sei_size=0; while(payload[0]==0xff) {sei_type+=0xff;payload++;}; sei_type+=payload[0];payload++; while(payload[0]==0xff) {sei_size+=0xff;payload++;}; sei_size+=payload[0];payload++; aprintf(" [SEI] Type : 0x%x size:%d/n",sei_type,sei_size); switch(sei_type) // Recovery point { case 1: { if(spsInfo.hasStructInfo) { getBits bits(sei_size,payload); payload+=sei_size; if(spsInfo.CpbDpbToSkip) { bits.get(spsInfo.CpbDpbToSkip); } //printf("Consumed: %d,/n",bits.getConsumedBits()); int pic=bits.get(4); aprintf("Pic struct: %d,/n",pic); switch(pic) { case 0: *picStruct=pictureFrame; break; case 3: case 4: *picStruct=pictureFrame; case 1: *picStruct=pictureTopField;break; case 2: *picStruct=pictureBottomField;break; default:*picStruct=pictureFrame; } }else payload+=sei_size; } break; case 6: { getBits bits(sei_size,payload); payload+=sei_size; *recoveryLength=bits.getUEG(); aprintf("[SEI] Recovery :%"PRIu32"/n",*recoveryLength); r=true; break; } default: payload+=sei_size; break; } } //if(payload+1<tail) ADM_warning("Bytes left in SEI %d/n",(int)(tail-payload)); return r;}
开发者ID:AlexanderStohr,项目名称:avidemux2,代码行数:73,
示例10: ADM_assertuint8_t AVDMBufferedAudioStream::goToTime(uint32_t newoffset) { ADM_assert(!newoffset); _instream->goToTime(0); _headBuff=_tailBuff=0; return 1;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:6,
示例11: ADM_assertvoid GenericAviSave::guiSetPhasis(const char *str){ ADM_assert(encoding_gui); encoding_gui->setPhasis(str); }
开发者ID:BackupTheBerlios,项目名称:avidemux,代码行数:6,
示例12: printfuint8_t OpenDMLHeader::indexRegular(uint32_t vidTrack){uint32_t fcc,flags,offset,len;uint32_t count,total=0;uint32_t trackId,ccType;uint32_t audioCount[9]={0,0,0,0, 0,0,0,0,0};uint32_t forward[9];uint32_t backward[9];int64_t startOfData; printf("Trying avi type 1 index/n"); if(!_regularIndex.offset) { printf("No regular index/n"); return 0; } fseeko(_fd,_regularIndex.offset,SEEK_SET); // first pass : count how much count=_regularIndex.size >> 4; while(count) { fcc=len=0; fcc=read32(); flags=read32(); offset=read32(); len=read32(); if(fcc==MKFCC('r','e','c',' ')) { _recHack=1; count--; continue; } trackId=((fcc>>8) & 0xFF) -'0';; if(trackId>9) trackId=0; ccType=fcc >>16; switch(ccType) { case MKFCC('d','c',0,0): // video tracks case MKFCC('d','b',0,0): total++; break; case MKFCC('w','b',0,0): audioCount[trackId]++; break; default: printf("Unknown fcc:");fourCC::print(fcc);printf("/n"); } count--; } printf("Found %u videos chunk/n",total); for(int i=0;i<9;i++) printf("Audio track :%d, %u audio chunk/n",i,audioCount[i]); fseeko(_fd,_regularIndex.offset,SEEK_SET); _idx=new odmlIndex[total]; memset(_idx,0,sizeof(odmlIndex)*total); count=0; int run=0; // Pack tracks for(int i=0;i<9;i++) { if(audioCount[i]) { forward[run]=i; backward[i]=run; run++; } } if(!run) { _nbAudioTracks=0; printf("No audio chunk found in index../n"); }else ADM_assert(run==_nbAudioTracks); // Create index uint32_t nb; for(int i=0;i<_nbAudioTracks;i++) { nb=audioCount[forward[i]]; _audioTracks[i].index=new odmlIndex[nb+1]; memset(_audioTracks[i].index,0,(sizeof(odmlIndex)*(nb+1))); _audioTracks[i].nbChunks=0; } uint32_t audiocount=0,videocount=0; uint32_t audiototal=0; uint32_t audioSize=0; odmlIndex *track; int Achunk; count=_regularIndex.size >> 4; while(count)//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
示例13: printf/* Uncompress frame, set flags if needed*/uint8_t decoderPng::uncompress(ADMCompressedImage * in, ADMImage * out){ int bpp; int colortype; // Check if it is png, and fill it if (!!png_sig_cmp (in->data, 0, 8)) { printf ("[PNG] wrong sig/n"); return 0; } // //gain2: Init (); io.data = in->data; io.size = in->dataLength; io.cur = 0; png_read_png (PNG_PTR, INFO_PTR, PNG_TRANSFORM_IDENTITY, NULL); // Check if it is 24 or 32 bits RGB bpp = png_get_bit_depth (PNG_PTR, INFO_PTR);// printf("Bpp:%u/n",bpp); // if needed we change colorspace colortype = png_get_color_type (PNG_PTR, INFO_PTR); // if (colorspace == ADM_COLOR_RGB24 && colortype == PNG_COLOR_TYPE_RGB_ALPHA) // RGB32 { // Switch to 32 bits colorspace = ADM_COLOR_RGB32A; recalc (); goto gain2; } else if (colorspace == ADM_COLOR_RGB32A && colortype == PNG_COLOR_TYPE_RGB) { // Switch to 24 bits colorspace = ADM_COLOR_RGB24; recalc (); goto gain2; } ADM_assert (out->_isRef); out->_planes[0] = decoded; out->_planes[1] = NULL; out->_planes[2] = NULL; if (colorspace == ADM_COLOR_RGB32A) out->_planeStride[0] = _w * 4; else out->_planeStride[0] = _w * 3; out->_planeStride[1] = 0; out->_planeStride[2] = 0; out->_colorspace = colorspace; Cleanup (); return 1;}
开发者ID:BackupTheBerlios,项目名称:avidemux,代码行数:64,
示例14: automation/** * /fn automation * @return */int automation(void ){static char **argv;static int argc;static int cur;static int myargc;static int index;static three_arg_type three;static two_arg_type two; argc=global_argc; argv = global_argv; //the port change has to be done before the video load for( int runParaSearch=2 ; runParaSearch < argc ; ){ if(*argv[runParaSearch] == '-' && *(argv[runParaSearch]+1) == '-') { index = searchReactionTable(argv[runParaSearch]+2); if(index != -1) { if(!strcmp(avs_port_change, argv[runParaSearch] +2 )) { A_set_avisynth_port(argv[runParaSearch+1]); break; } runParaSearch += reaction_table[index].have_arg +1; } else runParaSearch += 1; } else runParaSearch += 1; } printf("/n *** Automated : %" PRIu32" entries*************/n",(uint32_t)NB_AUTO); // we need to process argc-=1; cur=1; myargc=argc; while(myargc>0) { if(( *argv[cur]!='-') || (*(argv[cur]+1)!='-')) { if(cur==1) { loadCB(argv[cur]); } else printf("/n Found garbage %s/n",argv[cur]); cur+=1;myargc-=1; continue; } // else it begins with -- if(!strcmp(argv[cur]+2,"portable")) // portable mode switch has been already taken care of, ignore { cur++; myargc--; continue; } index= searchReactionTable(argv[cur]+2); if(index==-1) // not found { printf("/n Unknown command :%s/n",argv[cur] ); cur+=1;myargc-=1; } else { printf("%s-->%d/n", reaction_table[index].string,reaction_table[index].have_arg); one_arg_type call=reaction_table[index].callback; switch( reaction_table[index].have_arg) { case 3: three=(three_arg_type)call; three( argv[cur+1],argv[cur+2],argv[cur+3]); break; case 2: two=(two_arg_type)call; two( argv[cur+1],argv[cur+2]); break; case 1: call(argv[cur+1]); break; case 0: call(NULL); break; default: ADM_assert(0); break; } cur+=1+reaction_table[index].have_arg; myargc-=1+reaction_table[index].have_arg; } } // end while GUI_Verbose(); printf("/n ********** Automation ended***********/n");//.........这里部分代码省略.........
开发者ID:mean00,项目名称:avidemux2,代码行数:101,
示例15: GUI_FileSelRead/** * /fn GUI_FileSelRead * /brief Select a file for reading, name is allocated with a copy of the name, null if fail. */ void GUI_FileSelRead(const char *label,char * * name) { ADM_assert(fileSelDescriptor); return fileSelDescriptor->fileReadName(label,name); }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:9,
示例16: fprintfint preferences::set_lastfile(const char* file){ char *internal_file; if( ! file ){ fprintf(stderr,"Prefs: set_lastfile(NULL) called/n"); return RC_FAILED; } internal_file = ADM_PathCanonize(file); if( !internal_file ){ fprintf(stderr,"Prefs: set_lastfile(): PathCanonize() returns NULL/n"); return RC_FAILED; }#ifdef DEBUG_PREFS fprintf(stderr,"Prefs: set_lastfile(%s)/n",file); if( strcmp(file,internal_file) ) fprintf(stderr,"Prefs: set_lastfile(%s) (with appended current dir)/n",internal_file); PRT_LAFI("<= LASTFILES_",1,opt_defs[LASTFILES_FILE1].current_val); PRT_LAFI("<= LASTFILES_",2,opt_defs[LASTFILES_FILE2].current_val); PRT_LAFI("<= LASTFILES_",3,opt_defs[LASTFILES_FILE3].current_val); PRT_LAFI("<= LASTFILES_",4,opt_defs[LASTFILES_FILE4].current_val);#endif // change opt_defs array // // ToDo: // * a call with a file already in lastfiles will resort lastfiles with // the actual argument on top // * a call with a file new to lastfiles will drop LASTFILE_4, move all // one step down and add the file as LASTFILE_1 if( opt_defs[LASTFILES_FILE4].current_val && !strncmp(opt_defs[LASTFILES_FILE4].current_val,internal_file,strlen(opt_defs[LASTFILES_FILE4].current_val)) ){ char *x = opt_defs[LASTFILES_FILE4].current_val; opt_defs[LASTFILES_FILE4].current_val = opt_defs[LASTFILES_FILE3].current_val; opt_defs[LASTFILES_FILE3].current_val = opt_defs[LASTFILES_FILE2].current_val; opt_defs[LASTFILES_FILE2].current_val = opt_defs[LASTFILES_FILE1].current_val; opt_defs[LASTFILES_FILE1].current_val = x; }else if( opt_defs[LASTFILES_FILE3].current_val && !strncmp(opt_defs[LASTFILES_FILE3].current_val,internal_file,strlen(opt_defs[LASTFILES_FILE3].current_val)) ){ char *x = opt_defs[LASTFILES_FILE3].current_val; opt_defs[LASTFILES_FILE3].current_val = opt_defs[LASTFILES_FILE2].current_val; opt_defs[LASTFILES_FILE2].current_val = opt_defs[LASTFILES_FILE1].current_val; opt_defs[LASTFILES_FILE1].current_val = x; }else if( opt_defs[LASTFILES_FILE2].current_val && !strncmp(opt_defs[LASTFILES_FILE2].current_val,internal_file,strlen(opt_defs[LASTFILES_FILE2].current_val)) ){ char *x = opt_defs[LASTFILES_FILE2].current_val; opt_defs[LASTFILES_FILE2].current_val = opt_defs[LASTFILES_FILE1].current_val; opt_defs[LASTFILES_FILE1].current_val = x; }else if( opt_defs[LASTFILES_FILE1].current_val && !strncmp(opt_defs[LASTFILES_FILE1].current_val,internal_file,strlen(opt_defs[LASTFILES_FILE1].current_val)) ){ ; // nothing to do - always on top }else{ if( opt_defs[LASTFILES_FILE4].current_val ) ADM_dealloc(opt_defs[LASTFILES_FILE4].current_val); opt_defs[LASTFILES_FILE4].current_val = opt_defs[LASTFILES_FILE3].current_val; opt_defs[LASTFILES_FILE3].current_val = opt_defs[LASTFILES_FILE2].current_val; opt_defs[LASTFILES_FILE2].current_val = opt_defs[LASTFILES_FILE1].current_val; opt_defs[LASTFILES_FILE1].current_val = ADM_strdup(internal_file); }#ifdef USE_LIBXML2 // change the xmlDocument if( ! xdoc ){ // no .avidemuxrc file or not loaded yet load(); // try to load it if( ! xdoc ){ // really: no .avidemuxrc file save(); // generate one from internal defaults and actual changes if( xdoc ) erase_blank_nodes(xdoc->children); } } if( ! xdoc ){ fprintf(stderr,"Prefs: no xml document generated ny load() nor save()/n"); }else{ xmlNodePtr p; xmlNodePtr q; // we assume a valid xml document, but maybe an older version ADM_assert( xdoc->children ); p = xdoc->children; // ->avidemux (should be there) p = goto_node_with_create(p, "lastfiles"); // ->avidemux->lastfile q = goto_node_with_create(p, "file1"); // ->avidemux->lastfile->1 xmlNodeSetContent( q, (xmlChar*)(opt_defs[LASTFILES_FILE1].current_val?opt_defs[LASTFILES_FILE1].current_val:"")); q = goto_node_with_create(p, "file2"); // ->avidemux->lastfile->2 xmlNodeSetContent( q, (xmlChar*)(opt_defs[LASTFILES_FILE2].current_val?opt_defs[LASTFILES_FILE2].current_val:"")); q = goto_node_with_create(p, "file3"); // ->avidemux->lastfile->3 xmlNodeSetContent( q, (xmlChar*)(opt_defs[LASTFILES_FILE3].current_val?opt_defs[LASTFILES_FILE3].current_val:"")); q = goto_node_with_create(p, "file4"); // ->avidemux->lastfile->4 xmlNodeSetContent( q, (xmlChar*)(opt_defs[LASTFILES_FILE4].current_val?opt_defs[LASTFILES_FILE4].current_val:"")); save_xml_to_file(); }#endif#ifdef DEBUG_PREFS PRT_LAFI("=> LASTFILES_",1,opt_defs[LASTFILES_FILE1].current_val); PRT_LAFI("=> LASTFILES_",2,opt_defs[LASTFILES_FILE2].current_val); PRT_LAFI("=> LASTFILES_",3,opt_defs[LASTFILES_FILE3].current_val); PRT_LAFI("=> LASTFILES_",4,opt_defs[LASTFILES_FILE4].current_val);#endif delete[] internal_file;//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
示例17: FileSel_SelectRead/** * /fn FileSel_SelectRead * /brief Select a file for Reading, name is allocated with a copy of the name, null if fail. * @param title : [in] Title of the dialog box * @param target: [in/out] Buffer that will hold the name, must be at least max bytes big * @param max : [in] Max number of bytes the buffer will hold * @param source : [in] Initial value for the file, can be null */ uint8_t FileSel_SelectRead(const char *title,char *target,uint32_t max, const char *source){ ADM_assert(fileSelDescriptor); return fileSelDescriptor->fileSelectRead(title,target,max, source);}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:13,
示例18: ADM_assertuint8_t ADM_queue::isEmpty(void){ if(head) return 0; ADM_assert(!tail); return 1; }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:6,
示例19: memcpyDecimate::Decimate(AVDMGenericVideoStream *in,CONFcouple *couples) {{ int count = 0; char buf[80]; unsigned int *p; _in=in; memcpy(&_info,_in->getInfo(),sizeof(_info)); _info.encoding=1; _uncompressed=NULL; _info.encoding=1; // // Init here debug=0; show=0; #ifdef USE_SSE if(CpuCaps::hasSSE()) { printf("Decimate:SSE enabled/n"); }#endif // _param=new DECIMATE_PARAM; if(couples) { GET(cycle); GET(mode); GET(quality); GET(threshold); GET(threshold2); } else // Default { _param->cycle=5; _param->mode=0; _param->quality=2; _param->threshold=0; _param->threshold2=3.0; } ADM_assert(_param->cycle); vidCache=new VideoCache(_param->cycle*2+1,in); if (_param->mode == 0 || _param->mode == 2 || _param->mode == 3) { num_frames_hi = _info.nb_frames; _info.nb_frames = _info.nb_frames * (_param->cycle - 1) / _param->cycle; _info.fps1000=_info.fps1000*(_param->cycle-1); _info.fps1000=(uint32_t)(_info.fps1000/_param->cycle); } last_request = -1; firsttime = true; sum = (unsigned int *) ADM_alloc(MAX_BLOCKS * MAX_BLOCKS * sizeof(unsigned int)); ADM_assert(sum); all_video_cycle = true; if (debug) { char b[80]; sprintf(b, "Decimate %s by Donald Graft, Copyright 2003/n", VERSION); OutputDebugString(b); } }}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:69,
示例20: oplug_mpegffuint8_t oplug_mpegff(const char *name, ADM_OUT_FORMAT type){AVDMGenericVideoStream *_incoming;//EncoderFFMPEGMpeg1 *encoder;Encoder *encoder;ADMMpegMuxer *muxer=NULL;FILE *file=NULL;uint8_t audioBuffer[48000];uint32_t audioLen=0;uint32_t _w,_h,_fps1000,_page,total; AVDMGenericAudioStream *audio;uint32_t len,flags;uint32_t size;ADM_MUXER_TYPE mux;uint32_t audio_encoding=0;uint32_t real_framenum=0;uint8_t ret=0;uint32_t sample_target=0;uint32_t total_sample=0;ADMBitstream bitstream(0);uint32_t audioSum=0; twoPass=new char[strlen(name)+6]; twoFake=new char[strlen(name)+6]; strcpy(twoPass,name); strcat(twoPass,".stat"); /* orig: strcat(twoFake,".fake"); */ strcpy(twoFake,name); strcat(twoFake,".fake"); _incoming = getLastVideoFilter (frameStart,frameEnd-frameStart); _w=_incoming->getInfo()->width; _h=_incoming->getInfo()->height; _fps1000=_incoming->getInfo()->fps1000; _page=_w*_h; _page+=_page>>1; total=_incoming->getInfo()->nb_frames; if(!total) return 0; switch(type) { default: ADM_assert(0); case ADM_ES: // Else open file (if possible) mux=MUXER_NONE; break; case ADM_TS: if(!currentaudiostream) { GUI_Error_HIG(_("There is no audio track"), NULL); return 0; } audio=mpt_getAudioStream(); mux=MUXER_TS; break; case ADM_PS: { if(!currentaudiostream) { GUI_Error_HIG(_("There is no audio track"), NULL); return 0; } audio=mpt_getAudioStream(); // Have to check the type // If it is mpeg2 we use DVD-PS // If it is mpeg1 we use VCD-PS // Later check if it is SVCD if(!audio) { GUI_Error_HIG(_("Audio track is not suitable"), NULL); return 0; } // Check WAVHeader *hdr=audio->getInfo(); audio_encoding=hdr->encoding; if(current_codec==CodecXVCD ||current_codec==CodecVCD) { if(hdr->frequency!=44100 || hdr->encoding != WAV_MP2) { GUI_Error_HIG(("Incompatible audio"),_( "For VCD, audio must be 44.1 kHz MP2.")); deleteAudioFilter(audio); return 0; } mux=MUXER_VCD; printf("X*CD: Using VCD PS/n"); }else { aviInfo info; video_body->getVideoInfo(&info); if(hdr->frequency==44100 && _w==480&&hdr->encoding == WAV_MP2 ) // SVCD ? { mux=MUXER_SVCD; printf("X*VCD: Using SVCD PS/n"); }//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
示例21: DIA_xvid4/** /fn getFFCompressParams /brief Dialog for lavcodec mpeg4/... codec settings*/uint8_t DIA_xvid4(COMPRES_PARAMS *incoming){int b;int ret=0;int code; xvid4EncParam localParam; ADM_assert(incoming->extraSettingsLen==sizeof(localParam)); memcpy(&localParam,incoming->extraSettings,sizeof(localParam));#define PX(x) &(localParam.x) // Our tabs /* Tab 1 main */ diaElemBitrate bitrate(incoming,NULL);#define MKTOGGLE(y,x) diaElemToggle t_##x(PX(x),y) MKTOGGLE(QT_TR_NOOP("_Interlaced"), interlaced); MKTOGGLE(QT_TR_NOOP("Ca_rtoon mode"), cartoon); MKTOGGLE(QT_TR_NOOP("_Greyscale"), greyscale); MKTOGGLE(QT_TR_NOOP("Turbo mode"), turbo); MKTOGGLE(QT_TR_NOOP("C_hroma optimizer"), chroma_opt); diaElem *main[]={&bitrate,&t_interlaced,&t_cartoon,&t_greyscale,&t_turbo,&t_chroma_opt}; diaElemTabs tabMain(QT_TR_NOOP("Main"),6,main); /* Tab 2 motion */ diaMenuEntry motionMenu[] = { {0, QT_TR_NOOP("None"),NULL} ,{1, QT_TR_NOOP("Very Low"),NULL} ,{2, QT_TR_NOOP("Low"),NULL} ,{3, QT_TR_NOOP("Medium"),NULL} ,{4, QT_TR_NOOP("High"),NULL} ,{5, QT_TR_NOOP("Very High"),NULL} ,{6, QT_TR_NOOP("Ultra High"),NULL}}; diaElemMenu motion(PX(guiLevel),QT_TR_NOOP("Motion Search Precision"),7,motionMenu); diaMenuEntry vhqMenu[] = { {0, QT_TR_NOOP("Off"),NULL} ,{1, QT_TR_NOOP("Mode Decision"),NULL} ,{2, QT_TR_NOOP("Limited Search"),NULL} ,{3, QT_TR_NOOP("Medium Search"),NULL} ,{4, QT_TR_NOOP("Wide Search"),NULL} }; diaElemMenu vhq(PX(vhqmode),QT_TR_NOOP("VHQ Mode"),5,vhqMenu); /* Tab2-ASP */ diaElemUInteger bframe(PX(bframes),QT_TR_NOOP("Max B Frames"),0,3); diaElemToggle qpel(PX(qpel),QT_TR_NOOP("Quarter Pixel")); diaElemToggle gmc(PX(gmc),QT_TR_NOOP("GMC")); diaElemToggle bvhq(PX(bvhq),QT_TR_NOOP("BVHQ")); diaElemFrame frameASP(QT_TR_NOOP("Advanced Simple Profile")); frameASP.swallow(&bframe); frameASP.swallow(&qpel); frameASP.swallow(&gmc); frameASP.swallow(&bvhq); /* Tab 2 motion extra */ diaElemToggle inter4mv(PX(inter4mv),QT_TR_NOOP("4MV")); diaElemToggle chroma_me(PX(chroma_me),QT_TR_NOOP("Chroma ME")); diaElemToggle hqac(PX(chroma_me),QT_TR_NOOP("HQ AC")); diaElemFrame frameMore(QT_TR_NOOP("More Search")); frameMore.swallow(&inter4mv); frameMore.swallow(&chroma_me); frameMore.swallow(&hqac); /* Tab 2 gop size */ diaElemUInteger min_key_interval(PX(min_key_interval),QT_TR_NOOP("Min Gop Size"),1,900); diaElemUInteger max_key_interval(PX(max_key_interval),QT_TR_NOOP("Max Gop Size"),1,900); diaElemFrame frameGop(QT_TR_NOOP("GOP Size")); frameGop.swallow(&min_key_interval); frameGop.swallow(&max_key_interval); diaElem *motions[]={&motion,&vhq,&frameMore,&frameGop,&frameASP}; diaElemTabs tabMotion(QT_TR_NOOP("Motion"),5,motions); /* Tab 3 Qz*/ diaMenuEntry qzMenu[] = { {0, QT_TR_NOOP("H263"),NULL} ,{1, QT_TR_NOOP("Mpeg"),NULL}} ; diaElemMenu h263(PX(mpegQuantizer),QT_TR_NOOP("Quantization Matrix"),2,qzMenu); diaElemToggle trellis(PX(trellis),QT_TR_NOOP("Trellis Quantization")); diaElem *qz[]={&h263,&trellis}; diaElemTabs tabQz(QT_TR_NOOP("Quantization"),2,qz); /* Tab 4 : 2nd pass */#define MKENTRY(y,x) diaElemUInteger x(PX(x),y,0,100); frameOne.swallow(&x); diaElemFrame frameOne(QT_TR_NOOP("Two Pass Tuning")); MKENTRY(QT_TR_NOOP("Key Frame Boost(%)"), keyframe_boost); MKENTRY(QT_TR_NOOP("I-frames closer than..."), kfthreshold); MKENTRY(QT_TR_NOOP(".. are reduced by(%)"), kfreduction); MKENTRY(QT_TR_NOOP("Max Overflow Improvement(%)"), max_overflow_improvement); MKENTRY(QT_TR_NOOP("Max Overglow Degradation(%)"), max_overflow_degradation);#undef MKENTRY#define MKENTRY(y,x) diaElemUInteger x(PX(x),y,0,100);frameTwo.swallow(&x); diaElemFrame frameTwo(QT_TR_NOOP("Curve Compression")); MKENTRY(QT_TR_NOOP("High Bitrate Scenes (%)"), curve_compression_high);//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
示例22: UNUSED_ARGuint8_t ADMVideoStabilize::getFrameNumberNoAlloc(uint32_t frame, uint32_t *len, ADMImage *data, uint32_t *flags){UNUSED_ARG(flags);uint32_t uvlen;uint32_t dlen,dflags;ADMImage *_next;ADMImage *_previous; ADMImage *_current; uvlen= _info.width*_info.height; *len=uvlen+(uvlen>>1); if(frame> _info.nb_frames-1) return 0; _current=vidCache->getImage(frame); if(!_current) return 0; data->copyInfo(_current); if(!frame || (frame==_info.nb_frames-1)) { data->duplicate(_current); vidCache->unlockAll(); return 1; } _previous=vidCache->getImage(frame-1); if(!_previous) { vidCache->unlockAll(); return 0; } _next=vidCache->getImage(frame+1); if(!_next) { vidCache->unlockAll(); return 0; } // for u & v , no action -> copy it as is memcpy(UPLANE(data),UPLANE(_current),uvlen>>2); memcpy(VPLANE(data),VPLANE(_current),uvlen>>2); uint8_t *inprev,*innext,*incur,*zout; inprev=YPLANE(_previous)+1+_info.width; innext=YPLANE(_next)+1+_info.width; incur =YPLANE(_current)+1+_info.width; zout=YPLANE(data)+_info.width+1; uint8_t *nl,*pl,*nc,*pc; uint16_t c,coeff; uint32_t x; for(uint32_t y= _info.height-1;y>1;y--) { nl=incur+_info.width; pl=incur-_info.width; nc=incur+1; pc=incur-1; for(x= _info.width-1;x>1;x--) { c=*incur*4;; coeff=4;#define PONDERATE(x,p) if(distMatrix[*incur][x]<*_param) /{ c+=x;coeff++;} PONDERATE(*innext,1); PONDERATE(*inprev,1); PONDERATE(*(pc),1); PONDERATE(*(nc),1); PONDERATE(*(nl),1); PONDERATE(*(pl),1); //*zout=(uint8_t)floor(0.49+(c/coeff)); ADM_assert(coeff); ADM_assert(coeff<16); *zout=(c*fixMul[coeff])>>16; zout++; incur++; innext++; inprev++; nl++;pl++;nc++;pc++; } zout+=2; incur+=2; innext+=2; inprev+=2; } vidCache->unlockAll(); return 1; }
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:93,
示例23: ADM_assertvoid DIA_working::closeDialog( void ){ workWindow *wind=(workWindow *)_priv; ADM_assert(wind); if(wind) delete wind; wind=NULL;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:6,
示例24: whileuint8_t OGMDemuxer::readHeader(uint32_t *paySize, uint32_t *flags, uint64_t *frame,uint8_t *id){uint8_t gotcha=0,c=0;uint32_t total=0,failed=0;uint64_t seq; *frame=0; if(_payload) fseeko(_fd,_payload,SEEK_CUR); _payload=0; while(1) { _hdrpos=ftello(_fd); if(fread(&_page,sizeof(_page),1,_fd)!=1) return 0; if(!fourCC::check(_page.sig,(uint8_t *)"OggS")) { printf("Bad at offset :%lu 0x %x/n",_hdrpos,_hdrpos); ADM_assert(0); } *id=fourCC::get(_page.serial); // seq=_page.page_sequence[0]+(_page.page_sequence[1]<<8); //printf("seq:%x /n",seq); uint64_t *ll; ll=(uint64_t *)_page.abs_pos; //printf("abs:%llx /n",*ll); // //if(fourCC::check(_trackId,_page.serial)) // got it { gotcha=1; } total=0; _nbLace=_page.nb_segment; _nbFrag=0; for(uint32_t i=0;i<_page.nb_segment;i++) { c=fgetc(_fd); _lace[i]=c; if(c!=0xff) _nbFrag++; total+=c; } if(gotcha) {#if 0 *frame=*(unsigned long long *)_page.abs_pos;#else *frame+=_page.abs_pos[4]+(_page.abs_pos[5]<<8)+(_page.abs_pos[6]<<16)+ (_page.abs_pos[7]<<24); *frame=(*frame)<<32; *frame=_page.abs_pos[0]+(_page.abs_pos[1]<<8)+(_page.abs_pos[2]<<16)+ (_page.abs_pos[3]<<24); if(*frame>48000*3 && seq==3) { printf("Fixing stupid abs_pos/n"); *frame=0; } #endif *flags=_page.header_type; *paySize=total; _payload=total; return 1; } // skipt it fseek(_fd,total,SEEK_CUR); failed++; if(failed>10) { _payload=0; return 0; // we allow 10 fails } } return 0;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:82,
示例25: ADM_assertAVDMGenericVideoStream *getFirstCurrentVideoFilter( void){ ADM_assert(nb_active_filter); return videofilters[ 0].filter;}
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:5,
示例26: bindGUI///_____________________________________________________/// retrieve gtkwidget through their name/// the aim is to avoid having to modify the glade generated file///_____________________________________________________uint8_t bindGUI( void ){#define ADM_LOOKUP(a,b) a= lookup_widget (guiRootWindow,#b);if(!a) return 0; ADM_LOOKUP(guiDrawingArea,guiDrawing); ADM_LOOKUP(guiSlider,sliderNavigate); sliderAdjustment=gtk_range_get_adjustment (GTK_RANGE(guiSlider)); ADM_LOOKUP(guiMarkA,labelMarkA); ADM_LOOKUP(guiMarkB,labelMarkB); ADM_LOOKUP(guiCurFrame,boxCurFrame); ADM_LOOKUP(guiTotalFrame,labelTotalFrame); ADM_LOOKUP(guiCurTime,boxCurTime); ADM_LOOKUP(guiTotalTime,labelTotalTime);#if 0 ADM_LOOKUP(guiPreviewToggle,toggletoolbuttonPreview); ADM_LOOKUP(guiOutputToggle,toggletoolbuttonOutput); ADM_LOOKUP(guiAudioToggle,togglebuttonAudio); ADM_LOOKUP(guiVideoToggle,togglebuttonVideo);#endif#undef ADM_LOOKUP // bind menu #define CALLBACK(x,y) gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,#x)), "activate", / GTK_SIGNAL_FUNC(guiCallback), (void *) y) #include "GUI_menumap.h" #undef CALLBACK /// /bind menu // destroy gtk_object_set_data_full(GTK_OBJECT(guiRootWindow), "guiRootWindow", guiRootWindow, (GtkDestroyNotify) destroyCallback); // now add callbacks gtk_widget_add_events(guiRootWindow, GDK_BUTTON_PRESS_MASK); gtk_signal_connect(GTK_OBJECT(guiRootWindow), "button_press_event", GTK_SIGNAL_FUNC(UI_returnFocus), NULL); gtk_signal_connect(GTK_OBJECT(guiSlider), "button_press_event", GTK_SIGNAL_FUNC(UI_SliderPressed), NULL); gtk_signal_connect(GTK_OBJECT(guiSlider), "button_release_event", GTK_SIGNAL_FUNC(UI_SliderReleased), NULL); // Current Frame gtk_signal_connect(GTK_OBJECT(guiCurFrame), "focus_in_event", GTK_SIGNAL_FUNC(UI_grabFocus), (void *) NULL); gtk_signal_connect(GTK_OBJECT(guiCurFrame), "focus_out_event", GTK_SIGNAL_FUNC(UI_loseFocus), (void *) NULL); gtk_signal_connect(GTK_OBJECT(guiCurFrame), "activate", GTK_SIGNAL_FUNC(UI_focusAfterActivate), (void *) ACT_JumpToFrame); // Volume gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,"hscalVolume")), "value_changed", GTK_SIGNAL_FUNC(volumeChange), (void *) NULL); // Jog gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,"jogg")), "value_changed", GTK_SIGNAL_FUNC(jogChange), (void *) NULL); // Time Shift gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,"spinbuttonTimeShift")), "focus_in_event", GTK_SIGNAL_FUNC(UI_grabFocus), (void *) NULL); gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,"spinbuttonTimeShift")), "focus_out_event", GTK_SIGNAL_FUNC(UI_loseFocus), (void *) NULL); gtk_signal_connect(GTK_OBJECT(lookup_widget(guiRootWindow,"spinbuttonTimeShift")), "activate", GTK_SIGNAL_FUNC(UI_focusAfterActivate), (void *) ACT_TimeShift);#define ADD_SIGNAL(a,b,c) gtk_signal_connect(GTK_OBJECT(a), b, GTK_SIGNAL_FUNC(guiCallback), (void *) c); ADD_SIGNAL(guiSlider,"value_changed",ACT_Scale); ADD_SIGNAL(lookup_widget(guiRootWindow,"spinbuttonTimeShift"),"value_changed",ACT_TimeShift); // Callbacks for buttons uint32_t nb=sizeof(buttonCallback)/sizeof(buttonCallBack_S); GtkWidget *bt; for(uint32_t i=0;i<nb;i++) { bt= lookup_widget (guiRootWindow,buttonCallback[i].name); if(!bt) { printf("Binding failed for %s/n",buttonCallback[i].name); ADM_assert(0); } ADD_SIGNAL(bt,buttonCallback[i].signal,buttonCallback[i].action); GTK_WIDGET_UNSET_FLAGS (bt, GTK_CAN_FOCUS); } GTK_WIDGET_SET_FLAGS (lookup_widget(guiRootWindow,"boxCurFrame"), GTK_CAN_FOCUS); // set some tuning gtk_widget_set_usize(guiDrawingArea, 512, 288); // hscale GTK_WIDGET_UNSET_FLAGS (guiSlider, GTK_CAN_FOCUS); gtk_widget_show(guiSlider); // And, the size now scales to the width of the window.//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:avidemux-svn,代码行数:101,
注:本文中的ADM_assert函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ADM_error函数代码示例 C++ ADIOI_Malloc函数代码示例 |