mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-02 09:01:48 -05:00
seq: Add API functions to set different tempo base values
MIDI2 Set Tempo message uses 10ns-based values, and we need to update the API to change the base time unit. This patch adds a few new API functions: - snd_seq_has_queue_tempo_base() returns 1 if the client supports a new tempo-base value; if 0, it's an old system and application has to use the tempo in the fixed 1us unit - the tempo base can be changed with snd_seq_queue_tempo_set_tempo_base(), provided in nsec unit; the value has to be either 10 or 1000 (or 0 as default, equivalent with 1000) The protocol version is checked and fallback to the fixed 1us base for the old clients. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
568b2ac1db
commit
24c7f42733
6 changed files with 74 additions and 3 deletions
|
|
@ -26,7 +26,7 @@
|
|||
#include <sound/asound.h>
|
||||
|
||||
/** version of the sequencer */
|
||||
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 3)
|
||||
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4)
|
||||
|
||||
/**
|
||||
* definition of sequencer event types
|
||||
|
|
@ -539,11 +539,12 @@ struct snd_seq_queue_status {
|
|||
/* queue tempo */
|
||||
struct snd_seq_queue_tempo {
|
||||
int queue; /* sequencer queue */
|
||||
unsigned int tempo; /* current tempo, us/tick */
|
||||
unsigned int tempo; /* current tempo, us/tick (or different time-base below) */
|
||||
int ppq; /* time resolution, ticks/quarter */
|
||||
unsigned int skew_value; /* queue skew */
|
||||
unsigned int skew_base; /* queue skew base */
|
||||
char reserved[24]; /* for the future */
|
||||
unsigned short tempo_base; /* tempo base in nsec unit; either 10 or 1000 */
|
||||
char reserved[22]; /* for the future */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue