Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Most Bus properties ported to C++ #78

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
308aab9
BSE: bseitem: fix undo resolve crash
swesterfeld Sep 1, 2018
ef875f9
BSE: Bus::mute: port property to C++
swesterfeld Sep 1, 2018
c7146c9
BEAST-GTK: bstbuseditor: support both, aida and old style properties
swesterfeld Sep 1, 2018
5e09d9f
BSE: Bus::solo: port property to C++
swesterfeld Sep 1, 2018
80146d7
BSE: Bus::sync: port property to C++
swesterfeld Sep 3, 2018
2624084
BSE: Bus::left_volume: port property to C++
swesterfeld Sep 3, 2018
c4a5f95
BEAST-GTK: bstbuseditor: use left_volume C++ property
swesterfeld Sep 3, 2018
73408a5
BSE: Bus::right_volume: port property to C++
swesterfeld Sep 3, 2018
c3fb0d4
BEAST-GTK: bstbuseditor: use right_volume C++ property
swesterfeld Sep 3, 2018
36ae320
BSE: Bus::master_output: port property to C++
swesterfeld Sep 3, 2018
bb74147
SFI: provide scanner double/int64 parsing code
swesterfeld Sep 10, 2018
4084bb6
BSE: fix C++ property loading (float64)
swesterfeld Sep 10, 2018
446a37c
BEAST-GTK: move common name -> identifier conversion to bstutils
swesterfeld Sep 11, 2018
36e9df0
BSE: bsebus: avoid chained assignment
swesterfeld Sep 11, 2018
e850a05
BSE: bsebus: minor cosmetic changes
swesterfeld Sep 11, 2018
752ee2a
BSE: implement Bus::volume_db and Bus::pan properties
swesterfeld Sep 13, 2018
ea333df
BSE: remove Bus::sync property, no longer required due to panning sup…
swesterfeld Sep 13, 2018
39a9064
BEAST-GTK: bstbuseditor: edit volume_db/pan instead of left/right volume
swesterfeld Sep 13, 2018
94028c4
RES: add space for editing pan in each mixer bus
swesterfeld Sep 13, 2018
ee9a2df
BSE: allow disabling undo for Bus::master_output property setter
swesterfeld Sep 13, 2018
1fab351
BSE: Song: port remaining Bus::master-output set calls
swesterfeld Sep 13, 2018
5f86778
BSE: bsebus: add a few extra checks to volume/pan conversions
swesterfeld Sep 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions beast-gtk/bstbuseditor.cc
Expand Up @@ -90,10 +90,7 @@ get_property_param (BstBusEditor *self,
Bse::BusH bus = Bse::BusH::down_cast (bse_server.from_proxy (self->item));
for (auto cxxpspec : Bse::introspection_fields_to_param_list (bus.__aida_aux_data__()))
{
std::string pname = cxxpspec->name;
for (auto& c : pname)
if (c == '-')
c = '_';
std::string pname = Bst::name_to_identifier (cxxpspec->name);

if (property == pname)
return bst_param_new_property (cxxpspec, bus);
Expand Down
24 changes: 5 additions & 19 deletions beast-gtk/bstparam.cc
Expand Up @@ -426,20 +426,6 @@ bst_param_new_rec (GParamSpec *pspec,
// == Aida::Parameter binding ==
static Bse::ObjectS* aida_property_binding_object (GxkParam *param);

static std::string
name_to_identifier (const std::string &name)
{
if (strchr (name.c_str(), '-'))
{
std::string identifier (name);
for (size_t i = 0; i < identifier.size(); i++)
if (identifier[i] == '-')
identifier[i] = '_';
return identifier;
}
return name;
}

static void
aida_property_binding_set_value (GxkParam *param, const GValue *value)
{
Expand Down Expand Up @@ -472,18 +458,18 @@ aida_property_binding_set_value (GxkParam *param, const GValue *value)
Bse::warning ("%s: unsupported type: %s", __func__, g_type_name (G_PARAM_SPEC_VALUE_TYPE (param->pspec)));
return;
}
if (!objectp->__aida_set__ (name_to_identifier (pspec->name), any))
Bse::warning ("%s: __aida_set__: unknown value name: %s", __func__, name_to_identifier (pspec->name));
if (!objectp->__aida_set__ (Bst::name_to_identifier (pspec->name), any))
Bse::warning ("%s: __aida_set__: unknown value name: %s", __func__, Bst::name_to_identifier (pspec->name));
}

static void
aida_property_binding_get_value (GxkParam *param, GValue *param_value)
{
Bse::ObjectS *objectp = aida_property_binding_object (param);
GParamSpec *pspec = param->pspec;
Any any = objectp->__aida_get__ (name_to_identifier (pspec->name));
Any any = objectp->__aida_get__ (Bst::name_to_identifier (pspec->name));
if (any.empty())
Bse::warning ("%s: __aida_get__: unknown value name: %s (empty return value)", __func__, name_to_identifier (pspec->name));
Bse::warning ("%s: __aida_get__: unknown value name: %s (empty return value)", __func__, Bst::name_to_identifier (pspec->name));
GValue value = { 0, };
switch (G_TYPE_FUNDAMENTAL (G_PARAM_SPEC_VALUE_TYPE (param->pspec)))
{
Expand Down Expand Up @@ -568,7 +554,7 @@ bst_param_new_property (GParamSpec *pspec, const Bse::ObjectH handle)
auto notify = [param] (const Aida::Event &event) {
gxk_param_update (param);
};
objectp->on (String ("notify:") + name_to_identifier (param->pspec->name), notify);
objectp->on (String ("notify:") + Bst::name_to_identifier (param->pspec->name), notify);
gxk_param_set_size_group (param, param_size_group);
return param;
}
Expand Down
16 changes: 16 additions & 0 deletions beast-gtk/bstutils.cc
Expand Up @@ -159,6 +159,21 @@ monitor_fields_from_shm (int64 shm_id, uint32 shm_offset)
return MonitorFieldU { (char*) (shm_start + shm_offset) };
}

// param spec helper: name -> identifier
std::string
name_to_identifier (const std::string &name)
{
if (strchr (name.c_str(), '-'))
{
std::string identifier (name);
for (size_t i = 0; i < identifier.size(); i++)
if (identifier[i] == '-')
identifier[i] = '_';
return identifier;
}
return name;
}

} // Bst

/* --- variables --- */
Expand Down Expand Up @@ -425,6 +440,7 @@ bst_background_handler2_add (gboolean (*handler) (gpointer data),
bst_background_handler_add (handler, data, free_func, 2);
}


/* --- packing utilities --- */
#define SPACING 3
static void
Expand Down
2 changes: 2 additions & 0 deletions beast-gtk/bstutils.hh
Expand Up @@ -39,6 +39,8 @@ public:

MonitorFieldU monitor_fields_from_shm (int64 shm_id, uint32 shm_offset);

std::string name_to_identifier (const std::string &name);

} // Bst

// == Bse Server (BSE remote origin) ==
Expand Down