Home | History | Annotate | Download | only in server

Lines Matching full:curve

13 /* Simple curve with configurable max volume and volume step. */
15 struct cras_volume_curve curve;
20 static long get_dBFS_step(const struct cras_volume_curve *curve, size_t volume)
22 const struct stepped_curve *c = (const struct stepped_curve *)curve;
26 /* Curve that has each step explicitly called out by value. */
28 struct cras_volume_curve curve;
32 static long get_dBFS_explicit(const struct cras_volume_curve *curve,
35 const struct explicit_curve *c = (const struct explicit_curve *)curve;
56 struct stepped_curve *curve;
57 curve = (struct stepped_curve *)calloc(1, sizeof(*curve));
58 if (curve == NULL)
60 curve->curve.get_dBFS = get_dBFS_step;
61 curve->max_vol = max_volume;
62 curve->step = volume_step;
63 return &curve->curve;
69 struct explicit_curve *curve;
70 curve = (struct explicit_curve *)calloc(1, sizeof(*curve));
71 if (curve == NULL)
73 curve->curve.get_dBFS = get_dBFS_explicit;
74 memcpy(curve->dB_values, dB_values, sizeof(curve->dB_values));
75 return &curve->curve;
78 void cras_volume_curve_destroy(struct cras_volume_curve *curve)
80 free(curve);