Skip to content

Commit 298bc10

Browse files
Refactor: move media detection to own header
1 parent 676485e commit 298bc10

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

src/detection/media.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "fastfetch.h"
2+
#include "detection/media.h"
23

34
#include <string.h>
45
#include <pthread.h>

src/detection/media.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
#ifndef FF_INCLUDED_detection_media
4+
#define FF_INCLUDED_detection_media
5+
6+
#include "fastfetch.h"
7+
8+
typedef struct FFMediaResult
9+
{
10+
FFstrbuf busNameShort; //e.g. plasma-browser-integration
11+
FFstrbuf player; // e.g. Google Chrome
12+
FFstrbuf song;
13+
FFstrbuf artist;
14+
FFstrbuf album;
15+
FFstrbuf url;
16+
} FFMediaResult;
17+
18+
const FFMediaResult* ffDetectMedia(FFinstance* instance);
19+
20+
#endif

src/fastfetch.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,6 @@ typedef struct FFVulkanResult
189189
FFlist devices; //List of FFGPUResult
190190
} FFVulkanResult;
191191

192-
typedef struct FFMediaResult
193-
{
194-
FFstrbuf busNameShort; //e.g. plasma-browser-integration
195-
FFstrbuf player; // e.g. Google Chrome
196-
FFstrbuf song;
197-
FFstrbuf artist;
198-
FFstrbuf album;
199-
FFstrbuf url;
200-
} FFMediaResult;
201-
202192
//////////////////////
203193
// Init functions //
204194
//////////////////////
@@ -226,9 +216,6 @@ void ffLogoBuiltinListAutocompletion();
226216
// Detection functions //
227217
/////////////////////////
228218

229-
//detection/media.c
230-
const FFMediaResult* ffDetectMedia(FFinstance* instance);
231-
232219
//detection/vulkan.c
233220
const FFVulkanResult* ffDetectVulkan(const FFinstance* instance);
234221

src/modules/player.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "fastfetch.h"
22
#include "common/printing.h"
3+
#include "detection/media.h"
34

45
#include <ctype.h>
56

src/modules/song.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "fastfetch.h"
22
#include "common/printing.h"
3+
#include "detection/media.h"
34

45
#include <ctype.h>
56

0 commit comments

Comments
 (0)