plugins: Fix assignment of prefered keys

New keyword in plugin.cfg: key=<key>
* key=red
* key=green
* key=yellow
* key=blue
* key=auto

If entry is missing key is auto-assigned


Origin commit data
------------------
Branch: ni/coolstream
Commit: c0a0cdb221
Author: vanhofen <vanhofen@gmx.de>
Date: 2014-11-07 (Fri, 07 Nov 2014)

Origin message was:
------------------
- plugins: Fix assignment of prefered keys

New keyword in plugin.cfg: key=<key>
* key=red
* key=green
* key=yellow
* key=blue
* key=auto

If entry is missing key is auto-assigned


------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2014-11-07 12:17:29 +01:00
parent 8d64978b13
commit d7e583f7c8
2 changed files with 20 additions and 5 deletions

View File

@@ -77,7 +77,7 @@ class CPlugins
{
int index;
std::string filename;
int key;
neutrino_msg_t key;
std::string cfgfile;
std::string pluginfile;
std::string plugindir;
@@ -117,6 +117,7 @@ class CPlugins
int find_plugin(const std::string & filename);
CPlugins::p_type_t getPluginType(int type);
CPlugins::i_type_t getPluginIntegration(int integration);
neutrino_msg_t getPluginKey(std::string key="auto");
public:
CPlugins();
~CPlugins();
@@ -141,7 +142,7 @@ class CPlugins
inline int getIntegration (const int number) const { return plugin_list[number].integration ; }
inline bool isHidden (const int number) const { return plugin_list[number].hide ; }
inline int getIndex (const int number) const { return plugin_list[number].index ; }
inline neutrino_msg_t getKey (const int number) const { return (neutrino_msg_t)plugin_list[number].key; }
inline neutrino_msg_t getKey (const int number) const { return plugin_list[number].key ; }
void setType (const int number, int t) { plugin_list[number].type = (CPlugins::p_type_t) t ; }
bool overrideType(plugin *plugin_data, std::string &setting, p_type type);