From 2b84318ebebb1df2c3d86763229718c87a17a506 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Mon, 20 Feb 2023 11:47:00 +0100 Subject: [PATCH] Allow channels to be marked as dirty --- src/emu/chan.c | 16 ++++++++++++++++ src/emu/chan.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/emu/chan.c b/src/emu/chan.c index 4c3b3ac..12a0bfa 100644 --- a/src/emu/chan.c +++ b/src/emu/chan.c @@ -237,6 +237,22 @@ chan_flush(struct chan *chan) return 0; } +/** Marks the channel as dirty */ +int +chan_dirty(struct chan *chan) +{ + /* Nothing to do, already dirty */ + if (chan->is_dirty) + return 0; + + if (set_dirty(chan) != 0) { + err("%s: set_dirty failed\n", chan->name); + return -1; + } + + return 0; +} + void chan_prop_set(struct chan *chan, enum chan_prop prop, int value) { diff --git a/src/emu/chan.h b/src/emu/chan.h index b9f5814..da37036 100644 --- a/src/emu/chan.h +++ b/src/emu/chan.h @@ -63,5 +63,6 @@ USE_RET int chan_flush(struct chan *chan); void chan_prop_set(struct chan *chan, enum chan_prop prop, int value); USE_RET int chan_prop_get(struct chan *chan, enum chan_prop prop); void chan_set_dirty_cb(struct chan *chan, chan_cb_t func, void *arg); +USE_RET int chan_dirty(struct chan *chan); #endif /* CHAN_H */