## AgsAlsaMidiin

AgsAlsaMidiin — Input from sequencer

## Stability Level

Stable, unless otherwise indicated

## Functions

#define | AGS_ALSA_MIDIIN_GET_OBJ_MUTEX()
GQuark | ags_alsa_midiin_error_quark ()
gboolean | ags_alsa_midiin_test_flags ()
void | ags_alsa_midiin_set_flags ()
void | ags_alsa_midiin_unset_flags ()
void | ags_alsa_midiin_switch_buffer_flag ()
AgsAlsaMidiin * | ags_alsa_midiin_new ()

## Properties

double | bpm | Read / Write
gpointer | buffer | Read
char * | device | Read / Write

## Types and Values

#define | AGS_ALSA_MIDIIN_DEFAULT_ALSA_DEVICE
#define | AGS_ALSA_MIDIIN_DEFAULT_APP_BUFFER_SIZE
#define | AGS_ALSA_MIDIIN_DEFAULT_BACKEND_BUFFER_SIZE
#define | AGS_ALSA_MIDIIN_DEFAULT_BUFFER_SIZE
enum | AgsAlsaMidiinFlags
enum | AgsAlsaMidiinAppBufferMode
enum | AgsAlsaMidiinBackendBufferMode
enum | AgsAlsaMidiinSyncFlags
#define | AGS_ALSA_MIDIIN_ERROR
enum | AgsAlsaMidiinError

## Object Hierarchy

        GObject
        ╰── AgsAlsaMidiin

## Includes

    #include <ags/audio/alsa/ags_alsa_midiin.h>

## Description

AgsAlsaMidiin represents a sequencer and supports midi input.

## Functions

### AGS_ALSA_MIDIIN_GET_OBJ_MUTEX()

    #define AGS_ALSA_MIDIIN_GET_OBJ_MUTEX(obj) (&(((AgsAlsaMidiin *) obj)->obj_mutex))

### ags_alsa_midiin_error_quark ()

    GQuark
    ags_alsa_midiin_error_quark ();

### ags_alsa_midiin_test_flags ()

    gboolean
    ags_alsa_midiin_test_flags (AgsAlsaMidiin *alsa_midiin,
                                AgsAlsaMidiinFlags flags);

Test `flags` to be set on `alsa_midiin` .

#### Parameters

alsa_midiin | the AgsAlsaMidiin |
flags | the flags |

#### Returns

`TRUE` if flags are set, else `FALSE`

Since: 3.13.2

### ags_alsa_midiin_set_flags ()

    void
    ags_alsa_midiin_set_flags (AgsAlsaMidiin *alsa_midiin,
                               AgsAlsaMidiinFlags flags);

Enable a feature of `alsa_midiin` .

#### Parameters

alsa_midiin | the AgsAlsaMidiin |
flags | see AgsAlsaMidiinFlags |

Since: 3.13.2

### ags_alsa_midiin_unset_flags ()

    void
    ags_alsa_midiin_unset_flags (AgsAlsaMidiin *alsa_midiin,
                                 AgsAlsaMidiinFlags flags);

Disable a feature of `alsa_midiin` .

#### Parameters

alsa_midiin | the AgsAlsaMidiin |
flags | see AgsAlsaMidiinFlags |

Since: 3.13.2

### ags_alsa_midiin_switch_buffer_flag ()

    void
    ags_alsa_midiin_switch_buffer_flag (AgsAlsaMidiin *alsa_midiin);

The buffer flag indicates the currently played buffer.

#### Parameters

alsa_midiin | the AgsAlsaMidiin |

Since: 3.13.2

### ags_alsa_midiin_new ()

    AgsAlsaMidiin *
    ags_alsa_midiin_new ();

Creates a new instance of AgsAlsaMidiin.

#### Returns

the new AgsAlsaMidiin

Since: 3.13.2

## Types and Values

### AGS_ALSA_MIDIIN_DEFAULT_ALSA_DEVICE

    #define AGS_ALSA_MIDIIN_DEFAULT_ALSA_DEVICE "hw:0,0"

### AGS_ALSA_MIDIIN_DEFAULT_APP_BUFFER_SIZE

    #define AGS_ALSA_MIDIIN_DEFAULT_APP_BUFFER_SIZE (4)

