[beast/devel: 15/26] BEAST-GTK: use Rapicorn::Aida::enum_value_list<>()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel: 15/26] BEAST-GTK: use Rapicorn::Aida::enum_value_list<>()
- Date: Mon, 13 Oct 2014 02:27:22 +0000 (UTC)
commit ccf55b28f703344393fdb036ec51e39c27918bb6
Author: Tim Janik <timj gnu org>
Date: Sun Oct 12 05:25:23 2014 +0200
BEAST-GTK: use Rapicorn::Aida::enum_value_list<>()
beast-gtk/bstapp.cc | 3 ++-
beast-gtk/bstusermessage.cc | 12 ++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 78d4595..fe1e3ee 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -1108,7 +1108,8 @@ app_action_exec (gpointer data,
"are currently looking at a prominent warning or error message, there's
no "
"real merit to it."),
BST_MSG_TEXT3 ("Demo-Dialog-Type: %s",
- Rapicorn::Aida::TypeCode::from_enum<Bse::UserMessageType>().enum_find
(demo_type).ident));
+ Rapicorn::Aida::enum_value_find
(Rapicorn::Aida::enum_value_list<Bse::UserMessageType> (),
+ demo_type)->ident));
break;
default:
g_assert_not_reached ();
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index af3cfa3..5a4ff2f 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -15,10 +15,9 @@ static GSList *msg_windows = NULL;
const char*
bst_msg_type_ident (BstMsgType bmt)
{
- Rapicorn::Aida::TypeCode etype = Rapicorn::Aida::TypeCode::from_enum<Bse::UserMessageType> ();
- const Rapicorn::Aida::EnumValue ev = etype.enum_find (bmt);
- if (ev.ident)
- return ev.ident;
+ const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_value_find
(Rapicorn::Aida::enum_value_list<Bse::UserMessageType>(), bmt);
+ if (ev && ev->ident)
+ return ev->ident;
switch (bmt)
{
case BST_MSG_SCRIPT: return "script";
@@ -743,7 +742,7 @@ server_script_error (SfiProxy server,
static void
server_user_message (const Bse::UserMessage &umsg)
{
- Rapicorn::Aida::TypeCode etype = Rapicorn::Aida::TypeCode::from_enum<Bse::UserMessageType> ();
+ const Rapicorn::Aida::EnumValue *evalues = Rapicorn::Aida::enum_value_list<Bse::UserMessageType>();
auto convert_msg_type = [] (Bse::UserMessageType mtype) {
switch (mtype)
{
@@ -763,7 +762,8 @@ server_user_message (const Bse::UserMessage &umsg)
msg.details = umsg.text3.c_str();
Bse::String cfg = Bse::string_format (_("Show messages about %s"), umsg.label.c_str());
msg.config_check = cfg.c_str();
- msg.ident = etype.enum_find (umsg.type).ident;
+ const Rapicorn::Aida::EnumValue *ev = Rapicorn::Aida::enum_value_find (evalues, umsg.type);
+ msg.ident = ev ? ev->ident : NULL;
msg.label = NULL;
msg.janitor = 0;
msg.process = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]