BEAST/BSE - Better Audio System and Sound Engine  0.8.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
bseutils.hh
Go to the documentation of this file.
00001  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
00002 #ifndef __BSE_UTILS_H__
00003 #define __BSE_UTILS_H__
00004 
00005 #include <bse/bseclientapi.hh>
00006 #include <bse/bseserverapi.hh>
00007 
00008 #include <bse/bseenums.hh>
00009 #include <bse/bseglobals.hh>
00010 #include <bse/bsecompat.hh>
00011 
00012 G_BEGIN_DECLS
00013 
00014 /* --- C++ helper declaration --- */
00015 void    bse_cxx_init      (void);
00016 /* --- record utils --- */
00017 BseNoteDescription* bse_note_description             (BseMusicalTuningType   musical_tuning,
00018                                                       int                    note,
00019                                                       int                    fine_tune);
00020 BsePartNote*        bse_part_note                    (guint                  id,
00021                                                       guint                  channel,
00022                                                       guint                  tick,
00023                                                       guint                  duration,
00024                                                       gint                   note,
00025                                                       gint                   fine_tune,
00026                                                       gfloat                 velocity,
00027                                                       gboolean               selected);
00028 void                bse_part_note_seq_take_append    (BsePartNoteSeq        *seq,
00029                                                       BsePartNote           *element);
00030 BsePartControl*     bse_part_control                 (guint                  id,
00031                                                       guint                  tick,
00032                                                       BseMidiSignalType      ctype,
00033                                                       gfloat                 value,
00034                                                       gboolean               selected);
00035 void                bse_part_control_seq_take_append (BsePartControlSeq     *seq,
00036                                                       BsePartControl        *element);
00037 void                bse_note_sequence_resize         (BseNoteSequence       *rec,
00038                                                       guint                  length);
00039 guint               bse_note_sequence_length         (BseNoteSequence       *rec);
00040 void                bse_property_candidate_relabel   (BsePropertyCandidates *pc,
00041                                                       const gchar           *label,
00042                                                       const gchar           *tooltip);
00043 void                bse_item_seq_remove              (BseItemSeq            *iseq,
00044                                                       BseItem               *item);
00045 SfiRing*            bse_item_seq_to_ring             (BseItemSeq            *iseq);
00046 BseItemSeq*         bse_item_seq_from_ring           (SfiRing               *ring);
00047 
00048 
00049 /* --- debugging --- */
00050 void    bse_debug_dump_floats   (guint   debug_stream,
00051                                  guint   n_channels,
00052                                  guint   mix_freq,
00053                                  guint   n_values,
00054                                  gfloat *values);
00055 
00056 
00057 /* --- balance calculation --- */
00058 /* levels are 0..100, balance is -100..+100 */
00059 double  bse_balance_get         (double  level1,
00060                                  double  level2);
00061 void    bse_balance_set         (double  balance,
00062                                  double *level1,
00063                                  double *level2);
00064 
00065 
00066 /* --- icons --- */
00067 BseIcon* bse_icon_from_pixstream (const guint8     *pixstream);
00068 
00069 
00070 /* --- ID allocator --- */
00071 gulong  bse_id_alloc    (void);
00072 void    bse_id_free     (gulong id);
00073 
00074 
00075 /* --- string array manipulation --- */
00076 gchar**       bse_xinfos_add_value              (gchar          **xinfos,
00077                                                  const gchar     *key,
00078                                                  const gchar     *value);
00079 gchar**       bse_xinfos_add_float              (gchar          **xinfos,
00080                                                  const gchar     *key,
00081                                                  gfloat           fvalue);
00082 gchar**       bse_xinfos_add_num                (gchar          **xinfos,
00083                                                  const gchar     *key,
00084                                                  SfiNum           num);
00085 gchar**       bse_xinfos_parse_assignment       (gchar          **xinfos,
00086                                                  const gchar     *assignment);
00087 gchar**       bse_xinfos_del_value              (gchar          **xinfos,
00088                                                  const gchar     *key);
00089 const gchar*  bse_xinfos_get_value              (gchar          **xinfos,
00090                                                  const gchar     *key);
00091 gfloat        bse_xinfos_get_float              (gchar          **xinfos,
00092                                                  const gchar     *key);
00093 SfiNum        bse_xinfos_get_num                (gchar          **xinfos,
00094                                                  const gchar     *key);
00095 gchar**       bse_xinfos_dup_consolidated       (gchar          **xinfos,
00096                                                  gboolean         copy_interns);
00097 gint          bse_xinfo_stub_compare            (const gchar     *xinfo1,  /* must contain '=' */
00098                                                  const gchar     *xinfo2); /* must contain '=' */
00099 
00100 
00101 /* --- miscellaeous --- */
00102 guint           bse_string_hash                 (gconstpointer   string);
00103 gint            bse_string_equals               (gconstpointer   string1,
00104                                                  gconstpointer   string2);
00105 G_END_DECLS
00106 
00107 #endif /* __BSE_UTILS_H__ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines