[vlmc-devel] [PATCH] EffectSettingValue: Don't use QColor to save color

Hugo Beauzée-Luyssen hugo at beauzee.fr
Tue Apr 12 15:29:53 CEST 2016


On 04/12/2016 03:17 PM, yikei lu wrote:
> Could someone review this?
>
> 2016-04-12 20:42 GMT+09:00 Yikai Lu <luyikei.qmltu at gmail.com>:
>> ---
>>   src/EffectsEngine/EffectSettingValue.cpp | 9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/EffectsEngine/EffectSettingValue.cpp b/src/EffectsEngine/EffectSettingValue.cpp
>> index e2b0f5c..9862a05 100644
>> --- a/src/EffectsEngine/EffectSettingValue.cpp
>> +++ b/src/EffectsEngine/EffectSettingValue.cpp
>> @@ -20,7 +20,6 @@
>>    * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
>>    *****************************************************************************/
>>
>> -#include <QColor>
>>   #include <QPoint>
>>
>>   #include "EffectsEngine/Effect.h"
>> @@ -78,8 +77,8 @@ EffectSettingValue::set( const QVariant &val )
>>           }
>>       case Color:
>>           {
>> -            QColor  color = val.value<QColor>();
>> -            qreal   rgb[3] = { color.redF(), color.greenF(), color.blueF() };
>> +            QVariantList l = val.toList();
>> +            qreal   rgb[3] = { l[0].toFloat(), l[1].toFloat(), l[2].toFloat() };
>>               copyToFrei0rBuff( rgb, 3 * sizeof(float) );
>>               break ;
>>           }
>> @@ -139,7 +138,9 @@ EffectSettingValue::get()
>>               f0r_param_color_t   tmp;
>>               m_effectInstance->effect()->m_f0r_get_param_value( m_effectInstance->m_instance,
>>                                                                  &tmp, m_index );
>> -            m_val.setValue( QColor::fromRgbF( tmp.r, tmp.g, tmp.b ) );
>> +            QVariantList l;
>> +            l << tmp.r << tmp.g << tmp.b;
>> +            m_val.setValue( l );
>>               break ;
>>           }
>>       case Position:
>> --
>> 1.9.1
>>
> _______________________________________________
> Vlmc-devel mailing list
> Vlmc-devel at videolan.org
> https://mailman.videolan.org/listinfo/vlmc-devel
>
Applied, thanks!


More information about the Vlmc-devel mailing list