You are not logged in.

#1 09-21-2014 10:30:40

gerd1028
Membre
Registered: 05-09-2014
Posts: 35

various Patches for 2.2 Devel

Hi,

working with the current devel-version of your great program i found some issues:

- recreating the ffdiaporama.db is missing the field SoundWavw in table MediaFiles:

--- d:\zw\ffDiaporama\ffDiaporama\src\ffDiaporama_lib\cDatabase.cpp	2014-04-12 08:52:34.000000000 +0200
+++ f:\src\ffDiaporama\src\ffDiaporama_lib\cDatabase.cpp	2014-09-04 14:42:04.000000000 +0200
@@ -459,13 +459,14 @@
                             "ModifDateTime      text,"\
                             "FileSize           bigint,"\
                             "MediaFileType      int,"\
                             "BasicProperties    text,"\
                             "ExtendedProperties text,"\
                             "Thumbnail16        binary,"\
-                            "Thumbnail100       binary"\
+                            "Thumbnail100       binary,"\
+                            "SoundWave          text"\
                      ")";
     CreateIndexQuery.append("CREATE INDEX idx_MediaFiles_Key ON MediaFiles (Key)");
     CreateIndexQuery.append("CREATE INDEX idx_MediaFiles_FolderKey ON MediaFiles (FolderKey,ShortName)");
 }
 
 //=====================================================================================================
