Skip to content
/ jmccs Public

jMCCS is a Java-library supporting the Monitor Control Command Set allowing you to control your monitor using Java code

License

Notifications You must be signed in to change notification settings

pitkley/jmccs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jMCCS

jMCCS is a Java library for controlling monitors using the Monitor Control Command Set (MCCS) via DDC/CI. If the monitor supports DDC/CI, this library can be used to configure (almost) everything that can be set via the On-Screen-Display.

The library requires operating system-specific implementations, currently the following exist:

Using jMCCS

Maven dependency

jMCCS is a Maven project and available in Maven Central. You can use the following snippet to get jMCCS as a dependency.

<dependency>
  <groupId>de.pitkley.jmccs</groupId>
  <artifactId>jmccs</artifactId>
  <version>0.2.0</version>
</dependency>

Example

Following is a quick example on how you can set the brightness (luminance) of your monitors to 75 (0 being the minimum, 100 the maximum).

MonitorManager monitorManager = MonitorManager.get();
List<Monitor> monitors = monitorManager.getMonitors();

for (Monitor monitor : monitors) {
    monitor.setVCPFeature(VCPCode.LUMINANCE, 75);
}

Although this will work, the recommended way is to use the helper-class to replace any setVCPFeature-calls by more meaningful calls.

MonitorManager monitorManager = MonitorManager.get();
List<MonitorHelper> monitors = monitorManager.getMonitors()
                                   .stream()
                                   .map(MonitorHelper::new)
                                   .collect(Collectors.toList());

for (MonitorHelper monitor : monitors) {
    monitor.setLuminance(75);
}

Note: the helper-class will be automatically generated as part of the Maven build-process and thus can not be found in the source code directly.

Creating an implementation

To add support for an operating system, you have to provide an implementation for the abstract class MonitorManager and the interface Monitor. The MonitorManager has to be registered as a Service Provider by supplying a text-file in the META-INF-directory. See this file as an example.

(The only dependency you will need is the one above, it includes all needed transitive dependencies.)

License

This project is licensed under MIT.

About

jMCCS is a Java-library supporting the Monitor Control Command Set allowing you to control your monitor using Java code

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages