1 /*
2  * libInstPatch
3  * Copyright (C) 1999-2014 Element Green <element@elementsofsound.org>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; version 2.1
8  * of the License only.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  * 02110-1301, USA or on the web at http://www.gnu.org.
19  */
20 #ifndef __IPATCH_UNIT_DLS_H__
21 #define __IPATCH_UNIT_DLS_H__
22 
23 #include <glib.h>
24 #include <glib-object.h>
25 
26 /* Value for 0 seconds in DLS absolute time (a degenerate case) */
27 #define IPATCH_UNIT_DLS_ABS_TIME_0SECS ((gint32)0x80000000L)
28 
29 int ipatch_unit_dls_class_convert(guint16 src_units, const GValue *src_val);
30 
31 double ipatch_unit_dls_percent_to_percent(int dls_percent);
32 int ipatch_unit_percent_to_dls_percent(double percent);
33 double ipatch_unit_dls_gain_to_decibels(int dls_gain);
34 int ipatch_unit_decibels_to_dls_gain(double db);
35 double ipatch_unit_dls_abs_time_to_seconds(int dls_abs_time);
36 int ipatch_unit_seconds_to_dls_abs_time(double seconds);
37 double ipatch_unit_dls_rel_time_to_time_cents(int dls_rel_time);
38 int ipatch_unit_time_cents_to_dls_rel_time(double time_cents);
39 double ipatch_unit_dls_abs_pitch_to_hertz(int dls_abs_pitch);
40 int ipatch_unit_hertz_to_dls_abs_pitch(double hertz);
41 double ipatch_unit_dls_rel_pitch_to_cents(int dls_rel_pitch);
42 int ipatch_unit_cents_to_dls_rel_pitch(double cents);
43 
44 #endif
45