@@ -808,13 +809,17 @@
 //====================================================================================================================
 
 bool cFilesTable::GetAnalyseSound(qlonglong FileKey,QList<qreal> *Peak,QList<qreal> *Moyenne,int64_t *RealAudioDuration,int64_t *RealVideoDuration,qreal *MaxMoyenneValue) {
     QSqlQuery Query(Database->db);
     *RealAudioDuration=0;
     if (RealVideoDuration) *RealVideoDuration=0;
-    Query.prepare((QString("SELECT SoundWave FROM %1 WHERE Key=:Key").arg(TableName)));
+    if( !Query.prepare((QString("SELECT SoundWave FROM %1 WHERE Key=:Key").arg(TableName))) )
+    {
+        DisplayLastSQLError(&Query);
+        return false;
+    }
     Query.bindValue(":Key",FileKey,QSql::In);
     if (!Query.exec()) {
         DisplayLastSQLError(&Query);
         return false;
     }
     while (Query.next()) {

in BlurScanLine (ImageFilters) is an error in the loop-expression when blurring very small images:

--- d:\zw\ffDiaporama\ffDiaporama\src\ffDiaporama_lib\ImageFilters.cpp	2014-01-17 16:22:16.000000000 +0200
+++ f:\src\ffDiaporama\src\ffDiaporama_lib\ImageFilters.cpp	2014-09-21 09:48:20.000000000 +0200
@@ -833,13 +833,13 @@
     if (kern_width>columns) {
         for (dest=destination,x=0;x<columns;++x,dest+=offset) {
             aggregate = zero;
             scale = 0.0;
             k = kernel;
             src = source;
-            for (i=0;i<columns;++k,src+=offset) {
+            for (i=0;i<columns;++k,src+=offset,i++) {
                 if((i >= (x-kern_width/2)) && (i <= (x+kern_width/2))) {
                     aggregate.red  +=(*k)*qRed(*src);
                     aggregate.green+=(*k)*qGreen(*src);
                     aggregate.blue +=(*k)*qBlue(*src);
                     aggregate.alpha+=(*k)*qAlpha(*src);
                 }

in DlgImageComposer.cpp is a Log-Entry in the wrong line:

--- d:\zw\ffDiaporama\ffDiaporama\src\ffDiaporama\DlgSlide\DlgImageComposer.cpp	2014-03-14 16:57:30.000000000 +0200
+++ f:\src\ffDiaporama\src\ffDiaporama\DlgSlide\DlgImageComposer.cpp	2014-09-18 17:38:22.000000000 +0200
@@ -67,12 +67,13 @@
 }
 
 //====================================================================================================================
 // Initialise dialog
 
 void DlgImageComposer::DoInitDialog() {
+    ToLog(LOGMSG_DEBUGTRACE,"IN:DlgImageComposer::DoInitDialog");
     cShotComposer::DoInitDialog();
 
     // Thumbnail part
     ui->TextClipArtCB->PrepareTable();
     BlockTable->ProjectGeometry=ProjectGeometry;
 
@@ -156,13 +157,11 @@
     RefreshBlockTable(0);
 }
 
 //====================================================================================================================
 
 DlgImageComposer::~DlgImageComposer() {
-    ToLog(LOGMSG_DEBUGTRACE,"IN:DlgImageComposer::DoInitDialog");
 
     ffdProject->CloseUnusedLibAv(ffdProject->CurrentCol);
     delete ui;
 }
 
 //====================================================================================================================

when analysing sound MaxSoundValue can be 0

--- d:\zw\ffDiaporama\ffDiaporama\src\ffDiaporama\engine\cBaseMediaFile.cpp	2014-07-01 10:56:28.000000000 +0200
+++ f:\src\ffDiaporama\src\ffDiaporama\engine\cBaseMediaFile.cpp	2014-09-06 11:21:58.000000000 +0200
@@ -2101,12 +2105,14 @@
 
         // Compute MaxSoundValue as 90% of the max peak value
         QList<qreal> MaxVal;
         foreach (qreal Value,*Peak) MaxVal.append(Value);
         qSort(MaxVal.begin(),MaxVal.end());
         qreal MaxSoundValue=MaxVal.count()>0?MaxVal[MaxVal.count()*0.9]:1;
+        if( MaxSoundValue == 0 )
+            MaxSoundValue = 1;
 
         // Adjust Peak and Moyenne values by transforming them as % of the max value
         for (int i=0;i<Peak->count();i++) {
             (*Peak)[i]   =(*Peak)[i]/MaxSoundValue;
             (*Moyenne)[i]=(*Moyenne)[i]/MaxSoundValue;
         }

even if a hidden shot isn't shown, its properties a base for animations in the next step. So imho its better to show the props of this instead of showing some unwanted data:

--- d:\zw\ffDiaporama\ffDiaporama\src\ffDiaporama\DlgSlide\cShotComposer.cpp	2014-04-19 11:58:56.000000000 +0200
+++ f:\src\ffDiaporama\src\ffDiaporama\DlgSlide\cShotComposer.cpp	2014-09-13 18:16:46.000000000 +0200
@@ -238,32 +238,33 @@
 //====================================================================================================================
 
 void cShotComposer::RefreshControls(bool UpdateInteractiveZone) {
     InRefreshControls=true;
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
 
-    if ((BlockSelectMode==SELECTMODE_ONE)&&(CurrentCompoObject)&&(CurrentCompoObject->IsVisible)) {
+    bool bEnable = CurrentCompoObject && CurrentCompoObject->IsVisible;
+    if ((BlockSelectMode==SELECTMODE_ONE)&&(CurrentCompoObject)/*&&(CurrentCompoObject->IsVisible)*/) {
 
         qreal Ratio_X,Ratio_Y;
         ComputeBlockRatio(CurrentCompoObject,Ratio_X,Ratio_Y);
 
         if (GETUI("InheritDownCB")) {
             GETUI("InheritDownCB")->setEnabled(CurrentShotNbr!=0);
             if (GETCHECKBOX("InheritDownCB")->isChecked()!=!CurrentCompoObject->BlockInheritance)
                 GETCHECKBOX("InheritDownCB")->setChecked(!CurrentCompoObject->BlockInheritance);
         }
 
         // Position, size and rotation
-        GETUI("PosSize_X")->     setEnabled(true);
-        GETUI("PosSize_Y")->     setEnabled(true);
-        GETUI("PosSize_Width")-> setEnabled(true);
-        GETUI("PosSize_Height")->setEnabled(true);
-        GETDOUBLESPINBOX("PosXEd")->        setEnabled(true);
-        GETDOUBLESPINBOX("PosYEd")->        setEnabled(true);
-        GETDOUBLESPINBOX("WidthEd")->       setEnabled(true);
-        GETDOUBLESPINBOX("HeightEd")->      setEnabled(true);
+        GETUI("PosSize_X")->     setEnabled(bEnable);
+        GETUI("PosSize_Y")->     setEnabled(bEnable);
+        GETUI("PosSize_Width")-> setEnabled(bEnable);
+        GETUI("PosSize_Height")->setEnabled(bEnable);
+        GETDOUBLESPINBOX("PosXEd")->        setEnabled(bEnable);
+        GETDOUBLESPINBOX("PosYEd")->        setEnabled(bEnable);
+        GETDOUBLESPINBOX("WidthEd")->       setEnabled(bEnable);
+        GETDOUBLESPINBOX("HeightEd")->      setEnabled(bEnable);
 
         if (ApplicationConfig->DisplayUnit==DISPLAYUNIT_PERCENT) {
             GETDOUBLESPINBOX("PosXEd")->  setRange(-200,200);                                                  GETDOUBLESPINBOX("PosXEd")->  setValue(CurrentCompoObject->x*100/Ratio_X);
             GETDOUBLESPINBOX("PosYEd")->  setRange(-200,200);                                                  GETDOUBLESPINBOX("PosYEd")->  setValue(CurrentCompoObject->y*100/Ratio_Y);
             GETDOUBLESPINBOX("WidthEd")-> setRange(1,200);                                                     GETDOUBLESPINBOX("WidthEd")-> setValue(CurrentCompoObject->w*100/Ratio_X);
             GETDOUBLESPINBOX("HeightEd")->setRange(1,200);                                                     GETDOUBLESPINBOX("HeightEd")->setValue(CurrentCompoObject->h*100/Ratio_Y);
@@ -272,40 +273,40 @@
             GETDOUBLESPINBOX("PosYEd")->  setRange(-2*InteractiveZone->DisplayH,2*InteractiveZone->DisplayH);  GETDOUBLESPINBOX("PosYEd")->  setValue(CurrentCompoObject->y*InteractiveZone->DisplayH/Ratio_Y);
             GETDOUBLESPINBOX("WidthEd")-> setRange(3,2*InteractiveZone->DisplayW);                             GETDOUBLESPINBOX("WidthEd")-> setValue(CurrentCompoObject->w*InteractiveZone->DisplayW/Ratio_X);
             GETDOUBLESPINBOX("HeightEd")->setRange(3,2*InteractiveZone->DisplayH);                             GETDOUBLESPINBOX("HeightEd")->setValue(CurrentCompoObject->h*InteractiveZone->DisplayH/Ratio_Y);
         }
 
         // Rotation
-        GETUI("Rotate_X")-> setEnabled(true);
-        GETSPINBOX("RotateXED")-> setEnabled(true);
-        GETUI("ResetRotateXBT")->setEnabled(true);
-        GETSLIDER("RotateXSLD")->setEnabled(true);
-        GETUI("Rotate_Y")-> setEnabled(true);
-        GETSPINBOX("RotateYED")-> setEnabled(true);
-        GETUI("ResetRotateYBT")->setEnabled(true);
-        GETSLIDER("RotateYSLD")->setEnabled(true);
-        GETUI("Rotate_Z")-> setEnabled(true);
-        GETSPINBOX("RotateZED")-> setEnabled(true);
-        GETUI("ResetRotateZBT")->setEnabled(true);
-        GETSLIDER("RotateZSLD")->setEnabled(true);
+        GETUI("Rotate_X")-> setEnabled(bEnable);
+        GETSPINBOX("RotateXED")-> setEnabled(bEnable);
+        GETUI("ResetRotateXBT")->setEnabled(bEnable);
+        GETSLIDER("RotateXSLD")->setEnabled(bEnable);
+        GETUI("Rotate_Y")-> setEnabled(bEnable);
+        GETSPINBOX("RotateYED")-> setEnabled(bEnable);
+        GETUI("ResetRotateYBT")->setEnabled(bEnable);
+        GETSLIDER("RotateYSLD")->setEnabled(bEnable);
+        GETUI("Rotate_Z")-> setEnabled(bEnable);
+        GETSPINBOX("RotateZED")-> setEnabled(bEnable);
+        GETUI("ResetRotateZBT")->setEnabled(bEnable);
+        GETSLIDER("RotateZSLD")->setEnabled(bEnable);
 
         GETSPINBOX("RotateXED")->setValue(CurrentCompoObject->RotateXAxis);                       GETSLIDER("RotateXSLD")->setValue(CurrentCompoObject->RotateXAxis);
         GETSPINBOX("RotateYED")->setValue(CurrentCompoObject->RotateYAxis);                       GETSLIDER("RotateYSLD")->setValue(CurrentCompoObject->RotateYAxis);
         GETSPINBOX("RotateZED")->setValue(CurrentCompoObject->RotateZAxis);                       GETSLIDER("RotateZSLD")->setValue(CurrentCompoObject->RotateZAxis);
 
         // Shape part
-        GETUI("BlockShapeStyleBT")->setEnabled(true);
-        GETUI("BlockShapeStyleED")->setEnabled(true);
-        GETUI("BackgroundFormCB")->setEnabled(true);
-        GETUI("PenSizeEd")->       setEnabled(true);
-        GETUI("PenColorCB")->      setEnabled(CurrentCompoObject->PenSize!=0);
-        GETUI("PenStyleCB")->      setEnabled(CurrentCompoObject->PenSize!=0);
-        GETUI("OpacityCB")->       setEnabled(true);
-        GETUI("ShadowEffectCB")->  setEnabled(true);
-        GETUI("ShadowEffectED")->  setEnabled(CurrentCompoObject->FormShadow!=0);
-        GETUI("ShadowColorCB")->   setEnabled(CurrentCompoObject->FormShadow!=0);
+        GETUI("BlockShapeStyleBT")->setEnabled(bEnable);
+        GETUI("BlockShapeStyleED")->setEnabled(bEnable);
+        GETUI("BackgroundFormCB")->setEnabled(bEnable);
+        GETUI("PenSizeEd")->       setEnabled(bEnable);
+        GETUI("PenColorCB")->      setEnabled(CurrentCompoObject->PenSize!=0 && bEnable);
+        GETUI("PenStyleCB")->      setEnabled(CurrentCompoObject->PenSize!=0 && bEnable);
+        GETUI("OpacityCB")->       setEnabled(bEnable);
+        GETUI("ShadowEffectCB")->  setEnabled(bEnable);
+        GETUI("ShadowEffectED")->  setEnabled(CurrentCompoObject->FormShadow!=0 && bEnable);
+        GETUI("ShadowColorCB")->   setEnabled(CurrentCompoObject->FormShadow!=0 && bEnable);
 
         SetCBIndex(GETCOMBOBOX("BackgroundFormCB"),CurrentCompoObject->BackgroundForm);
         GETSPINBOX("PenSizeEd")->      setValue(int(CurrentCompoObject->PenSize));
         GETCOMBOBOX("OpacityCB")->     setCurrentIndex(CurrentCompoObject->Opacity);
         GETCOMBOBOX("ShadowEffectCB")->setCurrentIndex(CurrentCompoObject->FormShadow);
         GETSPINBOX("ShadowEffectED")-> setValue(int(CurrentCompoObject->FormShadowDistance));

May be these patches are usefull for you.

regards
gerd

Offline

Board footer