From 298bc10e5f5bb7e5bb81f07eb8f71b1c542521f4 Mon Sep 17 00:00:00 2001 From: Linus Dierheimer Date: Tue, 26 Jul 2022 18:15:45 +0200 Subject: [PATCH] Refactor: move media detection to own header --- src/detection/media.c | 1 + src/detection/media.h | 20 ++++++++++++++++++++ src/fastfetch.h | 13 ------------- src/modules/player.c | 1 + src/modules/song.c | 1 + 5 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 src/detection/media.h diff --git a/src/detection/media.c b/src/detection/media.c index c4878c807..e54174779 100644 --- a/src/detection/media.c +++ b/src/detection/media.c @@ -1,4 +1,5 @@ #include "fastfetch.h" +#include "detection/media.h" #include #include diff --git a/src/detection/media.h b/src/detection/media.h new file mode 100644 index 000000000..fa3d22b7c --- /dev/null +++ b/src/detection/media.h @@ -0,0 +1,20 @@ +#pragma once + +#ifndef FF_INCLUDED_detection_media +#define FF_INCLUDED_detection_media + +#include "fastfetch.h" + +typedef struct FFMediaResult +{ + FFstrbuf busNameShort; //e.g. plasma-browser-integration + FFstrbuf player; // e.g. Google Chrome + FFstrbuf song; + FFstrbuf artist; + FFstrbuf album; + FFstrbuf url; +} FFMediaResult; + +const FFMediaResult* ffDetectMedia(FFinstance* instance); + +#endif diff --git a/src/fastfetch.h b/src/fastfetch.h index f053e9503..1e5b007c0 100644 --- a/src/fastfetch.h +++ b/src/fastfetch.h @@ -189,16 +189,6 @@ typedef struct FFVulkanResult FFlist devices; //List of FFGPUResult } FFVulkanResult; -typedef struct FFMediaResult -{ - FFstrbuf busNameShort; //e.g. plasma-browser-integration - FFstrbuf player; // e.g. Google Chrome - FFstrbuf song; - FFstrbuf artist; - FFstrbuf album; - FFstrbuf url; -} FFMediaResult; - ////////////////////// // Init functions // ////////////////////// @@ -226,9 +216,6 @@ void ffLogoBuiltinListAutocompletion(); // Detection functions // ///////////////////////// -//detection/media.c -const FFMediaResult* ffDetectMedia(FFinstance* instance); - //detection/vulkan.c const FFVulkanResult* ffDetectVulkan(const FFinstance* instance); diff --git a/src/modules/player.c b/src/modules/player.c index 994411f7a..b7e03ff7b 100644 --- a/src/modules/player.c +++ b/src/modules/player.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/printing.h" +#include "detection/media.h" #include diff --git a/src/modules/song.c b/src/modules/song.c index 0466b5d93..69b571368 100644 --- a/src/modules/song.c +++ b/src/modules/song.c @@ -1,5 +1,6 @@ #include "fastfetch.h" #include "common/printing.h" +#include "detection/media.h" #include