[beast: 31/49] BSE: move MidiSignalType enum and PartControl procedures into bseapi.idl
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 31/49] BSE: move MidiSignalType enum and PartControl procedures into bseapi.idl
- Date: Wed, 1 Jul 2015 11:31:42 +0000 (UTC)
commit a08ce2ac3214710fb4d00d763b6b7c55606d360c
Author: Tim Janik <timj gnu org>
Date: Wed Jun 24 00:23:19 2015 +0200
BSE: move MidiSignalType enum and PartControl procedures into bseapi.idl
beast-gtk/bstbseutils.hh | 4 +-
beast-gtk/bsteventroll.cc | 39 ++++----
beast-gtk/bsteventroll.hh | 4 +-
beast-gtk/bsteventrollctrl.cc | 212 ++++++++++++++++++----------------------
beast-gtk/bsteventrollctrl.hh | 6 +-
beast-gtk/bstpartdialog.cc | 17 ++--
beast-gtk/bstpatterncolumns.cc | 58 +++++------
beast-gtk/bstpianorollctrl.cc | 2 +-
bse/bseapi.idl | 204 ++++++++++++++++++++++++++++++++++++++
bse/bsebasics.idl | 194 ------------------------------------
bse/bsecxxmodule.cc | 2 +-
bse/bseenums.hh | 175 +++++++++++++++++++++++++++++++++
bse/bsemidicontroller.cc | 24 +++---
bse/bsemidicontroller.hh | 2 +-
bse/bsemidievent.cc | 97 +++++++-----------
bse/bsemidievent.hh | 194 +------------------------------------
bse/bsemidifile.cc | 10 +-
bse/bsemidireceiver.cc | 92 +++++++++---------
bse/bsemidireceiver.hh | 10 +-
bse/bsepart.cc | 118 ++++++++++++-----------
bse/bsepart.hh | 27 +++---
bse/bsepart.proc | 154 +++--------------------------
bse/bsesequencer.cc | 2 +-
bse/bsesource.cc | 14 ++--
bse/bsesource.hh | 6 +-
bse/bsesource.proc | 6 +-
bse/bsestorage.cc | 4 +-
bse/bseutils.cc | 33 ++-----
bse/bseutils.hh | 8 +--
29 files changed, 763 insertions(+), 955 deletions(-)
---
diff --git a/beast-gtk/bstbseutils.hh b/beast-gtk/bstbseutils.hh
index 79901de..c1a9b0d 100644
--- a/beast-gtk/bstbseutils.hh
+++ b/beast-gtk/bstbseutils.hh
@@ -4,8 +4,10 @@
#include <sfi/sfi.hh> /* needed by bstoldbseapi.h */
#include "bstdefs.hh"
G_BEGIN_DECLS
-#define SFIDL_SKIPDEF__BseErrorType // replaced by Bse::ErrorType
+#define SFIDL_SKIPDEF__BseErrorType // replaced by Bse::ErrorType
#define BseErrorType Bse::ErrorType
+#define SFIDL_SKIPDEF__BseMidiSignalType // replaced by Bse::MidiSignalType
+#define BseMidiSignalType Bse::MidiSignalType
#include "bstoldbseapi.h" /* include this within extern "C" */
#undef BseErrorType
/* --- BSE utilities --- */
diff --git a/beast-gtk/bsteventroll.cc b/beast-gtk/bsteventroll.cc
index 6fdee38..3989176 100644
--- a/beast-gtk/bsteventroll.cc
+++ b/beast-gtk/bsteventroll.cc
@@ -84,7 +84,7 @@ bst_event_roll_init (BstEventRoll *self)
gtk_widget_set_double_buffered (widget, FALSE);
self->proxy = 0;
- self->control_type = BSE_MIDI_SIGNAL_CONTINUOUS_7; /* valoume */
+ self->control_type = Bse::MIDI_SIGNAL_CONTINUOUS_7; /* volume */
self->ppqn = 384; /* default Parts (clock ticks) Per Quarter Note */
self->qnpt = 1;
self->max_ticks = 1;
@@ -338,7 +338,6 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
guint8 *dash, dashes[3] = { 1, 1, 0 }; // long: { 2, 2, 0 };
GdkGC *draw_gc, *dark_gc;
int dlen, line_width = 0; /* line widths != 0 interfere with dash-settings on some X servers */
- BsePartControlSeq *cseq;
gint range, mid = event_roll_scale_range (self, &range);
gint x, xbound, width, height;
GXK_SCROLL_CANVAS_CLASS (bst_event_roll_parent_class)->draw_canvas (scc, drawable, area);
@@ -375,20 +374,20 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
/* draw controls */
dark_gc = STYLE (self)->dark_gc[GTK_STATE_NORMAL];
- cseq = self->proxy ? bse_part_list_controls (self->proxy,
- coord_to_tick (self, x, FALSE),
- coord_to_tick (self, xbound, FALSE),
- self->control_type) : NULL;
- for (uint i = 0; cseq && i < cseq->n_pcontrols; i++)
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->proxy));
+ Bse::PartControlSeq cseq;
+ if (part)
+ cseq = part.list_controls (coord_to_tick (self, x, false), coord_to_tick (self, xbound, false),
self->control_type);
+ for (size_t i = 0; i < cseq.size(); i++)
{
- BsePartControl *pctrl = cseq->pcontrols[i];
- guint tick = pctrl->tick;
+ const Bse::PartControl &pctrl = cseq[i];
+ guint tick = pctrl.tick;
GdkGC *xdark_gc, *xlight_gc, *xval_gc;
gint x1, x2, y1, y2;
- gboolean selected = pctrl->selected;
+ gboolean selected = pctrl.selected;
- selected |= (uint (pctrl->tick) >= self->selection_tick &&
- uint (pctrl->tick) < self->selection_tick + self->selection_duration);
+ selected |= (uint (pctrl.tick) >= self->selection_tick &&
+ uint (pctrl.tick) < self->selection_tick + self->selection_duration);
if (selected)
{
xdark_gc = STYLE (self)->bg_gc[GTK_STATE_SELECTED];
@@ -398,9 +397,9 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
else
{
xdark_gc = dark_gc;
- if (ABS (pctrl->value) < 0.00001)
+ if (ABS (pctrl.value) < 0.00001)
xval_gc = COLOR_GC_ZERO (self);
- else if (pctrl->value < 0)
+ else if (pctrl.value < 0)
xval_gc = COLOR_GC_NEGATIVE (self);
else
xval_gc = COLOR_GC_POSITIVE (self);
@@ -409,17 +408,17 @@ event_roll_draw_canvas (GxkScrollCanvas *scc,
x1 = tick_to_coord (self, tick);
x2 = x1 + XTHICKNESS (self);
x1 = MAX (0, x1 - XTHICKNESS (self));
- if (pctrl->value * range > 0)
+ if (pctrl.value * range > 0)
{
- y1 = mid - MAX (YTHICKNESS (self), range * pctrl->value);
+ y1 = mid - MAX (YTHICKNESS (self), range * pctrl.value);
y2 = mid + YTHICKNESS (self);
}
- else if (pctrl->value * range < 0)
+ else if (pctrl.value * range < 0)
{
y1 = mid - YTHICKNESS (self);
- y2 = mid + MAX (YTHICKNESS (self), range * -pctrl->value);
+ y2 = mid + MAX (YTHICKNESS (self), range * -pctrl.value);
}
- else /* pctrl->value * range == 0 */
+ else /* pctrl.value * range == 0 */
{
y1 = mid - YTHICKNESS (self);
y2 = mid + YTHICKNESS (self);
@@ -706,7 +705,7 @@ bst_event_roll_set_view_selection (BstEventRoll *self,
}
void
-bst_event_roll_set_control_type (BstEventRoll *self, BseMidiSignalType control_type)
+bst_event_roll_set_control_type (BstEventRoll *self, Bse::MidiSignalType control_type)
{
g_return_if_fail (BST_IS_EVENT_ROLL (self));
diff --git a/beast-gtk/bsteventroll.hh b/beast-gtk/bsteventroll.hh
index 90f7546..996989b 100644
--- a/beast-gtk/bsteventroll.hh
+++ b/beast-gtk/bsteventroll.hh
@@ -39,7 +39,7 @@ struct _BstEventRoll
GxkScrollCanvas parent_instance;
SfiProxy proxy;
- BseMidiSignalType control_type;
+ Bse::MidiSignalType control_type;
GtkWidget *child;
/* horizontal layout */
@@ -100,7 +100,7 @@ void bst_event_roll_set_view_selection (BstEventRoll *self,
void bst_event_roll_set_vpanel_width_hook (BstEventRoll *self,
gint (*fetch_vpanel_width) (gpointer data),
gpointer data);
-void bst_event_roll_set_control_type (BstEventRoll *self, BseMidiSignalType control_type);
+void bst_event_roll_set_control_type (BstEventRoll *self, Bse::MidiSignalType control_type);
void bst_event_roll_init_segment (BstEventRoll *self,
BstSegmentType type);
void bst_event_roll_segment_start (BstEventRoll *self,
diff --git a/beast-gtk/bsteventrollctrl.cc b/beast-gtk/bsteventrollctrl.cc
index 9d28529..6eb0c0e 100644
--- a/beast-gtk/bsteventrollctrl.cc
+++ b/beast-gtk/bsteventrollctrl.cc
@@ -23,7 +23,7 @@ static void controller_update_canvas_cursor (BstEventRollController *sel
/* --- variables --- */
-static BsePartControlSeq *clipboard_cseq = NULL;
+static Bse::PartControlSeq *clipboard_cseq = NULL;
/* --- actions --- */
enum {
@@ -55,16 +55,16 @@ bst_event_roll_controller_select_actions (BstEventRollController *self)
}
void
-bst_event_roll_controller_set_clipboard (BsePartControlSeq *cseq)
+bst_event_roll_controller_set_clipboard (const Bse::PartControlSeq &cseq)
{
if (clipboard_cseq)
- bse_part_control_seq_free (clipboard_cseq);
- clipboard_cseq = cseq && cseq->n_pcontrols ? bse_part_control_seq_copy_shallow (cseq) : NULL;
+ delete clipboard_cseq;
+ clipboard_cseq = cseq.size() ? new Bse::PartControlSeq (cseq) : NULL;
if (clipboard_cseq)
bst_piano_roll_controller_set_clipboard (NULL);
}
-BsePartControlSeq*
+Bse::PartControlSeq*
bst_event_roll_controller_get_clipboard (void)
{
return clipboard_cseq;
@@ -158,24 +158,24 @@ static void
bst_event_roll_controller_exec_action (BstEventRollController *self,
gulong action_id)
{
- SfiProxy part = self->eroll->proxy;
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
+ Bse::PartControlSeq cseq;
switch (action_id)
{
- BsePartControlSeq *cseq;
guint i;
case ACTION_SELECT_ALL:
- bse_part_select_controls (part, 0, self->eroll->max_ticks, CONTROL_TYPE (self));
+ bse_part_select_controls (part.proxy_id(), 0, self->eroll->max_ticks, CONTROL_TYPE (self));
break;
case ACTION_SELECT_NONE:
- bse_part_deselect_controls (part, 0, self->eroll->max_ticks, CONTROL_TYPE (self));
+ bse_part_deselect_controls (part.proxy_id(), 0, self->eroll->max_ticks, CONTROL_TYPE (self));
break;
case ACTION_SELECT_INVERT:
- cseq = bse_part_list_selected_controls (part, CONTROL_TYPE (self));
- bse_part_select_controls (part, 0, self->eroll->max_ticks, CONTROL_TYPE (self));
- for (i = 0; i < cseq->n_pcontrols; i++)
+ cseq = part.list_selected_controls (CONTROL_TYPE (self));
+ bse_part_select_controls (part.proxy_id(), 0, self->eroll->max_ticks, CONTROL_TYPE (self));
+ for (i = 0; i < cseq.size(); i++)
{
- BsePartControl *pcontrol = cseq->pcontrols[i];
- bse_part_deselect_event (part, pcontrol->id);
+ const Bse::PartControl &pcontrol = cseq[i];
+ bse_part_deselect_event (part.proxy_id(), pcontrol.id);
}
break;
}
@@ -260,98 +260,84 @@ event_canvas_button_tool (BstEventRollController *self,
void
bst_event_roll_controller_clear (BstEventRollController *self)
{
- BsePartControlSeq *cseq;
- SfiProxy proxy;
- guint i;
-
g_return_if_fail (self != NULL);
- proxy = self->eroll->proxy;
- cseq = bse_part_list_selected_controls (proxy, CONTROL_TYPE (self));
- bse_item_group_undo (proxy, "Clear Selection");
- for (i = 0; i < cseq->n_pcontrols; i++)
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
+ const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
+ bse_item_group_undo (part.proxy_id(), "Clear Selection");
+ for (size_t i = 0; i < cseq.size(); i++)
{
- BsePartControl *pctrl = cseq->pcontrols[i];
- bse_part_delete_event (proxy, pctrl->id);
+ const Bse::PartControl &pctrl = cseq[i];
+ bse_part_delete_event (part.proxy_id(), pctrl.id);
}
- bse_item_ungroup_undo (proxy);
+ bse_item_ungroup_undo (part.proxy_id());
}
void
bst_event_roll_controller_cut (BstEventRollController *self)
{
- BsePartControlSeq *cseq;
- SfiProxy proxy;
- guint i;
-
g_return_if_fail (self != NULL);
- proxy = self->eroll->proxy;
- cseq = bse_part_list_selected_controls (proxy, CONTROL_TYPE (self));
- bse_item_group_undo (proxy, "Cut Selection");
- for (i = 0; i < cseq->n_pcontrols; i++)
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
+ const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
+ bse_item_group_undo (part.proxy_id(), "Cut Selection");
+ for (size_t i = 0; i < cseq.size(); i++)
{
- BsePartControl *pctrl = cseq->pcontrols[i];
- bse_part_delete_event (proxy, pctrl->id);
+ const Bse::PartControl &pctrl = cseq[i];
+ bse_part_delete_event (part.proxy_id(), pctrl.id);
}
bst_event_roll_controller_set_clipboard (cseq);
- bse_item_ungroup_undo (proxy);
+ bse_item_ungroup_undo (part.proxy_id());
}
gboolean
bst_event_roll_controller_copy (BstEventRollController *self)
{
- BsePartControlSeq *cseq;
- SfiProxy proxy;
-
g_return_val_if_fail (self != NULL, FALSE);
- proxy = self->eroll->proxy;
- cseq = bse_part_list_selected_controls (proxy, CONTROL_TYPE (self));
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
+ const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
bst_event_roll_controller_set_clipboard (cseq);
- return cseq && cseq->n_pcontrols;
+ return cseq.size() > 0;
}
void
bst_event_roll_controller_paste (BstEventRollController *self)
{
- BsePartControlSeq *cseq;
- SfiProxy proxy;
-
g_return_if_fail (self != NULL);
- proxy = self->eroll->proxy;
- cseq = bst_event_roll_controller_get_clipboard ();
- if (cseq)
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
+ const Bse::PartControlSeq *cseq = bst_event_roll_controller_get_clipboard ();
+ if (!cseq || cseq->size() <= 0)
+ return;
+
+ uint ptick, ctick = self->eroll->max_ticks;
+ ptick = 100; // FIXME: bst_event_roll_get_paste_pos (self->eroll, &ptick);
+ for (size_t i = 0; i < cseq->size(); i++)
{
- guint i, ptick, ctick = self->eroll->max_ticks;
- ptick = 100; // FIXME: bst_event_roll_get_paste_pos (self->eroll, &ptick);
- for (i = 0; i < cseq->n_pcontrols; i++)
- {
- BsePartControl *pctrl = cseq->pcontrols[i];
- ctick = MIN (ctick, pctrl->tick);
- }
- bse_item_group_undo (proxy, "Paste Clipboard");
- bse_part_deselect_controls (proxy, 0, self->eroll->max_ticks, CONTROL_TYPE (self));
- for (i = 0; i < cseq->n_pcontrols; i++)
- {
- BsePartControl *pctrl = cseq->pcontrols[i];
- guint id = bse_part_insert_control (proxy,
- pctrl->tick - ctick + ptick,
- pctrl->control_type,
- pctrl->value);
- if (id)
- bse_part_select_event (proxy, id);
- }
- bse_item_ungroup_undo (proxy);
+ const Bse::PartControl &pctrl = (*cseq)[i];
+ ctick = MIN (ctick, uint (pctrl.tick));
+ }
+ bse_item_group_undo (part.proxy_id(), "Paste Clipboard");
+ bse_part_deselect_controls (part.proxy_id(), 0, self->eroll->max_ticks, CONTROL_TYPE (self));
+ for (size_t i = 0; i < cseq->size(); i++)
+ {
+ const Bse::PartControl &pctrl = (*cseq)[i];
+ guint id = bse_part_insert_control (part.proxy_id(),
+ pctrl.tick - ctick + ptick,
+ pctrl.control_type,
+ pctrl.value);
+ if (id)
+ bse_part_select_event (part.proxy_id(), id);
}
+ bse_item_ungroup_undo (part.proxy_id());
}
gboolean
bst_event_roll_controller_clipboard_full (BstEventRollController *self)
{
- BsePartControlSeq *cseq = bst_event_roll_controller_get_clipboard ();
- return cseq && cseq->n_pcontrols;
+ const Bse::PartControlSeq *cseq = bst_event_roll_controller_get_clipboard ();
+ return cseq && cseq->size();
}
gboolean
@@ -360,12 +346,12 @@ bst_event_roll_controller_has_selection (BstEventRollController *self,
{
if (self->cached_stamp != action_stamp)
{
- SfiProxy part = self->eroll->proxy;
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
if (part)
{
self->cached_stamp = action_stamp;
- BsePartControlSeq *cseq = bse_part_list_selected_controls (part, CONTROL_TYPE (self));
- self->cached_n_controls = cseq->n_pcontrols;
+ const Bse::PartControlSeq &cseq = part.list_selected_controls (CONTROL_TYPE (self));
+ self->cached_n_controls = cseq.size();
}
else
self->cached_n_controls = 0;
@@ -426,14 +412,14 @@ static void
move_start (BstEventRollController *self,
BstEventRollDrag *drag)
{
- SfiProxy part = self->eroll->proxy;
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
if (self->obj_id) /* got control event to move */
{
controller_update_canvas_cursor (self, BST_COMMON_ROLL_TOOL_MOVE);
gxk_status_set (GXK_STATUS_WAIT, _("Move Control Event"), NULL);
drag->state = GXK_DRAG_CONTINUE;
- if (bse_part_is_event_selected (part, self->obj_id))
- self->sel_cseq = bse_part_control_seq_copy_shallow (bse_part_list_selected_controls (part,
CONTROL_TYPE (self)));
+ if (bse_part_is_event_selected (part.proxy_id(), self->obj_id))
+ self->sel_cseq = part.list_selected_controls (CONTROL_TYPE (self));
}
else
{
@@ -447,26 +433,23 @@ move_group_motion (BstEventRollController *self,
BstEventRollDrag *drag)
{
SfiProxy part = self->eroll->proxy;
- gint i, new_tick, delta_tick;
+ gint new_tick, delta_tick;
new_tick = bst_event_roll_controller_quantize (self, drag->current_tick);
delta_tick = self->obj_tick;
delta_tick -= new_tick;
bse_item_group_undo (part, "Move Selection");
- for (i = 0; i < self->sel_cseq->n_pcontrols; i++)
+ for (size_t i = 0; i < self->sel_cseq.size(); i++)
{
- BsePartControl *pctrl = self->sel_cseq->pcontrols[i];
- gint tick = pctrl->tick;
- bse_part_change_control (part, pctrl->id,
+ const Bse::PartControl &pctrl = self->sel_cseq[i];
+ gint tick = pctrl.tick;
+ bse_part_change_control (part, pctrl.id,
MAX (tick - delta_tick, 0),
CONTROL_TYPE (self),
- pctrl->value);
+ pctrl.value);
}
if (drag->type == GXK_DRAG_DONE)
- {
- bse_part_control_seq_free (self->sel_cseq);
- self->sel_cseq = NULL;
- }
+ self->sel_cseq.clear();
bse_item_ungroup_undo (part);
}
@@ -474,22 +457,21 @@ static void
move_motion (BstEventRollController *self,
BstEventRollDrag *drag)
{
- SfiProxy part = self->eroll->proxy;
- gint new_tick;
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
- if (self->sel_cseq)
+ if (self->sel_cseq.size())
{
move_group_motion (self, drag);
return;
}
- new_tick = bst_event_roll_controller_quantize (self, drag->current_tick);
+ uint new_tick = bst_event_roll_controller_quantize (self, drag->current_tick);
if (new_tick != self->obj_tick)
{
- BsePartControlSeq *cseq = bse_part_get_controls (part, new_tick, CONTROL_TYPE (self));
- if (!cseq->n_pcontrols) /* avoid overlap */
+ const Bse::PartControlSeq &cseq = part.get_controls (new_tick, CONTROL_TYPE (self));
+ if (!cseq.size()) // avoid overlap
{
- if (bse_part_change_control (part, self->obj_id, new_tick, CONTROL_TYPE (self), self->obj_value)
!= Bse::ERROR_NONE)
+ if (bse_part_change_control (part.proxy_id(), self->obj_id, new_tick, CONTROL_TYPE (self),
self->obj_value) != Bse::ERROR_NONE)
drag->state = GXK_DRAG_ERROR;
else
self->obj_tick = new_tick;
@@ -501,11 +483,7 @@ static void
move_abort (BstEventRollController *self,
BstEventRollDrag *drag)
{
- if (self->sel_cseq)
- {
- bse_part_control_seq_free (self->sel_cseq);
- self->sel_cseq = NULL;
- }
+ self->sel_cseq.clear();
gxk_status_set (GXK_STATUS_ERROR, _("Move Control Event"), _("Lost Event"));
}
@@ -526,21 +504,20 @@ align_motion (BstEventRollController *self,
bst_event_roll_segment_move_to (self->eroll, drag->current_tick, drag->current_value_raw);
if (drag->type == GXK_DRAG_DONE)
{
- SfiProxy part = self->eroll->proxy;
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (self->eroll->proxy));
guint tick, duration, i;
- BsePartControlSeq *cseq;
- bse_item_group_undo (part, "Align Control Events");
+ bse_item_group_undo (part.proxy_id(), "Align Control Events");
bst_event_roll_segment_tick_range (self->eroll, &tick, &duration);
- cseq = bse_part_list_controls (part, tick, duration, CONTROL_TYPE (self));
- for (i = 0; i < cseq->n_pcontrols; i++)
+ const Bse::PartControlSeq &cseq = part.list_controls (tick, duration, CONTROL_TYPE (self));
+ for (i = 0; i < cseq.size(); i++)
{
- BsePartControl *pctrl = cseq->pcontrols[i];
- gdouble v = bst_event_roll_segment_value (self->eroll, pctrl->tick);
- bse_part_change_control (part, pctrl->id, pctrl->tick, CONTROL_TYPE (self), v);
+ const Bse::PartControl &pctrl = cseq[i];
+ gdouble v = bst_event_roll_segment_value (self->eroll, pctrl.tick);
+ bse_part_change_control (part.proxy_id(), pctrl.id, pctrl.tick, CONTROL_TYPE (self), v);
}
bst_event_roll_clear_segment (self->eroll);
- bse_item_ungroup_undo (part);
+ bse_item_ungroup_undo (part.proxy_id());
}
}
@@ -712,10 +689,10 @@ controller_canvas_drag (BstEventRollController *self,
if (drag->type == GXK_DRAG_START)
{
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (drag->eroll->proxy));
BstCommonRollTool tool = BST_COMMON_ROLL_TOOL_NONE;
- BsePartControlSeq *cseq;
- gint j, i = drag->start_tick;
- BsePartControl *nearest = NULL;
+ ssize_t j, i = drag->start_tick;
+ const Bse::PartControl *nearest = NULL;
gboolean retry_quantized = TRUE;
/* setup drag data */
@@ -724,16 +701,15 @@ controller_canvas_drag (BstEventRollController *self,
i -= drag->tick_width;
j += drag->tick_width;
i = MAX (i, 0);
- cseq = bse_part_list_controls (drag->eroll->proxy, i, j - i + 1, CONTROL_TYPE (self));
+ const Bse::PartControlSeq &cseq = part.list_controls (i, j - i + 1, CONTROL_TYPE (self));
j = SFI_MAXINT;
- for (i = 0; i < cseq->n_pcontrols; i++)
+ for (i = 0; i < (ssize_t) cseq.size(); i++)
{
- gint d = MAX (cseq->pcontrols[i]->tick, drag->start_tick) -
- MIN (cseq->pcontrols[i]->tick, drag->start_tick);
+ int d = MAX (cseq[i].tick, (int) drag->start_tick) - MIN (cseq[i].tick, (int) drag->start_tick);
if (d < j)
{
j = d;
- nearest = cseq->pcontrols[i];
+ nearest = &cseq[i];
}
}
if (!nearest && retry_quantized--)
@@ -753,9 +729,9 @@ controller_canvas_drag (BstEventRollController *self,
self->obj_tick = 0;
self->obj_value = 0;
}
- if (self->sel_cseq)
- g_warning ("leaking old drag selection (%p)", self->sel_cseq);
- self->sel_cseq = NULL;
+ if (self->sel_cseq.size())
+ g_warning ("leaking old drag selection (%lu)", self->sel_cseq.size());
+ self->sel_cseq.clear();
/* find drag tool */
tool = event_canvas_button_tool (self, drag->button, self->obj_id > 0);
diff --git a/beast-gtk/bsteventrollctrl.hh b/beast-gtk/bsteventrollctrl.hh
index 0a84084..3007b5a 100644
--- a/beast-gtk/bsteventrollctrl.hh
+++ b/beast-gtk/bsteventrollctrl.hh
@@ -13,7 +13,7 @@ typedef struct {
/* drag data */
guint obj_id, obj_tick;
gfloat obj_value;
- BsePartControlSeq *sel_cseq;
+ Bse::PartControlSeq sel_cseq;
BstSegment *segment;
/* tool data */
guint tool_index;
@@ -35,8 +35,8 @@ void bst_event_roll_controller_unref (BstEventRollController
*self);
guint bst_event_roll_controller_quantize (BstEventRollController *self,
guint fine_tick);
GxkActionList* bst_event_roll_controller_select_actions (BstEventRollController *self);
-void bst_event_roll_controller_set_clipboard (BsePartControlSeq *cseq);
-BsePartControlSeq* bst_event_roll_controller_get_clipboard (void);
+void bst_event_roll_controller_set_clipboard (const Bse::PartControlSeq &cseq);
+Bse::PartControlSeq* bst_event_roll_controller_get_clipboard (void);
void bst_event_roll_controller_clear (BstEventRollController *self);
void bst_event_roll_controller_cut (BstEventRollController *self);
gboolean bst_event_roll_controller_copy (BstEventRollController *self);
diff --git a/beast-gtk/bstpartdialog.cc b/beast-gtk/bstpartdialog.cc
index 57727ef..1e4c89a 100644
--- a/beast-gtk/bstpartdialog.cc
+++ b/beast-gtk/bstpartdialog.cc
@@ -94,7 +94,7 @@ eparam_changed (gpointer data,
BstPartDialog *self = BST_PART_DIALOG (data);
if (self->eroll)
{
- BseMidiSignalType midi_signal_type = bse_midi_signal_type_from_choice (sfi_value_get_choice
(¶m->value));
+ Bse::MidiSignalType midi_signal_type = Rapicorn::Aida::enum_value_from_string<Bse::MidiSignalType>
(sfi_value_get_choice (¶m->value));
bst_event_roll_set_control_type (self->eroll, midi_signal_type);
gxk_widget_update_actions (self); /* update controllers */
}
@@ -109,7 +109,6 @@ bst_part_dialog_init (BstPartDialog *self)
GxkActionList *al1;
GtkObject *adjustment;
GtkAdjustment *adj;
- GParamSpec *pspec;
GxkRadget *radget;
/* configure self */
@@ -201,16 +200,18 @@ bst_part_dialog_init (BstPartDialog *self)
/* event roll children */
g_object_new (GTK_TYPE_LABEL, "visible", TRUE, "label", "C", "parent", self->eroll, NULL);
- /* event roll control type */
- pspec = bst_procedure_ref_pspec ("BsePart+change-control", "control-type");
- if (pspec)
+ // event roll control type
+ static GParamSpec *control_type_pspec =
+ g_param_spec_ref (sfi_pspec_choice ("control_type", NULL, NULL, "MIDI_SIGNAL_PITCH_BEND",
+ Bse::choice_values_from_enum<Bse::MidiSignalType>(),
+ ":r:w:S:G:"));
+ if (control_type_pspec)
{
- GxkParam *param = gxk_param_new_value (pspec, eparam_changed, self);
+ GxkParam *param = gxk_param_new_value (control_type_pspec, eparam_changed, self);
GtkWidget *rwidget = gxk_param_create_editor (param, "choice-button");
gxk_radget_add (radget, "event-roll-control-area", rwidget);
g_object_connect (radget, "swapped_signal::destroy", gxk_param_destroy, param, NULL);
- g_param_spec_unref (pspec);
- sfi_value_set_choice (¶m->value, bse_midi_signal_type_to_choice (BSE_MIDI_SIGNAL_VELOCITY));
+ sfi_value_set_choice (¶m->value, Rapicorn::Aida::enum_value_to_string<Bse::MidiSignalType>
(Bse::MIDI_SIGNAL_VELOCITY).c_str());
gxk_param_apply_value (param); /* update model, auto updates GUI */
}
diff --git a/beast-gtk/bstpatterncolumns.cc b/beast-gtk/bstpatterncolumns.cc
index 4df54be..438faa8 100644
--- a/beast-gtk/bstpatterncolumns.cc
+++ b/beast-gtk/bstpatterncolumns.cc
@@ -292,11 +292,8 @@ control_get_digit_increment (guint num_type,
}
static guint
-pattern_column_event_to_string (BstPatternColumn *column,
- gchar buffer[64],
- BsePartControl *pctrl,
- gchar placeholder,
- int *ivalue_p)
+pattern_column_event_to_string (BstPatternColumn *column, gchar buffer[64], const Bse::PartControl &pctrl,
+ gchar placeholder, int *ivalue_p)
{
gboolean is_signed = (column->lflags & BST_PATTERN_LFLAG_SIGNED) != 0;
guint num_type = column->lflags & BST_PATTERN_LFLAG_NUM_MASK;
@@ -312,7 +309,7 @@ pattern_column_event_to_string (BstPatternColumn *column,
{
const gchar *format;
gchar *p = buffer;
- gint ival = control_get_max (num_type, n_digits) * pctrl->value;
+ gint ival = control_get_max (num_type, n_digits) * pctrl.value;
if (num_type == BST_PATTERN_LFLAG_DEC)
{
static const char *formats[] = { "%1u", "%2u", "%3u", "%4u", "%5u", "%6u", "%7u", "%8u", "%9u" };
@@ -374,18 +371,18 @@ pattern_column_event_value_from_string (BstPatternColumn *column,
return pattern_column_event_value_from_int (column, ival);
}
-static BseMidiSignalType
+static Bse::MidiSignalType
pattern_column_control_type (BstPatternColumn *column, bool *isnote_p)
{
- BseMidiSignalType control_type;
+ Bse::MidiSignalType control_type;
bool isnote = true;
if (column->ltype == BST_PATTERN_LTYPE_VELOCITY)
- control_type = BSE_MIDI_SIGNAL_VELOCITY;
+ control_type = Bse::MIDI_SIGNAL_VELOCITY;
else if (column->ltype == BST_PATTERN_LTYPE_FINE_TUNE)
- control_type = BSE_MIDI_SIGNAL_FINE_TUNE;
+ control_type = Bse::MIDI_SIGNAL_FINE_TUNE;
else
{
- control_type = BseMidiSignalType (BSE_MIDI_SIGNAL_CONTINUOUS_0 + column->num);
+ control_type = Bse::MidiSignalType (Bse::MIDI_SIGNAL_CONTINUOUS_0 + column->num);
isnote = false;
}
if (isnote_p)
@@ -393,27 +390,27 @@ pattern_column_control_type (BstPatternColumn *column, bool *isnote_p)
return control_type;
}
-static BsePartControl*
+static Bse::PartControl
pattern_column_event_lookup (BstPatternColumn *column,
BstPatternView *pview,
guint tick,
guint duration,
- BsePartControlSeq **cseq_p,
+ Bse::PartControlSeq *cseq_p,
gchar *placeholder_p)
{
- BsePartControl *pctrl = NULL;
- BsePartControlSeq *cseq;
- guint control_type = pattern_column_control_type (column, NULL);
- cseq = bse_part_get_channel_controls (pview->proxy, column->num, tick, duration, BseMidiSignalType
(control_type));
- if ((!cseq || cseq->n_pcontrols < 1) && placeholder_p)
+ Bse::MidiSignalType control_type = (Bse::MidiSignalType) pattern_column_control_type (column, NULL);
+ Bse::PartH part = Bse::PartH::down_cast (bse_server.from_proxy (pview->proxy));
+ Bse::PartControlSeq cseq = part.get_channel_controls (column->num, tick, duration, control_type);
+ Bse::PartControl pctrl;
+ if (cseq.size() < 1 && placeholder_p)
*placeholder_p = '-';
- else if (cseq && cseq->n_pcontrols == 1)
+ else if (cseq.size() == 1)
{
- pctrl = cseq->pcontrols[0];
+ pctrl = cseq[0];
if (placeholder_p)
*placeholder_p = 0;
}
- else if (cseq && cseq->n_pcontrols > 1 && placeholder_p)
+ else if (cseq.size() > 1 && placeholder_p)
*placeholder_p = '*';
if (cseq_p)
*cseq_p = cseq;
@@ -435,7 +432,7 @@ pattern_column_event_draw_cell (BstPatternColumn *column,
GdkGC *inactive_gc = gcs[BST_PATTERN_COLUMN_GC_TEXT0];
GdkGC *text_gc = gcs[BST_PATTERN_COLUMN_GC_TEXT1];
gchar placeholder = 0;
- BsePartControl *pctrl = pattern_column_event_lookup (column, pview, tick, duration, NULL, &placeholder);
+ Bse::PartControl pctrl = pattern_column_event_lookup (column, pview, tick, duration, NULL, &placeholder);
gchar buffer[64] = { 0, };
int n = pattern_column_event_to_string (column, buffer, pctrl, placeholder, NULL);
GdkGC *draw_gc = placeholder == '-' ? inactive_gc : text_gc;
@@ -493,27 +490,26 @@ pattern_column_event_key_event (BstPatternColumn *column,
gboolean is_signed = (column->lflags & BST_PATTERN_LFLAG_SIGNED) != 0;
SfiProxy proxy = pview->proxy;
gchar placeholder = 0;
- BsePartControlSeq *cseq;
- BsePartControl *pctrl = pattern_column_event_lookup (column, pview, tick, duration, &cseq, &placeholder);
+ Bse::PartControlSeq cseq;
+ Bse::PartControl pctrl = pattern_column_event_lookup (column, pview, tick, duration, &cseq, &placeholder);
gchar buffer[64] = { 0, };
int ivalue, handled = FALSE;
pattern_column_event_to_string (column, buffer, pctrl, placeholder, &ivalue);
if (action == BST_PATTERN_REMOVE_EVENTS)
{
- guint i;
bse_item_group_undo (proxy, "Remove Events");
- for (i = 0; i < (cseq ? cseq->n_pcontrols : 0); i++)
- bse_part_delete_event (proxy, cseq->pcontrols[i]->id);
+ for (size_t i = 0; i < cseq.size(); i++)
+ bse_part_delete_event (proxy, cseq[i].id);
bse_item_ungroup_undo (proxy);
handled = TRUE;
}
else if (action == BST_PATTERN_SET_DIGIT && /* insertions */
- (!cseq || cseq->n_pcontrols == 0))
+ cseq.size() == 0)
{
guint digit = column->n_focus_positions - focus_pos;
gint dmax = control_get_max (num_type, 1);
bool isnote;
- BseMidiSignalType control_type = pattern_column_control_type (column, &isnote);
+ Bse::MidiSignalType control_type = pattern_column_control_type (column, &isnote);
gfloat value;
ivalue = MIN (param, dmax) * control_get_digit_increment (num_type, digit);
value = pattern_column_event_value_from_int (column, ivalue);
@@ -522,7 +518,7 @@ pattern_column_event_key_event (BstPatternColumn *column,
else
bst_gui_error_bell (pview);
}
- else if (pctrl && focus_pos < (int) strlen (buffer) && !(modifier & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
+ else if (pctrl.id && focus_pos < (int) strlen (buffer) && !(modifier & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
{
gfloat value = 0;
gchar *newstr = g_strdup (buffer);
@@ -563,7 +559,7 @@ pattern_column_event_key_event (BstPatternColumn *column,
default: ;
}
if (handled)
- bse_part_change_control (proxy, pctrl->id, pctrl->tick, pctrl->control_type, value);
+ bse_part_change_control (proxy, pctrl.id, pctrl.tick, pctrl.control_type, value);
g_free (newstr);
}
return handled;
diff --git a/beast-gtk/bstpianorollctrl.cc b/beast-gtk/bstpianorollctrl.cc
index 2fa02a2..d87d9fb 100644
--- a/beast-gtk/bstpianorollctrl.cc
+++ b/beast-gtk/bstpianorollctrl.cc
@@ -140,7 +140,7 @@ bst_piano_roll_controller_set_clipboard (BsePartNoteSeq *pseq)
bse_part_note_seq_free (clipboard_pseq);
clipboard_pseq = pseq && pseq->n_pnotes ? bse_part_note_seq_copy_shallow (pseq) : NULL;
if (clipboard_pseq)
- bst_event_roll_controller_set_clipboard (NULL);
+ bst_event_roll_controller_set_clipboard (Bse::PartControlSeq());
}
BsePartNoteSeq*
diff --git a/bse/bseapi.idl b/bse/bseapi.idl
index 223f06e..7f52432 100644
--- a/bse/bseapi.idl
+++ b/bse/bseapi.idl
@@ -6,6 +6,11 @@
namespace Bse {
+Const MAXINT32 = +4294967295;
+Const MAXINT31 = +2147483647;
+Const MININT31 = -2147483648;
+Const MAXFLOAT64 = 1.7976931348623157e+308;
+
enum ErrorType {
ERROR_NONE = Enum (0, "OK"),
ERROR_INTERNAL = Enum (1, "Internal error (please report)"),
@@ -85,6 +90,187 @@ enum ErrorType {
ERROR_INVALID_OVERLAP = Enum (67, "Invalid overlap"),
};
+enum MidiSignalType {
+ // special case signals
+ MIDI_SIGNAL_PROGRAM = Enum (1, _("Program Change")), // 7bit
+ MIDI_SIGNAL_PRESSURE = Enum (2, _("Channel Pressure")), // 7bit
+ MIDI_SIGNAL_PITCH_BEND = Enum (3, _("Pitch Bend")), // 14bit
+ MIDI_SIGNAL_VELOCITY = Enum (4, _("Note Velocity")),
+ MIDI_SIGNAL_FINE_TUNE = Enum (5, _("Note Fine Tune")),
+ // 14bit, continuous controls
+ MIDI_SIGNAL_CONTINUOUS_0 = Enum (64, _("Bank Select")),
+ MIDI_SIGNAL_CONTINUOUS_1 = Enum (65, _("Modulation Depth")),
+ MIDI_SIGNAL_CONTINUOUS_2 = Enum (66, _("Breath Control")),
+ MIDI_SIGNAL_CONTINUOUS_3 = Enum (67, _("Continuous 3")),
+ MIDI_SIGNAL_CONTINUOUS_4 = Enum (68, _("Foot Controller")),
+ MIDI_SIGNAL_CONTINUOUS_5 = Enum (69, _("Portamento Time")),
+ MIDI_SIGNAL_CONTINUOUS_6 = Enum (70, _("Data Entry")),
+ MIDI_SIGNAL_CONTINUOUS_7 = Enum (71, _("Volume")),
+ MIDI_SIGNAL_CONTINUOUS_8 = Enum (72, _("Balance")),
+ MIDI_SIGNAL_CONTINUOUS_9 = Enum (73, _("Continuous 9")),
+ MIDI_SIGNAL_CONTINUOUS_10 = Enum (74, _("Panorama")),
+ MIDI_SIGNAL_CONTINUOUS_11 = Enum (75, _("Expression")),
+ MIDI_SIGNAL_CONTINUOUS_12 = Enum (76, _("Effect Control 1")),
+ MIDI_SIGNAL_CONTINUOUS_13 = Enum (77, _("Effect Control 2")),
+ MIDI_SIGNAL_CONTINUOUS_14 = Enum (78, _("Continuous 14")),
+ MIDI_SIGNAL_CONTINUOUS_15 = Enum (79, _("Continuous 15")),
+ MIDI_SIGNAL_CONTINUOUS_16 = Enum (80, _("General Purpose Controller 1")),
+ MIDI_SIGNAL_CONTINUOUS_17 = Enum (81, _("General Purpose Controller 2")),
+ MIDI_SIGNAL_CONTINUOUS_18 = Enum (82, _("General Purpose Controller 3")),
+ MIDI_SIGNAL_CONTINUOUS_19 = Enum (83, _("General Purpose Controller 4")),
+ MIDI_SIGNAL_CONTINUOUS_20 = Enum (84, _("Continuous 20")),
+ MIDI_SIGNAL_CONTINUOUS_21 = Enum (85, _("Continuous 21")),
+ MIDI_SIGNAL_CONTINUOUS_22 = Enum (86, _("Continuous 22")),
+ MIDI_SIGNAL_CONTINUOUS_23 = Enum (87, _("Continuous 23")),
+ MIDI_SIGNAL_CONTINUOUS_24 = Enum (88, _("Continuous 24")),
+ MIDI_SIGNAL_CONTINUOUS_25 = Enum (89, _("Continuous 25")),
+ MIDI_SIGNAL_CONTINUOUS_26 = Enum (90, _("Continuous 26")),
+ MIDI_SIGNAL_CONTINUOUS_27 = Enum (91, _("Continuous 27")),
+ MIDI_SIGNAL_CONTINUOUS_28 = Enum (92, _("Continuous 28")),
+ MIDI_SIGNAL_CONTINUOUS_29 = Enum (93, _("Continuous 29")),
+ MIDI_SIGNAL_CONTINUOUS_30 = Enum (94, _("Continuous 30")),
+ MIDI_SIGNAL_CONTINUOUS_31 = Enum (95, _("Continuous 31")),
+ // 14bit, special case signals
+ MIDI_SIGNAL_CONSTANT_HIGH = Enum (96, _("Constant HIGH")),
+ MIDI_SIGNAL_CONSTANT_CENTER = Enum (97, _("Constant CENTER")),
+ MIDI_SIGNAL_CONSTANT_LOW = Enum (98, _("Constant LOW")),
+ MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER = Enum (99, _("Constant Negative CENTER")),
+ MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH = Enum (100, _("Constant Negative HIGH")),
+ MIDI_SIGNAL_PARAMETER = Enum (101, _("Registered Parameter")),
+ MIDI_SIGNAL_NON_PARAMETER = Enum (102, _("Non-Registered Parameter")),
+ // 7bit, literal channel controls, MSB values
+ MIDI_SIGNAL_CONTROL_0 = Enum (128, _("Control 0 Bank Select MSB")),
+ MIDI_SIGNAL_CONTROL_1 = Enum (129, _("Control 1 Modulation Depth MSB")),
+ MIDI_SIGNAL_CONTROL_2 = Enum (130, _("Control 2 Breath Control MSB")),
+ MIDI_SIGNAL_CONTROL_3 = Enum (131, _("control-3")),
+ MIDI_SIGNAL_CONTROL_4 = Enum (132, _("Control 4 Foot Controller MSB")),
+ MIDI_SIGNAL_CONTROL_5 = Enum (133, _("Control 5 Portamento Time MSB")),
+ MIDI_SIGNAL_CONTROL_6 = Enum (134, _("Control 6 Data Entry MSB")),
+ MIDI_SIGNAL_CONTROL_7 = Enum (135, _("Control 7 Volume MSB")),
+ MIDI_SIGNAL_CONTROL_8 = Enum (136, _("Control 8 Balance MSB")),
+ MIDI_SIGNAL_CONTROL_9 = Enum (137, _("control-9")),
+ MIDI_SIGNAL_CONTROL_10 = Enum (138, _("Control 10 Panorama MSB")),
+ MIDI_SIGNAL_CONTROL_11 = Enum (139, _("Control 11 Expression MSB")),
+ MIDI_SIGNAL_CONTROL_12 = Enum (140, _("Control 12 Effect Control 1 MSB")),
+ MIDI_SIGNAL_CONTROL_13 = Enum (141, _("Control 13 Effect Control 2 MSB")),
+ MIDI_SIGNAL_CONTROL_14 = Enum (142, _("control-14")),
+ MIDI_SIGNAL_CONTROL_15 = Enum (143, _("control-15")),
+ MIDI_SIGNAL_CONTROL_16 = Enum (144, _("Control 16 General Purpose Controller 1 MSB")),
+ MIDI_SIGNAL_CONTROL_17 = Enum (145, _("Control 17 General Purpose Controller 2 MSB")),
+ MIDI_SIGNAL_CONTROL_18 = Enum (146, _("Control 18 General Purpose Controller 3 MSB")),
+ MIDI_SIGNAL_CONTROL_19 = Enum (147, _("Control 19 General Purpose Controller 4 MSB")),
+ MIDI_SIGNAL_CONTROL_20 = Enum (148, _("control-20")),
+ MIDI_SIGNAL_CONTROL_21 = Enum (149, _("control-21")),
+ MIDI_SIGNAL_CONTROL_22 = Enum (150, _("control-22")),
+ MIDI_SIGNAL_CONTROL_23 = Enum (151, _("control-23")),
+ MIDI_SIGNAL_CONTROL_24 = Enum (152, _("control-24")),
+ MIDI_SIGNAL_CONTROL_25 = Enum (153, _("control-25")),
+ MIDI_SIGNAL_CONTROL_26 = Enum (154, _("control-26")),
+ MIDI_SIGNAL_CONTROL_27 = Enum (155, _("control-27")),
+ MIDI_SIGNAL_CONTROL_28 = Enum (156, _("control-28")),
+ MIDI_SIGNAL_CONTROL_29 = Enum (157, _("control-29")),
+ MIDI_SIGNAL_CONTROL_30 = Enum (158, _("control-30")),
+ MIDI_SIGNAL_CONTROL_31 = Enum (159, _("control-31")),
+ // 7bit, literal channel controls, LSB values
+ MIDI_SIGNAL_CONTROL_32 = Enum (160, _("Control 32 Bank Select LSB")),
+ MIDI_SIGNAL_CONTROL_33 = Enum (161, _("Control 33 Modulation Depth LSB")),
+ MIDI_SIGNAL_CONTROL_34 = Enum (162, _("Control 34 Breath Control LSB")),
+ MIDI_SIGNAL_CONTROL_35 = Enum (163, _("control-35")),
+ MIDI_SIGNAL_CONTROL_36 = Enum (164, _("Control 36 Foot Controller LSB")),
+ MIDI_SIGNAL_CONTROL_37 = Enum (165, _("Control 37 Portamento Time LSB")),
+ MIDI_SIGNAL_CONTROL_38 = Enum (166, _("Control 38 Data Entry LSB")),
+ MIDI_SIGNAL_CONTROL_39 = Enum (167, _("Control 39 Volume LSB")),
+ MIDI_SIGNAL_CONTROL_40 = Enum (168, _("Control 40 Balance LSB")),
+ MIDI_SIGNAL_CONTROL_41 = Enum (169, _("control-41")),
+ MIDI_SIGNAL_CONTROL_42 = Enum (170, _("Control 42 Panorama LSB")),
+ MIDI_SIGNAL_CONTROL_43 = Enum (171, _("Control 43 Expression LSB")),
+ MIDI_SIGNAL_CONTROL_44 = Enum (172, _("Control 44 Effect Control 1 LSB")),
+ MIDI_SIGNAL_CONTROL_45 = Enum (173, _("Control 45 Effect Control 2 LSB")),
+ MIDI_SIGNAL_CONTROL_46 = Enum (174, _("control-46")),
+ MIDI_SIGNAL_CONTROL_47 = Enum (175, _("control-47")),
+ MIDI_SIGNAL_CONTROL_48 = Enum (176, _("Control 48 General Purpose Controller 1 LSB")),
+ MIDI_SIGNAL_CONTROL_49 = Enum (177, _("Control 49 General Purpose Controller 2 LSB")),
+ MIDI_SIGNAL_CONTROL_50 = Enum (178, _("Control 50 General Purpose Controller 3 LSB")),
+ MIDI_SIGNAL_CONTROL_51 = Enum (179, _("Control 51 General Purpose Controller 4 LSB")),
+ MIDI_SIGNAL_CONTROL_52 = Enum (180, _("control-52")),
+ MIDI_SIGNAL_CONTROL_53 = Enum (181, _("control-53")),
+ MIDI_SIGNAL_CONTROL_54 = Enum (182, _("control-54")),
+ MIDI_SIGNAL_CONTROL_55 = Enum (183, _("control-55")),
+ MIDI_SIGNAL_CONTROL_56 = Enum (184, _("control-56")),
+ MIDI_SIGNAL_CONTROL_57 = Enum (185, _("control-57")),
+ MIDI_SIGNAL_CONTROL_58 = Enum (186, _("control-58")),
+ MIDI_SIGNAL_CONTROL_59 = Enum (187, _("control-59")),
+ MIDI_SIGNAL_CONTROL_60 = Enum (188, _("control-60")),
+ MIDI_SIGNAL_CONTROL_61 = Enum (189, _("control-61")),
+ MIDI_SIGNAL_CONTROL_62 = Enum (190, _("control-62")),
+ MIDI_SIGNAL_CONTROL_63 = Enum (191, _("control-63")),
+ // 7bit, literal channel controls
+ MIDI_SIGNAL_CONTROL_64 = Enum (192, _("Control 64 Damper Pedal Switch (Sustain)")),
+ MIDI_SIGNAL_CONTROL_65 = Enum (193, _("Control 65 Portamento Switch")),
+ MIDI_SIGNAL_CONTROL_66 = Enum (194, _("Control 66 Sustenuto Switch")),
+ MIDI_SIGNAL_CONTROL_67 = Enum (195, _("Control 67 Soft Switch")),
+ MIDI_SIGNAL_CONTROL_68 = Enum (196, _("Control 68 Legato Pedal Switch")),
+ MIDI_SIGNAL_CONTROL_69 = Enum (197, _("Control 69 Hold Pedal Switch")),
+ MIDI_SIGNAL_CONTROL_70 = Enum (198, _("Control 70 Sound Variation")),
+ MIDI_SIGNAL_CONTROL_71 = Enum (199, _("Control 71 Filter Resonance (Timbre)")),
+ MIDI_SIGNAL_CONTROL_72 = Enum (200, _("Control 72 Sound Release Time")),
+ MIDI_SIGNAL_CONTROL_73 = Enum (201, _("Control 73 Sound Attack Time")),
+ MIDI_SIGNAL_CONTROL_74 = Enum (202, _("Control 74 Sound Brightness")),
+ MIDI_SIGNAL_CONTROL_75 = Enum (203, _("Control 75 Sound Decay Time")),
+ MIDI_SIGNAL_CONTROL_76 = Enum (204, _("Control 76 Vibrato Rate")),
+ MIDI_SIGNAL_CONTROL_77 = Enum (205, _("Control 77 Vibrato Depth")),
+ MIDI_SIGNAL_CONTROL_78 = Enum (206, _("Control 78 Vibrato Delay")),
+ MIDI_SIGNAL_CONTROL_79 = Enum (207, _("Control 79 Sound Control 10")),
+ MIDI_SIGNAL_CONTROL_80 = Enum (208, _("Control 80 General Purpose Switch 5")),
+ MIDI_SIGNAL_CONTROL_81 = Enum (209, _("Control 81 General Purpose Switch 6")),
+ MIDI_SIGNAL_CONTROL_82 = Enum (210, _("Control 82 General Purpose Switch 7")),
+ MIDI_SIGNAL_CONTROL_83 = Enum (211, _("Control 83 General Purpose Switch 8")),
+ MIDI_SIGNAL_CONTROL_84 = Enum (212, _("Control 84 Portamento Control (Note)")),
+ MIDI_SIGNAL_CONTROL_85 = Enum (213, _("control-85")),
+ MIDI_SIGNAL_CONTROL_86 = Enum (214, _("control-86")),
+ MIDI_SIGNAL_CONTROL_87 = Enum (215, _("control-87")),
+ MIDI_SIGNAL_CONTROL_88 = Enum (216, _("control-88")),
+ MIDI_SIGNAL_CONTROL_89 = Enum (217, _("control-89")),
+ MIDI_SIGNAL_CONTROL_90 = Enum (218, _("control-90")),
+ MIDI_SIGNAL_CONTROL_91 = Enum (219, _("Control 91 Reverb Depth")),
+ MIDI_SIGNAL_CONTROL_92 = Enum (220, _("Control 92 Tremolo Depth")),
+ MIDI_SIGNAL_CONTROL_93 = Enum (221, _("Control 93 Chorus Depth")),
+ MIDI_SIGNAL_CONTROL_94 = Enum (222, _("Control 93 Detune Depth")),
+ MIDI_SIGNAL_CONTROL_95 = Enum (223, _("Control 95 Phase Depth")),
+ MIDI_SIGNAL_CONTROL_96 = Enum (224, _("Control 96 Data Increment Trigger")),
+ MIDI_SIGNAL_CONTROL_97 = Enum (225, _("Control 97 Data Decrement Trigger")),
+ MIDI_SIGNAL_CONTROL_98 = Enum (226, _("Control 98 Non-Registered Parameter MSB")),
+ MIDI_SIGNAL_CONTROL_99 = Enum (227, _("Control 99 Non-Registered Parameter LSB")),
+ MIDI_SIGNAL_CONTROL_100 = Enum (228, _("Control 100 Registered Parameter MSB")),
+ MIDI_SIGNAL_CONTROL_101 = Enum (229, _("Control 101 Registered Parameter LSB")),
+ MIDI_SIGNAL_CONTROL_102 = Enum (230, _("control-102")),
+ MIDI_SIGNAL_CONTROL_103 = Enum (231, _("control-103")),
+ MIDI_SIGNAL_CONTROL_104 = Enum (232, _("control-104")),
+ MIDI_SIGNAL_CONTROL_105 = Enum (233, _("control-105")),
+ MIDI_SIGNAL_CONTROL_106 = Enum (234, _("control-106")),
+ MIDI_SIGNAL_CONTROL_107 = Enum (235, _("control-107")),
+ MIDI_SIGNAL_CONTROL_108 = Enum (236, _("control-108")),
+ MIDI_SIGNAL_CONTROL_109 = Enum (237, _("control-109")),
+ MIDI_SIGNAL_CONTROL_110 = Enum (238, _("control-110")),
+ MIDI_SIGNAL_CONTROL_111 = Enum (239, _("control-111")),
+ MIDI_SIGNAL_CONTROL_112 = Enum (240, _("control-112")),
+ MIDI_SIGNAL_CONTROL_113 = Enum (241, _("control-113")),
+ MIDI_SIGNAL_CONTROL_114 = Enum (242, _("control-114")),
+ MIDI_SIGNAL_CONTROL_115 = Enum (243, _("control-115")),
+ MIDI_SIGNAL_CONTROL_116 = Enum (244, _("control-116")),
+ MIDI_SIGNAL_CONTROL_117 = Enum (245, _("control-117")),
+ MIDI_SIGNAL_CONTROL_118 = Enum (246, _("control-118")),
+ MIDI_SIGNAL_CONTROL_119 = Enum (247, _("control-119")),
+ MIDI_SIGNAL_CONTROL_120 = Enum (248, _("Control 120 All Sound Off ITrigger")),
+ MIDI_SIGNAL_CONTROL_121 = Enum (249, _("Control 121 All Controllers Off ITrigger")),
+ MIDI_SIGNAL_CONTROL_122 = Enum (250, _("Control 122 Local Control Switch")),
+ MIDI_SIGNAL_CONTROL_123 = Enum (251, _("Control 123 All Notes Off ITrigger")),
+ MIDI_SIGNAL_CONTROL_124 = Enum (252, _("Control 124 Omni Mode Off ITrigger")),
+ MIDI_SIGNAL_CONTROL_125 = Enum (253, _("Control 125 Omni Mode On ITrigger")),
+ MIDI_SIGNAL_CONTROL_126 = Enum (254, _("Control 126 Monophonic Voices Mode")),
+ MIDI_SIGNAL_CONTROL_127 = Enum (255, _("Control 127 Polyphonic Mode On ITrigger")),
+};
+
/// Object to carry out IDL, API, signal, etc tests.
interface TestObject {
int32 echo_test (String msg); ///< Echo custom message to stdout.
@@ -119,8 +305,26 @@ interface Item : Object {
Item common_ancestor (Item other); ///< Find a common container (parent or grand-parent) of two items
if any.
};
+/// Part specific control event representation.
+record PartControl {
+ int32 id = Num ("ID", "", ":readwrite");
+ int32 tick = Range ("Tick", "", ":readwrite", 0, MAXINT31, 1);
+ MidiSignalType control_type;
+ float64 value = Range ("Value", "", ":readwrite", -1, +1, 0.1);
+ bool selected = Bool ("Selected", "", ":readwrite");
+};
+/// A list of part control events.
+sequence PartControlSeq {
+ PartControl pcontrols;
+};
+
+
/// Data object containing piano notes and effects.
interface Part : Item {
+ PartControlSeq list_selected_controls (MidiSignalType control_type); ///< List all currently selected
control events of a specific type.
+ PartControlSeq list_controls (int32 tick, int32 duration, MidiSignalType control_type); ///< List
all control events within a tick range.
+ PartControlSeq get_channel_controls (int32 channel, int32 tick, int32 duration, MidiSignalType
control_type); ///< Retrieve all control events of a specific type within range of a channel.
+ PartControlSeq get_controls (int32 tick, MidiSignalType control_type); ///< Retrieve all control
events of a specific type at specified tick.
};
/// Base type for synthesis objects with input or output streams.
diff --git a/bse/bsebasics.idl b/bse/bsebasics.idl
index 6388592..69fbae0 100644
--- a/bse/bsebasics.idl
+++ b/bse/bsebasics.idl
@@ -108,187 +108,6 @@ enum MusicalTuningType {
"This is attempted by tuning upwards from C a sequence of six
pure fourths, "
"as well as six equally imperfect fifths.")),
};
-/* various MIDI specific definitions */
-enum MidiSignalType {
- /* special cased signals */
- MIDI_SIGNAL_PROGRAM = Enum (1, _("Program Change")), /* 7bit */
- MIDI_SIGNAL_PRESSURE = Enum (2, _("Channel Pressure")), /* 7bit */
- MIDI_SIGNAL_PITCH_BEND = Enum (3, _("Pitch Bend")), /* 14bit */
- MIDI_SIGNAL_VELOCITY = Enum (4, _("Note Velocity")),
- MIDI_SIGNAL_FINE_TUNE = Enum (5, _("Note Fine Tune")),
- /* 14bit, continuous controls */
- MIDI_SIGNAL_CONTINUOUS_0 = Enum (64, _("Bank Select")),
- MIDI_SIGNAL_CONTINUOUS_1 = Enum (65, _("Modulation Depth")),
- MIDI_SIGNAL_CONTINUOUS_2 = Enum (66, _("Breath Control")),
- MIDI_SIGNAL_CONTINUOUS_3 = Enum (67, _("Continuous 3")),
- MIDI_SIGNAL_CONTINUOUS_4 = Enum (68, _("Foot Controller")),
- MIDI_SIGNAL_CONTINUOUS_5 = Enum (69, _("Portamento Time")),
- MIDI_SIGNAL_CONTINUOUS_6 = Enum (70, _("Data Entry")),
- MIDI_SIGNAL_CONTINUOUS_7 = Enum (71, _("Volume")),
- MIDI_SIGNAL_CONTINUOUS_8 = Enum (72, _("Balance")),
- MIDI_SIGNAL_CONTINUOUS_9 = Enum (73, _("Continuous 9")),
- MIDI_SIGNAL_CONTINUOUS_10 = Enum (74, _("Panorama")),
- MIDI_SIGNAL_CONTINUOUS_11 = Enum (75, _("Expression")),
- MIDI_SIGNAL_CONTINUOUS_12 = Enum (76, _("Effect Control 1")),
- MIDI_SIGNAL_CONTINUOUS_13 = Enum (77, _("Effect Control 2")),
- MIDI_SIGNAL_CONTINUOUS_14 = Enum (78, _("Continuous 14")),
- MIDI_SIGNAL_CONTINUOUS_15 = Enum (79, _("Continuous 15")),
- MIDI_SIGNAL_CONTINUOUS_16 = Enum (80, _("General Purpose Controller 1")),
- MIDI_SIGNAL_CONTINUOUS_17 = Enum (81, _("General Purpose Controller 2")),
- MIDI_SIGNAL_CONTINUOUS_18 = Enum (82, _("General Purpose Controller 3")),
- MIDI_SIGNAL_CONTINUOUS_19 = Enum (83, _("General Purpose Controller 4")),
- MIDI_SIGNAL_CONTINUOUS_20 = Enum (84, _("Continuous 20")),
- MIDI_SIGNAL_CONTINUOUS_21 = Enum (85, _("Continuous 21")),
- MIDI_SIGNAL_CONTINUOUS_22 = Enum (86, _("Continuous 22")),
- MIDI_SIGNAL_CONTINUOUS_23 = Enum (87, _("Continuous 23")),
- MIDI_SIGNAL_CONTINUOUS_24 = Enum (88, _("Continuous 24")),
- MIDI_SIGNAL_CONTINUOUS_25 = Enum (89, _("Continuous 25")),
- MIDI_SIGNAL_CONTINUOUS_26 = Enum (90, _("Continuous 26")),
- MIDI_SIGNAL_CONTINUOUS_27 = Enum (91, _("Continuous 27")),
- MIDI_SIGNAL_CONTINUOUS_28 = Enum (92, _("Continuous 28")),
- MIDI_SIGNAL_CONTINUOUS_29 = Enum (93, _("Continuous 29")),
- MIDI_SIGNAL_CONTINUOUS_30 = Enum (94, _("Continuous 30")),
- MIDI_SIGNAL_CONTINUOUS_31 = Enum (95, _("Continuous 31")),
- /* 14bit, special cased signals */
- MIDI_SIGNAL_CONSTANT_HIGH = Enum (96, _("Constant HIGH")),
- MIDI_SIGNAL_CONSTANT_CENTER = Enum (97, _("Constant CENTER")),
- MIDI_SIGNAL_CONSTANT_LOW = Enum (98, _("Constant LOW")),
- MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER = Enum (99, _("Constant Negative CENTER")),
- MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH = Enum (100, _("Constant Negative HIGH")),
- MIDI_SIGNAL_PARAMETER = Enum (101, _("Registered Parameter")),
- MIDI_SIGNAL_NON_PARAMETER = Enum (102, _("Non-Registered Parameter")),
- /* 7bit, literal channel controls, MSB values */
- MIDI_SIGNAL_CONTROL_0 = Enum (128, _("Control 0 Bank Select MSB")),
- MIDI_SIGNAL_CONTROL_1 = Enum (129, _("Control 1 Modulation Depth MSB")),
- MIDI_SIGNAL_CONTROL_2 = Enum (130, _("Control 2 Breath Control MSB")),
- MIDI_SIGNAL_CONTROL_3 = Enum (131, _("control-3")),
- MIDI_SIGNAL_CONTROL_4 = Enum (132, _("Control 4 Foot Controller MSB")),
- MIDI_SIGNAL_CONTROL_5 = Enum (133, _("Control 5 Portamento Time MSB")),
- MIDI_SIGNAL_CONTROL_6 = Enum (134, _("Control 6 Data Entry MSB")),
- MIDI_SIGNAL_CONTROL_7 = Enum (135, _("Control 7 Volume MSB")),
- MIDI_SIGNAL_CONTROL_8 = Enum (136, _("Control 8 Balance MSB")),
- MIDI_SIGNAL_CONTROL_9 = Enum (137, _("control-9")),
- MIDI_SIGNAL_CONTROL_10 = Enum (138, _("Control 10 Panorama MSB")),
- MIDI_SIGNAL_CONTROL_11 = Enum (139, _("Control 11 Expression MSB")),
- MIDI_SIGNAL_CONTROL_12 = Enum (140, _("Control 12 Effect Control 1 MSB")),
- MIDI_SIGNAL_CONTROL_13 = Enum (141, _("Control 13 Effect Control 2 MSB")),
- MIDI_SIGNAL_CONTROL_14 = Enum (142, _("control-14")),
- MIDI_SIGNAL_CONTROL_15 = Enum (143, _("control-15")),
- MIDI_SIGNAL_CONTROL_16 = Enum (144, _("Control 16 General Purpose Controller 1 MSB")),
- MIDI_SIGNAL_CONTROL_17 = Enum (145, _("Control 17 General Purpose Controller 2 MSB")),
- MIDI_SIGNAL_CONTROL_18 = Enum (146, _("Control 18 General Purpose Controller 3 MSB")),
- MIDI_SIGNAL_CONTROL_19 = Enum (147, _("Control 19 General Purpose Controller 4 MSB")),
- MIDI_SIGNAL_CONTROL_20 = Enum (148, _("control-20")),
- MIDI_SIGNAL_CONTROL_21 = Enum (149, _("control-21")),
- MIDI_SIGNAL_CONTROL_22 = Enum (150, _("control-22")),
- MIDI_SIGNAL_CONTROL_23 = Enum (151, _("control-23")),
- MIDI_SIGNAL_CONTROL_24 = Enum (152, _("control-24")),
- MIDI_SIGNAL_CONTROL_25 = Enum (153, _("control-25")),
- MIDI_SIGNAL_CONTROL_26 = Enum (154, _("control-26")),
- MIDI_SIGNAL_CONTROL_27 = Enum (155, _("control-27")),
- MIDI_SIGNAL_CONTROL_28 = Enum (156, _("control-28")),
- MIDI_SIGNAL_CONTROL_29 = Enum (157, _("control-29")),
- MIDI_SIGNAL_CONTROL_30 = Enum (158, _("control-30")),
- MIDI_SIGNAL_CONTROL_31 = Enum (159, _("control-31")),
- /* 7bit, literal channel controls, LSB values */
- MIDI_SIGNAL_CONTROL_32 = Enum (160, _("Control 32 Bank Select LSB")),
- MIDI_SIGNAL_CONTROL_33 = Enum (161, _("Control 33 Modulation Depth LSB")),
- MIDI_SIGNAL_CONTROL_34 = Enum (162, _("Control 34 Breath Control LSB")),
- MIDI_SIGNAL_CONTROL_35 = Enum (163, _("control-35")),
- MIDI_SIGNAL_CONTROL_36 = Enum (164, _("Control 36 Foot Controller LSB")),
- MIDI_SIGNAL_CONTROL_37 = Enum (165, _("Control 37 Portamento Time LSB")),
- MIDI_SIGNAL_CONTROL_38 = Enum (166, _("Control 38 Data Entry LSB")),
- MIDI_SIGNAL_CONTROL_39 = Enum (167, _("Control 39 Volume LSB")),
- MIDI_SIGNAL_CONTROL_40 = Enum (168, _("Control 40 Balance LSB")),
- MIDI_SIGNAL_CONTROL_41 = Enum (169, _("control-41")),
- MIDI_SIGNAL_CONTROL_42 = Enum (170, _("Control 42 Panorama LSB")),
- MIDI_SIGNAL_CONTROL_43 = Enum (171, _("Control 43 Expression LSB")),
- MIDI_SIGNAL_CONTROL_44 = Enum (172, _("Control 44 Effect Control 1 LSB")),
- MIDI_SIGNAL_CONTROL_45 = Enum (173, _("Control 45 Effect Control 2 LSB")),
- MIDI_SIGNAL_CONTROL_46 = Enum (174, _("control-46")),
- MIDI_SIGNAL_CONTROL_47 = Enum (175, _("control-47")),
- MIDI_SIGNAL_CONTROL_48 = Enum (176, _("Control 48 General Purpose Controller 1 LSB")),
- MIDI_SIGNAL_CONTROL_49 = Enum (177, _("Control 49 General Purpose Controller 2 LSB")),
- MIDI_SIGNAL_CONTROL_50 = Enum (178, _("Control 50 General Purpose Controller 3 LSB")),
- MIDI_SIGNAL_CONTROL_51 = Enum (179, _("Control 51 General Purpose Controller 4 LSB")),
- MIDI_SIGNAL_CONTROL_52 = Enum (180, _("control-52")),
- MIDI_SIGNAL_CONTROL_53 = Enum (181, _("control-53")),
- MIDI_SIGNAL_CONTROL_54 = Enum (182, _("control-54")),
- MIDI_SIGNAL_CONTROL_55 = Enum (183, _("control-55")),
- MIDI_SIGNAL_CONTROL_56 = Enum (184, _("control-56")),
- MIDI_SIGNAL_CONTROL_57 = Enum (185, _("control-57")),
- MIDI_SIGNAL_CONTROL_58 = Enum (186, _("control-58")),
- MIDI_SIGNAL_CONTROL_59 = Enum (187, _("control-59")),
- MIDI_SIGNAL_CONTROL_60 = Enum (188, _("control-60")),
- MIDI_SIGNAL_CONTROL_61 = Enum (189, _("control-61")),
- MIDI_SIGNAL_CONTROL_62 = Enum (190, _("control-62")),
- MIDI_SIGNAL_CONTROL_63 = Enum (191, _("control-63")),
- /* 7bit, literal channel controls */
- MIDI_SIGNAL_CONTROL_64 = Enum (192, _("Control 64 Damper Pedal Switch (Sustain)")),
- MIDI_SIGNAL_CONTROL_65 = Enum (193, _("Control 65 Portamento Switch")),
- MIDI_SIGNAL_CONTROL_66 = Enum (194, _("Control 66 Sustenuto Switch")),
- MIDI_SIGNAL_CONTROL_67 = Enum (195, _("Control 67 Soft Switch")),
- MIDI_SIGNAL_CONTROL_68 = Enum (196, _("Control 68 Legato Pedal Switch")),
- MIDI_SIGNAL_CONTROL_69 = Enum (197, _("Control 69 Hold Pedal Switch")),
- MIDI_SIGNAL_CONTROL_70 = Enum (198, _("Control 70 Sound Variation")),
- MIDI_SIGNAL_CONTROL_71 = Enum (199, _("Control 71 Filter Resonance (Timbre)")),
- MIDI_SIGNAL_CONTROL_72 = Enum (200, _("Control 72 Sound Release Time")),
- MIDI_SIGNAL_CONTROL_73 = Enum (201, _("Control 73 Sound Attack Time")),
- MIDI_SIGNAL_CONTROL_74 = Enum (202, _("Control 74 Sound Brightness")),
- MIDI_SIGNAL_CONTROL_75 = Enum (203, _("Control 75 Sound Decay Time")),
- MIDI_SIGNAL_CONTROL_76 = Enum (204, _("Control 76 Vibrato Rate")),
- MIDI_SIGNAL_CONTROL_77 = Enum (205, _("Control 77 Vibrato Depth")),
- MIDI_SIGNAL_CONTROL_78 = Enum (206, _("Control 78 Vibrato Delay")),
- MIDI_SIGNAL_CONTROL_79 = Enum (207, _("Control 79 Sound Control 10")),
- MIDI_SIGNAL_CONTROL_80 = Enum (208, _("Control 80 General Purpose Switch 5")),
- MIDI_SIGNAL_CONTROL_81 = Enum (209, _("Control 81 General Purpose Switch 6")),
- MIDI_SIGNAL_CONTROL_82 = Enum (210, _("Control 82 General Purpose Switch 7")),
- MIDI_SIGNAL_CONTROL_83 = Enum (211, _("Control 83 General Purpose Switch 8")),
- MIDI_SIGNAL_CONTROL_84 = Enum (212, _("Control 84 Portamento Control (Note)")),
- MIDI_SIGNAL_CONTROL_85 = Enum (213, _("control-85")),
- MIDI_SIGNAL_CONTROL_86 = Enum (214, _("control-86")),
- MIDI_SIGNAL_CONTROL_87 = Enum (215, _("control-87")),
- MIDI_SIGNAL_CONTROL_88 = Enum (216, _("control-88")),
- MIDI_SIGNAL_CONTROL_89 = Enum (217, _("control-89")),
- MIDI_SIGNAL_CONTROL_90 = Enum (218, _("control-90")),
- MIDI_SIGNAL_CONTROL_91 = Enum (219, _("Control 91 Reverb Depth")),
- MIDI_SIGNAL_CONTROL_92 = Enum (220, _("Control 92 Tremolo Depth")),
- MIDI_SIGNAL_CONTROL_93 = Enum (221, _("Control 93 Chorus Depth")),
- MIDI_SIGNAL_CONTROL_94 = Enum (222, _("Control 93 Detune Depth")),
- MIDI_SIGNAL_CONTROL_95 = Enum (223, _("Control 95 Phase Depth")),
- MIDI_SIGNAL_CONTROL_96 = Enum (224, _("Control 96 Data Increment Trigger")),
- MIDI_SIGNAL_CONTROL_97 = Enum (225, _("Control 97 Data Decrement Trigger")),
- MIDI_SIGNAL_CONTROL_98 = Enum (226, _("Control 98 Non-Registered Parameter MSB")),
- MIDI_SIGNAL_CONTROL_99 = Enum (227, _("Control 99 Non-Registered Parameter LSB")),
- MIDI_SIGNAL_CONTROL_100 = Enum (228, _("Control 100 Registered Parameter MSB")),
- MIDI_SIGNAL_CONTROL_101 = Enum (229, _("Control 101 Registered Parameter LSB")),
- MIDI_SIGNAL_CONTROL_102 = Enum (230, _("control-102")),
- MIDI_SIGNAL_CONTROL_103 = Enum (231, _("control-103")),
- MIDI_SIGNAL_CONTROL_104 = Enum (232, _("control-104")),
- MIDI_SIGNAL_CONTROL_105 = Enum (233, _("control-105")),
- MIDI_SIGNAL_CONTROL_106 = Enum (234, _("control-106")),
- MIDI_SIGNAL_CONTROL_107 = Enum (235, _("control-107")),
- MIDI_SIGNAL_CONTROL_108 = Enum (236, _("control-108")),
- MIDI_SIGNAL_CONTROL_109 = Enum (237, _("control-109")),
- MIDI_SIGNAL_CONTROL_110 = Enum (238, _("control-110")),
- MIDI_SIGNAL_CONTROL_111 = Enum (239, _("control-111")),
- MIDI_SIGNAL_CONTROL_112 = Enum (240, _("control-112")),
- MIDI_SIGNAL_CONTROL_113 = Enum (241, _("control-113")),
- MIDI_SIGNAL_CONTROL_114 = Enum (242, _("control-114")),
- MIDI_SIGNAL_CONTROL_115 = Enum (243, _("control-115")),
- MIDI_SIGNAL_CONTROL_116 = Enum (244, _("control-116")),
- MIDI_SIGNAL_CONTROL_117 = Enum (245, _("control-117")),
- MIDI_SIGNAL_CONTROL_118 = Enum (246, _("control-118")),
- MIDI_SIGNAL_CONTROL_119 = Enum (247, _("control-119")),
- MIDI_SIGNAL_CONTROL_120 = Enum (248, _("Control 120 All Sound Off ITrigger")),
- MIDI_SIGNAL_CONTROL_121 = Enum (249, _("Control 121 All Controllers Off ITrigger")),
- MIDI_SIGNAL_CONTROL_122 = Enum (250, _("Control 122 Local Control Switch")),
- MIDI_SIGNAL_CONTROL_123 = Enum (251, _("Control 123 All Notes Off ITrigger")),
- MIDI_SIGNAL_CONTROL_124 = Enum (252, _("Control 124 Omni Mode Off ITrigger")),
- MIDI_SIGNAL_CONTROL_125 = Enum (253, _("Control 125 Omni Mode On ITrigger")),
- MIDI_SIGNAL_CONTROL_126 = Enum (254, _("Control 126 Monophonic Voices Mode")),
- MIDI_SIGNAL_CONTROL_127 = Enum (255, _("Control 127 Polyphonic Mode On ITrigger")),
-};
enum MidiControlType {
/* special cased signals */
MIDI_CONTROL_NONE = Enum (0, _("None")),
@@ -533,19 +352,6 @@ sequence PartNoteSeq {
Info blurb = "A list of part notes";
PartNote pnotes;
};
-record PartControl
-{
- Info blurb = "Part specific control event representation";
- Int id = SfiUInt ("ID", "", 0, ":readwrite");
- Int tick = SfiInt ("Tick", "", 0, 0, MAXINT, 1, ":readwrite");
- MidiSignalType control_type;
- Real value = SfiReal ("Value", "", 0, -1, +1, 0.1, ":readwrite");
- Bool selected = SfiBool ("Selected", "", FALSE, ":readwrite");
-};
-sequence PartControlSeq {
- Info blurb = "A list of part control events";
- PartControl pcontrols;
-};
record NoteDescription
{
MusicalTuningType musical_tuning;
diff --git a/bse/bsecxxmodule.cc b/bse/bsecxxmodule.cc
index eb89f32..3c69439 100644
--- a/bse/bsecxxmodule.cc
+++ b/bse/bsecxxmodule.cc
@@ -225,7 +225,7 @@ auto_update_data_free (gpointer data) /* UserThread */
static void
midi_control_handler (gpointer handler_data, /* MIDI Device Thread (and possibly others) */
guint64 tick_stamp,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
gfloat control_value, /* -1 .. +1 */
guint n_mcdatas,
BseModule *const*modules,
diff --git a/bse/bseenums.hh b/bse/bseenums.hh
index a697e7b..c2be615 100644
--- a/bse/bseenums.hh
+++ b/bse/bseenums.hh
@@ -122,6 +122,181 @@ typedef enum
BSE_ERROR_INVALID_DURATION = Bse::ERROR_INVALID_DURATION,
BSE_ERROR_INVALID_OVERLAP = Bse::ERROR_INVALID_OVERLAP,
} BseErrorType;
+typedef enum
+{
+ BSE_MIDI_SIGNAL_PROGRAM = Bse::MIDI_SIGNAL_PROGRAM,
+ BSE_MIDI_SIGNAL_PRESSURE = Bse::MIDI_SIGNAL_PRESSURE,
+ BSE_MIDI_SIGNAL_PITCH_BEND = Bse::MIDI_SIGNAL_PITCH_BEND,
+ BSE_MIDI_SIGNAL_VELOCITY = Bse::MIDI_SIGNAL_VELOCITY,
+ BSE_MIDI_SIGNAL_FINE_TUNE = Bse::MIDI_SIGNAL_FINE_TUNE,
+ BSE_MIDI_SIGNAL_CONTINUOUS_0 = Bse::MIDI_SIGNAL_CONTINUOUS_0,
+ BSE_MIDI_SIGNAL_CONTINUOUS_1 = Bse::MIDI_SIGNAL_CONTINUOUS_1,
+ BSE_MIDI_SIGNAL_CONTINUOUS_2 = Bse::MIDI_SIGNAL_CONTINUOUS_2,
+ BSE_MIDI_SIGNAL_CONTINUOUS_3 = Bse::MIDI_SIGNAL_CONTINUOUS_3,
+ BSE_MIDI_SIGNAL_CONTINUOUS_4 = Bse::MIDI_SIGNAL_CONTINUOUS_4,
+ BSE_MIDI_SIGNAL_CONTINUOUS_5 = Bse::MIDI_SIGNAL_CONTINUOUS_5,
+ BSE_MIDI_SIGNAL_CONTINUOUS_6 = Bse::MIDI_SIGNAL_CONTINUOUS_6,
+ BSE_MIDI_SIGNAL_CONTINUOUS_7 = Bse::MIDI_SIGNAL_CONTINUOUS_7,
+ BSE_MIDI_SIGNAL_CONTINUOUS_8 = Bse::MIDI_SIGNAL_CONTINUOUS_8,
+ BSE_MIDI_SIGNAL_CONTINUOUS_9 = Bse::MIDI_SIGNAL_CONTINUOUS_9,
+ BSE_MIDI_SIGNAL_CONTINUOUS_10 = Bse::MIDI_SIGNAL_CONTINUOUS_10,
+ BSE_MIDI_SIGNAL_CONTINUOUS_11 = Bse::MIDI_SIGNAL_CONTINUOUS_11,
+ BSE_MIDI_SIGNAL_CONTINUOUS_12 = Bse::MIDI_SIGNAL_CONTINUOUS_12,
+ BSE_MIDI_SIGNAL_CONTINUOUS_13 = Bse::MIDI_SIGNAL_CONTINUOUS_13,
+ BSE_MIDI_SIGNAL_CONTINUOUS_14 = Bse::MIDI_SIGNAL_CONTINUOUS_14,
+ BSE_MIDI_SIGNAL_CONTINUOUS_15 = Bse::MIDI_SIGNAL_CONTINUOUS_15,
+ BSE_MIDI_SIGNAL_CONTINUOUS_16 = Bse::MIDI_SIGNAL_CONTINUOUS_16,
+ BSE_MIDI_SIGNAL_CONTINUOUS_17 = Bse::MIDI_SIGNAL_CONTINUOUS_17,
+ BSE_MIDI_SIGNAL_CONTINUOUS_18 = Bse::MIDI_SIGNAL_CONTINUOUS_18,
+ BSE_MIDI_SIGNAL_CONTINUOUS_19 = Bse::MIDI_SIGNAL_CONTINUOUS_19,
+ BSE_MIDI_SIGNAL_CONTINUOUS_20 = Bse::MIDI_SIGNAL_CONTINUOUS_20,
+ BSE_MIDI_SIGNAL_CONTINUOUS_21 = Bse::MIDI_SIGNAL_CONTINUOUS_21,
+ BSE_MIDI_SIGNAL_CONTINUOUS_22 = Bse::MIDI_SIGNAL_CONTINUOUS_22,
+ BSE_MIDI_SIGNAL_CONTINUOUS_23 = Bse::MIDI_SIGNAL_CONTINUOUS_23,
+ BSE_MIDI_SIGNAL_CONTINUOUS_24 = Bse::MIDI_SIGNAL_CONTINUOUS_24,
+ BSE_MIDI_SIGNAL_CONTINUOUS_25 = Bse::MIDI_SIGNAL_CONTINUOUS_25,
+ BSE_MIDI_SIGNAL_CONTINUOUS_26 = Bse::MIDI_SIGNAL_CONTINUOUS_26,
+ BSE_MIDI_SIGNAL_CONTINUOUS_27 = Bse::MIDI_SIGNAL_CONTINUOUS_27,
+ BSE_MIDI_SIGNAL_CONTINUOUS_28 = Bse::MIDI_SIGNAL_CONTINUOUS_28,
+ BSE_MIDI_SIGNAL_CONTINUOUS_29 = Bse::MIDI_SIGNAL_CONTINUOUS_29,
+ BSE_MIDI_SIGNAL_CONTINUOUS_30 = Bse::MIDI_SIGNAL_CONTINUOUS_30,
+ BSE_MIDI_SIGNAL_CONTINUOUS_31 = Bse::MIDI_SIGNAL_CONTINUOUS_31,
+ BSE_MIDI_SIGNAL_CONSTANT_HIGH = Bse::MIDI_SIGNAL_CONSTANT_HIGH,
+ BSE_MIDI_SIGNAL_CONSTANT_CENTER = Bse::MIDI_SIGNAL_CONSTANT_CENTER,
+ BSE_MIDI_SIGNAL_CONSTANT_LOW = Bse::MIDI_SIGNAL_CONSTANT_LOW,
+ BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER = Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER,
+ BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH = Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH,
+ BSE_MIDI_SIGNAL_PARAMETER = Bse::MIDI_SIGNAL_PARAMETER,
+ BSE_MIDI_SIGNAL_NON_PARAMETER = Bse::MIDI_SIGNAL_NON_PARAMETER,
+ BSE_MIDI_SIGNAL_CONTROL_0 = Bse::MIDI_SIGNAL_CONTROL_0,
+ BSE_MIDI_SIGNAL_CONTROL_1 = Bse::MIDI_SIGNAL_CONTROL_1,
+ BSE_MIDI_SIGNAL_CONTROL_2 = Bse::MIDI_SIGNAL_CONTROL_2,
+ BSE_MIDI_SIGNAL_CONTROL_3 = Bse::MIDI_SIGNAL_CONTROL_3,
+ BSE_MIDI_SIGNAL_CONTROL_4 = Bse::MIDI_SIGNAL_CONTROL_4,
+ BSE_MIDI_SIGNAL_CONTROL_5 = Bse::MIDI_SIGNAL_CONTROL_5,
+ BSE_MIDI_SIGNAL_CONTROL_6 = Bse::MIDI_SIGNAL_CONTROL_6,
+ BSE_MIDI_SIGNAL_CONTROL_7 = Bse::MIDI_SIGNAL_CONTROL_7,
+ BSE_MIDI_SIGNAL_CONTROL_8 = Bse::MIDI_SIGNAL_CONTROL_8,
+ BSE_MIDI_SIGNAL_CONTROL_9 = Bse::MIDI_SIGNAL_CONTROL_9,
+ BSE_MIDI_SIGNAL_CONTROL_10 = Bse::MIDI_SIGNAL_CONTROL_10,
+ BSE_MIDI_SIGNAL_CONTROL_11 = Bse::MIDI_SIGNAL_CONTROL_11,
+ BSE_MIDI_SIGNAL_CONTROL_12 = Bse::MIDI_SIGNAL_CONTROL_12,
+ BSE_MIDI_SIGNAL_CONTROL_13 = Bse::MIDI_SIGNAL_CONTROL_13,
+ BSE_MIDI_SIGNAL_CONTROL_14 = Bse::MIDI_SIGNAL_CONTROL_14,
+ BSE_MIDI_SIGNAL_CONTROL_15 = Bse::MIDI_SIGNAL_CONTROL_15,
+ BSE_MIDI_SIGNAL_CONTROL_16 = Bse::MIDI_SIGNAL_CONTROL_16,
+ BSE_MIDI_SIGNAL_CONTROL_17 = Bse::MIDI_SIGNAL_CONTROL_17,
+ BSE_MIDI_SIGNAL_CONTROL_18 = Bse::MIDI_SIGNAL_CONTROL_18,
+ BSE_MIDI_SIGNAL_CONTROL_19 = Bse::MIDI_SIGNAL_CONTROL_19,
+ BSE_MIDI_SIGNAL_CONTROL_20 = Bse::MIDI_SIGNAL_CONTROL_20,
+ BSE_MIDI_SIGNAL_CONTROL_21 = Bse::MIDI_SIGNAL_CONTROL_21,
+ BSE_MIDI_SIGNAL_CONTROL_22 = Bse::MIDI_SIGNAL_CONTROL_22,
+ BSE_MIDI_SIGNAL_CONTROL_23 = Bse::MIDI_SIGNAL_CONTROL_23,
+ BSE_MIDI_SIGNAL_CONTROL_24 = Bse::MIDI_SIGNAL_CONTROL_24,
+ BSE_MIDI_SIGNAL_CONTROL_25 = Bse::MIDI_SIGNAL_CONTROL_25,
+ BSE_MIDI_SIGNAL_CONTROL_26 = Bse::MIDI_SIGNAL_CONTROL_26,
+ BSE_MIDI_SIGNAL_CONTROL_27 = Bse::MIDI_SIGNAL_CONTROL_27,
+ BSE_MIDI_SIGNAL_CONTROL_28 = Bse::MIDI_SIGNAL_CONTROL_28,
+ BSE_MIDI_SIGNAL_CONTROL_29 = Bse::MIDI_SIGNAL_CONTROL_29,
+ BSE_MIDI_SIGNAL_CONTROL_30 = Bse::MIDI_SIGNAL_CONTROL_30,
+ BSE_MIDI_SIGNAL_CONTROL_31 = Bse::MIDI_SIGNAL_CONTROL_31,
+ BSE_MIDI_SIGNAL_CONTROL_32 = Bse::MIDI_SIGNAL_CONTROL_32,
+ BSE_MIDI_SIGNAL_CONTROL_33 = Bse::MIDI_SIGNAL_CONTROL_33,
+ BSE_MIDI_SIGNAL_CONTROL_34 = Bse::MIDI_SIGNAL_CONTROL_34,
+ BSE_MIDI_SIGNAL_CONTROL_35 = Bse::MIDI_SIGNAL_CONTROL_35,
+ BSE_MIDI_SIGNAL_CONTROL_36 = Bse::MIDI_SIGNAL_CONTROL_36,
+ BSE_MIDI_SIGNAL_CONTROL_37 = Bse::MIDI_SIGNAL_CONTROL_37,
+ BSE_MIDI_SIGNAL_CONTROL_38 = Bse::MIDI_SIGNAL_CONTROL_38,
+ BSE_MIDI_SIGNAL_CONTROL_39 = Bse::MIDI_SIGNAL_CONTROL_39,
+ BSE_MIDI_SIGNAL_CONTROL_40 = Bse::MIDI_SIGNAL_CONTROL_40,
+ BSE_MIDI_SIGNAL_CONTROL_41 = Bse::MIDI_SIGNAL_CONTROL_41,
+ BSE_MIDI_SIGNAL_CONTROL_42 = Bse::MIDI_SIGNAL_CONTROL_42,
+ BSE_MIDI_SIGNAL_CONTROL_43 = Bse::MIDI_SIGNAL_CONTROL_43,
+ BSE_MIDI_SIGNAL_CONTROL_44 = Bse::MIDI_SIGNAL_CONTROL_44,
+ BSE_MIDI_SIGNAL_CONTROL_45 = Bse::MIDI_SIGNAL_CONTROL_45,
+ BSE_MIDI_SIGNAL_CONTROL_46 = Bse::MIDI_SIGNAL_CONTROL_46,
+ BSE_MIDI_SIGNAL_CONTROL_47 = Bse::MIDI_SIGNAL_CONTROL_47,
+ BSE_MIDI_SIGNAL_CONTROL_48 = Bse::MIDI_SIGNAL_CONTROL_48,
+ BSE_MIDI_SIGNAL_CONTROL_49 = Bse::MIDI_SIGNAL_CONTROL_49,
+ BSE_MIDI_SIGNAL_CONTROL_50 = Bse::MIDI_SIGNAL_CONTROL_50,
+ BSE_MIDI_SIGNAL_CONTROL_51 = Bse::MIDI_SIGNAL_CONTROL_51,
+ BSE_MIDI_SIGNAL_CONTROL_52 = Bse::MIDI_SIGNAL_CONTROL_52,
+ BSE_MIDI_SIGNAL_CONTROL_53 = Bse::MIDI_SIGNAL_CONTROL_53,
+ BSE_MIDI_SIGNAL_CONTROL_54 = Bse::MIDI_SIGNAL_CONTROL_54,
+ BSE_MIDI_SIGNAL_CONTROL_55 = Bse::MIDI_SIGNAL_CONTROL_55,
+ BSE_MIDI_SIGNAL_CONTROL_56 = Bse::MIDI_SIGNAL_CONTROL_56,
+ BSE_MIDI_SIGNAL_CONTROL_57 = Bse::MIDI_SIGNAL_CONTROL_57,
+ BSE_MIDI_SIGNAL_CONTROL_58 = Bse::MIDI_SIGNAL_CONTROL_58,
+ BSE_MIDI_SIGNAL_CONTROL_59 = Bse::MIDI_SIGNAL_CONTROL_59,
+ BSE_MIDI_SIGNAL_CONTROL_60 = Bse::MIDI_SIGNAL_CONTROL_60,
+ BSE_MIDI_SIGNAL_CONTROL_61 = Bse::MIDI_SIGNAL_CONTROL_61,
+ BSE_MIDI_SIGNAL_CONTROL_62 = Bse::MIDI_SIGNAL_CONTROL_62,
+ BSE_MIDI_SIGNAL_CONTROL_63 = Bse::MIDI_SIGNAL_CONTROL_63,
+ BSE_MIDI_SIGNAL_CONTROL_64 = Bse::MIDI_SIGNAL_CONTROL_64,
+ BSE_MIDI_SIGNAL_CONTROL_65 = Bse::MIDI_SIGNAL_CONTROL_65,
+ BSE_MIDI_SIGNAL_CONTROL_66 = Bse::MIDI_SIGNAL_CONTROL_66,
+ BSE_MIDI_SIGNAL_CONTROL_67 = Bse::MIDI_SIGNAL_CONTROL_67,
+ BSE_MIDI_SIGNAL_CONTROL_68 = Bse::MIDI_SIGNAL_CONTROL_68,
+ BSE_MIDI_SIGNAL_CONTROL_69 = Bse::MIDI_SIGNAL_CONTROL_69,
+ BSE_MIDI_SIGNAL_CONTROL_70 = Bse::MIDI_SIGNAL_CONTROL_70,
+ BSE_MIDI_SIGNAL_CONTROL_71 = Bse::MIDI_SIGNAL_CONTROL_71,
+ BSE_MIDI_SIGNAL_CONTROL_72 = Bse::MIDI_SIGNAL_CONTROL_72,
+ BSE_MIDI_SIGNAL_CONTROL_73 = Bse::MIDI_SIGNAL_CONTROL_73,
+ BSE_MIDI_SIGNAL_CONTROL_74 = Bse::MIDI_SIGNAL_CONTROL_74,
+ BSE_MIDI_SIGNAL_CONTROL_75 = Bse::MIDI_SIGNAL_CONTROL_75,
+ BSE_MIDI_SIGNAL_CONTROL_76 = Bse::MIDI_SIGNAL_CONTROL_76,
+ BSE_MIDI_SIGNAL_CONTROL_77 = Bse::MIDI_SIGNAL_CONTROL_77,
+ BSE_MIDI_SIGNAL_CONTROL_78 = Bse::MIDI_SIGNAL_CONTROL_78,
+ BSE_MIDI_SIGNAL_CONTROL_79 = Bse::MIDI_SIGNAL_CONTROL_79,
+ BSE_MIDI_SIGNAL_CONTROL_80 = Bse::MIDI_SIGNAL_CONTROL_80,
+ BSE_MIDI_SIGNAL_CONTROL_81 = Bse::MIDI_SIGNAL_CONTROL_81,
+ BSE_MIDI_SIGNAL_CONTROL_82 = Bse::MIDI_SIGNAL_CONTROL_82,
+ BSE_MIDI_SIGNAL_CONTROL_83 = Bse::MIDI_SIGNAL_CONTROL_83,
+ BSE_MIDI_SIGNAL_CONTROL_84 = Bse::MIDI_SIGNAL_CONTROL_84,
+ BSE_MIDI_SIGNAL_CONTROL_85 = Bse::MIDI_SIGNAL_CONTROL_85,
+ BSE_MIDI_SIGNAL_CONTROL_86 = Bse::MIDI_SIGNAL_CONTROL_86,
+ BSE_MIDI_SIGNAL_CONTROL_87 = Bse::MIDI_SIGNAL_CONTROL_87,
+ BSE_MIDI_SIGNAL_CONTROL_88 = Bse::MIDI_SIGNAL_CONTROL_88,
+ BSE_MIDI_SIGNAL_CONTROL_89 = Bse::MIDI_SIGNAL_CONTROL_89,
+ BSE_MIDI_SIGNAL_CONTROL_90 = Bse::MIDI_SIGNAL_CONTROL_90,
+ BSE_MIDI_SIGNAL_CONTROL_91 = Bse::MIDI_SIGNAL_CONTROL_91,
+ BSE_MIDI_SIGNAL_CONTROL_92 = Bse::MIDI_SIGNAL_CONTROL_92,
+ BSE_MIDI_SIGNAL_CONTROL_93 = Bse::MIDI_SIGNAL_CONTROL_93,
+ BSE_MIDI_SIGNAL_CONTROL_94 = Bse::MIDI_SIGNAL_CONTROL_94,
+ BSE_MIDI_SIGNAL_CONTROL_95 = Bse::MIDI_SIGNAL_CONTROL_95,
+ BSE_MIDI_SIGNAL_CONTROL_96 = Bse::MIDI_SIGNAL_CONTROL_96,
+ BSE_MIDI_SIGNAL_CONTROL_97 = Bse::MIDI_SIGNAL_CONTROL_97,
+ BSE_MIDI_SIGNAL_CONTROL_98 = Bse::MIDI_SIGNAL_CONTROL_98,
+ BSE_MIDI_SIGNAL_CONTROL_99 = Bse::MIDI_SIGNAL_CONTROL_99,
+ BSE_MIDI_SIGNAL_CONTROL_100 = Bse::MIDI_SIGNAL_CONTROL_100,
+ BSE_MIDI_SIGNAL_CONTROL_101 = Bse::MIDI_SIGNAL_CONTROL_101,
+ BSE_MIDI_SIGNAL_CONTROL_102 = Bse::MIDI_SIGNAL_CONTROL_102,
+ BSE_MIDI_SIGNAL_CONTROL_103 = Bse::MIDI_SIGNAL_CONTROL_103,
+ BSE_MIDI_SIGNAL_CONTROL_104 = Bse::MIDI_SIGNAL_CONTROL_104,
+ BSE_MIDI_SIGNAL_CONTROL_105 = Bse::MIDI_SIGNAL_CONTROL_105,
+ BSE_MIDI_SIGNAL_CONTROL_106 = Bse::MIDI_SIGNAL_CONTROL_106,
+ BSE_MIDI_SIGNAL_CONTROL_107 = Bse::MIDI_SIGNAL_CONTROL_107,
+ BSE_MIDI_SIGNAL_CONTROL_108 = Bse::MIDI_SIGNAL_CONTROL_108,
+ BSE_MIDI_SIGNAL_CONTROL_109 = Bse::MIDI_SIGNAL_CONTROL_109,
+ BSE_MIDI_SIGNAL_CONTROL_110 = Bse::MIDI_SIGNAL_CONTROL_110,
+ BSE_MIDI_SIGNAL_CONTROL_111 = Bse::MIDI_SIGNAL_CONTROL_111,
+ BSE_MIDI_SIGNAL_CONTROL_112 = Bse::MIDI_SIGNAL_CONTROL_112,
+ BSE_MIDI_SIGNAL_CONTROL_113 = Bse::MIDI_SIGNAL_CONTROL_113,
+ BSE_MIDI_SIGNAL_CONTROL_114 = Bse::MIDI_SIGNAL_CONTROL_114,
+ BSE_MIDI_SIGNAL_CONTROL_115 = Bse::MIDI_SIGNAL_CONTROL_115,
+ BSE_MIDI_SIGNAL_CONTROL_116 = Bse::MIDI_SIGNAL_CONTROL_116,
+ BSE_MIDI_SIGNAL_CONTROL_117 = Bse::MIDI_SIGNAL_CONTROL_117,
+ BSE_MIDI_SIGNAL_CONTROL_118 = Bse::MIDI_SIGNAL_CONTROL_118,
+ BSE_MIDI_SIGNAL_CONTROL_119 = Bse::MIDI_SIGNAL_CONTROL_119,
+ BSE_MIDI_SIGNAL_CONTROL_120 = Bse::MIDI_SIGNAL_CONTROL_120,
+ BSE_MIDI_SIGNAL_CONTROL_121 = Bse::MIDI_SIGNAL_CONTROL_121,
+ BSE_MIDI_SIGNAL_CONTROL_122 = Bse::MIDI_SIGNAL_CONTROL_122,
+ BSE_MIDI_SIGNAL_CONTROL_123 = Bse::MIDI_SIGNAL_CONTROL_123,
+ BSE_MIDI_SIGNAL_CONTROL_124 = Bse::MIDI_SIGNAL_CONTROL_124,
+ BSE_MIDI_SIGNAL_CONTROL_125 = Bse::MIDI_SIGNAL_CONTROL_125,
+ BSE_MIDI_SIGNAL_CONTROL_126 = Bse::MIDI_SIGNAL_CONTROL_126,
+ BSE_MIDI_SIGNAL_CONTROL_127 = Bse::MIDI_SIGNAL_CONTROL_127,
+} BseMidiSignalType;
#endif // BSE_IDL_SURROGATES
diff --git a/bse/bsemidicontroller.cc b/bse/bsemidicontroller.cc
index b974e3d..b52039c 100644
--- a/bse/bsemidicontroller.cc
+++ b/bse/bsemidicontroller.cc
@@ -98,25 +98,25 @@ bse_midi_controller_class_init (BseMidiControllerClass *klass)
PROP_CONTROL_1,
bse_param_spec_genum ("control_1", "Signal 1", NULL,
BSE_TYPE_MIDI_SIGNAL_TYPE,
- BSE_MIDI_SIGNAL_PITCH_BEND,
+ Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD));
bse_object_class_add_param (object_class, "MIDI Controls",
PROP_CONTROL_2,
bse_param_spec_genum ("control_2", "Signal 2", NULL,
BSE_TYPE_MIDI_SIGNAL_TYPE,
- BSE_MIDI_SIGNAL_CONTINUOUS_1,
+ Bse::MIDI_SIGNAL_CONTINUOUS_1,
SFI_PARAM_STANDARD));
bse_object_class_add_param (object_class, "MIDI Controls",
PROP_CONTROL_3,
bse_param_spec_genum ("control_3", "Signal 3", NULL,
BSE_TYPE_MIDI_SIGNAL_TYPE,
- BSE_MIDI_SIGNAL_CONTINUOUS_7,
+ Bse::MIDI_SIGNAL_CONTINUOUS_7,
SFI_PARAM_STANDARD));
bse_object_class_add_param (object_class, "MIDI Controls",
PROP_CONTROL_4,
bse_param_spec_genum ("control_4", "Signal 4", NULL,
BSE_TYPE_MIDI_SIGNAL_TYPE,
- BSE_MIDI_SIGNAL_PRESSURE,
+ Bse::MIDI_SIGNAL_PRESSURE,
SFI_PARAM_STANDARD));
ochannel_id = bse_source_class_add_ochannel (source_class, "ctrl-out1", _("Ctrl Out1"), _("MIDI Signal
1"));
@@ -133,10 +133,10 @@ static void
bse_midi_controller_init (BseMidiController *self)
{
self->midi_channel = 0;
- self->controls[0] = BSE_MIDI_SIGNAL_PITCH_BEND;
- self->controls[1] = BSE_MIDI_SIGNAL_CONTINUOUS_1;
- self->controls[2] = BSE_MIDI_SIGNAL_CONTINUOUS_7;
- self->controls[3] = BSE_MIDI_SIGNAL_PRESSURE;
+ self->controls[0] = Bse::MIDI_SIGNAL_PITCH_BEND;
+ self->controls[1] = Bse::MIDI_SIGNAL_CONTINUOUS_1;
+ self->controls[2] = Bse::MIDI_SIGNAL_CONTINUOUS_7;
+ self->controls[3] = Bse::MIDI_SIGNAL_PRESSURE;
}
static void
@@ -154,19 +154,19 @@ bse_midi_controller_set_property (GObject *object,
bse_midi_controller_update_modules (self);
break;
case PROP_CONTROL_1:
- self->controls[0] = BseMidiSignalType (g_value_get_enum (value));
+ self->controls[0] = Bse::MidiSignalType (g_value_get_enum (value));
bse_midi_controller_update_modules (self);
break;
case PROP_CONTROL_2:
- self->controls[1] = BseMidiSignalType (g_value_get_enum (value));
+ self->controls[1] = Bse::MidiSignalType (g_value_get_enum (value));
bse_midi_controller_update_modules (self);
break;
case PROP_CONTROL_3:
- self->controls[2] = BseMidiSignalType (g_value_get_enum (value));
+ self->controls[2] = Bse::MidiSignalType (g_value_get_enum (value));
bse_midi_controller_update_modules (self);
break;
case PROP_CONTROL_4:
- self->controls[3] = BseMidiSignalType (g_value_get_enum (value));
+ self->controls[3] = Bse::MidiSignalType (g_value_get_enum (value));
bse_midi_controller_update_modules (self);
break;
default:
diff --git a/bse/bsemidicontroller.hh b/bse/bsemidicontroller.hh
index 3cf0d85..fd966c8 100644
--- a/bse/bsemidicontroller.hh
+++ b/bse/bsemidicontroller.hh
@@ -18,7 +18,7 @@ G_BEGIN_DECLS
struct BseMidiController : BseSource {
guint midi_channel;
- BseMidiSignalType controls[4];
+ Bse::MidiSignalType controls[4];
};
struct BseMidiControllerClass : BseSourceClass
{};
diff --git a/bse/bsemidievent.cc b/bse/bsemidievent.cc
index 35b9d0c..000c799 100644
--- a/bse/bsemidievent.cc
+++ b/bse/bsemidievent.cc
@@ -9,70 +9,49 @@
#include <errno.h>
-/* --- variables --- */
-static GEnumClass *bse_midi_signal_class = NULL;
-
-
/* --- functions --- */
/**
- * @param type BseMidiSignalType type
+ * @param type Bse::MidiSignalType type
*
* Get the initial default value for a midi signal.
* This function is MT-safe and may be called from any thread.
*/
-float
-bse_midi_signal_default (BseMidiSignalType type)
+double
+bse_midi_signal_default (Bse::MidiSignalType type)
{
switch (type)
{
- case BSE_MIDI_SIGNAL_PITCH_BEND: return 0.0;
- case BSE_MIDI_SIGNAL_CONTINUOUS_7: return 100.0 / 127.0; /* Volume */
- case BSE_MIDI_SIGNAL_CONTINUOUS_8: return 0.5; /* Balance */
- case BSE_MIDI_SIGNAL_CONTINUOUS_10: return 0.5; /* Panorama */
- case BSE_MIDI_SIGNAL_CONTINUOUS_11: return 0x3f80 / (float) 0x3fff; /* Expression */
- case BSE_MIDI_SIGNAL_CONTROL_7: return 100.0 / 127.0; /* Volume MSB */
- case BSE_MIDI_SIGNAL_CONTROL_8: return 0.5; /* Balance MSB */
- case BSE_MIDI_SIGNAL_CONTROL_10: return 0.5; /* Panorama MSB */
- case BSE_MIDI_SIGNAL_CONTROL_11: return 1.0; /* Expression MSB */
- case BSE_MIDI_SIGNAL_CONTROL_64:
+ case Bse::MIDI_SIGNAL_PITCH_BEND: return 0.0;
+ case Bse::MIDI_SIGNAL_CONTINUOUS_7: return 100.0 / 127.0; /* Volume */
+ case Bse::MIDI_SIGNAL_CONTINUOUS_8: return 0.5; /* Balance */
+ case Bse::MIDI_SIGNAL_CONTINUOUS_10: return 0.5; /* Panorama */
+ case Bse::MIDI_SIGNAL_CONTINUOUS_11: return 0x3f80 / (float) 0x3fff; /* Expression */
+ case Bse::MIDI_SIGNAL_CONTROL_7: return 100.0 / 127.0; /* Volume MSB */
+ case Bse::MIDI_SIGNAL_CONTROL_8: return 0.5; /* Balance MSB */
+ case Bse::MIDI_SIGNAL_CONTROL_10: return 0.5; /* Panorama MSB */
+ case Bse::MIDI_SIGNAL_CONTROL_11: return 1.0; /* Expression MSB */
+ case Bse::MIDI_SIGNAL_CONTROL_64:
return BSE_GCONFIG (invert_sustain) ? 1.0 : 0.0; /* Damper Pedal Switch */
- case BSE_MIDI_SIGNAL_CONTROL_120: return 1.0; /* All Sound Off ITrigger */
- case BSE_MIDI_SIGNAL_CONTROL_121: return 1.0; /* All Controllers Off ITrigger */
- case BSE_MIDI_SIGNAL_CONTROL_123: return 1.0; /* All Notes Off ITrigger */
- case BSE_MIDI_SIGNAL_CONTROL_124: return 1.0; /* Omni Mode Off ITrigger */
- case BSE_MIDI_SIGNAL_CONTROL_125: return 1.0; /* Omni Mode On ITrigger */
- case BSE_MIDI_SIGNAL_CONTROL_127: return 1.0; /* Polyphonic Mode On ITrigger */
- case BSE_MIDI_SIGNAL_CONSTANT_HIGH: return 1.0;
- case BSE_MIDI_SIGNAL_CONSTANT_CENTER: return 0.5;
- case BSE_MIDI_SIGNAL_CONSTANT_LOW: return 0.0;
- case BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER: return -0.5;
- case BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH: return -1.0;
+ case Bse::MIDI_SIGNAL_CONTROL_120: return 1.0; /* All Sound Off ITrigger */
+ case Bse::MIDI_SIGNAL_CONTROL_121: return 1.0; /* All Controllers Off ITrigger */
+ case Bse::MIDI_SIGNAL_CONTROL_123: return 1.0; /* All Notes Off ITrigger */
+ case Bse::MIDI_SIGNAL_CONTROL_124: return 1.0; /* Omni Mode Off ITrigger */
+ case Bse::MIDI_SIGNAL_CONTROL_125: return 1.0; /* Omni Mode On ITrigger */
+ case Bse::MIDI_SIGNAL_CONTROL_127: return 1.0; /* Polyphonic Mode On ITrigger */
+ case Bse::MIDI_SIGNAL_CONSTANT_HIGH: return 1.0;
+ case Bse::MIDI_SIGNAL_CONSTANT_CENTER: return 0.5;
+ case Bse::MIDI_SIGNAL_CONSTANT_LOW: return 0.0;
+ case Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER: return -0.5;
+ case Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH: return -1.0;
default: return 0.0;
}
}
const char*
-bse_midi_signal_name (BseMidiSignalType signal)
-{
- GEnumValue *ev;
-
- if (!bse_midi_signal_class)
- bse_midi_signal_class = (GEnumClass*) g_type_class_ref (BSE_TYPE_MIDI_SIGNAL_TYPE);
-
- ev = g_enum_get_value (bse_midi_signal_class, signal);
- return ev ? ev->value_name : NULL;
-}
-
-const char*
-bse_midi_signal_nick (BseMidiSignalType signal)
+bse_midi_signal_name (Bse::MidiSignalType signal)
{
- GEnumValue *ev;
-
- if (!bse_midi_signal_class)
- bse_midi_signal_class = (GEnumClass*) g_type_class_ref (BSE_TYPE_MIDI_SIGNAL_TYPE);
-
- ev = g_enum_get_value (bse_midi_signal_class, signal);
- return ev ? ev->value_nick : NULL;
+ const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_info<Bse::MidiSignalType>().find_value (signal);
+ return ev ? ev->blurb : NULL;
}
@@ -184,7 +163,7 @@ bse_midi_event_note_off (uint midi_channel,
BseMidiEvent*
bse_midi_event_signal (uint midi_channel,
uint64 delta_time,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
float value)
{
BseMidiEvent *event;
@@ -195,25 +174,25 @@ bse_midi_event_signal (uint midi_channel,
event = bse_midi_alloc_event ();
switch (signal_type)
{
- case BSE_MIDI_SIGNAL_PROGRAM:
+ case Bse::MIDI_SIGNAL_PROGRAM:
event->status = BSE_MIDI_PROGRAM_CHANGE;
event->data.program = bse_ftoi (CLAMP (value, 0, 1) * 0x7f);
break;
- case BSE_MIDI_SIGNAL_PRESSURE:
+ case Bse::MIDI_SIGNAL_PRESSURE:
event->status = BSE_MIDI_CHANNEL_PRESSURE;
event->data.intensity = MAX (value, 0);
break;
- case BSE_MIDI_SIGNAL_PITCH_BEND:
+ case Bse::MIDI_SIGNAL_PITCH_BEND:
event->status = BSE_MIDI_PITCH_BEND;
event->data.pitch_bend = value;
break;
- case BSE_MIDI_SIGNAL_VELOCITY:
- case BSE_MIDI_SIGNAL_FINE_TUNE:
- case BSE_MIDI_SIGNAL_CONSTANT_HIGH:
- case BSE_MIDI_SIGNAL_CONSTANT_CENTER:
- case BSE_MIDI_SIGNAL_CONSTANT_LOW:
- case BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER:
- case BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH:
+ case Bse::MIDI_SIGNAL_VELOCITY:
+ case Bse::MIDI_SIGNAL_FINE_TUNE:
+ case Bse::MIDI_SIGNAL_CONSTANT_HIGH:
+ case Bse::MIDI_SIGNAL_CONSTANT_CENTER:
+ case Bse::MIDI_SIGNAL_CONSTANT_LOW:
+ case Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER:
+ case Bse::MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH:
/* these are special signals that don't map to MIDI events */
sfi_delete_struct (BseMidiEvent, event);
return NULL;
diff --git a/bse/bsemidievent.hh b/bse/bsemidievent.hh
index 08acd0f..5dc8c3e 100644
--- a/bse/bsemidievent.hh
+++ b/bse/bsemidievent.hh
@@ -134,198 +134,10 @@ BseMidiEvent* bse_midi_event_note_off (uint midi_channel,
gfloat frequency);
BseMidiEvent* bse_midi_event_signal (uint midi_channel,
uint64 delta_time,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
float value);
-
-
-/* --- MIDI Signals --- */
-#if 0
-typeNOTdef enum /*< prefix=BSE_MIDI_SIGNAL >*/ /* FIXME: sync to bserecords.sfidl */
-{
- /* special cased signals */
- BSE_MIDI_SIGNAL_PROGRAM = 1, /*< nick=Program Change >*/ /* 7bit */
- BSE_MIDI_SIGNAL_PRESSURE, /*< nick=Channel Pressure >*/ /* 7bit */
- BSE_MIDI_SIGNAL_PITCH_BEND, /*< nick=Pitch Bend >*/ /* 14bit */
- BSE_MIDI_SIGNAL_VELOCITY, /*< nick=Note Velocity >*/
- BSE_MIDI_SIGNAL_FINE_TUNE, /*< nick=Note Fine Tune >*/
- /* 14bit, continuous controls */
- BSE_MIDI_SIGNAL_CONTINUOUS_0 = 64, /*< nick=Bank Select >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_1, /*< nick=Modulation Depth >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_2, /*< nick=Breath Control >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_3, /*< nick=Continuous 3 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_4, /*< nick=Foot Controller >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_5, /*< nick=Portamento Time >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_6, /*< nick=Data Entry >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_7, /*< nick=Volume >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_8, /*< nick=Balance >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_9, /*< nick=Continuous 9 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_10, /*< nick=Panorama >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_11, /*< nick=Expression >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_12, /*< nick=Effect Control 1 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_13, /*< nick=Effect Control 2 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_14, /*< nick=Continuous 14 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_15, /*< nick=Continuous 15 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_16, /*< nick=General Purpose Controller 1 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_17, /*< nick=General Purpose Controller 2 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_18, /*< nick=General Purpose Controller 3 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_19, /*< nick=General Purpose Controller 4 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_20, /*< nick=Continuous 20 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_21, /*< nick=Continuous 21 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_22, /*< nick=Continuous 22 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_23, /*< nick=Continuous 23 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_24, /*< nick=Continuous 24 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_25, /*< nick=Continuous 25 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_26, /*< nick=Continuous 26 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_27, /*< nick=Continuous 27 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_28, /*< nick=Continuous 28 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_29, /*< nick=Continuous 29 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_30, /*< nick=Continuous 30 >*/
- BSE_MIDI_SIGNAL_CONTINUOUS_31, /*< nick=Continuous 31 >*/
- /* 14bit, special cased signals */
- BSE_MIDI_SIGNAL_CONSTANT_HIGH = 96, /*< nick=Constant HIGH >*/
- BSE_MIDI_SIGNAL_CONSTANT_CENTER, /*< nick=Constant CENTER >*/
- BSE_MIDI_SIGNAL_CONSTANT_LOW, /*< nick=Constant LOW >*/
- BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_CENTER, /*< nick=Constant Negative CENTER >*/
- BSE_MIDI_SIGNAL_CONSTANT_NEGATIVE_HIGH, /*< nick=Constant Negative HIGH >*/
- BSE_MIDI_SIGNAL_PARAMETER, /*< nick=Registered Parameter >*/
- BSE_MIDI_SIGNAL_NON_PARAMETER, /*< nick=Non-Registered Parameter >*/
- /* 7bit, literal channel controls, MSB values */
- BSE_MIDI_SIGNAL_CONTROL_0 = 128, /*< nick=Control 0 Bank Select MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_1, /*< nick=Control 1 Modulation Depth MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_2, /*< nick=Control 2 Breath Control MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_3,
- BSE_MIDI_SIGNAL_CONTROL_4, /*< nick=Control 4 Foot Controller MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_5, /*< nick=Control 5 Portamento Time MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_6, /*< nick=Control 6 Data Entry MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_7, /*< nick=Control 7 Volume MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_8, /*< nick=Control 8 Balance MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_9,
- BSE_MIDI_SIGNAL_CONTROL_10, /*< nick=Control 10 Panorama MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_11, /*< nick=Control 11 Expression MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_12, /*< nick=Control 12 Effect Control 1 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_13, /*< nick=Control 13 Effect Control 2 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_14,
- BSE_MIDI_SIGNAL_CONTROL_15,
- BSE_MIDI_SIGNAL_CONTROL_16, /*< nick=Control 16 General Purpose Controller 1 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_17, /*< nick=Control 17 General Purpose Controller 2 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_18, /*< nick=Control 18 General Purpose Controller 3 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_19, /*< nick=Control 19 General Purpose Controller 4 MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_20,
- BSE_MIDI_SIGNAL_CONTROL_21,
- BSE_MIDI_SIGNAL_CONTROL_22,
- BSE_MIDI_SIGNAL_CONTROL_23,
- BSE_MIDI_SIGNAL_CONTROL_24,
- BSE_MIDI_SIGNAL_CONTROL_25,
- BSE_MIDI_SIGNAL_CONTROL_26,
- BSE_MIDI_SIGNAL_CONTROL_27,
- BSE_MIDI_SIGNAL_CONTROL_28,
- BSE_MIDI_SIGNAL_CONTROL_29,
- BSE_MIDI_SIGNAL_CONTROL_30,
- BSE_MIDI_SIGNAL_CONTROL_31,
- /* 7bit, literal channel controls, LSB values */
- BSE_MIDI_SIGNAL_CONTROL_32, /*< nick=Control 32 Bank Select LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_33, /*< nick=Control 33 Modulation Depth LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_34, /*< nick=Control 34 Breath Control LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_35,
- BSE_MIDI_SIGNAL_CONTROL_36, /*< nick=Control 36 Foot Controller LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_37, /*< nick=Control 37 Portamento Time LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_38, /*< nick=Control 38 Data Entry LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_39, /*< nick=Control 39 Volume LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_40, /*< nick=Control 40 Balance LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_41,
- BSE_MIDI_SIGNAL_CONTROL_42, /*< nick=Control 42 Panorama LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_43, /*< nick=Control 43 Expression LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_44, /*< nick=Control 44 Effect Control 1 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_45, /*< nick=Control 45 Effect Control 2 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_46,
- BSE_MIDI_SIGNAL_CONTROL_47,
- BSE_MIDI_SIGNAL_CONTROL_48, /*< nick=Control 48 General Purpose Controller 1 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_49, /*< nick=Control 49 General Purpose Controller 2 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_50, /*< nick=Control 50 General Purpose Controller 3 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_51, /*< nick=Control 51 General Purpose Controller 4 LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_52,
- BSE_MIDI_SIGNAL_CONTROL_53,
- BSE_MIDI_SIGNAL_CONTROL_54,
- BSE_MIDI_SIGNAL_CONTROL_55,
- BSE_MIDI_SIGNAL_CONTROL_56,
- BSE_MIDI_SIGNAL_CONTROL_57,
- BSE_MIDI_SIGNAL_CONTROL_58,
- BSE_MIDI_SIGNAL_CONTROL_59,
- BSE_MIDI_SIGNAL_CONTROL_60,
- BSE_MIDI_SIGNAL_CONTROL_61,
- BSE_MIDI_SIGNAL_CONTROL_62,
- BSE_MIDI_SIGNAL_CONTROL_63,
- /* 7bit, literal channel controls */
- BSE_MIDI_SIGNAL_CONTROL_64, /*< nick=Control 64 Damper Pedal Switch (Sustain) >*/
- BSE_MIDI_SIGNAL_CONTROL_65, /*< nick=Control 65 Portamento Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_66, /*< nick=Control 66 Sustenuto Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_67, /*< nick=Control 67 Soft Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_68, /*< nick=Control 68 Legato Pedal Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_69, /*< nick=Control 69 Hold Pedal Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_70, /*< nick=Control 70 Sound Variation >*/
- BSE_MIDI_SIGNAL_CONTROL_71, /*< nick=Control 71 Filter Resonance (Timbre) >*/
- BSE_MIDI_SIGNAL_CONTROL_72, /*< nick=Control 72 Sound Release Time >*/
- BSE_MIDI_SIGNAL_CONTROL_73, /*< nick=Control 73 Sound Attack Time >*/
- BSE_MIDI_SIGNAL_CONTROL_74, /*< nick=Control 74 Sound Brightness >*/
- BSE_MIDI_SIGNAL_CONTROL_75, /*< nick=Control 75 Sound Decay Time >*/
- BSE_MIDI_SIGNAL_CONTROL_76, /*< nick=Control 76 Vibrato Rate >*/
- BSE_MIDI_SIGNAL_CONTROL_77, /*< nick=Control 77 Vibrato Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_78, /*< nick=Control 78 Vibrato Delay >*/
- BSE_MIDI_SIGNAL_CONTROL_79, /*< nick=Control 79 Sound Control 10 >*/
- BSE_MIDI_SIGNAL_CONTROL_80, /*< nick=Control 80 General Purpose Switch 5 >*/
- BSE_MIDI_SIGNAL_CONTROL_81, /*< nick=Control 81 General Purpose Switch 6 >*/
- BSE_MIDI_SIGNAL_CONTROL_82, /*< nick=Control 82 General Purpose Switch 7 >*/
- BSE_MIDI_SIGNAL_CONTROL_83, /*< nick=Control 83 General Purpose Switch 8 >*/
- BSE_MIDI_SIGNAL_CONTROL_84, /*< nick=Control 84 Portamento Control (Note) >*/
- BSE_MIDI_SIGNAL_CONTROL_85,
- BSE_MIDI_SIGNAL_CONTROL_86,
- BSE_MIDI_SIGNAL_CONTROL_87,
- BSE_MIDI_SIGNAL_CONTROL_88,
- BSE_MIDI_SIGNAL_CONTROL_89,
- BSE_MIDI_SIGNAL_CONTROL_90,
- BSE_MIDI_SIGNAL_CONTROL_91, /*< nick=Control 91 Reverb Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_92, /*< nick=Control 92 Tremolo Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_93, /*< nick=Control 93 Chorus Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_94, /*< nick=Control 93 Detune Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_95, /*< nick=Control 95 Phase Depth >*/
- BSE_MIDI_SIGNAL_CONTROL_96, /*< nick=Control 96 Data Increment Trigger >*/
- BSE_MIDI_SIGNAL_CONTROL_97, /*< nick=Control 97 Data Decrement Trigger >*/
- BSE_MIDI_SIGNAL_CONTROL_98, /*< nick=Control 98 Non-Registered Parameter MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_99, /*< nick=Control 99 Non-Registered Parameter LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_100, /*< nick=Control 100 Registered Parameter MSB >*/
- BSE_MIDI_SIGNAL_CONTROL_101, /*< nick=Control 101 Registered Parameter LSB >*/
- BSE_MIDI_SIGNAL_CONTROL_102,
- BSE_MIDI_SIGNAL_CONTROL_103,
- BSE_MIDI_SIGNAL_CONTROL_104,
- BSE_MIDI_SIGNAL_CONTROL_105,
- BSE_MIDI_SIGNAL_CONTROL_106,
- BSE_MIDI_SIGNAL_CONTROL_107,
- BSE_MIDI_SIGNAL_CONTROL_108,
- BSE_MIDI_SIGNAL_CONTROL_109,
- BSE_MIDI_SIGNAL_CONTROL_110,
- BSE_MIDI_SIGNAL_CONTROL_111,
- BSE_MIDI_SIGNAL_CONTROL_112,
- BSE_MIDI_SIGNAL_CONTROL_113,
- BSE_MIDI_SIGNAL_CONTROL_114,
- BSE_MIDI_SIGNAL_CONTROL_115,
- BSE_MIDI_SIGNAL_CONTROL_116,
- BSE_MIDI_SIGNAL_CONTROL_117,
- BSE_MIDI_SIGNAL_CONTROL_118,
- BSE_MIDI_SIGNAL_CONTROL_119,
- BSE_MIDI_SIGNAL_CONTROL_120, /*< nick=Control 120 All Sound Off ITrigger >*/
- BSE_MIDI_SIGNAL_CONTROL_121, /*< nick=Control 121 All Controllers Off ITrigger >*/
- BSE_MIDI_SIGNAL_CONTROL_122, /*< nick=Control 122 Local Control Switch >*/
- BSE_MIDI_SIGNAL_CONTROL_123, /*< nick=Control 123 All Notes Off ITrigger >*/
- BSE_MIDI_SIGNAL_CONTROL_124, /*< nick=Control 124 Omni Mode Off ITrigger >*/
- BSE_MIDI_SIGNAL_CONTROL_125, /*< nick=Control 125 Omni Mode On ITrigger >*/
- BSE_MIDI_SIGNAL_CONTROL_126, /*< nick=Control 126 Monophonic Voices Mode >*/
- BSE_MIDI_SIGNAL_CONTROL_127 /*< nick=Control 127 Polyphonic Mode On ITrigger >*/
-} BseMidiSignalType;
-#endif
-
-gfloat bse_midi_signal_default (BseMidiSignalType signal);
-const gchar* bse_midi_signal_name (BseMidiSignalType signal);
-const gchar* bse_midi_signal_nick (BseMidiSignalType signal);
+double bse_midi_signal_default (Bse::MidiSignalType signal);
+const char* bse_midi_signal_name (Bse::MidiSignalType signal);
G_END_DECLS
diff --git a/bse/bsemidifile.cc b/bse/bsemidifile.cc
index 53a860e..6ec8426 100644
--- a/bse/bsemidifile.cc
+++ b/bse/bsemidifile.cc
@@ -237,7 +237,7 @@ bse_midi_file_add_part_events (BseMidiFile *smf,
for (i = 0; i < track->n_events; i++)
{
BseMidiEvent *event = track->events[i];
- BseMidiSignalType msignal = BseMidiSignalType (0);
+ Bse::MidiSignalType msignal = Bse::MidiSignalType (0);
start += event->delta_time;
switch (event->status)
{
@@ -263,25 +263,25 @@ bse_midi_file_add_part_events (BseMidiFile *smf,
case BSE_MIDI_CONTROL_CHANGE:
if (!msignal)
{
- msignal = BseMidiSignalType (BSE_MIDI_SIGNAL_CONTROL_0 + event->data.control.control);
+ msignal = Bse::MidiSignalType (Bse::MIDI_SIGNAL_CONTROL_0 + event->data.control.control);
fvalue = event->data.control.value;
}
case BSE_MIDI_PROGRAM_CHANGE:
if (!msignal)
{
- msignal = BSE_MIDI_SIGNAL_PROGRAM;
+ msignal = Bse::MIDI_SIGNAL_PROGRAM;
fvalue = event->data.program * (1.0 / (double) 0x7F);
}
case BSE_MIDI_CHANNEL_PRESSURE:
if (!msignal)
{
- msignal = BSE_MIDI_SIGNAL_PRESSURE;
+ msignal = Bse::MIDI_SIGNAL_PRESSURE;
fvalue = event->data.intensity;
}
case BSE_MIDI_PITCH_BEND:
if (!msignal)
{
- msignal = BSE_MIDI_SIGNAL_PITCH_BEND;
+ msignal = Bse::MIDI_SIGNAL_PITCH_BEND;
fvalue = event->data.pitch_bend;
}
bse_item_exec_void (part, "insert-control",
diff --git a/bse/bsemidireceiver.cc b/bse/bsemidireceiver.cc
index 1d86363..2e3d74a 100644
--- a/bse/bsemidireceiver.cc
+++ b/bse/bsemidireceiver.cc
@@ -68,10 +68,10 @@ static Bse::Mutex global_midi_mutex;
/* --- midi controls --- */
struct ControlKey {
guint midi_channel;
- BseMidiSignalType type;
+ Bse::MidiSignalType type;
explicit
ControlKey (guint _mc,
- BseMidiSignalType _tp) :
+ Bse::MidiSignalType _tp) :
midi_channel (_mc),
type (_tp) {}
bool
@@ -198,7 +198,7 @@ struct ControlValue {
}
void
notify_handlers (guint64 tick_stamp,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseTrans *trans)
{
for (HandlerList::iterator it = handlers.begin(); it != handlers.end(); it++)
@@ -343,7 +343,7 @@ public:
private:
ControlValue*
get_control_value (guint midi_channel,
- BseMidiSignalType type)
+ Bse::MidiSignalType type)
{
Controls::iterator it = controls.find (ControlKey (midi_channel, type));
if (it != controls.end())
@@ -355,7 +355,7 @@ private:
public:
gfloat
get_control (guint midi_channel,
- BseMidiSignalType type)
+ Bse::MidiSignalType type)
{
Controls::iterator it = controls.find (ControlKey (midi_channel, type));
return it != controls.end() ? it->second.value : bse_midi_signal_default (type);
@@ -363,7 +363,7 @@ public:
GSList*
set_control (guint midi_channel,
guint64 tick_stamp,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
gfloat value,
BseTrans *trans)
{
@@ -379,7 +379,7 @@ public:
}
void
add_control (guint midi_channel,
- BseMidiSignalType type,
+ Bse::MidiSignalType type,
BseModule *module)
{
ControlValue *cv = get_control_value (midi_channel, type);
@@ -387,7 +387,7 @@ public:
}
void
remove_control (guint midi_channel,
- BseMidiSignalType type,
+ Bse::MidiSignalType type,
BseModule *module)
{
ControlValue *cv = get_control_value (midi_channel, type);
@@ -395,7 +395,7 @@ public:
}
bool
add_control_handler (guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module)
@@ -405,7 +405,7 @@ public:
}
void
set_control_handler_data (guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
gpointer extra_data,
@@ -416,7 +416,7 @@ public:
}
void
remove_control_handler (guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module)
@@ -432,7 +432,7 @@ typedef struct
{
guint midi_channel;
gfloat values[BSE_MIDI_CONTROL_MODULE_N_CHANNELS];
- BseMidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS];
+ Bse::MidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS];
guint ref_count;
} MidiCModuleData;
@@ -451,7 +451,7 @@ midi_control_module_process_U (BseModule *module, /* vswitch->smodule */
static BseModule*
create_midi_control_module_L (MidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS])
+ Bse::MidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS])
{
static const BseModuleClass midi_cmodule_class = {
0, /* n_istreams */
@@ -483,7 +483,7 @@ create_midi_control_module_L (MidiReceiver *self,
}
typedef struct {
- BseMidiSignalType signal;
+ Bse::MidiSignalType signal;
gfloat value;
} MidiCModuleAccessData;
@@ -503,7 +503,7 @@ midi_control_module_access_U (BseModule *module,
static void
change_midi_control_modules_L (GSList *modules,
guint64 tick_stamp,
- BseMidiSignalType signal,
+ Bse::MidiSignalType signal,
gfloat value,
BseTrans *trans)
{
@@ -526,7 +526,7 @@ change_midi_control_modules_L (GSList *modules,
static gboolean
match_midi_control_module_L (BseModule *cmodule,
guint midi_channel,
- BseMidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS])
+ Bse::MidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS])
{
MidiCModuleData *cdata = (MidiCModuleData *) cmodule->user_data;
gboolean match = TRUE;
@@ -1352,7 +1352,7 @@ bse_midi_receiver_fetch_notify_events (BseMidiReceiver *self)
BseModule*
bse_midi_receiver_retrieve_control_module (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS],
+ Bse::MidiSignalType signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS],
BseTrans *trans)
{
BseModule *cmodule;
@@ -1411,7 +1411,7 @@ bse_midi_receiver_discard_control_module (BseMidiReceiver *self,
cdata->ref_count--;
if (!cdata->ref_count)
{
- BseMidiSignalType *signals = cdata->signals;
+ Bse::MidiSignalType *signals = cdata->signals;
guint midi_channel = cdata->midi_channel;
self->n_cmodules--;
self->cmodules[i] = self->cmodules[self->n_cmodules];
@@ -1435,7 +1435,7 @@ bse_midi_receiver_discard_control_module (BseMidiReceiver *self,
gboolean
bse_midi_receiver_add_control_handler (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module)
@@ -1454,7 +1454,7 @@ bse_midi_receiver_add_control_handler (BseMidiReceiver *self,
void
bse_midi_receiver_set_control_handler_data (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
gpointer extra_data,
@@ -1472,7 +1472,7 @@ bse_midi_receiver_set_control_handler_data (BseMidiReceiver *self,
void
bse_midi_receiver_remove_control_handler (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module)
@@ -1785,7 +1785,7 @@ static inline void
update_midi_signal_L (BseMidiReceiver *self,
guint channel,
guint64 tick_stamp,
- BseMidiSignalType signal,
+ Bse::MidiSignalType signal,
gfloat value,
BseTrans *trans)
{
@@ -1804,9 +1804,9 @@ static inline void
update_midi_signal_continuous_msb_L (BseMidiReceiver *self,
guint channel,
guint64 tick_stamp,
- BseMidiSignalType continuous_signal,
+ Bse::MidiSignalType continuous_signal,
gfloat value,
- BseMidiSignalType lsb_signal,
+ Bse::MidiSignalType lsb_signal,
BseTrans *trans)
{
gint ival;
@@ -1823,8 +1823,8 @@ static inline void
update_midi_signal_continuous_lsb_L (BseMidiReceiver *self,
guint channel,
guint64 tick_stamp,
- BseMidiSignalType continuous_signal,
- BseMidiSignalType msb_signal,
+ Bse::MidiSignalType continuous_signal,
+ Bse::MidiSignalType msb_signal,
gfloat value,
BseTrans *trans)
{
@@ -1854,24 +1854,24 @@ process_midi_control_L (BseMidiReceiver *self,
if (extra_continuous)
{
- /* internal BSE_MIDI_SIGNAL_CONTINUOUS_* change */
- update_midi_signal_L (self, channel, tick_stamp, static_cast<BseMidiSignalType> (64 + control), value,
trans);
+ /* internal Bse::MIDI_SIGNAL_CONTINUOUS_* change */
+ update_midi_signal_L (self, channel, tick_stamp, static_cast<Bse::MidiSignalType> (64 + control),
value, trans);
return;
}
- /* all MIDI controls are passed literally as BSE_MIDI_SIGNAL_CONTROL_* */
- update_midi_signal_L (self, channel, tick_stamp, static_cast<BseMidiSignalType> (128 + control), value,
trans);
+ /* all MIDI controls are passed literally as Bse::MIDI_SIGNAL_CONTROL_* */
+ update_midi_signal_L (self, channel, tick_stamp, static_cast<Bse::MidiSignalType> (128 + control), value,
trans);
if (control < 32) /* MSB part of continuous 14bit signal */
update_midi_signal_continuous_msb_L (self, channel, tick_stamp,
- static_cast<BseMidiSignalType> (control + 64), /* continuous
signal */
+ static_cast<Bse::MidiSignalType> (control + 64), /*
continuous signal */
value, /* MSB value
*/
- static_cast<BseMidiSignalType> (128 + control + 32), /* LSB signal
*/
+ static_cast<Bse::MidiSignalType> (128 + control + 32), /* LSB signal
*/
trans);
else if (control < 64) /* LSB part of continuous 14bit signal */
update_midi_signal_continuous_lsb_L (self, channel, tick_stamp,
- static_cast<BseMidiSignalType> (control + 32), /* continuous
signal */
- static_cast<BseMidiSignalType> (128 + control - 32), /* MSB signal
*/
+ static_cast<Bse::MidiSignalType> (control + 32), /*
continuous signal */
+ static_cast<Bse::MidiSignalType> (128 + control - 32), /* MSB signal
*/
value, /* LSB value
*/
trans);
else switch (control)
@@ -1884,29 +1884,29 @@ process_midi_control_L (BseMidiReceiver *self,
break;
case 98: /* Non-Registered Parameter MSB */
update_midi_signal_continuous_msb_L (self, channel, tick_stamp,
- BSE_MIDI_SIGNAL_NON_PARAMETER, /* continuous signal */
+ Bse::MIDI_SIGNAL_NON_PARAMETER, /* continuous signal */
value, /* MSB value */
- BSE_MIDI_SIGNAL_CONTROL_99, /* LSB signal */
+ Bse::MIDI_SIGNAL_CONTROL_99, /* LSB signal */
trans);
break;
case 99: /* Non-Registered Parameter LSB */
update_midi_signal_continuous_lsb_L (self, channel, tick_stamp,
- BSE_MIDI_SIGNAL_NON_PARAMETER, /* continuous signal */
- BSE_MIDI_SIGNAL_CONTROL_98, /* MSB signal */
+ Bse::MIDI_SIGNAL_NON_PARAMETER, /* continuous signal */
+ Bse::MIDI_SIGNAL_CONTROL_98, /* MSB signal */
value, /* LSB value */
trans);
break;
case 100: /* Registered Parameter MSB */
update_midi_signal_continuous_msb_L (self, channel, tick_stamp,
- BSE_MIDI_SIGNAL_PARAMETER, /* continuous signal */
+ Bse::MIDI_SIGNAL_PARAMETER, /* continuous signal */
value, /* MSB value */
- BSE_MIDI_SIGNAL_CONTROL_101, /* LSB signal */
+ Bse::MIDI_SIGNAL_CONTROL_101, /* LSB signal */
trans);
break;
case 101: /* Registered Parameter LSB */
update_midi_signal_continuous_lsb_L (self, channel, tick_stamp,
- BSE_MIDI_SIGNAL_PARAMETER, /* continuous signal */
- BSE_MIDI_SIGNAL_CONTROL_100, /* MSB signal */
+ Bse::MIDI_SIGNAL_PARAMETER, /* continuous signal */
+ Bse::MIDI_SIGNAL_CONTROL_100, /* MSB signal */
value, /* LSB value */
trans);
break;
@@ -1964,7 +1964,7 @@ midi_receiver_process_event_L (BseMidiReceiver *self,
{
gboolean sustained_note = event->status == BSE_MIDI_NOTE_OFF &&
(BSE_GCONFIG (invert_sustain) ^
- (self->get_control (event->channel, BSE_MIDI_SIGNAL_CONTROL_64) >=
0.5));
+ (self->get_control (event->channel, Bse::MIDI_SIGNAL_CONTROL_64) >=
0.5));
mchannel->adjust_note (event->delta_time,
event->data.note.frequency, event->status,
event->data.note.velocity, sustained_note, trans);
@@ -1990,21 +1990,21 @@ midi_receiver_process_event_L (BseMidiReceiver *self,
EDEBUG ("MidiChannel[%u]: Program %u (Value=%f) (stamp:%llu)", event->channel,
event->data.program, event->data.program / (gfloat) 0x7f, event->delta_time);
update_midi_signal_L (self, event->channel, event->delta_time,
- BSE_MIDI_SIGNAL_PROGRAM, event->data.program / (gfloat) 0x7f,
+ Bse::MIDI_SIGNAL_PROGRAM, event->data.program / (gfloat) 0x7f,
trans);
break;
case BSE_MIDI_CHANNEL_PRESSURE:
EDEBUG ("MidiChannel[%u]: Channel Pressure Value=%f (stamp:%llu)", event->channel,
event->data.intensity, event->delta_time);
update_midi_signal_L (self, event->channel, event->delta_time,
- BSE_MIDI_SIGNAL_PRESSURE, event->data.intensity,
+ Bse::MIDI_SIGNAL_PRESSURE, event->data.intensity,
trans);
break;
case BSE_MIDI_PITCH_BEND:
EDEBUG ("MidiChannel[%u]: Pitch Bend Value=%f (stamp:%llu)", event->channel,
event->data.pitch_bend, event->delta_time);
update_midi_signal_L (self, event->channel, event->delta_time,
- BSE_MIDI_SIGNAL_PITCH_BEND, event->data.pitch_bend,
+ Bse::MIDI_SIGNAL_PITCH_BEND, event->data.pitch_bend,
trans);
break;
default:
diff --git a/bse/bsemidireceiver.hh b/bse/bsemidireceiver.hh
index 915de2c..8cf7bcc 100644
--- a/bse/bsemidireceiver.hh
+++ b/bse/bsemidireceiver.hh
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
#define BSE_MIDI_VOICE_N_CHANNELS (3)
typedef void (*BseMidiControlHandler) (gpointer handler_data,
guint64 tick_stamp,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
gfloat control_value,
guint n_modules,
BseModule *const *modules,
@@ -29,27 +29,27 @@ void bse_midi_receiver_process_events (BseMidiReceiver *s
guint64 max_tick_stamp);
BseModule* bse_midi_receiver_retrieve_control_module (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType
signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS],
+ Bse::MidiSignalType
signals[BSE_MIDI_CONTROL_MODULE_N_CHANNELS],
BseTrans *trans);
void bse_midi_receiver_discard_control_module (BseMidiReceiver *self,
BseModule *cmodule,
BseTrans *trans);
gboolean bse_midi_receiver_add_control_handler (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module);
void bse_midi_receiver_set_control_handler_data(BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
gpointer extra_data,
BseFreeFunc extra_free); /* UserThread */
void bse_midi_receiver_remove_control_handler (BseMidiReceiver *self,
guint midi_channel,
- BseMidiSignalType signal_type,
+ Bse::MidiSignalType signal_type,
BseMidiControlHandler handler_func,
gpointer handler_data,
BseModule *module);
diff --git a/bse/bsepart.cc b/bse/bsepart.cc
index 4b559e4..b3b8558 100644
--- a/bse/bsepart.cc
+++ b/bse/bsepart.cc
@@ -535,7 +535,7 @@ void
bse_part_select_controls (BsePart *self,
guint tick,
guint duration,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gboolean selected)
{
g_return_if_fail (BSE_IS_PART (self));
@@ -619,7 +619,7 @@ void
bse_part_select_controls_exclusive (BsePart *self,
guint tick,
guint duration,
- BseMidiSignalType ctype)
+ Bse::MidiSignalType ctype)
{
BsePartTickNode *node, *bound;
@@ -816,15 +816,15 @@ bse_part_insert_note (BsePart *self,
}
static gboolean
-check_valid_control_type (BseMidiSignalType ctype)
+check_valid_control_type (Bse::MidiSignalType ctype)
{
- if (ctype >= BSE_MIDI_SIGNAL_PROGRAM && ctype <= BSE_MIDI_SIGNAL_FINE_TUNE)
+ if (ctype >= Bse::MIDI_SIGNAL_PROGRAM && ctype <= Bse::MIDI_SIGNAL_FINE_TUNE)
return TRUE;
- if (ctype >= BSE_MIDI_SIGNAL_CONTINUOUS_0 && ctype <= BSE_MIDI_SIGNAL_CONTINUOUS_31)
+ if (ctype >= Bse::MIDI_SIGNAL_CONTINUOUS_0 && ctype <= Bse::MIDI_SIGNAL_CONTINUOUS_31)
return TRUE;
- if (ctype >= BSE_MIDI_SIGNAL_PARAMETER && ctype <= BSE_MIDI_SIGNAL_NON_PARAMETER)
+ if (ctype >= Bse::MIDI_SIGNAL_PARAMETER && ctype <= Bse::MIDI_SIGNAL_NON_PARAMETER)
return TRUE;
- if (ctype >= BSE_MIDI_SIGNAL_CONTROL_0 && ctype <= BSE_MIDI_SIGNAL_CONTROL_127)
+ if (ctype >= Bse::MIDI_SIGNAL_CONTROL_0 && ctype <= Bse::MIDI_SIGNAL_CONTROL_127)
return TRUE;
return FALSE;
}
@@ -832,7 +832,7 @@ check_valid_control_type (BseMidiSignalType ctype)
guint
bse_part_insert_control (BsePart *self,
guint tick,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gfloat value)
{
BsePartTickNode *node;
@@ -957,7 +957,7 @@ gboolean
bse_part_change_control (BsePart *self,
guint id,
guint tick,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gfloat value)
{
guint old_tick;
@@ -1021,10 +1021,10 @@ bse_part_change_control (BsePart *self,
gfloat velocity = note->velocity;
switch (ctype)
{
- case BSE_MIDI_SIGNAL_VELOCITY:
+ case Bse::MIDI_SIGNAL_VELOCITY:
velocity = CLAMP (value, 0, +1);
break;
- case BSE_MIDI_SIGNAL_FINE_TUNE:
+ case Bse::MIDI_SIGNAL_FINE_TUNE:
fine_tune = bse_ftoi (value * BSE_MAX_FINE_TUNE);
fine_tune = CLAMP (fine_tune, BSE_MIN_FINE_TUNE, BSE_MAX_FINE_TUNE);
break;
@@ -1040,13 +1040,13 @@ bse_part_change_control (BsePart *self,
static inline gfloat
note_get_control_value (BsePartEventNote *note,
- BseMidiSignalType ctype)
+ Bse::MidiSignalType ctype)
{
switch (ctype)
{
- case BSE_MIDI_SIGNAL_VELOCITY:
+ case Bse::MIDI_SIGNAL_VELOCITY:
return note->velocity;
- case BSE_MIDI_SIGNAL_FINE_TUNE:
+ case Bse::MIDI_SIGNAL_FINE_TUNE:
return note->fine_tune * (1.0 / BSE_MAX_FINE_TUNE);
default:
return 0;
@@ -1085,7 +1085,7 @@ bse_part_query_event (BsePart *self,
equery->velocity = 0;
equery->fine_tune_value = 0;
equery->velocity_value = 0;
- equery->control_type = BseMidiSignalType (cev->ctype);
+ equery->control_type = Bse::MidiSignalType (cev->ctype);
equery->control_value = cev->value;
}
return BSE_PART_EVENT_CONTROL;
@@ -1111,9 +1111,9 @@ bse_part_query_event (BsePart *self,
equery->note = note->note;
equery->fine_tune = note->fine_tune;
equery->velocity = note->velocity;
- equery->fine_tune_value = note_get_control_value (note, BSE_MIDI_SIGNAL_FINE_TUNE);
- equery->velocity_value = note_get_control_value (note, BSE_MIDI_SIGNAL_VELOCITY);
- equery->control_type = BseMidiSignalType (0);
+ equery->fine_tune_value = note_get_control_value (note, Bse::MIDI_SIGNAL_FINE_TUNE);
+ equery->velocity_value = note_get_control_value (note, Bse::MIDI_SIGNAL_VELOCITY);
+ equery->control_type = Bse::MidiSignalType (0);
equery->control_value = 0;
}
return BSE_PART_EVENT_NOTE;
@@ -1139,16 +1139,10 @@ part_note_seq_append (BsePartNoteSeq *pseq,
}
static void
-part_control_seq_append_note (BsePartControlSeq *cseq,
- BsePartEventNote *note,
- BseMidiSignalType ctype)
+part_control_seq_append_note (Bse::PartControlSeq &cseq, BsePartEventNote *note, Bse::MidiSignalType ctype)
{
- BsePartControl *ctrl = bse_part_control (note->id,
- note->tick,
- ctype,
- note_get_control_value (note, ctype),
- note->selected);
- bse_part_control_seq_take_append (cseq, ctrl);
+ Bse::PartControl pctrl = bse_part_control (note->id, note->tick, ctype, note_get_control_value (note,
ctype), note->selected);
+ cseq.push_back (pctrl);
}
BsePartNoteSeq*
@@ -1212,20 +1206,19 @@ bse_part_list_notes (BsePart *self,
return pseq;
}
-BsePartControlSeq*
+Bse::PartControlSeq
bse_part_list_controls (BsePart *self,
guint match_channel, /* for note events */
guint tick,
guint duration,
- BseMidiSignalType ctype)
+ Bse::MidiSignalType ctype)
{
- BsePartControlSeq *cseq;
+ Bse::PartControlSeq cseq;
- g_return_val_if_fail (BSE_IS_PART (self), NULL);
- g_return_val_if_fail (tick < BSE_PART_MAX_TICK, NULL);
- g_return_val_if_fail (duration > 0 && duration <= BSE_PART_MAX_TICK, NULL);
+ g_return_val_if_fail (BSE_IS_PART (self), cseq);
+ g_return_val_if_fail (tick < BSE_PART_MAX_TICK, cseq);
+ g_return_val_if_fail (duration > 0 && duration <= BSE_PART_MAX_TICK, cseq);
- cseq = bse_part_control_seq_new ();
if (BSE_PART_NOTE_CONTROL (ctype))
{
guint channel;
@@ -1255,12 +1248,7 @@ bse_part_list_controls (BsePart *self,
BsePartEventControl *cev;
for (cev = node->events; cev; cev = cev->next)
if (cev->ctype == ctype)
- bse_part_control_seq_take_append (cseq,
- bse_part_control (cev->id,
- node->tick,
- BseMidiSignalType (cev->ctype),
- cev->value,
- cev->selected));
+ cseq.push_back (bse_part_control (cev->id, node->tick, Bse::MidiSignalType (cev->ctype),
cev->value, cev->selected));
node++;
}
}
@@ -1330,14 +1318,12 @@ bse_part_list_selected_notes (BsePart *self)
return pseq;
}
-BsePartControlSeq*
-bse_part_list_selected_controls (BsePart *self,
- BseMidiSignalType ctype)
+Bse::PartControlSeq
+bse_part_list_selected_controls (BsePart *self, Bse::MidiSignalType ctype)
{
- BsePartControlSeq *cseq;
- g_return_val_if_fail (BSE_IS_PART (self), NULL);
+ Bse::PartControlSeq cseq;
+ g_return_val_if_fail (BSE_IS_PART (self), cseq);
- cseq = bse_part_control_seq_new ();
if (BSE_PART_NOTE_CONTROL (ctype))
{
guint channel;
@@ -1362,12 +1348,7 @@ bse_part_list_selected_controls (BsePart *self,
BsePartEventControl *cev;
for (cev = node->events; cev; cev = cev->next)
if (cev->ctype == ctype && cev->selected)
- bse_part_control_seq_take_append (cseq,
- bse_part_control (cev->id,
- node->tick,
- BseMidiSignalType (cev->ctype),
- cev->value,
- cev->selected));
+ cseq.push_back (bse_part_control (cev->id, node->tick, Bse::MidiSignalType (cev->ctype),
cev->value, cev->selected));
node++;
}
}
@@ -1555,7 +1536,7 @@ bse_part_restore_private (BseObject *object,
parse_or_return (scanner, ')');
if (error)
bse_storage_warn (storage, "unknown control event: %s", error->message);
- else if (!bse_part_insert_control (self, tick, BseMidiSignalType (ctype), CLAMP (value, -1, +1)))
+ else if (!bse_part_insert_control (self, tick, Bse::MidiSignalType (ctype), CLAMP (value, -1, +1)))
bse_storage_warn (storage, "failed to insert control event of type: %d", ctype);
g_clear_error (&error);
}
@@ -1625,7 +1606,7 @@ bse_part_restore_private (BseObject *object,
return G_TOKEN_FLOAT;
parse_or_return (scanner, ')');
- if (!bse_part_insert_control (self, tick, BseMidiSignalType (ctype), CLAMP (value, -1, +1)))
+ if (!bse_part_insert_control (self, tick, Bse::MidiSignalType (ctype), CLAMP (value, -1, +1)))
bse_storage_warn (storage, "skipping control event of invalid type: %d", ctype);
return G_TOKEN_NONE;
}
@@ -2117,7 +2098,32 @@ PartImpl::PartImpl (BseObject *bobj) :
PartImpl::~PartImpl ()
{}
-// BsePart *self = as<BsePart*>();
-// shared_ptr_cast<PartIface> (opart->as<PartIface*>());
+PartControlSeq
+PartImpl::list_controls (int tick, int duration, MidiSignalType control_type)
+{
+ BsePart *self = as<BsePart*>();
+ return bse_part_list_controls (self, ~uint (0), tick, duration, control_type);
+}
+
+PartControlSeq
+PartImpl::list_selected_controls (MidiSignalType control_type)
+{
+ BsePart *self = as<BsePart*>();
+ return bse_part_list_selected_controls (self, control_type);
+}
+
+PartControlSeq
+PartImpl::get_controls (int tick, MidiSignalType control_type)
+{
+ BsePart *self = as<BsePart*>();
+ return bse_part_list_controls (self, ~uint (0), tick, 1, control_type);
+}
+
+PartControlSeq
+PartImpl::get_channel_controls (int channel, int tick, int duration, MidiSignalType control_type)
+{
+ BsePart *self = as<BsePart*>();
+ return bse_part_list_controls (self, channel, tick, duration, control_type);
+}
} // Bse
diff --git a/bse/bsepart.hh b/bse/bsepart.hh
index e79f48e..f418022 100644
--- a/bse/bsepart.hh
+++ b/bse/bsepart.hh
@@ -77,7 +77,7 @@ guint bse_part_insert_note (BsePart *self,
gfloat velocity);
guint bse_part_insert_control (BsePart *self,
guint tick,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gfloat value);
gboolean bse_part_change_note (BsePart *self,
guint id,
@@ -90,7 +90,7 @@ gboolean bse_part_change_note (BsePart *self,
gboolean bse_part_change_control (BsePart *self,
guint id,
guint tick,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gfloat value);
BsePartNoteSeq* bse_part_list_notes (BsePart *self,
guint channel,
@@ -99,11 +99,11 @@ BsePartNoteSeq* bse_part_list_notes (BsePart *self,
gint min_note,
gint max_note,
gboolean include_crossings);
-BsePartControlSeq* bse_part_list_controls (BsePart *self,
+Bse::PartControlSeq bse_part_list_controls (BsePart *self,
guint channel, /* for note events */
guint tick,
guint duration,
- BseMidiSignalType ctype);
+ Bse::MidiSignalType ctype);
void bse_part_queue_notes_within (BsePart *self,
guint tick,
guint duration,
@@ -111,8 +111,7 @@ void bse_part_queue_notes_within (BsePart *self,
gint max_note);
#define bse_part_queue_controls(p,t,d) bse_part_queue_notes_within (p, t, d,
BSE_MIN_NOTE, BSE_MAX_NOTE)
BsePartNoteSeq* bse_part_list_selected_notes (BsePart *self);
-BsePartControlSeq* bse_part_list_selected_controls (BsePart *self,
- BseMidiSignalType ctype);
+Bse::PartControlSeq bse_part_list_selected_controls (BsePart *self, Bse::MidiSignalType ctype);
void bse_part_select_notes (BsePart *self,
guint channel,
guint tick,
@@ -123,7 +122,7 @@ void bse_part_select_notes (BsePart *self,
void bse_part_select_controls (BsePart *self,
guint tick,
guint duration,
- BseMidiSignalType ctype,
+ Bse::MidiSignalType ctype,
gboolean selected);
void bse_part_select_notes_exclusive (BsePart *self,
guint channel,
@@ -134,7 +133,7 @@ void bse_part_select_notes_exclusive (BsePart *self,
void bse_part_select_controls_exclusive (BsePart *self,
guint tick,
guint duration,
- BseMidiSignalType ctype);
+ Bse::MidiSignalType ctype);
gboolean bse_part_set_note_selected (BsePart *self,
guint id,
guint channel,
@@ -157,7 +156,7 @@ struct BsePartQueryEvent {
gfloat fine_tune_value;
gfloat velocity_value;
/* control */
- BseMidiSignalType control_type;
+ Bse::MidiSignalType control_type;
gfloat control_value;
};
@@ -170,8 +169,8 @@ BsePartEventType bse_part_query_event (BsePart *self,
#define BSE_PART_MAX_CHANNELS (0x1024)
#define BSE_PART_MAX_TICK (0x7fffffff)
#define BSE_PART_INVAL_TICK_FLAG (0x80000000)
-#define BSE_PART_NOTE_CONTROL(ctype) ((ctype) == BSE_MIDI_SIGNAL_VELOCITY || \
- (ctype) == BSE_MIDI_SIGNAL_FINE_TUNE)
+#define BSE_PART_NOTE_CONTROL(ctype) ((ctype) == Bse::MIDI_SIGNAL_VELOCITY || \
+ (ctype) == Bse::MIDI_SIGNAL_FINE_TUNE)
/* --- BsePartControlChannel --- */
struct BsePartEventControl;
@@ -183,7 +182,7 @@ struct BsePartEventControl {
BsePartEventControl *next;
guint id : 31;
guint selected : 1;
- guint ctype; /* BseMidiSignalType */
+ guint ctype; /* Bse::MidiSignalType */
gfloat value; /* -1 .. 1 */
};
@@ -274,6 +273,10 @@ protected:
virtual ~PartImpl ();
public:
explicit PartImpl (BseObject*);
+ virtual PartControlSeq list_selected_controls (MidiSignalType control_type) override;
+ virtual PartControlSeq list_controls (int tick, int duration, MidiSignalType control_type)
override;
+ virtual PartControlSeq get_channel_controls (int channel, int tick, int duration, MidiSignalType
control_type) override;
+ virtual PartControlSeq get_controls (int tick, MidiSignalType control_type) override;
};
} // Bse
diff --git a/bse/bsepart.proc b/bse/bsepart.proc
index 6dc1287..da1801c 100644
--- a/bse/bsepart.proc
+++ b/bse/bsepart.proc
@@ -116,7 +116,7 @@ METHOD (BsePart, insert-control) {
IN = sfi_pspec_int ("tick", "Start Tick", NULL,
0, 0, BSE_PART_MAX_TICK - 1, 384, SFI_PARAM_STANDARD);
IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
+ BSE_TYPE_MIDI_SIGNAL_TYPE, Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD);
IN = sfi_pspec_real ("value", "Value", NULL,
0.0, -1.0, +1.0, 0.1,
@@ -142,7 +142,7 @@ BODY (BseProcedureClass *proc,
/* action */
ustack = bse_item_undo_open (self, "insert-event");
- id = bse_part_insert_control (self, tick, BseMidiSignalType (ctype), value);
+ id = bse_part_insert_control (self, tick, Bse::MidiSignalType (ctype), value);
if (id)
bse_item_push_undo_proc (self, "delete-event", id);
bse_item_undo_close (ustack);
@@ -225,7 +225,7 @@ METHOD (BsePart, change-control) {
IN = sfi_pspec_int ("tick", "Start Tick", NULL,
0, 0, BSE_PART_MAX_TICK - 1, 384, SFI_PARAM_STANDARD);
IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
+ BSE_TYPE_MIDI_SIGNAL_TYPE, Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD);
IN = sfi_pspec_real ("value", "Value", NULL,
0.0, -1.0, +1.0, 0.1,
@@ -258,7 +258,7 @@ BODY (BseProcedureClass *proc,
BseUndoStack *ustack = bse_item_undo_open (self, "change-control");
if (equery.tick != tick || equery.control_type != ctype || equery.control_value != value)
{
- success = bse_part_change_control (self, id, tick, BseMidiSignalType (ctype), value);
+ success = bse_part_change_control (self, id, tick, Bse::MidiSignalType (ctype), value);
if (success)
bse_item_push_undo_proc (self, "change-control", id, equery.tick, equery.control_type,
equery.control_value);
}
@@ -270,16 +270,16 @@ BODY (BseProcedureClass *proc,
{
BseUndoStack *ustack = bse_item_undo_open (self, "change-control");
BsePartQueryEvent xquery;
- success = bse_part_change_control (self, id, tick, BseMidiSignalType (ctype), value);
+ success = bse_part_change_control (self, id, tick, Bse::MidiSignalType (ctype), value);
if (success && bse_part_query_event (self, id, &xquery) == BSE_PART_EVENT_NOTE &&
(equery.fine_tune_value != xquery.fine_tune_value ||
equery.velocity_value != xquery.velocity_value))
switch (ctype)
{
- case BSE_MIDI_SIGNAL_VELOCITY:
+ case Bse::MIDI_SIGNAL_VELOCITY:
bse_item_push_undo_proc (self, "change-control", id, equery.tick, ctype, equery.velocity_value);
break;
- case BSE_MIDI_SIGNAL_FINE_TUNE:
+ case Bse::MIDI_SIGNAL_FINE_TUNE:
bse_item_push_undo_proc (self, "change-control", id, equery.tick, ctype, equery.fine_tune_value);
break;
default: ;
@@ -439,39 +439,6 @@ BODY (BseProcedureClass *proc,
return Bse::ERROR_NONE;
}
-METHOD (BsePart, list-controls) {
- HELP = "List all control events within a tick range.";
- IN = bse_param_spec_object ("part", "Part", NULL,
- BSE_TYPE_PART, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("tick", "Start Tick", NULL,
- 0, 0, BSE_PART_MAX_TICK - 1, 384, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("duration", "Tick Duration", NULL,
- 1, 1, BSE_PART_MAX_TICK, 384, SFI_PARAM_STANDARD);
- IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
- SFI_PARAM_STANDARD);
- OUT = bse_param_spec_boxed ("control_list", "Control List", NULL,
- BSE_TYPE_PART_CONTROL_SEQ, SFI_PARAM_STANDARD);
-}
-BODY (BseProcedureClass *proc,
- const GValue *in_values,
- GValue *out_values)
-{
- /* extract parameter values */
- BsePart *self = (BsePart*) bse_value_get_object (in_values++);
- guint tick = sfi_value_get_int (in_values++);
- guint duration = sfi_value_get_int (in_values++);
- guint ctype = g_value_get_enum (in_values++);
-
- /* check parameters */
- if (!BSE_IS_PART (self))
- return Bse::ERROR_PROC_PARAM_INVAL;
-
- /* action */
- bse_value_take_boxed (out_values++, bse_part_list_controls (self, ~0, tick, duration, BseMidiSignalType
(ctype)));
-
- return Bse::ERROR_NONE;
-}
METHOD (BsePart, queue-notes) {
HELP = "Queue updates for all notes starting within the given rectangle.";
@@ -559,33 +526,6 @@ BODY (BseProcedureClass *proc,
return Bse::ERROR_NONE;
}
-METHOD (BsePart, list-selected-controls) {
- HELP = "List all currently selected control events of a specific type.";
- IN = bse_param_spec_object ("part", "Part", NULL,
- BSE_TYPE_PART, SFI_PARAM_STANDARD);
- IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
- SFI_PARAM_STANDARD);
- OUT = bse_param_spec_boxed ("control_list", "Control List", NULL,
- BSE_TYPE_PART_CONTROL_SEQ, SFI_PARAM_STANDARD);
-}
-BODY (BseProcedureClass *proc,
- const GValue *in_values,
- GValue *out_values)
-{
- /* extract parameter values */
- BsePart *self = (BsePart*) bse_value_get_object (in_values++);
- guint ctype = g_value_get_enum (in_values++);
-
- /* check parameters */
- if (!BSE_IS_PART (self))
- return Bse::ERROR_PROC_PARAM_INVAL;
-
- /* action */
- bse_value_take_boxed (out_values++, bse_part_list_selected_controls (self, BseMidiSignalType (ctype)));
-
- return Bse::ERROR_NONE;
-}
METHOD (BsePart, check-overlap) {
HELP = "Check whether a note would overlap with neighbours.";
@@ -649,74 +589,6 @@ BODY (BseProcedureClass *proc,
return Bse::ERROR_NONE;
}
-METHOD (BsePart, get-controls) {
- HELP = "Retrieve all control events of a specific type at specified tick.";
- IN = bse_param_spec_object ("part", "Part", NULL,
- BSE_TYPE_PART, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("tick", "Tick", NULL,
- 0, 0, BSE_PART_MAX_TICK - 1, 384, SFI_PARAM_STANDARD);
- IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
- SFI_PARAM_STANDARD);
- OUT = bse_param_spec_boxed ("control_list", "Control List", NULL,
- BSE_TYPE_PART_CONTROL_SEQ, SFI_PARAM_STANDARD);
-}
-BODY (BseProcedureClass *proc,
- const GValue *in_values,
- GValue *out_values)
-{
- /* extract parameter values */
- BsePart *self = (BsePart*) bse_value_get_object (in_values++);
- guint tick = sfi_value_get_int (in_values++);
- guint ctype = g_value_get_enum (in_values++);
-
- /* check parameters */
- if (!BSE_IS_PART (self))
- return Bse::ERROR_PROC_PARAM_INVAL;
-
- /* action */
- bse_value_take_boxed (out_values++, bse_part_list_controls (self, ~0, tick, 1, BseMidiSignalType (ctype)));
-
- return Bse::ERROR_NONE;
-}
-
-METHOD (BsePart, get-channel-controls) {
- HELP = "Retrieve all control events of a specific type within range of a channel.";
- IN = bse_param_spec_object ("part", "Part", NULL,
- BSE_TYPE_PART, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("channel", "Channel", NULL,
- 0, 0, BSE_PART_MAX_CHANNELS, 4, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("tick", "Tick", NULL,
- 0, 0, BSE_PART_MAX_TICK - 1, 384, SFI_PARAM_STANDARD);
- IN = sfi_pspec_int ("duration", "Tick Duration", NULL,
- 1, 1, BSE_PART_MAX_TICK, 384, SFI_PARAM_STANDARD);
- IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
- SFI_PARAM_STANDARD);
- OUT = bse_param_spec_boxed ("control_list", "Control List", NULL,
- BSE_TYPE_PART_CONTROL_SEQ, SFI_PARAM_STANDARD);
-}
-BODY (BseProcedureClass *proc,
- const GValue *in_values,
- GValue *out_values)
-{
- /* extract parameter values */
- BsePart *self = (BsePart*) bse_value_get_object (in_values++);
- guint channel = sfi_value_get_int (in_values++);
- guint tick = sfi_value_get_int (in_values++);
- guint duration = sfi_value_get_int (in_values++);
- guint ctype = g_value_get_enum (in_values++);
-
- /* check parameters */
- if (!BSE_IS_PART (self))
- return Bse::ERROR_PROC_PARAM_INVAL;
-
- /* action */
- bse_value_take_boxed (out_values++, bse_part_list_controls (self, channel, tick, duration,
BseMidiSignalType (ctype)));
-
- return Bse::ERROR_NONE;
-}
-
METHOD (BsePart, get-min-note) {
HELP = "Retrieve the minimum note supported in this part.";
IN = bse_param_spec_object ("part", "Part", NULL,
@@ -807,7 +679,7 @@ METHOD (BsePart, select-controls-exclusive) {
IN = sfi_pspec_int ("duration", "Duration", "Selection Duration",
0, 0, BSE_PART_MAX_TICK, 384, SFI_PARAM_STANDARD);
IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
+ BSE_TYPE_MIDI_SIGNAL_TYPE, Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD);
}
BODY (BseProcedureClass *proc,
@@ -824,7 +696,7 @@ BODY (BseProcedureClass *proc,
if (!BSE_IS_PART (self))
return Bse::ERROR_PROC_PARAM_INVAL;
- bse_part_select_controls_exclusive (self, tick, duration, BseMidiSignalType (ctype));
+ bse_part_select_controls_exclusive (self, tick, duration, Bse::MidiSignalType (ctype));
return Bse::ERROR_NONE;
}
@@ -838,7 +710,7 @@ METHOD (BsePart, select-controls) {
IN = sfi_pspec_int ("duration", "Duration", "Selection Duration",
0, 0, BSE_PART_MAX_TICK, 384, SFI_PARAM_STANDARD);
IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
+ BSE_TYPE_MIDI_SIGNAL_TYPE, Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD);
}
BODY (BseProcedureClass *proc,
@@ -855,7 +727,7 @@ BODY (BseProcedureClass *proc,
if (!BSE_IS_PART (self))
return Bse::ERROR_PROC_PARAM_INVAL;
- bse_part_select_controls (self, tick, duration, BseMidiSignalType (ctype), TRUE);
+ bse_part_select_controls (self, tick, duration, Bse::MidiSignalType (ctype), TRUE);
return Bse::ERROR_NONE;
}
@@ -935,7 +807,7 @@ METHOD (BsePart, deselect-controls) {
IN = sfi_pspec_int ("duration", "Duration", "Selection Duration",
0, 0, BSE_PART_MAX_TICK, 384, SFI_PARAM_STANDARD);
IN = bse_param_spec_genum ("control_type", "Control Type", NULL,
- BSE_TYPE_MIDI_SIGNAL_TYPE, BSE_MIDI_SIGNAL_PITCH_BEND,
+ BSE_TYPE_MIDI_SIGNAL_TYPE, Bse::MIDI_SIGNAL_PITCH_BEND,
SFI_PARAM_STANDARD);
}
BODY (BseProcedureClass *proc,
@@ -952,7 +824,7 @@ BODY (BseProcedureClass *proc,
if (!BSE_IS_PART (self))
return Bse::ERROR_PROC_PARAM_INVAL;
- bse_part_select_controls (self, tick, duration, BseMidiSignalType (ctype), FALSE);
+ bse_part_select_controls (self, tick, duration, Bse::MidiSignalType (ctype), FALSE);
return Bse::ERROR_NONE;
}
diff --git a/bse/bsesequencer.cc b/bse/bsesequencer.cc
index 5144049..d297586 100644
--- a/bse/bsesequencer.cc
+++ b/bse/bsesequencer.cc
@@ -519,7 +519,7 @@ Sequencer::process_part_SL (BsePart *part, double start_stamp, uint start_tick,
{
BseMidiEvent *event = bse_midi_event_signal (midi_channel,
bse_dtoull (start_stamp + (node->tick - start_tick) *
stamps_per_tick),
- BseMidiSignalType (cev->ctype), cev->value);
+ Bse::MidiSignalType (cev->ctype), cev->value);
bse_midi_receiver_push_event (midi_receiver, event);
SDEBUG ("control: tick=%llu midisignal=%-3d value=%f now=%llu",
uint64 (event->delta_time), cev->ctype, cev->value, Bse::TickStamp::current());
diff --git a/bse/bsesource.cc b/bse/bsesource.cc
index 73abca6..b6dc206 100644
--- a/bse/bsesource.cc
+++ b/bse/bsesource.cc
@@ -467,13 +467,13 @@ Bse::ErrorType
bse_source_set_automation_property (BseSource *source,
const gchar *prop_name,
guint midi_channel,
- BseMidiSignalType signal_type)
+ Bse::MidiSignalType signal_type)
{
g_assert (BSE_MIDI_CONTROL_NONE == BseMidiControlType (0) &&
- BSE_MIDI_CONTROL_CONTINUOUS_0 == BseMidiControlType (BSE_MIDI_SIGNAL_CONTINUOUS_0) &&
- BSE_MIDI_CONTROL_CONTINUOUS_31 == BseMidiControlType (BSE_MIDI_SIGNAL_CONTINUOUS_31) &&
- BSE_MIDI_CONTROL_0 == BseMidiControlType (BSE_MIDI_SIGNAL_CONTROL_0) &&
- BSE_MIDI_CONTROL_127 == BseMidiControlType (BSE_MIDI_SIGNAL_CONTROL_127));
+ BSE_MIDI_CONTROL_CONTINUOUS_0 == BseMidiControlType (Bse::MIDI_SIGNAL_CONTINUOUS_0) &&
+ BSE_MIDI_CONTROL_CONTINUOUS_31 == BseMidiControlType (Bse::MIDI_SIGNAL_CONTINUOUS_31) &&
+ BSE_MIDI_CONTROL_0 == BseMidiControlType (Bse::MIDI_SIGNAL_CONTROL_0) &&
+ BSE_MIDI_CONTROL_127 == BseMidiControlType (Bse::MIDI_SIGNAL_CONTROL_127));
g_return_val_if_fail (BSE_IS_SOURCE (source), Bse::ERROR_INTERNAL);
g_return_val_if_fail (prop_name != NULL, Bse::ERROR_INTERNAL);
if (BSE_SOURCE_PREPARED (source))
@@ -495,7 +495,7 @@ bse_source_set_automation_property (BseSource *source,
if (!ap)
{
key.midi_channel = 0;
- key.signal_type = BseMidiSignalType (0);
+ key.signal_type = Bse::MidiSignalType (0);
aparray = g_bsearch_array_insert (aparray, &aprop_bconfig, &key);
ap = (BseAutomationProperty*) g_bsearch_array_lookup (aparray, &aprop_bconfig, &key);
}
@@ -518,7 +518,7 @@ void
bse_source_get_automation_property (BseSource *source,
const gchar *prop_name,
guint *pmidi_channel,
- BseMidiSignalType *psignal_type)
+ Bse::MidiSignalType *psignal_type)
{
g_return_if_fail (BSE_IS_SOURCE (source));
g_return_if_fail (prop_name != NULL);
diff --git a/bse/bsesource.hh b/bse/bsesource.hh
index 8e5c4b9..37559c6 100644
--- a/bse/bsesource.hh
+++ b/bse/bsesource.hh
@@ -221,16 +221,16 @@ BseMusicalTuningType bse_source_prepared_musical_tuning (BseSource *source);
typedef struct {
GParamSpec *pspec;
guint midi_channel;
- BseMidiSignalType signal_type;
+ Bse::MidiSignalType signal_type;
} BseAutomationProperty;
Bse::ErrorType bse_source_set_automation_property (BseSource *source,
const gchar *prop_name,
guint midi_channel,
- BseMidiSignalType signal_type);
+ Bse::MidiSignalType signal_type);
void bse_source_get_automation_property (BseSource *source,
const gchar *prop_name,
guint *pmidi_channel,
- BseMidiSignalType *psignal_type);
+ Bse::MidiSignalType *psignal_type);
BseAutomationProperty* bse_source_get_automation_properties (BseSource *source,
guint *n_props);
diff --git a/bse/bsesource.proc b/bse/bsesource.proc
index cca681d..6be7818 100644
--- a/bse/bsesource.proc
+++ b/bse/bsesource.proc
@@ -694,7 +694,7 @@ BODY (BseProcedureClass *proc,
BseSource *source = (BseSource*) bse_value_get_object (in_values++);
const char *property = sfi_value_get_string (in_values++);
guint midi_channel = sfi_value_get_int (in_values++);
- BseMidiSignalType control_type = (BseMidiSignalType) g_value_get_enum (in_values++);
+ Bse::MidiSignalType control_type = (Bse::MidiSignalType) g_value_get_enum (in_values++);
Bse::ErrorType error = Bse::ERROR_NONE;
/* check parameters */
@@ -703,7 +703,7 @@ BODY (BseProcedureClass *proc,
/* connect */
guint old_midi_channel = 0;
- BseMidiSignalType old_control_type = BseMidiSignalType (0);
+ Bse::MidiSignalType old_control_type = Bse::MidiSignalType (0);
bse_source_get_automation_property (source, property, &old_midi_channel, &old_control_type);
if (old_midi_channel != midi_channel || old_control_type != control_type)
{
@@ -768,7 +768,7 @@ BODY (BseProcedureClass *proc,
return Bse::ERROR_PROC_PARAM_INVAL;
/* connect */
- BseMidiSignalType control_type = BseMidiSignalType (0);
+ Bse::MidiSignalType control_type = Bse::MidiSignalType (0);
bse_source_get_automation_property (source, property, NULL, &control_type);
/* set output parameters */
g_value_set_enum (out_values++, control_type);
diff --git a/bse/bsestorage.cc b/bse/bsestorage.cc
index 8a31b83..d6f759c 100644
--- a/bse/bsestorage.cc
+++ b/bse/bsestorage.cc
@@ -689,7 +689,7 @@ restore_source_automation (BseItem *item,
BseMidiControlType control_type = (BseMidiControlType) sfi_choice2enum (scanner->value.v_identifier,
BSE_TYPE_MIDI_CONTROL_TYPE);
/* close statement */
parse_or_return (scanner, ')');
- Bse::ErrorType error = bse_source_set_automation_property (BSE_SOURCE (item), pspec->name, midi_channel,
BseMidiSignalType (control_type));
+ Bse::ErrorType error = bse_source_set_automation_property (BSE_SOURCE (item), pspec->name, midi_channel,
Bse::MidiSignalType (control_type));
if (error)
bse_storage_warn (self, "failed to automate property \"%s\": %s", pspec->name, bse_error_blurb (error));
return G_TOKEN_NONE;
@@ -1040,7 +1040,7 @@ bse_source_store_automation (BseSource *source,
GParamSpec *pspec)
{
guint midi_channel = 0;
- BseMidiSignalType signal_type = BseMidiSignalType (0);
+ Bse::MidiSignalType signal_type = Bse::MidiSignalType (0);
bse_source_get_automation_property (source, pspec->name, &midi_channel, &signal_type);
BseMidiControlType control_type = BseMidiControlType (signal_type);
if (control_type)
diff --git a/bse/bseutils.cc b/bse/bseutils.cc
index f96cf03..c980e82 100644
--- a/bse/bseutils.cc
+++ b/bse/bseutils.cc
@@ -85,36 +85,19 @@ bse_part_note_seq_take_append (BsePartNoteSeq *seq,
bse_part_note_free (element);
}
-BsePartControl*
-bse_part_control (guint id,
- guint tick,
- BseMidiSignalType ctype,
- gfloat value,
- gboolean selected)
-{
- BsePartControl *pctrl = bse_part_control_new ();
-
- pctrl->id = id;
- pctrl->tick = tick;
- pctrl->control_type = ctype;
- pctrl->value = value;
- pctrl->selected = selected != FALSE;
-
+Bse::PartControl
+bse_part_control (uint id, uint tick, Bse::MidiSignalType ctype, double value, bool selected)
+{
+ Bse::PartControl pctrl;
+ pctrl.id = id;
+ pctrl.tick = tick;
+ pctrl.control_type = ctype;
+ pctrl.value = value;
+ pctrl.selected = selected != false;
return pctrl;
}
void
-bse_part_control_seq_take_append (BsePartControlSeq *seq,
- BsePartControl *element)
-{
- g_return_if_fail (seq != NULL);
- g_return_if_fail (element != NULL);
-
- bse_part_control_seq_append (seq, element);
- bse_part_control_free (element);
-}
-
-void
bse_note_sequence_resize (BseNoteSequence *rec,
guint length)
{
diff --git a/bse/bseutils.hh b/bse/bseutils.hh
index f2e0572..4118248 100644
--- a/bse/bseutils.hh
+++ b/bse/bseutils.hh
@@ -26,13 +26,7 @@ BsePartNote* bse_part_note (guint id,
gboolean selected);
void bse_part_note_seq_take_append (BsePartNoteSeq *seq,
BsePartNote *element);
-BsePartControl* bse_part_control (guint id,
- guint tick,
- BseMidiSignalType ctype,
- gfloat value,
- gboolean selected);
-void bse_part_control_seq_take_append (BsePartControlSeq *seq,
- BsePartControl *element);
+Bse::PartControl bse_part_control (uint id, uint tick, Bse::MidiSignalType ctype, double
value, bool selected);
void bse_note_sequence_resize (BseNoteSequence *rec,
guint length);
guint bse_note_sequence_length (BseNoteSequence *rec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]