[beast/devel] BST: use Rapicorn's new TypeCode::from_enum<>()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast/devel] BST: use Rapicorn's new TypeCode::from_enum<>()
- Date: Sat, 4 May 2013 03:51:41 +0000 (UTC)
commit f5b100afabad1a41d6200d84e3d41d3232ba186c
Author: Tim Janik <timj gnu org>
Date: Wed May 1 13:45:27 2013 +0200
BST: use Rapicorn's new TypeCode::from_enum<>()
beast-gtk/bstapp.cc | 2 +-
beast-gtk/bstusermessage.cc | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/beast-gtk/bstapp.cc b/beast-gtk/bstapp.cc
index 6492e69..dd09d21 100644
--- a/beast-gtk/bstapp.cc
+++ b/beast-gtk/bstapp.cc
@@ -1111,7 +1111,7 @@ 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::enum_info<Bse::UserMessageType>().find_first
(demo_type)->name));
+ Rapicorn::Aida::TypeCode::from_enum<Bse::UserMessageType>().enum_find
(demo_type).ident));
break;
default:
g_assert_not_reached ();
diff --git a/beast-gtk/bstusermessage.cc b/beast-gtk/bstusermessage.cc
index 94c685a..4e0f4f0 100644
--- a/beast-gtk/bstusermessage.cc
+++ b/beast-gtk/bstusermessage.cc
@@ -15,10 +15,10 @@ static GSList *msg_windows = NULL;
const char*
bst_msg_type_ident (BstMsgType bmt)
{
- Rapicorn::Aida::EnumInfo einfo = Rapicorn::Aida::enum_info<Bse::UserMessageType> ();
- const Rapicorn::Aida::EnumInfo::Value *ev = einfo.find_first (bmt);
- if (ev)
- return ev->name;
+ 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;
switch (bmt)
{
case BST_MSG_SCRIPT: return "script";
@@ -750,7 +750,7 @@ server_script_error (SfiProxy server,
static void
server_user_message (const Bse::UserMessage &umsg)
{
- Rapicorn::Aida::EnumInfo einfo = Rapicorn::Aida::enum_info<Bse::UserMessageType> ();
+ Rapicorn::Aida::TypeCode etype = Rapicorn::Aida::TypeCode::from_enum<Bse::UserMessageType> ();
auto convert_msg_type = [] (Bse::UserMessageType mtype) {
switch (mtype)
{
@@ -770,7 +770,7 @@ server_user_message (const Bse::UserMessage &umsg)
msg.details = umsg.text3.c_str();
Bse::String cfg = Bse::string_printf (_("Show messages about %s"), umsg.label.c_str());
msg.config_check = cfg.c_str();
- msg.ident = einfo.find_first (umsg.type)->name;
+ msg.ident = etype.enum_find (umsg.type).ident;
msg.label = NULL;
msg.janitor = 0;
msg.process = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]