mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
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:
@@ -199,7 +199,7 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
{};
|
{};
|
||||||
|
|
||||||
plugin_data->index = sindex++;
|
plugin_data->index = sindex++;
|
||||||
plugin_data->key = 0; //CRCInput::RC_nokey
|
plugin_data->key = CRCInput::RC_nokey;
|
||||||
#if 0
|
#if 0
|
||||||
plugin_data->fb = false;
|
plugin_data->fb = false;
|
||||||
plugin_data->rc = false;
|
plugin_data->rc = false;
|
||||||
@@ -232,9 +232,9 @@ bool CPlugins::parseCfg(plugin *plugin_data)
|
|||||||
{
|
{
|
||||||
plugin_data->index = atoi(parm);
|
plugin_data->index = atoi(parm);
|
||||||
}
|
}
|
||||||
else if (cmd == "pluginversion")
|
else if (cmd == "key")
|
||||||
{
|
{
|
||||||
plugin_data->key = atoi(parm);
|
plugin_data->key = getPluginKey(parm);
|
||||||
}
|
}
|
||||||
else if (cmd == "name")
|
else if (cmd == "name")
|
||||||
{
|
{
|
||||||
@@ -571,3 +571,17 @@ CPlugins::i_type_t CPlugins::getPluginIntegration(int integration)
|
|||||||
return I_TYPE_DISABLED;
|
return I_TYPE_DISABLED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
neutrino_msg_t CPlugins::getPluginKey(std::string key)
|
||||||
|
{
|
||||||
|
if (key == "red")
|
||||||
|
return CRCInput::RC_red;
|
||||||
|
else if (key == "green")
|
||||||
|
return CRCInput::RC_green;
|
||||||
|
else if (key == "yellow")
|
||||||
|
return CRCInput::RC_yellow;
|
||||||
|
else if (key == "blue")
|
||||||
|
return CRCInput::RC_blue;
|
||||||
|
else /* (key == "auto") */
|
||||||
|
return CRCInput::RC_nokey;
|
||||||
|
}
|
||||||
|
@@ -77,7 +77,7 @@ class CPlugins
|
|||||||
{
|
{
|
||||||
int index;
|
int index;
|
||||||
std::string filename;
|
std::string filename;
|
||||||
int key;
|
neutrino_msg_t key;
|
||||||
std::string cfgfile;
|
std::string cfgfile;
|
||||||
std::string pluginfile;
|
std::string pluginfile;
|
||||||
std::string plugindir;
|
std::string plugindir;
|
||||||
@@ -117,6 +117,7 @@ class CPlugins
|
|||||||
int find_plugin(const std::string & filename);
|
int find_plugin(const std::string & filename);
|
||||||
CPlugins::p_type_t getPluginType(int type);
|
CPlugins::p_type_t getPluginType(int type);
|
||||||
CPlugins::i_type_t getPluginIntegration(int integration);
|
CPlugins::i_type_t getPluginIntegration(int integration);
|
||||||
|
neutrino_msg_t getPluginKey(std::string key="auto");
|
||||||
public:
|
public:
|
||||||
CPlugins();
|
CPlugins();
|
||||||
~CPlugins();
|
~CPlugins();
|
||||||
@@ -141,7 +142,7 @@ class CPlugins
|
|||||||
inline int getIntegration (const int number) const { return plugin_list[number].integration ; }
|
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 bool isHidden (const int number) const { return plugin_list[number].hide ; }
|
||||||
inline int getIndex (const int number) const { return plugin_list[number].index ; }
|
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 ; }
|
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);
|
bool overrideType(plugin *plugin_data, std::string &setting, p_type type);
|
||||||
|
Reference in New Issue
Block a user