mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-18 13:49:57 +01:00
Introducing multiple levels of Source Failure
This allows Mixer manager to deal with failed sources with the appropriate action: try to repair, leave for user to recreate, or delete.
This commit is contained in:
10
src/Source.h
10
src/Source.h
@@ -177,7 +177,13 @@ public:
|
||||
virtual guint64 playtime () const { return 0; }
|
||||
|
||||
// a Source shall informs if the source failed (i.e. shall be deleted)
|
||||
virtual bool failed () const = 0;
|
||||
typedef enum {
|
||||
FAIL_NONE = 0,
|
||||
FAIL_BAD= 1,
|
||||
FAIL_CRITICAL = 2,
|
||||
FAIL_FATAL = 3
|
||||
} Failure;
|
||||
virtual Failure failed () const = 0;
|
||||
|
||||
// a Source shall define a way to get a texture
|
||||
virtual uint texture () const = 0;
|
||||
@@ -251,7 +257,7 @@ public:
|
||||
}
|
||||
|
||||
static bool isInitialized (const Source* elem) {
|
||||
return (elem && elem->mode_ > Source::UNINITIALIZED);
|
||||
return (elem && ( elem->mode_ > Source::UNINITIALIZED || elem->failed() ) );
|
||||
}
|
||||
|
||||
// class-dependent icon
|
||||
|
||||
Reference in New Issue
Block a user