示例#1
0
void CAtmoRegistryConfig::SaveSettings() {
    // alle Variabel etc. in Registry speichern
    char regKeyName[100],valueName[32];
	WriteRegistryInt(configRootKey,"comport",this->m_Comport);

    WriteRegistryInt(configRootKey,"comport_1", m_Comports[0] );
    WriteRegistryInt(configRootKey,"comport_2", m_Comports[1] );
    WriteRegistryInt(configRootKey,"comport_3", m_Comports[2] );


    // don't destroy config in that case..
    if(m_eAtmoConnectionType != actNUL)
       WriteRegistryInt(configRootKey,"ConnectionType",(int)m_eAtmoConnectionType);

    WriteRegistryInt(configRootKey,"EffectMode",(int)m_eEffectMode);

	WriteRegistryInt(configRootKey,"WhiteAdjustment_Red",m_WhiteAdjustment_Red);
	WriteRegistryInt(configRootKey,"WhiteAdjustment_Green",m_WhiteAdjustment_Green);
	WriteRegistryInt(configRootKey,"WhiteAdjustment_Blue",m_WhiteAdjustment_Blue);
	WriteRegistryInt(configRootKey,"UseSoftwareWhiteAdj",(int)m_UseSoftwareWhiteAdj);

    
    WriteRegistryInt(configRootKey,"UsePerChWhiteAdj",(int)m_WhiteAdjPerChannel);

    sprintf(regKeyName,"%sWhiteAdjPerChannel\\",configRootKey);
    WriteRegistryInt(regKeyName,"count",(int)m_chWhiteAdj_Count);

    for(int i=0; (i<m_chWhiteAdj_Count) && m_chWhiteAdj_Red && m_chWhiteAdj_Blue && m_chWhiteAdj_Green; i++) 
    {
        sprintf(valueName,"red_%d",i);
        WriteRegistryInt(regKeyName, valueName, m_chWhiteAdj_Red[i] );

        sprintf(valueName,"green_%d",i);
        WriteRegistryInt(regKeyName, valueName, m_chWhiteAdj_Green[i] );

        sprintf(valueName,"blue_%d",i);
        WriteRegistryInt(regKeyName, valueName, m_chWhiteAdj_Blue[i] );
    }


    WriteRegistryInt(configRootKey,"ColorChanger_iSteps",this->m_ColorChanger_iSteps);
    WriteRegistryInt(configRootKey,"ColorChanger_iDelay",this->m_ColorChanger_iDelay);

    WriteRegistryInt(configRootKey,"LrColorChanger_iSteps",this->m_LrColorChanger_iSteps);
    WriteRegistryInt(configRootKey,"LrColorChanger_iDelay",this->m_LrColorChanger_iDelay);

    WriteRegistryInt(configRootKey,"StaticColor_Red",this->m_StaticColor_Red);
    WriteRegistryInt(configRootKey,"StaticColor_Green",this->m_StaticColor_Green);
    WriteRegistryInt(configRootKey,"StaticColor_Blue",this->m_StaticColor_Blue);

    WriteRegistryInt(configRootKey,"isSetShutdownColor",m_IsSetShutdownColor);
	WriteRegistryInt(configRootKey,"ShutdownColor_red",m_ShutdownColor_Red);
	WriteRegistryInt(configRootKey,"ShutdownColor_green",m_ShutdownColor_Green);
	WriteRegistryInt(configRootKey,"ShutdownColor_blue",m_ShutdownColor_Blue);

    WriteRegistryInt(configRootKey,"LiveViewFilterMode",(int)m_LiveViewFilterMode);
    WriteRegistryInt(configRootKey,"LiveViewFilter_PercentNew",m_LiveViewFilter_PercentNew);
    WriteRegistryInt(configRootKey,"LiveViewFilter_MeanLength",m_LiveViewFilter_MeanLength);
    WriteRegistryInt(configRootKey,"LiveViewFilter_MeanThreshold",m_LiveViewFilter_MeanThreshold);

    WriteRegistryInt(configRootKey,"LiveView_EdgeWeighting",m_LiveView_EdgeWeighting);
    WriteRegistryInt(configRootKey,"LiveView_RowsPerFrame",m_LiveView_RowsPerFrame);

    WriteRegistryInt(configRootKey,"LiveView_BrightCorrect",m_LiveView_BrightCorrect);
    WriteRegistryInt(configRootKey,"LiveView_DarknessLimit",m_LiveView_DarknessLimit);
    WriteRegistryInt(configRootKey,"LiveView_HueWinSize",m_LiveView_HueWinSize);
    WriteRegistryInt(configRootKey,"LiveView_SatWinSize",m_LiveView_SatWinSize);
    WriteRegistryInt(configRootKey,"LiveView_WidescreenMode",m_LiveView_WidescreenMode);

    WriteRegistryInt(configRootKey,"LiveView_HOverscanBorder",m_LiveView_HOverscanBorder);
    WriteRegistryInt(configRootKey,"LiveView_VOverscanBorder",m_LiveView_VOverscanBorder);
    WriteRegistryInt(configRootKey,"LiveView_DisplayNr",m_LiveView_DisplayNr);
    WriteRegistryInt(configRootKey,"LiveView_FrameDelay",m_LiveView_FrameDelay);
    WriteRegistryInt(configRootKey,"LiveView_GDI_FrameRate",m_LiveView_GDI_FrameRate);

    WriteRegistryInt(configRootKey,"ZonesTopCount",m_ZonesTopCount);
    WriteRegistryInt(configRootKey,"ZonesBottomCount",m_ZonesBottomCount);
    WriteRegistryInt(configRootKey,"ZonesLRCount",m_ZonesLRCount);
    WriteRegistryInt(configRootKey,"ZoneSummary",m_ZoneSummary);
    


    WriteRegistryInt(configRootKey,"Hardware_global_gamma",m_Hardware_global_gamma);
    WriteRegistryInt(configRootKey,"Hardware_global_contrast",m_Hardware_global_contrast);
    WriteRegistryInt(configRootKey,"Hardware_contrast_red",m_Hardware_contrast_red);
    WriteRegistryInt(configRootKey,"Hardware_contrast_green",m_Hardware_contrast_green);
    WriteRegistryInt(configRootKey,"Hardware_contrast_blue",m_Hardware_contrast_blue);
    WriteRegistryInt(configRootKey,"Hardware_gamma_red",m_Hardware_gamma_red);
    WriteRegistryInt(configRootKey,"Hardware_gamma_green",m_Hardware_gamma_green);
    WriteRegistryInt(configRootKey,"Hardware_gamma_blue",m_Hardware_gamma_blue);

    WriteRegistryInt(configRootKey,"Software_gamma_mode",(int)m_Software_gamma_mode);
    WriteRegistryInt(configRootKey,"Software_gamma_red",m_Software_gamma_red);
    WriteRegistryInt(configRootKey,"Software_gamma_green",m_Software_gamma_green);
    WriteRegistryInt(configRootKey,"Software_gamma_blue",m_Software_gamma_blue);
    WriteRegistryInt(configRootKey,"Software_gamma_global",m_Software_gamma_global);

    WriteRegistryString( configRootKey, "DMX_BaseChannels", m_DMX_BaseChannels );
    WriteRegistryInt(configRootKey,"DMX_RGB_Channels",m_DMX_RGB_Channels);
    WriteRegistryInt(configRootKey,"DMX_BaudrateIndex", m_DMX_BaudrateIndex );  

    WriteRegistryInt(configRootKey,"MoMo_Channels", m_MoMo_Channels );

    WriteRegistryInt(configRootKey,"Fnordlicht_Amount", m_Fnordlicht_Amount );

    WriteRegistryInt(configRootKey,"hAtmoClLeds", m_AtmoClLeds);

    WriteRegistryInt(configRootKey,"NumChannelAssignments",getNumChannelAssignments());
    WriteRegistryInt(configRootKey,"CurrentChannelAssignment",m_CurrentChannelAssignment);
    for(int i=1;i<10;i++) {
        CAtmoChannelAssignment *ta = this->m_ChannelAssignments[i];
        if(ta!=NULL) {
           sprintf(regKeyName,"%sChannelAssignment_%d\\",configRootKey,i);
           WriteRegistryString(regKeyName,"name", ta->getName() );
           WriteRegistryInt(regKeyName,"count", ta->getSize() );
           for(int c=0;c<ta->getSize();c++) {
               sprintf(valueName,"channel_%d",c);
               WriteRegistryInt(regKeyName,valueName,ta->getZoneIndex(c));
           }
        }
    }
}
示例#2
0
void CAtmoConfig::Assign(CAtmoConfig *pAtmoConfigSrc) {

#if defined(_ATMO_VLC_PLUGIN_)
    this->setSerialDevice(0, pAtmoConfigSrc->getSerialDevice(0));
    this->setSerialDevice(1, pAtmoConfigSrc->getSerialDevice(1));
    this->setSerialDevice(2, pAtmoConfigSrc->getSerialDevice(2));
    this->setSerialDevice(3, pAtmoConfigSrc->getSerialDevice(3));
#else
    this->m_Comport                  = pAtmoConfigSrc->m_Comport;
    this->m_Comports[0]              = pAtmoConfigSrc->m_Comports[0];
    this->m_Comports[1]              = pAtmoConfigSrc->m_Comports[1];
    this->m_Comports[2]              = pAtmoConfigSrc->m_Comports[2];
#endif

    this->m_eAtmoConnectionType      = pAtmoConfigSrc->m_eAtmoConnectionType;
    this->m_eEffectMode              = pAtmoConfigSrc->m_eEffectMode;

    this->m_WhiteAdjustment_Red      = pAtmoConfigSrc->m_WhiteAdjustment_Red;
    this->m_WhiteAdjustment_Green    = pAtmoConfigSrc->m_WhiteAdjustment_Green;
    this->m_WhiteAdjustment_Blue     = pAtmoConfigSrc->m_WhiteAdjustment_Blue;
    this->m_UseSoftwareWhiteAdj      = pAtmoConfigSrc->m_UseSoftwareWhiteAdj;

    this->m_WhiteAdjPerChannel       = pAtmoConfigSrc->m_WhiteAdjPerChannel;
    this->m_chWhiteAdj_Count         = pAtmoConfigSrc->m_chWhiteAdj_Count;
    delete []m_chWhiteAdj_Red;
    delete []m_chWhiteAdj_Green;
    delete []m_chWhiteAdj_Blue;
    if(m_chWhiteAdj_Count > 0)
    {
       m_chWhiteAdj_Red   = new int[ m_chWhiteAdj_Count ];
       m_chWhiteAdj_Green = new int[ m_chWhiteAdj_Count ];
       m_chWhiteAdj_Blue  = new int[ m_chWhiteAdj_Count ];
       memcpy(m_chWhiteAdj_Red, pAtmoConfigSrc->m_chWhiteAdj_Red, sizeof(int) * m_chWhiteAdj_Count);
       memcpy(m_chWhiteAdj_Green, pAtmoConfigSrc->m_chWhiteAdj_Green, sizeof(int) * m_chWhiteAdj_Count);
       memcpy(m_chWhiteAdj_Blue, pAtmoConfigSrc->m_chWhiteAdj_Blue, sizeof(int) * m_chWhiteAdj_Count);
    } else {
       m_chWhiteAdj_Red   = NULL;
       m_chWhiteAdj_Green = NULL;
       m_chWhiteAdj_Blue  = NULL;
    }

    this->m_IsSetShutdownColor       = pAtmoConfigSrc->m_IsSetShutdownColor;
    this->m_ShutdownColor_Red        = pAtmoConfigSrc->m_ShutdownColor_Red;
    this->m_ShutdownColor_Green      = pAtmoConfigSrc->m_ShutdownColor_Green;
    this->m_ShutdownColor_Blue       = pAtmoConfigSrc->m_ShutdownColor_Blue;

    this->m_ColorChanger_iSteps      = pAtmoConfigSrc->m_ColorChanger_iSteps;
    this->m_ColorChanger_iDelay      = pAtmoConfigSrc->m_ColorChanger_iDelay;

    this->m_LrColorChanger_iSteps    = pAtmoConfigSrc->m_LrColorChanger_iSteps;
    this->m_LrColorChanger_iDelay    = pAtmoConfigSrc->m_LrColorChanger_iDelay;

    this->m_StaticColor_Red          = pAtmoConfigSrc->m_StaticColor_Red;
    this->m_StaticColor_Green        = pAtmoConfigSrc->m_StaticColor_Green;
    this->m_StaticColor_Blue         = pAtmoConfigSrc->m_StaticColor_Blue;

    this->m_LiveViewFilterMode             = pAtmoConfigSrc->m_LiveViewFilterMode;
    this->m_LiveViewFilter_PercentNew      = pAtmoConfigSrc->m_LiveViewFilter_PercentNew;
    this->m_LiveViewFilter_MeanLength      = pAtmoConfigSrc->m_LiveViewFilter_MeanLength;
    this->m_LiveViewFilter_MeanThreshold   = pAtmoConfigSrc->m_LiveViewFilter_MeanThreshold;

    this->m_show_statistics               = pAtmoConfigSrc->m_show_statistics;

    this->m_LiveView_EdgeWeighting  =  pAtmoConfigSrc->m_LiveView_EdgeWeighting;
    this->m_LiveView_BrightCorrect  =  pAtmoConfigSrc->m_LiveView_BrightCorrect;
    this->m_LiveView_DarknessLimit  =  pAtmoConfigSrc->m_LiveView_DarknessLimit;
    this->m_LiveView_HueWinSize     =  pAtmoConfigSrc->m_LiveView_HueWinSize;
    this->m_LiveView_SatWinSize     =  pAtmoConfigSrc->m_LiveView_SatWinSize;
    this->m_LiveView_WidescreenMode =  pAtmoConfigSrc->m_LiveView_WidescreenMode;

    this->m_LiveView_HOverscanBorder  = pAtmoConfigSrc->m_LiveView_HOverscanBorder;
    this->m_LiveView_VOverscanBorder  = pAtmoConfigSrc->m_LiveView_VOverscanBorder;
    this->m_LiveView_DisplayNr        = pAtmoConfigSrc->m_LiveView_DisplayNr;
    this->m_LiveView_FrameDelay       = pAtmoConfigSrc->m_LiveView_FrameDelay;
    this->m_LiveView_GDI_FrameRate    = pAtmoConfigSrc->m_LiveView_GDI_FrameRate;
    this->m_LiveView_RowsPerFrame   =  pAtmoConfigSrc->m_LiveView_RowsPerFrame;

    this->m_ZonesTopCount             = pAtmoConfigSrc->m_ZonesTopCount;
    this->m_ZonesBottomCount          = pAtmoConfigSrc->m_ZonesBottomCount;
    this->m_ZonesLRCount              = pAtmoConfigSrc->m_ZonesLRCount;
    this->m_ZoneSummary               = pAtmoConfigSrc->m_ZoneSummary;
    UpdateZoneCount();

    this->m_Software_gamma_mode      =  pAtmoConfigSrc->m_Software_gamma_mode;
    this->m_Software_gamma_red       =  pAtmoConfigSrc->m_Software_gamma_red;
    this->m_Software_gamma_green     =  pAtmoConfigSrc->m_Software_gamma_green;
    this->m_Software_gamma_blue      =  pAtmoConfigSrc->m_Software_gamma_blue;
    this->m_Software_gamma_global    =  pAtmoConfigSrc->m_Software_gamma_global;

    this->setDMX_BaseChannels( pAtmoConfigSrc->getDMX_BaseChannels() );

    this->m_DMX_RGB_Channels         = pAtmoConfigSrc->m_DMX_RGB_Channels;

    this->m_MoMo_Channels            = pAtmoConfigSrc->m_MoMo_Channels;

    this->m_Fnordlicht_Amount        = pAtmoConfigSrc->m_Fnordlicht_Amount;

    this->m_CurrentChannelAssignment = pAtmoConfigSrc->m_CurrentChannelAssignment;

    clearChannelMappings();
    for(int i=1;i<pAtmoConfigSrc->getNumChannelAssignments();i++) {
        CAtmoChannelAssignment *ta = pAtmoConfigSrc->m_ChannelAssignments[i];
        if(ta!=NULL) {
            CAtmoChannelAssignment *dest = this->m_ChannelAssignments[i];
            if(dest == NULL) {
               dest = new CAtmoChannelAssignment();
               this->m_ChannelAssignments[i] = dest;
            }
            // memcpy(dest, ta, sizeof(tChannelAssignment));
            dest->setSize(ta->getSize());
            dest->setName(ta->getName());
            dest->system = ta->system;
            for(int c=0;c<dest->getSize();c++)
                dest->setZoneIndex(c, ta->getZoneIndex(c));
        }
    }

    UpdateZoneDefinitionCount();
}