add more changes to the notification support. still not finished.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@939 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -9,14 +9,38 @@
|
|||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
namespace media {
|
namespace media {
|
||||||
|
|
||||||
|
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
enum notification_type_mask
|
||||||
|
{
|
||||||
|
notification_no_mask = 0,
|
||||||
|
notification_node_created = (1 << 0),
|
||||||
|
notification_node_deleted = (1 << 1),
|
||||||
|
notification_connection_made = (1 << 2),
|
||||||
|
notification_connection_broken = (1 << 3),
|
||||||
|
notification_buffer_created = (1 << 4),
|
||||||
|
notification_buffer_deleted = (1 << 5),
|
||||||
|
notification_transport_state = (1 << 6),
|
||||||
|
notification_parameter_changed = (1 << 7),
|
||||||
|
notification_format_change = (1 << 8),
|
||||||
|
notification_web_changed = (1 << 9),
|
||||||
|
notification_default_changed = (1 << 10),
|
||||||
|
notification_new_parameter_value= (1 << 11),
|
||||||
|
notification_node_stopped = (1 << 12),
|
||||||
|
notification_flavors_changed = (1 << 13),
|
||||||
|
notification_error = (1 << 31), // XXX, um well... always allow error notifications? Handled in the server
|
||||||
|
notification_basic = (notification_node_created | notification_node_deleted | notification_connection_made | notification_connection_broken),
|
||||||
|
notification_wildcard = (0xffffffff - notification_error) // exclude error, it is handled in the server
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NotificationManager();
|
NotificationManager();
|
||||||
~NotificationManager();
|
~NotificationManager();
|
||||||
|
|
||||||
status_t Register(const BMessenger ¬ifyHandler, const media_node &node, int32 notificationType);
|
status_t Register(const BMessenger ¬ifyHandler, const media_node &node, notification_type_mask mask);
|
||||||
status_t Unregister(const BMessenger ¬ifyHandler, const media_node &node, int32 notificationType);
|
status_t Unregister(const BMessenger ¬ifyHandler, const media_node &node, notification_type_mask mask);
|
||||||
|
|
||||||
status_t ReportError(const media_node &node, BMediaNode::node_error what, const BMessage * info);
|
status_t ReportError(const media_node &node, BMediaNode::node_error what, const BMessage * info);
|
||||||
|
|
||||||
@@ -36,6 +60,7 @@ public:
|
|||||||
void NodeStopped(const media_node &node, bigtime_t when); // XXX fix
|
void NodeStopped(const media_node &node, bigtime_t when); // XXX fix
|
||||||
|
|
||||||
static bool IsValidNotificationType(int32 notificationType);
|
static bool IsValidNotificationType(int32 notificationType);
|
||||||
|
static notification_type_mask NotificationType2Mask(int32 notificationType);
|
||||||
private:
|
private:
|
||||||
status_t SendMessageToMediaServer(BMessage *msg);
|
status_t SendMessageToMediaServer(BMessage *msg);
|
||||||
|
|
||||||
@@ -46,6 +71,9 @@ private:
|
|||||||
}; // namespace media
|
}; // namespace media
|
||||||
}; // namespace BPrivate
|
}; // namespace BPrivate
|
||||||
|
|
||||||
|
#define NOTIFICATION_PARAM_WHAT "be:media:internal:what"
|
||||||
|
#define NOTIFICATION_PARAM_MASK "be:media:internal:mask"
|
||||||
|
|
||||||
extern BPrivate::media::NotificationManager *_NotificationManager;
|
extern BPrivate::media::NotificationManager *_NotificationManager;
|
||||||
|
|
||||||
#endif // _NOTIFICATION_MANAGER_H
|
#endif // _NOTIFICATION_MANAGER_H
|
||||||
|
|||||||
Reference in New Issue
Block a user