title: Use "g_array_index()" on GValueArray type
body: <p>I have an application that uses the GstLevel element get and print RMS
  and peak values.</p>
  
  <p>The program prints warnings when I read the level-values in
  level_message_cb(...) function. Seems like all the GstStructure fields
  are now GValueArray types.</p>
  
  <pre><code>static gboolean
  level_message_cb (GstBus * bus, GstMessage * message, gpointer data) {
  
      if (message-&gt;type == GST_MESSAGE_ELEMENT) {
          const GstStructure *s = gst_message_get_structure (message);
          const gchar *name = gst_structure_get_name (s);
  
          if (strcmp (name, "level") == 0) {
              gint channels;
              GstClockTime endtime;
              gdouble rms_dB, peak_dB, decay_dB;
              gdouble rms;
              const GValue *array_val;
              const GValue *value;
  
              GValueArray *rms_arr, *peak_arr, *decay_arr;
              gint i;
  
              if (!gst_structure_get_clock_time (s, "endtime", &amp;endtime))
                  g_warning ("Could not parse endtime");
  
              array_val = gst_structure_get_value (s, "rms");
              rms_arr = (GValueArray *) g_value_get_boxed (array_val);
  
              array_val = gst_structure_get_value (s, "peak");
              peak_arr = (GValueArray *) g_value_get_boxed (array_val);
  
              array_val = gst_structure_get_value (s, "decay");
              decay_arr = (GValueArray *) g_value_get_boxed (array_val);
  
              channels = rms_arr-&gt;n_values;
  
              g_print ("endtime: %" GST_TIME_FORMAT ", channels: %d\n",
                   GST_TIME_ARGS (endtime), channels);
  
              for (i = 0; i &lt; channels; ++i) {
  
                  g_print ("channel %d\n", i);
  
                  array_val = gst_structure_get_value (s, "rms");
                  arr = (GValueArray *) g_value_get_boxed (array_val);
  
                  value = g_value_array_get_nth (rms_arr, i);
                  rms_dB = g_value_get_double (value);
  
                  value = g_value_array_get_nth (peak_arr, i);
                  peak_dB = g_value_get_double (value);
  
                  value = g_value_array_get_nth (decay_arr, i);
                  decay_dB = g_value_get_double (value);
  
                  g_print ("RMS: %f dB, peak: %f dB, decay: %f dB\n",
                       rms_dB, peak_dB, decay_dB);
  
                  rms = pow (10, rms_dB / 20);
  
                  g_print ("normalized rms value: %f\n", rms);
              }
          }
      }
      return TRUE;
  }
  </code></pre>
  
  <p>This is the warning I get:</p>
  
  <pre><code>warning: 'g_value_array_get_nth' is deprecated. Use 'g_array_index' instead
  </code></pre>
  
  <p>How can I use "g_array_index()" on GValueArray type. GArray has a
  g_array_index() method, but GValueArray has not.</p>
  
  <p>I read somewhere that GValueArray is also deprecated or should be avoided.
  Please instruct me how to read the level values in right way in the
  level_message_cb() function.</p>
  
  <p>Kindly Triniton.</p>