### AGS_ALSA_MIDIIN_DEFAULT_BACKEND_BUFFER_SIZE

    #define AGS_ALSA_MIDIIN_DEFAULT_BACKEND_BUFFER_SIZE (8)

### AGS_ALSA_MIDIIN_DEFAULT_BUFFER_SIZE

    #define AGS_ALSA_MIDIIN_DEFAULT_BUFFER_SIZE (4096)

### enum AgsAlsaMidiinFlags

Enum values to control the behavior or indicate internal state of AgsAlsaMidiin by enable/disable as flags.

#### Members

AGS_ALSA_MIDIIN_ADDED_TO_REGISTRY | the alsa_midiin was added to registry, see `AgsConnectable::`add_to_registry()`` |
AGS_ALSA_MIDIIN_CONNECTED | indicates the alsa_midiin was connected by calling `AgsConnectable::`connect()`` |
AGS_ALSA_MIDIIN_INITIALIZED | recording is initialized |
AGS_ALSA_MIDIIN_RECORD | is recording |
AGS_ALSA_MIDIIN_SHUTDOWN | stop recording |
AGS_ALSA_MIDIIN_START_RECORD | just started recording |
AGS_ALSA_MIDIIN_NONBLOCKING | do non-blocking calls |
AGS_ALSA_MIDIIN_ATTACK_FIRST | use first attack, instead of second one |

### enum AgsAlsaMidiinAppBufferMode

Enum values to indicate internal state of AgsAlsaMidiin application buffer by setting mode.

#### Members

AGS_ALSA_MIDIIN_APP_BUFFER_0 | ring-buffer 0 |
AGS_ALSA_MIDIIN_APP_BUFFER_1 | ring-buffer 1 |
AGS_ALSA_MIDIIN_APP_BUFFER_2 | ring-buffer 2 |
AGS_ALSA_MIDIIN_APP_BUFFER_3 | ring-buffer 3 |

### enum AgsAlsaMidiinBackendBufferMode

Enum values to indicate internal state of AgsAlsaMidiin backend buffer by setting mode.

#### Members

AGS_ALSA_MIDIIN_BACKEND_BUFFER_0 | ring-buffer 0 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_1 | ring-buffer 1 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_2 | ring-buffer 2 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_3 | ring-buffer 3 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_4 | ring-buffer 4 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_5 | ring-buffer 5 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_6 | ring-buffer 6 |
AGS_ALSA_MIDIIN_BACKEND_BUFFER_7 | ring-buffer 7 |

### enum AgsAlsaMidiinSyncFlags

Enum values to control the synchronization between sequencer and poll.

#### Members

AGS_ALSA_MIDIIN_PASS_THROUGH | do not sync |
AGS_ALSA_MIDIIN_INITIAL_POLL | initial poll |
AGS_ALSA_MIDIIN_POLL_WAIT | sync wait, sequencer conditional lock |
AGS_ALSA_MIDIIN_POLL_DONE | sync done, sequencer conditional lock |
AGS_ALSA_MIDIIN_POLL_FINISH_WAIT | sync wait, client conditional lock |
AGS_ALSA_MIDIIN_POLL_FINISH_DONE | sync done, client conditional lock |
AGS_ALSA_MIDIIN_POLL_SWITCH_BUFFER | switch buffer |

### AGS_ALSA_MIDIIN_ERROR

    #define AGS_ALSA_MIDIIN_ERROR (ags_alsa_midiin_error_quark())

### enum AgsAlsaMidiinError

#### Members

AGS_ALSA_MIDIIN_ERROR_LOCKED_SEQUENCER |  |

## Property Details

### The `“bpm”` property

      “bpm”                      double

Beats per minute

Owner: AgsAlsaMidiin

Flags: Read / Write

Allowed values: [1,240]

Default value: 120

Since: 3.13.2

### The `“buffer”` property

      “buffer”                   gpointer

The buffer

Owner: AgsAlsaMidiin

Flags: Read

Since: 3.13.2

### The `“device”` property

      “device”                   char *

The alsa sequencer indentifier

Owner: AgsAlsaMidiin

Flags: Read / Write

Default value: "hw:0,0"

Since: 3.13.2