The set of events is used only for ALSATimer.RealTimeEvent.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
ticks = 500 * 1000 * 1000 // resolution # 500msec
params.set_property('interval', ticks)
params.set_property('queue-size', 64)
-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)
+events = (ALSATimer.RealTimeEventType.RESOLUTION,
+ ALSATimer.RealTimeEventType.TICK,
+ ALSATimer.RealTimeEventType.START,
+ ALSATimer.RealTimeEventType.STOP,
+ ALSATimer.RealTimeEventType.CONTINUE,
+ ALSATimer.RealTimeEventType.PAUSE,
+ ALSATimer.RealTimeEventType.SUSPEND,
+ ALSATimer.RealTimeEventType.RESUME)
params.set_event_filter(events)
_, params = instance.set_params(params)
} ALSATimerInstanceParamFlag;
/**
- * 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.
+ * ALSATimerRealTimeEventType:
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_RESOLUTION: The event for timer resolution.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_TICK: The event for timer tick.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_START: The event for timer start.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_STOP: The event for timer stop.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_CONTINUE: The event for timer continue.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_PAUSE: The event for timer pause.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_EARLY: The event before timer start.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_SUSPEND: The event for timer suspend.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_RESUME: The event for timer resume.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MSTART: The event for master timer start.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MSTOP: The event for master timer stop.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MCONTINUE: The event for master timer continue.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MPAUSE: The event for master timer pause.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MSUSPEND: The event for master timer suspend.
+ * @ALSATIMER_REAL_TIME_EVENT_TYPE_MRESUME: The event for master timer resume.
*
- * A set of enumerations for the type of timestamp event.
+ * A set of enumerations for the type of real time event.
*/
typedef enum
{
- 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;
+ ALSATIMER_REAL_TIME_EVENT_TYPE_RESOLUTION = SNDRV_TIMER_EVENT_RESOLUTION,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_TICK = SNDRV_TIMER_EVENT_TICK,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_START = SNDRV_TIMER_EVENT_START,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_STOP = SNDRV_TIMER_EVENT_STOP,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_CONTINUE = SNDRV_TIMER_EVENT_CONTINUE,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_PAUSE = SNDRV_TIMER_EVENT_PAUSE,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_EARLY = SNDRV_TIMER_EVENT_EARLY,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_SUSPEND = SNDRV_TIMER_EVENT_SUSPEND,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_RESUME = SNDRV_TIMER_EVENT_RESUME,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MSTART = SNDRV_TIMER_EVENT_MSTART,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MSTOP = SNDRV_TIMER_EVENT_MSTOP,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MCONTINUE = SNDRV_TIMER_EVENT_MCONTINUE,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MPAUSE = SNDRV_TIMER_EVENT_MPAUSE,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MSUSPEND = SNDRV_TIMER_EVENT_MSUSPEND,
+ ALSATIMER_REAL_TIME_EVENT_TYPE_MRESUME = SNDRV_TIMER_EVENT_MRESUME,
+} ALSATimerRealTimeEventType;
/**
* ALSATimerEventType
"alsatimer_user_instance_continue";
"alsatimer_user_instance_choose_event_type";
- "alsatimer_tstamp_event_type_get_type";
+ "alsatimer_real_time_event_type_get_type";
"alsatimer_event_type_get_type";
"alsatimer_tick_time_event_get_type";
* alsatimer_instance_params_set_event_filter:
* @self: A [class@InstanceParams].
* @entries: (array length=entry_count): The array with elements for entries of
- * [enum@TstampEventType].
+ * [enum@RealTimeEventType].
* @entry_count: The number of elements in the above array.
* @error: A [struct@GLib.Error] at failure.
*
- * Set the list of [enum@TstampEventType] to filter events. This parameter is effective only for
- * target instance with [enum@EventType:TIMESTAMP].
+ * Set the list of [enum@RealTimeEventType] to filter events. This parameter is effective only for
+ * target instance with [enum@EventType].TIMESTAMP.
*
* Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
gboolean alsatimer_instance_params_set_event_filter(ALSATimerInstanceParams *self,
- const ALSATimerTstampEventType *entries,
+ const ALSATimerRealTimeEventType *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@TstampEventType].
+ * [enum@RealTimeEventType].
* @entry_count: The number of elements in the above array.
* @error: A [struct@GLib.Error] at failure.
*
- * Get the list of [enum@TstampEventType] to filter events. This parameter is effective only for
- * target instance with [enum@EventType:TIMESTAMP].
+ * Get the list of [enum@RealTimeEventType] to filter events. This parameter is effective only for
+ * target instance with [enum@EventType].REAL_TIME.
*
* Returns: %TRUE when the overall operation finishes successfully, else %FALSE.
*/
gboolean alsatimer_instance_params_get_event_filter(ALSATimerInstanceParams *self,
- ALSATimerTstampEventType **entries,
+ ALSATimerRealTimeEventType **entries,
gsize *entry_count, GError **error)
{
ALSATimerInstanceParamsPrivate *priv;
- ALSATimerTstampEventType *list;
+ ALSATimerRealTimeEventType *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] = (ALSATimerTstampEventType)i;
+ list[index] = (ALSATimerRealTimeEventType)i;
if (++index >= count)
break;
}
ALSATimerInstanceParams *alsatimer_instance_params_new();
gboolean alsatimer_instance_params_set_event_filter(ALSATimerInstanceParams *self,
- const ALSATimerTstampEventType *entries,
+ const ALSATimerRealTimeEventType *entries,
gsize entry_count, GError **error);
gboolean alsatimer_instance_params_get_event_filter(ALSATimerInstanceParams *self,
- ALSATimerTstampEventType **entries,
+ ALSATimerRealTimeEventType **entries,
gsize *entry_count, GError **error);
G_END_DECLS
/**
* alsatimer_real_time_event_get_event:
* @self: A [struct@RealTimeEvent].
- * @event: (out): The type of tstamp event, one of [enum@TstampEventType].
+ * @event: (out): The type of real time event, one of [enum@RealTimeEventType].
*
- * Get the kind of event for the timestamp event.
+ * Get the kind of event for the real time event.
*/
void alsatimer_real_time_event_get_event(const ALSATimerRealTimeEvent *self,
- ALSATimerTstampEventType *event)
+ ALSATimerRealTimeEventType *event)
{
- *event = (ALSATimerTstampEventType)self->event;
+ *event = (ALSATimerRealTimeEventType)self->event;
}
/**
* alsatimer_real_time_event_get_time:
* @self: A [struct@RealTimeEvent].
* @real_time: (array fixed-size=2) (inout): The array with two elements for the seconds and
- * nanoseconds part of timestamp when the instance queues the timestamp event.
+ * nanoseconds part of timestamp when the real time event occurs.
*
* Get the seconds and nanoseconds part for the real time event.
*/
* @self: A [struct@RealTimeEvent].
* @val: (out): The value depending on the type of timestamp event.
*
- * Get the value depending on the type of timestamp event.
+ * Get the value depending on the type of real time event.
*/
void alsatimer_real_time_event_get_val(const ALSATimerRealTimeEvent *self, guint *val)
{
GType alsatimer_real_time_event_get_type() G_GNUC_CONST;
void alsatimer_real_time_event_get_event(const ALSATimerRealTimeEvent *self,
- ALSATimerTstampEventType *event);
+ ALSATimerRealTimeEventType *event);
void alsatimer_real_time_event_get_time(const ALSATimerRealTimeEvent *self,
gint64 *const real_time[2]);
'EARLY_EVENT',
)
-tstamp_event_types = (
+real_time_event_types = (
'RESOLUTION',
'TICK',
'START',
ALSATimer.SpecificGlobalDevice: specific_global_devices,
ALSATimer.DeviceInfoFlag: device_info_flags,
ALSATimer.InstanceParamFlag: instance_param_flags,
- ALSATimer.TstampEventType: tstamp_event_types,
+ ALSATimer.RealTimeEventType: real_time_event_types,
ALSATimer.EventType: event_types,
ALSATimer.UserInstanceError: user_instance_error_types,
}