monorepo structuring

This commit is contained in:
Aylur
2024-09-01 14:17:36 +02:00
parent 408faee169
commit 3e3f045d65
203 changed files with 512 additions and 7849 deletions
+4
View File
@@ -0,0 +1,4 @@
#include "astal/wireplumber/audio.h"
#include "astal/wireplumber/endpoint.h"
#include "astal/wireplumber/wp.h"
@@ -0,0 +1,33 @@
#ifndef ASTAL_WIREPLUMBER_AUDIO_H
#define ASTAL_WIREPLUMBER_AUDIO_H
#include <glib-object.h>
#include "device.h"
#include "endpoint.h"
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_AUDIO (astal_wp_audio_get_type())
G_DECLARE_FINAL_TYPE(AstalWpAudio, astal_wp_audio, ASTAL_WP, AUDIO, GObject)
AstalWpEndpoint *astal_wp_audio_get_speaker(AstalWpAudio *self, guint id);
AstalWpEndpoint *astal_wp_audio_get_microphone(AstalWpAudio *self, guint id);
AstalWpEndpoint *astal_wp_audio_get_recorder(AstalWpAudio *self, guint id);
AstalWpEndpoint *astal_wp_audio_get_stream(AstalWpAudio *self, guint id);
AstalWpEndpoint *astal_wp_audio_get_endpoint(AstalWpAudio *self, guint id);
AstalWpDevice *astal_wp_audio_get_device(AstalWpAudio *self, guint id);
AstalWpEndpoint *astal_wp_audio_get_default_speaker(AstalWpAudio *self);
AstalWpEndpoint *astal_wp_audio_get_default_microphone(AstalWpAudio *self);
GList *astal_wp_audio_get_microphones(AstalWpAudio *self);
GList *astal_wp_audio_get_speakers(AstalWpAudio *self);
GList *astal_wp_audio_get_recorders(AstalWpAudio *self);
GList *astal_wp_audio_get_streams(AstalWpAudio *self);
GList *astal_wp_audio_get_devices(AstalWpAudio *self);
G_END_DECLS
#endif // !ASTAL_WIREPLUMBER_AUDIO_H
@@ -0,0 +1,29 @@
#ifndef ASTAL_WP_DEVICE_H
#define ASTAL_WP_DEVICE_H
#include <glib-object.h>
#include "profile.h"
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_DEVICE (astal_wp_device_get_type())
G_DECLARE_FINAL_TYPE(AstalWpDevice, astal_wp_device, ASTAL_WP, DEVICE, GObject)
#define ASTAL_WP_TYPE_DEVICE_TYPE (astal_wp_device_type_get_type())
typedef enum { ASTAL_WP_DEVICE_TYPE_AUDIO, ASTAL_WP_DEVICE_TYPE_VIDEO } AstalWpDeviceType;
guint astal_wp_device_get_id(AstalWpDevice *self);
const gchar *astal_wp_device_get_description(AstalWpDevice *self);
const gchar *astal_wp_device_get_icon(AstalWpDevice *self);
AstalWpProfile *astal_wp_device_get_profile(AstalWpDevice *self, gint id);
GList *astal_wp_device_get_profiles(AstalWpDevice *self);
void astal_wp_device_set_active_profile(AstalWpDevice *self, int profile_id);
gint astal_wp_device_get_active_profile(AstalWpDevice *self);
AstalWpDeviceType astal_wp_device_get_device_type(AstalWpDevice *self);
G_END_DECLS
#endif // !ASTAL_WP_DEVICE_H
@@ -0,0 +1,43 @@
#ifndef ASTAL_WP_ENDPOINT_H
#define ASTAL_WP_ENDPOINT_H
#include <glib-object.h>
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_ENDPOINT (astal_wp_endpoint_get_type())
G_DECLARE_FINAL_TYPE(AstalWpEndpoint, astal_wp_endpoint, ASTAL_WP, ENDPOINT, GObject)
#define ASTAL_WP_TYPE_MEDIA_CLASS (astal_wp_media_class_get_type())
typedef enum {
ASTAL_WP_MEDIA_CLASS_AUDIO_MICROPHONE,
ASTAL_WP_MEDIA_CLASS_AUDIO_SPEAKER,
ASTAL_WP_MEDIA_CLASS_AUDIO_RECORDER,
ASTAL_WP_MEDIA_CLASS_AUDIO_STREAM,
ASTAL_WP_MEDIA_CLASS_VIDEO_SOURCE,
ASTAL_WP_MEDIA_CLASS_VIDEO_SINK,
ASTAL_WP_MEDIA_CLASS_VIDEO_RECORDER,
ASTAL_WP_MEDIA_CLASS_VIDEO_STREAM,
} AstalWpMediaClass;
void astal_wp_endpoint_set_volume(AstalWpEndpoint *self, gdouble volume);
void astal_wp_endpoint_set_mute(AstalWpEndpoint *self, gboolean mute);
gboolean astal_wp_endpoint_get_is_default(AstalWpEndpoint *self);
void astal_wp_endpoint_set_is_default(AstalWpEndpoint *self, gboolean is_default);
gboolean astal_wp_endpoint_get_lock_channels(AstalWpEndpoint *self);
void astal_wp_endpoint_set_lock_channels(AstalWpEndpoint *self, gboolean lock_channels);
AstalWpMediaClass astal_wp_endpoint_get_media_class(AstalWpEndpoint *self);
guint astal_wp_endpoint_get_id(AstalWpEndpoint *self);
gboolean astal_wp_endpoint_get_mute(AstalWpEndpoint *self);
gdouble astal_wp_endpoint_get_volume(AstalWpEndpoint *self);
const gchar *astal_wp_endpoint_get_description(AstalWpEndpoint *self);
const gchar *astal_wp_endpoint_get_name(AstalWpEndpoint *self);
const gchar *astal_wp_endpoint_get_icon(AstalWpEndpoint *self);
const gchar *astal_wp_endpoint_get_volume_icon(AstalWpEndpoint *self);
G_END_DECLS
#endif // !ASTAL_WP_ENDPOINT_H
@@ -0,0 +1,10 @@
astal_wireplumber_subheaders = files(
'audio.h',
'device.h',
'endpoint.h',
'profile.h',
'video.h',
'wp.h',
)
install_headers(astal_wireplumber_subheaders, subdir: 'astal/wireplumber')
@@ -0,0 +1,17 @@
#ifndef ASTAL_WP_PROFILE_H
#define ASTAL_WP_PROFILE_H
#include <glib-object.h>
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_PROFILE (astal_wp_profile_get_type())
G_DECLARE_FINAL_TYPE(AstalWpProfile, astal_wp_profile, ASTAL_WP, PROFILE, GObject)
gint astal_wp_profile_get_index(AstalWpProfile *self);
const gchar *astal_wp_profile_get_description(AstalWpProfile *self);
G_END_DECLS
#endif // !ASTAL_WP_PROFILE_H
@@ -0,0 +1,29 @@
#ifndef ASTAL_WIREPLUMBER_VIDEO_H
#define ASTAL_WIREPLUMBER_VIDEO_H
#include <glib-object.h>
#include "device.h"
#include "endpoint.h"
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_VIDEO (astal_wp_video_get_type())
G_DECLARE_FINAL_TYPE(AstalWpVideo, astal_wp_video, ASTAL_WP, VIDEO, GObject)
AstalWpEndpoint *astal_wp_video_get_source(AstalWpVideo *self, guint id);
AstalWpEndpoint *astal_wp_video_get_sink(AstalWpVideo *self, guint id);
AstalWpEndpoint *astal_wp_video_get_recorder(AstalWpVideo *self, guint id);
AstalWpEndpoint *astal_wp_video_get_stream(AstalWpVideo *self, guint id);
AstalWpDevice *astal_wp_video_get_device(AstalWpVideo *self, guint id);
GList *astal_wp_video_get_sources(AstalWpVideo *self);
GList *astal_wp_video_get_sinks(AstalWpVideo *self);
GList *astal_wp_video_get_recorders(AstalWpVideo *self);
GList *astal_wp_video_get_streams(AstalWpVideo *self);
GList *astal_wp_video_get_devices(AstalWpVideo *self);
G_END_DECLS
#endif // !ASTAL_WIREPLUMBER_VIDEO_H
@@ -0,0 +1,47 @@
#ifndef ASTAL_WIREPLUMBER_H
#define ASTAL_WIREPLUMBER_H
#include <glib-object.h>
#include "audio.h"
#include "device.h"
#include "endpoint.h"
#include "video.h"
G_BEGIN_DECLS
#define ASTAL_WP_TYPE_SCALE (astal_wp_scale_get_type())
typedef enum {
ASTAL_WP_SCALE_LINEAR,
ASTAL_WP_SCALE_CUBIC,
} AstalWpScale;
#define ASTAL_WP_TYPE_WP (astal_wp_wp_get_type())
G_DECLARE_FINAL_TYPE(AstalWpWp, astal_wp_wp, ASTAL_WP, WP, GObject)
AstalWpWp* astal_wp_wp_get_default();
AstalWpWp* astal_wp_get_default_wp();
AstalWpAudio* astal_wp_wp_get_audio(AstalWpWp* self);
AstalWpVideo* astal_wp_wp_get_video(AstalWpWp* self);
AstalWpEndpoint* astal_wp_wp_get_endpoint(AstalWpWp* self, guint id);
GList* astal_wp_wp_get_endpoints(AstalWpWp* self);
AstalWpDevice* astal_wp_wp_get_device(AstalWpWp* self, guint id);
GList* astal_wp_wp_get_devices(AstalWpWp* self);
AstalWpEndpoint* astal_wp_wp_get_default_speaker(AstalWpWp* self);
AstalWpEndpoint* astal_wp_wp_get_default_microphone(AstalWpWp* self);
AstalWpScale astal_wp_wp_get_scale(AstalWpWp* self);
void astal_wp_wp_set_scale(AstalWpWp* self, AstalWpScale scale);
AstalWpVideo* astal_wp_video_new(AstalWpWp* wp);
AstalWpAudio* astal_wp_audio_new(AstalWpWp* wp);
G_END_DECLS
#endif // !ASTAL_WIREPLUMBER_H
+8
View File
@@ -0,0 +1,8 @@
astal_wireplumber_inc = include_directories('.', 'astal/wireplumber', 'private')
astal_wireplumber_headers = files(
'astal-wp.h',
)
install_headers(astal_wireplumber_headers)
subdir('astal/wireplumber')
@@ -0,0 +1,15 @@
#ifndef ASTAL_WP_DEVICE_PRIVATE_H
#define ASTAL_WP_DEVICE_PRIVATE_H
#include <glib-object.h>
#include <wp/wp.h>
#include "device.h"
G_BEGIN_DECLS
AstalWpDevice *astal_wp_device_create(WpDevice *device);
G_END_DECLS
#endif // !ASTAL_WP_DEVICE_PRIATE_H
@@ -0,0 +1,22 @@
#ifndef ASTAL_WP_ENDPOINT_PRIV_H
#define ASTAL_WP_ENDPOINT_PRIV_H
#include <glib-object.h>
#include <wp/wp.h>
#include "endpoint.h"
#include "wp.h"
G_BEGIN_DECLS
AstalWpEndpoint *astal_wp_endpoint_create(WpNode *node, WpPlugin *mixer, WpPlugin *defaults,
AstalWpWp *wp);
AstalWpEndpoint *astal_wp_endpoint_init_as_default(AstalWpEndpoint *self, WpPlugin *mixer,
WpPlugin *defaults, AstalWpMediaClass type,
AstalWpWp *wp);
void astal_wp_endpoint_update_default(AstalWpEndpoint *self, gboolean is_default);
void astal_wp_endpoint_update_volume(AstalWpEndpoint *self);
G_END_DECLS
#endif // !ASTAL_WP_ENDPOINT_PRIV_H