Murray Cumming wrote:
According to the documentation, add_signal_watch[_full] can be called more than once (several times), but remove_signal_watch must be called the same number of times. By testing I found that the following error is produced if remove_signal_watch is called "once" too often (in other words, it cannot be called unless an add_signal_watch[_full] was called before):On Wed, 2007-12-05 at 17:57 -0500, José Alburquerque wrote:José Alburquerque wrote:Murray Cumming wrote:I think we should do this in C++ much as it is done in C: - We should have an add_watch(priority) that just causes the signal to be emitted. and - We should have an add_watch(slot) that provides a sigc::slot that is called. We have lots of these set_func(slot)-like functions in gtkmm.Hi. I'm trying to implement these GstBus "watch" functions and I have a quick question. AFAICT, GstBus has the following "watch" functions: gst_bus_add_watch(GstBus*, GstBusFunc func, gpointer) gs_bus_add_watch_full(GstBus*, gint priority, GstBusFunc func, gpointer data, GDestroyNotify notify) gst_bus_add_signal_watch(GstBus*) gst_bus_add_signal_watch_full(GstBus*, gint priority) gst_bus_remove_signal_watch(GstBus*) As I understand, the first two will be wrapped using slots while the last three deal with enabling/disabling the Gst::Bus "message" signal. My question is: When these functions are wrapped, should similar names be used for the methods (eg. Gst::Bus::add_signal_watch() for gst_bus_add_signal_watch)? -JoseI was sort of thinking of having a Gst::Bus::enable_message_signal() and a Gst::Bus::disable_message_signal() (for the message signal)I do wonder if these can be called more than once, and what remove_signal_watch() does if I've called it twice. If they can only be called once then enable/disable would be clearer, but I think we need to discover more.
(gstreamer-ogg-player:5939): GStreamer-CRITICAL **: Bus bus1 has no signal watches attached
and then having methods like Gst::Bus::add_watch() andGst::Bus::add_watch(priority) for the slots.This seems correct.
-Jose