Man Linux: Main Page and Category List

NAME

       YGetAudioModes - Audio mode list retrieving

SYNTAX

       #include <Y2/Y.h>
       #include <Y2/Ylib.h>

       YAudioModeValuesStruct **YGetAudioModes(
               YConnection *connection,
               int *count
       )

       typedef struct {

               char name[YAudioNameMax];

               int sample_rate;
               int channels;
               int sample_size;
               int fragment_size_bytes;
               char direction;
               char allow_fragmenting;
               int num_fragments;

       } YAudioModeValuesStruct;

ARGUMENTS

       connection
              Specifies  the connection to the Y server, obtained by a call to
              YOpenConnection.

       count  Specifies a pointer to an int that will indicate the  number  of
              dynamically    allocated    YAudioModeValuesStruct    structures
              returned.

DESCRIPTION

       The YGetAudioModes function fetches a list  of  Audio  mode  names  and
       their values from the Y server.

RETURN VALUE

       The  YGetAudioModes  function returns a pointer to an array of pointers
       of YAudioModeValuesStruct structures.  The returned pointer needs to be
       deallocated by calling YFreeAudioModesList.

       Can return NULL on error.

EXAMPLE

       #include <stdio.h>
       #include <Y2/Y.h>
       #include <Y2/Ylib.h>

       int main(int argc, char *argv[])
       {
               YAudioModeValuesStruct **list;
               int count;
               YConnection *con = YOpenConnection(
                       "/usr/sbin/starty",
                       "127.0.0.1:9433"
               );
               if(con == NULL)
                       return(1);

               list = YGetAudioModes(con, &count);

               YFreeAudioModesList(list, count);

               YCloseConnection(con, False);

               return(0);
       }

SEE ALSO

       YFreeAudioModesList(3)                        YChangeAudioModePreset(3)
       YMatchAudioModeValues(3)