feedback-vibra: Add support for patterns

Add a new class that takes an array of durations and magnitudes.
A magnitude of 0 indicates a pause.

We can consider dropping the VibraRumble class at some point as that
is a special case of VibraPeriodic now however as the feedbacks are
encoded in the themes let's make sure VibraPattern is good API before
deprecating VibraRumble.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
This commit is contained in:
Guido Günther
2024-12-15 18:35:58 +01:00
parent 386c98c381
commit 9cebb2c081
4 changed files with 307 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/*
* Copyright (C) 2024 The Phosh Developers
*
* SPDX-License-Identifier: GPL-3.0+
*/
#pragma once
#include "fbd-feedback-vibra.h"
G_BEGIN_DECLS
#define FBD_TYPE_FEEDBACK_VIBRA_PATTERN (fbd_feedback_vibra_pattern_get_type())
G_DECLARE_FINAL_TYPE (FbdFeedbackVibraPattern, fbd_feedback_vibra_pattern, FBD,
FEEDBACK_VIBRA_PATTERN,
FbdFeedbackVibra);
FbdFeedbackVibraPattern *fbd_feedback_vibra_pattern_new (GArray *magnitudes, GArray *durations);
G_END_DECLS