Struct ddc_winapi::Monitor
source · pub struct Monitor { /* private fields */ }
Expand description
A handle to an attached monitor that allows the use of DDC/CI operations.
Implementations§
source§impl Monitor
impl Monitor
sourcepub unsafe fn new(monitor: PHYSICAL_MONITOR) -> Self
pub unsafe fn new(monitor: PHYSICAL_MONITOR) -> Self
Create a new monitor from the specified handle.
sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Physical monitor description string.
sourcepub fn winapi_get_timing_report(&self) -> Result<MC_TIMING_REPORT>
pub fn winapi_get_timing_report(&self) -> Result<MC_TIMING_REPORT>
Retrieves a monitor’s horizontal and vertical synchronization frequencies.
sourcepub fn winapi_set_vcp_feature(&self, code: BYTE, value: DWORD) -> Result<()>
pub fn winapi_set_vcp_feature(&self, code: BYTE, value: DWORD) -> Result<()>
Sets the value of a Virtual Control Panel (VCP) code for a monitor.
sourcepub fn winapi_save_current_settings(&self) -> Result<()>
pub fn winapi_save_current_settings(&self) -> Result<()>
Saves the current monitor settings to the display’s nonvolatile storage.
sourcepub fn winapi_get_vcp_feature_and_vcp_feature_reply(
&self,
code: BYTE
) -> Result<(MC_VCP_CODE_TYPE, DWORD, DWORD)>
pub fn winapi_get_vcp_feature_and_vcp_feature_reply( &self, code: BYTE ) -> Result<(MC_VCP_CODE_TYPE, DWORD, DWORD)>
Retrieves the current value, maximum value, and code type of a Virtual Control Panel (VCP) code for a monitor.
Returns (vcp_type, current_value, max_value)
sourcepub fn winapi_get_capabilities_string_length(&self) -> Result<DWORD>
pub fn winapi_get_capabilities_string_length(&self) -> Result<DWORD>
Retrieves the length of the buffer to pass to
winapi_capabilities_request_and_capabilities_reply
.
sourcepub fn winapi_capabilities_request_and_capabilities_reply(
&self,
string: &mut [u8]
) -> Result<()>
pub fn winapi_capabilities_request_and_capabilities_reply( &self, string: &mut [u8] ) -> Result<()>
Retrieves a string describing a monitor’s capabilities.
This string is always ASCII and includes a terminating null character.
Trait Implementations§
source§impl Ddc for Monitor
impl Ddc for Monitor
source§fn capabilities_string(&mut self) -> Result<Vec<u8>, Self::Error>
fn capabilities_string(&mut self) -> Result<Vec<u8>, Self::Error>
Retrieve the capability string from the device. Read more
source§fn get_vcp_feature(&mut self, code: FeatureCode) -> Result<VcpValue, Self::Error>
fn get_vcp_feature(&mut self, code: FeatureCode) -> Result<VcpValue, Self::Error>
Gets the current value of an MCCS VCP feature.
source§fn set_vcp_feature(
&mut self,
code: FeatureCode,
value: u16
) -> Result<(), Self::Error>
fn set_vcp_feature( &mut self, code: FeatureCode, value: u16 ) -> Result<(), Self::Error>
Sets a VCP feature to the specified value.
source§fn save_current_settings(&mut self) -> Result<(), Self::Error>
fn save_current_settings(&mut self) -> Result<(), Self::Error>
Instructs the device to save its current settings.
source§fn get_timing_report(&mut self) -> Result<TimingMessage, Self::Error>
fn get_timing_report(&mut self) -> Result<TimingMessage, Self::Error>
Retrieves a timing report from the device.