📄 refddcproc.c
字号:
_vcpParms( pRsp, MAXNORM - 1, normValue );
}
break;
case VCP_HUE: /* hue */
if( conn < LAST_CONNECTOR )
{
_getVCP( &normValue, pictcont_GetHueLimits, pictcont_GetHue );
_vcpParms( pRsp, MAXNORM - 1, normValue );
}
break;
case VCP_LUMINANCE: /* luminance */
if( conn < LAST_CONNECTOR )
{
_getVCP( &normValue, pictcont_GetBrightnessLimits, pictcont_GetBrightness );
_vcpParms( pRsp, MAXNORM - 1, normValue );
}
break;
case VCP_SATURATION: /* saturation */
if( conn < LAST_CONNECTOR )
{
_getVCP( &normValue, pictcont_GetColorLimits, pictcont_GetColor );
_vcpParms( pRsp, MAXNORM - 1, normValue );
}
break;
case VCP_SHARPNESS: /* sharpness */
if( conn < LAST_CONNECTOR )
{
_getVCP( &normValue, pictcont_GetSharpnessLimits, pictcont_GetSharpness );
_vcpParms( pRsp, MAXNORM - 1, normValue );
}
break;
case VCP_CTRLVALUE: /* setting-change state */
if( guiApp_GetDDCCISettingsChanged())
_vcpParms( pRsp, 0, 2 ); /* report settings changed */
else
_vcpParms( pRsp, 0, 1 ); /* report settings not changed */
break;
case VCP_COLORTEMP: /* color temp */
if( conn >= LAST_CONNECTOR )
_vcpParms( pRsp, 0, 0 );
else
_vcpParms( pRsp, 0, pictcont_GetColorTempPresets());
break;
case VCP_TECHTYPE: /* technology type */
_vcpParms( pRsp, 0, 8 ); /* DLP */
break;
case VCP_MCCSVER: /* MCCS version */
_vcpParms( pRsp, 0, 0x0300 ); /* 3.00 */
break;
default:
cc = DDC_UNKNOWNVCP;
_vcpParms( pRsp, 0, 0 );
break;
}
/************************************************/
/* Format response and set "available" flag. */
/************************************************/
pRsp -> dstAddr = 0x50; /* destination address */
pRsp -> srcAddr = 0x6e; /* source address */
pRsp -> length = 0x88; /* message length (code + text) */
pRsp -> code = CIREP_GETVCP; /* operation code */
pRsp -> text[0] = DDC_PASS != cc; /* result code */
pRsp -> text[1] = pMsg -> text[0]; /* VCP opcode */
pRsp -> text[2] = 0; /* type code (set) */
pRsp -> text[7] = _ckSum( pRsp, 11 ); /* checksum */
ddcciRspAvailable( TRUE ); /* response is available */
return cc;
}
/****************************************************************************/
/* 0x03 Set VCP feature */
/* */
/* Set a value when a setting request for a valid feature is received. */
/****************************************************************************/
static DDC_COMP ciCmdSetVcp( pCI_MESSAGE pMsg, pCI_MESSAGE pRsp )
{
uint16 hostValue; /* host setting value, normalized to 0..MAXNORM */
DP_CONNECTOR conn; /* active connector number */
dbmsg_trace( DBM_DDCCI, "ciCmdSetVcp\r\n" );
/************************************************/
/* Handle non-display settings. */
/************************************************/
if( VCP_CTRLVALUE == pMsg -> text[0] ) /* setting-change state */
{
if( 1 == pMsg -> text[2] )
guiApp_ResetDDCCISettingsChanged();
return DDC_PASS;
}
else if( VCP_FACTCOLOR == pMsg -> text[0] ) /* set color default */
{
if( pMsg -> text[1] | pMsg -> text[2] ) /* if non-zero */
{
dbmsg_trace( DBM_DDCCI, "VCP_FACTCOLOR\r\n" );
datapath_UserRestoreColorDefaults( FALSE ); /* restore current */
}
return DDC_PASS;
}
else if( VCP_FACTDEFAULT == pMsg -> text[0] )/* set all factory default */
{
if( pMsg -> text[1] | pMsg -> text[2] ) /* if non-zero */
{
dbmsg_trace( DBM_DDCCI, "VCP_FACTDEFAULT\r\n" );
datapath_UserRestoreColorDefaults( TRUE ); /* restore all */
datapath_UserRestoreDisplayDefaults();
}
return DDC_PASS;
}
else if( VCP_COLORTEMP == pMsg -> text[0] ) /* "color temperature" */
{
dbmsg_trace( DBM_DDCCI, "VCP_COLORTEMP\r\n" );
pictcont_SetColorTempPresets( pMsg -> text[2] );
return DDC_PASS;
}
/************************************************/
/* Update only if local GUI is closed. */
/************************************************/
if( guiApp_IsGUIDisplayed())
return DDC_PASS;
/************************************************/
/* Validate setting value received from host. */
/************************************************/
if(( hostValue = ( pMsg -> text[1] << 8 ) | pMsg -> text[2] ) > MAXNORM )
return DDC_HOSTVALUE;
/************************************************/
/* Ensure an external source is displayed; the */
/* setting is applied to the current source. */
/************************************************/
if(( conn = datapath_GetActiveDisplay()) >= LAST_CONNECTOR )
return DDC_NOINPUT;
/************************************************/
/* Perform the setting. The same algorithm is */
/* used for each, so the setting-function takes */
/* pointers to functions which obtain limts for */
/* the setting and which set the calculated */
/* value to hardware. */
/************************************************/
switch( pMsg -> text[0] ) /* VCP opcode */
{
case VCP_CONTRAST: /* contrast */
_setVCP( &ciSettings[ conn ].Contrast, hostValue,
pictcont_GetContrastLimits, pictcont_SetContrast );
break;
case VCP_HUE: /* hue */
_setVCP( &ciSettings[ conn ].Hue, hostValue,
pictcont_GetHueLimits, pictcont_SetHue );
break;
case VCP_LUMINANCE: /* luminance */
_setVCP( &ciSettings[ conn ].Brightness, hostValue,
pictcont_GetBrightnessLimits, pictcont_SetBrightness );
break;
case VCP_SATURATION: /* saturation */
_setVCP( &ciSettings[ conn ].Color, hostValue,
pictcont_GetColorLimits, pictcont_SetColor );
break;
case VCP_SHARPNESS: /* sharpness */
_setVCP( &ciSettings[ conn ].Sharpness, hostValue,
pictcont_GetSharpnessLimits, pictcont_SetSharpness );
break;
default:
return DDC_UNKNOWNVCP;
}
return DDC_PASS;
}
/****************************************************************************/
/* 0x0c Save settings */
/* */
/* Scan all settings on all connectors and save modified values to EEPROM. */
/****************************************************************************/
static DDC_COMP ciCmdSavVcp( pCI_MESSAGE pMsg, pCI_MESSAGE pRsp )
{
int x; /* temp index */
dbmsg_trace( DBM_DDCCI, "ciCmdSavVcp\r\n" );
/************************************************/
/* Scan connectors and update EEPROM. */
/************************************************/
for( x = 0; x < NUM_CONNECTORS; x++ )
{
if( UNSET != ciSettings[ x ].Brightness )
EE_PUTVAR( UserMachine.ConnectorSettings[x].Brightness,
ciSettings[ x ].Brightness );
if( UNSET != ciSettings[ x ].Contrast )
EE_PUTVAR( UserMachine.ConnectorSettings[x].Contrast,
ciSettings[ x ].Contrast );
if( UNSET != ciSettings[ x ].Hue )
EE_PUTVAR( UserMachine.ConnectorSettings[x].Hue,
ciSettings[ x ].Hue );
if( UNSET != ciSettings[ x ].Color )
EE_PUTVAR( UserMachine.ConnectorSettings[x].Color,
ciSettings[ x ].Color );
if( UNSET != ciSettings[ x ].Sharpness )
EE_PUTVAR( UserMachine.ConnectorSettings[x].Sharpness,
ciSettings[ x ].Sharpness );
}
_unSet(); /* indicate all settings untouched by DDC/CI */
return DDC_PASS;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -