BEAST/BSE - Better Audio System and Sound Engine  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bseutils.hh
Go to the documentation of this file.
1  // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl.html
2 #ifndef __BSE_UTILS_H__
3 #define __BSE_UTILS_H__
4 
5 #include <bse/bseclientapi.hh>
6 #include <rapicorn-core.hh>
7 
8 namespace Bse {
9 
12  public virtual std::enable_shared_from_this<ImplicitBase> {
13 public:
14  template<class Class, typename std::enable_if<std::is_base_of<ImplicitBase, Class>::value>::type* = nullptr>
15  static std::shared_ptr<Class> shared_ptr (Class *object)
16  {
17  return object ? std::shared_ptr<Class> (object->shared_from_this()) : std::shared_ptr<Class>();
18  }
19 };
20 
21 } // Bse
22 
23 #include <bse/bseserverapi.hh>
24 
25 #include <bse/bseenums.hh>
26 #include <bse/bseglobals.hh>
27 #include <bse/bsecompat.hh>
28 
29 G_BEGIN_DECLS
30 
31 /* --- C++ helper declaration --- */
32 void bse_cxx_init (void);
33 /* --- record utils --- */
34 BseNoteDescription* bse_note_description (BseMusicalTuningType musical_tuning,
35  int note,
36  int fine_tune);
37 BsePartNote* bse_part_note (guint id,
38  guint channel,
39  guint tick,
40  guint duration,
41  gint note,
42  gint fine_tune,
43  gfloat velocity,
44  gboolean selected);
45 void bse_part_note_seq_take_append (BsePartNoteSeq *seq,
46  BsePartNote *element);
47 BsePartControl* bse_part_control (guint id,
48  guint tick,
49  BseMidiSignalType ctype,
50  gfloat value,
51  gboolean selected);
52 void bse_part_control_seq_take_append (BsePartControlSeq *seq,
53  BsePartControl *element);
54 void bse_note_sequence_resize (BseNoteSequence *rec,
55  guint length);
56 guint bse_note_sequence_length (BseNoteSequence *rec);
57 void bse_property_candidate_relabel (BsePropertyCandidates *pc,
58  const gchar *label,
59  const gchar *tooltip);
60 void bse_item_seq_remove (BseItemSeq *iseq,
61  BseItem *item);
62 SfiRing* bse_item_seq_to_ring (BseItemSeq *iseq);
63 BseItemSeq* bse_item_seq_from_ring (SfiRing *ring);
64 
65 
66 /* --- debugging --- */
67 void bse_debug_dump_floats (guint debug_stream,
68  guint n_channels,
69  guint mix_freq,
70  guint n_values,
71  gfloat *values);
72 
73 
74 /* --- balance calculation --- */
75 /* levels are 0..100, balance is -100..+100 */
76 double bse_balance_get (double level1,
77  double level2);
78 void bse_balance_set (double balance,
79  double *level1,
80  double *level2);
81 
82 
83 /* --- icons --- */
84 BseIcon* bse_icon_from_pixstream (const guint8 *pixstream);
85 
86 
87 /* --- ID allocator --- */
88 gulong bse_id_alloc (void);
89 void bse_id_free (gulong id);
90 
91 
92 /* --- string array manipulation --- */
93 gchar** bse_xinfos_add_value (gchar **xinfos,
94  const gchar *key,
95  const gchar *value);
96 gchar** bse_xinfos_add_float (gchar **xinfos,
97  const gchar *key,
98  gfloat fvalue);
99 gchar** bse_xinfos_add_num (gchar **xinfos,
100  const gchar *key,
101  SfiNum num);
102 gchar** bse_xinfos_parse_assignment (gchar **xinfos,
103  const gchar *assignment);
104 gchar** bse_xinfos_del_value (gchar **xinfos,
105  const gchar *key);
106 const gchar* bse_xinfos_get_value (gchar **xinfos,
107  const gchar *key);
108 gfloat bse_xinfos_get_float (gchar **xinfos,
109  const gchar *key);
110 SfiNum bse_xinfos_get_num (gchar **xinfos,
111  const gchar *key);
112 gchar** bse_xinfos_dup_consolidated (gchar **xinfos,
113  gboolean copy_interns);
114 gint bse_xinfo_stub_compare (const gchar *xinfo1, /* must contain '=' */
115  const gchar *xinfo2); /* must contain '=' */
116 
117 
118 /* --- miscellaeous --- */
119 guint bse_string_hash (gconstpointer string);
120 gint bse_string_equals (gconstpointer string1,
121  gconstpointer string2);
122 G_END_DECLS
123 
124 #endif /* __BSE_UTILS_H__ */
static std::shared_ptr< Class > shared_ptr(Class *object)
Definition: bseutils.hh:15
IDL API base class until Rapicorn supports ImplicitBaseP out of the box.
Definition: bseutils.hh:11
Definition: sfiring.hh:23
Definition: bseitem.hh:33