[vlmc-devel] commit: EffectSettingValue: Handle all off frei0r's types. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri Aug 20 01:10:27 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Aug 20 01:10:08 2010 +0200| [9909ec0db9aefa0e12d7acddbda6946448a379df] | committer: Hugo Beauzée-Luyssen 

EffectSettingValue: Handle all off frei0r's types.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=9909ec0db9aefa0e12d7acddbda6946448a379df
---

 src/EffectsEngine/EffectSettingValue.cpp |   31 ++++++++++++++++++++++++++---
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/src/EffectsEngine/EffectSettingValue.cpp b/src/EffectsEngine/EffectSettingValue.cpp
index 2b7a4ac..d70b530 100644
--- a/src/EffectsEngine/EffectSettingValue.cpp
+++ b/src/EffectsEngine/EffectSettingValue.cpp
@@ -24,6 +24,8 @@
 #include "EffectSettingValue.h"
 #include "EffectInstance.h"
 
+#include <QColor>
+#include <QPoint>
 #include <QtDebug>
 
 EffectSettingValue::EffectSettingValue( Type type, EffectInstance* instance, quint32 index,
@@ -60,10 +62,31 @@ EffectSettingValue::set( const QVariant &val )
             copyToFrei0rBuff( &tmp );
             break ;
         }
-//        case String:
-//        case Bool:
-//        case Color:
-//        case Position:
+        case String:
+        {
+            QByteArray      bytes = val.toString().toUtf8();
+            const char*   tmp = bytes;
+            copyToFrei0rBuff( tmp, bytes.length() );
+            break ;
+        }
+        case Bool:
+        {
+            bool    tmp = val.toBool();
+            copyToFrei0rBuff( &tmp );
+            break ;
+        }
+        case Color:
+        {
+            QColor  color = val.value<QColor>();
+            float   rgb[3] = { color.redF(), color.greenF(), color.blueF() };
+            copyToFrei0rBuff( rgb, 3 * sizeof(float) );
+        }
+        case Position:
+        {
+            QPointF     pos = val.value<QPointF>();
+            double      posD[2] = { pos.x(), pos.y() };
+            copyToFrei0rBuff( posD, 2 * sizeof(double) );
+        }
     default:
         qCritical() << "Setting type" << m_type << "is not handled by the effects engine";
         break;



More information about the Vlmc-devel mailing list