mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 23:42:43 +02:00
libeplayer3: implement multi-program support
Origin commit data
------------------
Branch: master
Commit: 9112c4d16d
Author: martii <m4rtii@gmx.de>
Date: 2014-08-22 (Fri, 22 Aug 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sstream>
|
||||
|
||||
#include "player.h"
|
||||
#include "misc.h"
|
||||
@@ -411,3 +412,33 @@ int Player::GetTeletextPid()
|
||||
Track *track = input.teletextTrack;
|
||||
return track ? track->pid : 0;
|
||||
}
|
||||
|
||||
bool Player::GetPrograms(std::vector<std::string> &keys, std::vector<std::string> &values)
|
||||
{
|
||||
keys.clear();
|
||||
values.clear();
|
||||
|
||||
std::vector<Program> p = manager.getPrograms();
|
||||
|
||||
if (p.empty())
|
||||
return false;
|
||||
|
||||
for (std::vector<Program>::iterator it = p.begin(); it != p.end(); ++it) {
|
||||
std::stringstream s;
|
||||
s << it->id;
|
||||
keys.push_back(s.str());
|
||||
values.push_back(it->title);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Player::SelectProgram(int key)
|
||||
{
|
||||
return manager.selectProgram(key);
|
||||
}
|
||||
|
||||
bool Player::SelectProgram(std::string &key)
|
||||
{
|
||||
return manager.selectProgram(atoi(key.c_str()));
|
||||
}
|
||||
|
Reference in New Issue
Block a user