From: pkv Date: Fri, 25 Nov 2005 11:47:51 +0000 (+0000) Subject: show/hide the recorder toolbar in dependence of existance the external executable X-Git-Tag: TG-D5-38-2003_D2005-20-12~109 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f43fd354e89f0c67933080108184f16eb82eb7e2;p=modules%2Fvisu.git show/hide the recorder toolbar in dependence of existance the external executable --- diff --git a/src/VVTK/VVTK_MainWindow.cxx b/src/VVTK/VVTK_MainWindow.cxx index d3ee34ca..47e35583 100644 --- a/src/VVTK/VVTK_MainWindow.cxx +++ b/src/VVTK/VVTK_MainWindow.cxx @@ -96,6 +96,10 @@ VVTK_MainWindow connect( myStopAction, SIGNAL( activated() ), this, SLOT( OnStopRecording() ) ); myRecorder=VVTK_Recorder::New(); + myRecorder->CheckExistAVIMaker(); + if (myRecorder->ErrorStatus()){ + myRecordingToolBar->setEnabled(false); + } } void diff --git a/src/VVTK/VVTK_Recorder.cxx b/src/VVTK/VVTK_Recorder.cxx index a52e3f57..ca2e1aa5 100755 --- a/src/VVTK/VVTK_Recorder.cxx +++ b/src/VVTK/VVTK_Recorder.cxx @@ -75,6 +75,9 @@ VVTK_Recorder::VVTK_Recorder() myName=new char [512]; myName[0]=0; myNbWrittenFrames=0; + // + myNameAVIMaker=new char[32]; + strcpy (myNameAVIMaker, "jpeg2yuv"); } //=============================================== // function: ~ @@ -86,6 +89,22 @@ VVTK_Recorder::~VVTK_Recorder() myFilter->Delete(); delete myWriterMgr; delete myName; + delete myNameAVIMaker; +} +//=============================================== +// function: CheckExistAVIMaker +// purpose : +//=============================================== +void VVTK_Recorder::CheckExistAVIMaker() +{ + int iErr, iES; + // + myErrorStatus=0; + iErr=system(myNameAVIMaker); + iErr=WEXITSTATUS(iErr); + if (iErr==127){ + myErrorStatus=iErr; + } } //=============================================== // function: DoPlay @@ -328,8 +347,7 @@ void VVTK_Recorder::PreWrite() void VVTK_Recorder::AddSkippedFrames() { myErrorStatus=0; - // - + //... } //=============================================== // function: MakeFileAVI @@ -344,8 +362,8 @@ void VVTK_Recorder::MakeFileAVI() //"jpeg2yuv -f 10 -I p -n 16 -v 0 -j abcx_1%06d.jpeg | yuv2lav -o z.avi" // iNbFPS=(int)myNbFPS; - sprintf(aCmd, "jpeg2yuv -I p -v 0 -f %d -n %d -j %s%s | yuv2lav -o %s.avi", - iNbFPS, myNbWrittenFrames, myName, fmt, myName); + sprintf(aCmd, "%s -I p -v 0 -f %d -n %d -j %s%s | yuv2lav -o %s.avi", + myNameAVIMaker, iNbFPS, myNbWrittenFrames, myName, fmt, myName); // myErrorStatus=system(aCmd); } diff --git a/src/VVTK/VVTK_Recorder.h b/src/VVTK/VVTK_Recorder.h index 849343e3..1b820894 100755 --- a/src/VVTK/VVTK_Recorder.h +++ b/src/VVTK/VVTK_Recorder.h @@ -73,6 +73,7 @@ public: void* theClientData, void* theCallData); + void CheckExistAVIMaker(); // protected : VVTK_Recorder(); @@ -100,6 +101,8 @@ protected : vtkWindowToImageFilter *myFilter; VVTK_ImageWriterMgr *myWriterMgr; + char *myNameAVIMaker; + private: VVTK_Recorder(const VVTK_Recorder&); //Not implemented void operator=(const VVTK_Recorder&); //Not implemented