|
|
|
|
@ -197,6 +197,28 @@ void DefaultConfiguration(ncmpcpp_config &conf) |
|
|
|
|
conf.message_delay_time = 4; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string GetLineValue(const string &line, char a, char b) |
|
|
|
|
{ |
|
|
|
|
int i = 0; |
|
|
|
|
int begin = -1, end = -1; |
|
|
|
|
for (string::const_iterator it = line.begin(); it != line.end(); i++, it++) |
|
|
|
|
{ |
|
|
|
|
if (*it == a || *it == b) |
|
|
|
|
{ |
|
|
|
|
if (begin < 0) |
|
|
|
|
begin = i+1; |
|
|
|
|
else |
|
|
|
|
end = i; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (begin >= 0 && end >= 0) |
|
|
|
|
return line.substr(begin, end-begin); |
|
|
|
|
else |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
namespace |
|
|
|
|
{ |
|
|
|
|
void GetKeys(string line, int *key) |
|
|
|
|
{ |
|
|
|
|
int i = line.find("=")+1; |
|
|
|
|
@ -220,26 +242,6 @@ void GetKeys(string line, int *key) |
|
|
|
|
key[1] = !two.empty() && two[0] == '\'' ? two[1] : (atoi(two.c_str()) == 0 ? null_key : atoi(two.c_str())); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string GetLineValue(const string &line, char a, char b) |
|
|
|
|
{ |
|
|
|
|
int i = 0; |
|
|
|
|
int begin = -1, end = -1; |
|
|
|
|
for (string::const_iterator it = line.begin(); it != line.end(); i++, it++) |
|
|
|
|
{ |
|
|
|
|
if (*it == a || *it == b) |
|
|
|
|
{ |
|
|
|
|
if (begin < 0) |
|
|
|
|
begin = i+1; |
|
|
|
|
else |
|
|
|
|
end = i; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (begin >= 0 && end >= 0) |
|
|
|
|
return line.substr(begin, end-begin); |
|
|
|
|
else |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
string IntoStr(Color color) |
|
|
|
|
{ |
|
|
|
|
string result; |
|
|
|
|
@ -289,6 +291,7 @@ Color IntoColor(const string &color) |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ReadKeys(ncmpcpp_keys &keys) |
|
|
|
|
{ |
|
|
|
|
|