+ free( psz_gradient_path );
+
+
+ p_sys->p_atmo_dyndata->UnLockCriticalSection();
+
+}
+
+static void Atmo_SetupConfig(filter_t *p_filter, CAtmoConfig *p_atmo_config)
+{
+ /*
+ figuring out the device ports (com-ports, ttys)
+ */
+ char *psz_serialdev = var_CreateGetStringCommand( p_filter,
+ CFG_PREFIX "serialdev" );
+ char *psz_temp = psz_serialdev;
+
+ if( psz_temp && strlen(psz_temp) > 0 )
+ {
+ char *psz_token;
+ int i_port = 0;
+ int i;
+ int j;
+
+ msg_Dbg( p_filter, "use port(s) %s",psz_serialdev);
+
+ /*
+ psz_serialdev - may contain up to 4 COM ports for the quattro device
+ the quattro device is just hack of useing 4 classic devices as one
+ logical device - thanks that usb-com-ports exists :)
+ as Seperator I defined , or ; with the hope that these
+ characters are never part of a device name
+ */
+ while( (psz_token = strsep(&psz_temp, ",;")) != NULL && i_port < 4 )
+ {
+ /*
+ psz_token may contain spaces we have to trim away
+ */
+ i = 0;
+ j = 0;
+ /*
+ find first none space in string
+ */
+ while( psz_token[i] == 32 ) i++;
+ /*
+ contains string only spaces or is empty? skip it
+ */
+ if( !psz_token[i] )
+ continue;
+
+ /*
+ trim
+ */
+ while( psz_token[i] && psz_token[i] != 32 )
+ psz_token[ j++ ] = psz_token[ i++ ];
+ psz_token[j++] = 0;
+
+ msg_Dbg( p_filter, "Serial Device [%d]: %s", i_port, psz_token );
+
+ p_atmo_config->setSerialDevice( i_port, psz_token );
+
+ i_port++;
+ }
+ }
+ else
+ {
+ msg_Err(p_filter,"no serial devicename(s) set");
+ }
+ free( psz_serialdev );
+
+ /*
+ configuration of light source layout arround the display
+ */
+ p_atmo_config->setZonesTopCount(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "zones-top")
+ );
+ p_atmo_config->setZonesBottomCount(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "zones-bottom")
+ );
+ p_atmo_config->setZonesLRCount(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "zones-lr")
+ );
+ p_atmo_config->setZoneSummary(
+ var_CreateGetBoolCommand( p_filter, CFG_PREFIX "zone-summary")
+ );
+
+
+ p_atmo_config->setLiveViewFilterMode(
+ (AtmoFilterMode)var_CreateGetIntegerCommand( p_filter,
+ CFG_PREFIX "filtermode")
+ );
+
+ p_atmo_config->setLiveViewFilter_PercentNew(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "percentnew")
+ );
+ p_atmo_config->setLiveViewFilter_MeanLength(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "meanlength")
+ );
+ p_atmo_config->setLiveViewFilter_MeanThreshold(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "meanthreshold")
+ );
+
+ p_atmo_config->setLiveView_EdgeWeighting(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "edgeweightning")
+ );
+ p_atmo_config->setLiveView_BrightCorrect(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "brightness")
+ );
+ p_atmo_config->setLiveView_DarknessLimit(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "darknesslimit")
+ );
+ p_atmo_config->setLiveView_HueWinSize(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "huewinsize")
+ );
+ p_atmo_config->setLiveView_SatWinSize(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "satwinsize")
+ );
+
+ /* currently not required inside vlc */
+ p_atmo_config->setLiveView_WidescreenMode( 0 );
+
+ p_atmo_config->setLiveView_FrameDelay(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "framedelay")
+ );
+
+
+ p_atmo_config->setUseSoftwareWhiteAdj(
+ var_CreateGetBoolCommand( p_filter, CFG_PREFIX "whiteadj")
+ );
+ p_atmo_config->setWhiteAdjustment_Red(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "white-red")
+ );
+ p_atmo_config->setWhiteAdjustment_Green(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "white-green")
+ );
+ p_atmo_config->setWhiteAdjustment_Blue(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "white-blue")
+ );
+
+ /*
+ settings for DMX device only
+ */
+ p_atmo_config->setDMX_RGB_Channels(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "dmx-channels")
+ );
+
+ char *psz_chbase = var_CreateGetStringCommand( p_filter,
+ CFG_PREFIX "dmx-chbase" );
+ if( psz_chbase && strlen(psz_chbase) > 0 )
+ p_atmo_config->setDMX_BaseChannels( psz_chbase );
+
+ free( psz_chbase );
+
+ /*
+ momolight options
+ */
+ p_atmo_config->setMoMo_Channels(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "momo-channels")
+ );
+
+ /*
+ fnordlicht options
+ */
+ p_atmo_config->setFnordlicht_Amount(
+ var_CreateGetIntegerCommand( p_filter, CFG_PREFIX "fnordlicht-amount")
+ );
+