ticks = 500 * 1000 * 1000 // resolution # 500msec
params.set_property('interval', ticks)
params.set_property('queue-size', 64)
-events = (ALSATimer.EventType.RESOLUTION,
- ALSATimer.EventType.TICK,
- ALSATimer.EventType.START,
- ALSATimer.EventType.STOP,
- ALSATimer.EventType.CONTINUE,
- ALSATimer.EventType.PAUSE,
- ALSATimer.EventType.SUSPEND,
- ALSATimer.EventType.RESUME)
+events = (ALSATimer.TstampEventType.RESOLUTION,
+ ALSATimer.TstampEventType.TICK,
+ ALSATimer.TstampEventType.START,
+ ALSATimer.TstampEventType.STOP,
+ ALSATimer.TstampEventType.CONTINUE,
+ ALSATimer.TstampEventType.PAUSE,
+ ALSATimer.TstampEventType.SUSPEND,
+ ALSATimer.TstampEventType.RESUME)
params.set_event_filter(events)
_, params = instance.set_params(params)
} ALSATimerInstanceParamFlag;
/**
- * ALSATimerEventType:
- * @ALSATIMER_EVENT_TYPE_RESOLUTION: The event for timer resolution.
- * @ALSATIMER_EVENT_TYPE_TICK: The event for timer tick.
- * @ALSATIMER_EVENT_TYPE_START: The event for timer start.
- * @ALSATIMER_EVENT_TYPE_STOP: The event for timer stop.
- * @ALSATIMER_EVENT_TYPE_CONTINUE: The event for timer continue.
- * @ALSATIMER_EVENT_TYPE_PAUSE: The event for timer pause.
- * @ALSATIMER_EVENT_TYPE_EARLY: The event before timer start.
- * @ALSATIMER_EVENT_TYPE_SUSPEND: The event for timer suspend.
- * @ALSATIMER_EVENT_TYPE_RESUME: The event for timer resume.
- * @ALSATIMER_EVENT_TYPE_MSTART: The event for master timer start.
- * @ALSATIMER_EVENT_TYPE_MSTOP: The event for master timer stop.
- * @ALSATIMER_EVENT_TYPE_MCONTINUE: The event for master timer continue.
- * @ALSATIMER_EVENT_TYPE_MPAUSE: The event for master timer pause.
- * @ALSATIMER_EVENT_TYPE_MSUSPEND: The event for master timer suspend.
- * @ALSATIMER_EVENT_TYPE_MRESUME: The event for master timer resume.
+ * ALSATimerTstampEventType:
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_RESOLUTION: The event for timer resolution.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_TICK: The event for timer tick.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_START: The event for timer start.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_STOP: The event for timer stop.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_CONTINUE: The event for timer continue.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_PAUSE: The event for timer pause.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_EARLY: The event before timer start.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_SUSPEND: The event for timer suspend.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_RESUME: The event for timer resume.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MSTART: The event for master timer start.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MSTOP: The event for master timer stop.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MCONTINUE: The event for master timer continue.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MPAUSE: The event for master timer pause.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MSUSPEND: The event for master timer suspend.
+ * @ALSATIMER_TSTAMP_EVENT_TYPE_MRESUME: The event for master timer resume.
*
- * A set of enumerations for timer event.
+ * A set of enumerations for the type of timestamp event.
*/
typedef enum
{
- ALSATIMER_EVENT_TYPE_RESOLUTION = SNDRV_TIMER_EVENT_RESOLUTION,
- ALSATIMER_EVENT_TYPE_TICK = SNDRV_TIMER_EVENT_TICK,
- ALSATIMER_EVENT_TYPE_START = SNDRV_TIMER_EVENT_START,
- ALSATIMER_EVENT_TYPE_STOP = SNDRV_TIMER_EVENT_STOP,
- ALSATIMER_EVENT_TYPE_CONTINUE = SNDRV_TIMER_EVENT_CONTINUE,
- ALSATIMER_EVENT_TYPE_PAUSE = SNDRV_TIMER_EVENT_PAUSE,
- ALSATIMER_EVENT_TYPE_EARLY = SNDRV_TIMER_EVENT_EARLY,
- ALSATIMER_EVENT_TYPE_SUSPEND = SNDRV_TIMER_EVENT_SUSPEND,
- ALSATIMER_EVENT_TYPE_RESUME = SNDRV_TIMER_EVENT_RESUME,
- ALSATIMER_EVENT_TYPE_MSTART = SNDRV_TIMER_EVENT_MSTART,
- ALSATIMER_EVENT_TYPE_MSTOP = SNDRV_TIMER_EVENT_MSTOP,
- ALSATIMER_EVENT_TYPE_MCONTINUE = SNDRV_TIMER_EVENT_MCONTINUE,
- ALSATIMER_EVENT_TYPE_MPAUSE = SNDRV_TIMER_EVENT_MPAUSE,
- ALSATIMER_EVENT_TYPE_MSUSPEND = SNDRV_TIMER_EVENT_MSUSPEND,
- ALSATIMER_EVENT_TYPE_MRESUME = SNDRV_TIMER_EVENT_MRESUME,
-} ALSATimerEventType;
+ ALSATIMER_TSTAMP_EVENT_TYPE_RESOLUTION = SNDRV_TIMER_EVENT_RESOLUTION,
+ ALSATIMER_TSTAMP_EVENT_TYPE_TICK = SNDRV_TIMER_EVENT_TICK,
+ ALSATIMER_TSTAMP_EVENT_TYPE_START = SNDRV_TIMER_EVENT_START,
+ ALSATIMER_TSTAMP_EVENT_TYPE_STOP = SNDRV_TIMER_EVENT_STOP,
+ ALSATIMER_TSTAMP_EVENT_TYPE_CONTINUE = SNDRV_TIMER_EVENT_CONTINUE,
+ ALSATIMER_TSTAMP_EVENT_TYPE_PAUSE = SNDRV_TIMER_EVENT_PAUSE,
+ ALSATIMER_TSTAMP_EVENT_TYPE_EARLY = SNDRV_TIMER_EVENT_EARLY,
+ ALSATIMER_TSTAMP_EVENT_TYPE_SUSPEND = SNDRV_TIMER_EVENT_SUSPEND,
+ ALSATIMER_TSTAMP_EVENT_TYPE_RESUME = SNDRV_TIMER_EVENT_RESUME,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MSTART = SNDRV_TIMER_EVENT_MSTART,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MSTOP = SNDRV_TIMER_EVENT_MSTOP,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MCONTINUE = SNDRV_TIMER_EVENT_MCONTINUE,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MPAUSE = SNDRV_TIMER_EVENT_MPAUSE,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MSUSPEND = SNDRV_TIMER_EVENT_MSUSPEND,
+ ALSATIMER_TSTAMP_EVENT_TYPE_MRESUME = SNDRV_TIMER_EVENT_MRESUME,
+} ALSATimerTstampEventType;
/**
* ALSATimerEventDataType
"alsatimer_specific_global_device_get_type";
"alsatimer_device_info_flag_get_type";
"alsatimer_instance_param_flag_get_type";
- "alsatimer_event_type_get_type";
"alsatimer_event_data_type_get_type";
"alsatimer_device_id_get_type";
"alsatimer_user_instance_stop";
"alsatimer_user_instance_pause";
"alsatimer_user_instance_continue";
+
+ "alsatimer_tstamp_event_type_get_type";
} ALSA_GOBJECT_0_2_0;
/**
* alsatimer_event_data_tstamp_get_event:
* @self: A [struct@EventDataTstamp].
- * @event: (out): The type of tstamp event, one of [enum@EventType].
+ * @event: (out): The type of tstamp event, one of [enum@TstampEventType].
*
* Get the kind of event for the timestamp event.
*/
void alsatimer_event_data_tstamp_get_event(const ALSATimerEventDataTstamp *self,
- ALSATimerEventType *event)
+ ALSATimerTstampEventType *event)
{
- *event = (ALSATimerEventType)self->event;
+ *event = (ALSATimerTstampEventType)self->event;
}
/**
GType alsatimer_event_data_tstamp_get_type() G_GNUC_CONST;
void alsatimer_event_data_tstamp_get_event(const ALSATimerEventDataTstamp *self,
- ALSATimerEventType *event);
+ ALSATimerTstampEventType *event);
void alsatimer_event_data_tstamp_get_tstamp(const ALSATimerEventDataTstamp *self,
gint64 *const tstamp[2]);
/**
* alsatimer_instance_params_set_event_filter:
* @self: A [class@InstanceParams].
- * @entries: (array length=entry_count): The array with elements for entries of [enum@EventType].
+ * @entries: (array length=entry_count): The array with elements for entries of
+ * [enum@TstampEventType].
* @entry_count: The number of elements in the above array.
* @error: A [struct@GLib.Error] at failure.
*
- * Set the list of [enum@EventType] to filter events. This parameter is effective only for target
- * instance with [enum@EventDataType:TIMESTAMP].
+ * Set the list of [enum@TstampEventType] to filter events. This parameter is effective only for
+ * target instance with [enum@EventDataType:TIMESTAMP].
*
* Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
gboolean alsatimer_instance_params_set_event_filter(ALSATimerInstanceParams *self,
- const ALSATimerEventType *entries,
+ const ALSATimerTstampEventType *entries,
gsize entry_count, GError **error)
{
ALSATimerInstanceParamsPrivate *priv;
/**
* alsatimer_instance_params_get_event_filter:
* @self: A [class@InstanceParams].
- * @entries: (array length=entry_count)(out): The array with elements for entries of [enum@EventType].
+ * @entries: (array length=entry_count)(out): The array with elements for entries of
+ * [enum@TstampEventType].
* @entry_count: The number of elements in the above array.
* @error: A [struct@GLib.Error] at failure.
*
- * Get the list of ALSATimerEventType to filter events. This parameter is effective only for target
- * instance with [enum@EventDataType:TIMESTAMP].
+ * Get the list of [enum@TstampEventType] to filter events. This parameter is effective only for
+ * target instance with [enum@EventDataType:TIMESTAMP].
*
* Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
gboolean alsatimer_instance_params_get_event_filter(ALSATimerInstanceParams *self,
- ALSATimerEventType **entries,
+ ALSATimerTstampEventType **entries,
gsize *entry_count, GError **error)
{
ALSATimerInstanceParamsPrivate *priv;
- ALSATimerEventType *list;
+ ALSATimerTstampEventType *list;
unsigned int filter;
unsigned int count;
unsigned int index;
index = 0;
for (i = 0; i < sizeof(filter) * 8; ++i) {
if ((1u << i) & filter) {
- list[index] = (ALSATimerEventType)i;
+ list[index] = (ALSATimerTstampEventType)i;
if (++index >= count)
break;
}
ALSATimerInstanceParams *alsatimer_instance_params_new();
gboolean alsatimer_instance_params_set_event_filter(ALSATimerInstanceParams *self,
- const ALSATimerEventType *entries,
+ const ALSATimerTstampEventType *entries,
gsize entry_count, GError **error);
gboolean alsatimer_instance_params_get_event_filter(ALSATimerInstanceParams *self,
- ALSATimerEventType **entries,
+ ALSATimerTstampEventType **entries,
gsize *entry_count, GError **error);
G_END_DECLS
'EARLY_EVENT',
)
-event_types = (
+tstamp_event_types = (
'RESOLUTION',
'TICK',
'START',
ALSATimer.SpecificGlobalDevice: specific_global_devices,
ALSATimer.DeviceInfoFlag: device_info_flags,
ALSATimer.InstanceParamFlag: instance_param_flags,
- ALSATimer.EventType: event_types,
+ ALSATimer.TstampEventType: tstamp_event_types,
ALSATimer.EventDataType: event_data_types,
ALSATimer.UserInstanceError: user_instance_error_types,
}