2021-04-16 16:49:33 +02:00
|
|
|
#include "resolution.h"
|
2021-02-18 22:25:36 +01:00
|
|
|
|
2021-04-16 16:49:33 +02:00
|
|
|
void ffPrintResolutionValue(FFinstance* instance, uint8_t moduleIndex, FFcache* cache, int width, int height, int refreshRate)
|
2021-02-27 14:40:03 +01:00
|
|
|
{
|
2021-04-15 18:59:26 +02:00
|
|
|
FFstrbuf value;
|
|
|
|
|
ffStrbufInitA(&value, 32);
|
|
|
|
|
ffStrbufAppendF(&value, "%ix%i", width, height);
|
|
|
|
|
|
|
|
|
|
if(refreshRate > 0)
|
|
|
|
|
ffStrbufAppendF(&value, " @ %iHz", refreshRate);
|
|
|
|
|
|
|
|
|
|
ffPrintAndAppendToCache(instance, FF_RESOLUTION_MODULE_NAME, moduleIndex, &instance->config.resolutionKey, cache, &value, &instance->config.resolutionFormat, FF_RESOLUTION_NUM_FORMAT_ARGS, (FFformatarg[]){
|
|
|
|
|
{FF_FORMAT_ARG_TYPE_INT, &width},
|
|
|
|
|
{FF_FORMAT_ARG_TYPE_INT, &height},
|
|
|
|
|
{FF_FORMAT_ARG_TYPE_INT, &refreshRate}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ffPrintResolution(FFinstance* instance)
|
|
|
|
|
{
|
|
|
|
|
if(ffPrintFromCache(instance, FF_RESOLUTION_MODULE_NAME, &instance->config.resolutionKey, &instance->config.resolutionFormat, FF_RESOLUTION_NUM_FORMAT_ARGS))
|
|
|
|
|
return;
|
|
|
|
|
|
2021-04-16 16:49:33 +02:00
|
|
|
if(ffPrintResolutionWaylandBackend(instance))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if(ffPrintResolutionXrandrBackend(instance))
|
2021-04-15 18:59:26 +02:00
|
|
|
return;
|
2021-02-22 16:52:51 +01:00
|
|
|
|
2021-04-16 16:49:33 +02:00
|
|
|
ffPrintResolutionX11Backend(instance);
|
2021-03-27 18:14:19 +01:00
|
|
|
}
|