"alsatimer_user_instance_get_type";
"alsatimer_user_instance_new";
"alsatimer_user_instance_open";
+ "alsatimer_user_instance_attach";
+ "alsatimer_user_instance_attach_as_slave";
local:
*;
};
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <sys/ioctl.h>
#include <errno.h>
struct _ALSATimerUserInstancePrivate {
{
return g_object_new(ALSATIMER_TYPE_USER_INSTANCE, NULL);
}
+
+/**
+ * alsatimer_user_instance_attach:
+ * @self: A #ALSATimerUserInstance.
+ * @device_id: A #ALSATimerDeviceId to which the instance is attached.
+ * @error: A #GError.
+ *
+ * Attach the instance to the timer device.
+ */
+void alsatimer_user_instance_attach(ALSATimerUserInstance *self,
+ ALSATimerDeviceId *device_id,
+ GError **error)
+{
+ ALSATimerUserInstancePrivate *priv;
+ struct snd_timer_select sel = {0};
+
+ g_return_if_fail(ALSATIMER_IS_USER_INSTANCE(self));
+ g_return_if_fail(device_id != NULL);
+ priv = alsatimer_user_instance_get_instance_private(self);
+
+ sel.id = *device_id;
+ if (ioctl(priv->fd, SNDRV_TIMER_IOCTL_SELECT, &sel) < 0)
+ generate_error(error, errno);
+}
#include <glib.h>
#include <glib-object.h>
+#include <timer/device-id.h>
+
G_BEGIN_DECLS
#define ALSATIMER_TYPE_USER_INSTANCE (alsatimer_user_instance_get_type())
void alsatimer_user_instance_open(ALSATimerUserInstance *self, GError **error);
+void alsatimer_user_instance_attach(ALSATimerUserInstance *self,
+ ALSATimerDeviceId *device_id,
+ GError **error);
+
G_END_DECLS
#endif