本文整理汇总了C++中ePtr类的典型用法代码示例。如果您正苦于以下问题:C++ ePtr类的具体用法?C++ ePtr怎么用?C++ ePtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ePtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: frontendDataToDict
void frontendDataToDict(ePyObject &dest, ePtr<iDVBFrontendData> data)
{
if (dest && PyDict_Check(dest))
{
PutToDict(dest, "tuner_number", data->getNumber());
PutToDict(dest, "tuner_type", data->getTypeDescription().c_str());
}
}
示例2: setPixmap
void eSubtitleWidget::setPixmap(ePtr<gPixmap> &pixmap, gRegion changed, eRect pixmap_dest)
{
m_pixmap = pixmap;
m_pixmap_dest = pixmap_dest; /* this is in a virtual 720x576 cage */
/* incoming "changed" regions are relative to the physical pixmap area, so they have to be scaled to the virtual pixmap area, then to the screen */
changed.scale(m_pixmap_dest.width(), 720, m_pixmap_dest.height(), 576);
changed.moveBy(ePoint(m_pixmap_dest.x(), m_pixmap_dest.y()));
if (pixmap->size().width() && pixmap->size().height())
changed.scale(size().width(), pixmap->size().width(), size().height(), pixmap->size().height());
invalidate(changed);
}
示例3: tuner_type_channel_default
int tuner_type_channel_default(ePtr<iDVBChannelList> &channellist, const eDVBChannelID &chid)
{
if (channellist)
{
ePtr<iDVBFrontendParameters> feparm;
if (!channellist->getChannelFrontendData(chid, feparm))
{
int system;
if (!feparm->getSystem(system))
{
switch(system)
{
case iDVBFrontend::feSatellite:
return 50000;
case iDVBFrontend::feCable:
return 40000;
case iDVBFrontend::feTerrestrial:
return 30000;
default:
break;
}
}
}
}
return 0;
}
示例4: ASSERT
RESULT eNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service, bool simulate, pNavigation::RecordType type)
{
ASSERT(m_servicehandler);
RESULT res = m_servicehandler->record(ref, service);
if (res)
{
eDebug("record: %d", res);
service = 0;
}
else
{
if (simulate)
m_simulate_recordings.insert(service);
else
{
ePtr<eConnection> conn;
service->connectEvent(slot(*this, &eNavigation::recordEvent), conn);
m_recordings[service]=conn;
m_recordings_services[service]=ref;
m_recordings_types[service]=type;
//for (std::map<ePtr<iRecordableService>, eServiceReference >::iterator it2(m_recordings_services.begin()); it2 != m_recordings_services.end(); ++it2)
// eDebug("[core.cpp] recordService: ref %s", (it2->second).toString().c_str());
//for (std::map<ePtr<iRecordableService>, pNavigation::RecordType >::iterator it3(m_recordings_types.begin()); it3 != m_recordings_types.end(); ++it3)
// eDebug("[core.cpp] recordService: type %d", it3->second);
}
}
return res;
}
示例5: eMain
eMain()
{
m_dvbdb = new eDVBDB();
m_mgr = new eDVBResourceManager();
eDVBFrontendParametersSatellite fesat;
fesat.frequency = 11817000; // 12070000;
fesat.symbol_rate = 27500000;
fesat.polarisation = eDVBFrontendParametersSatellite::Polarisation_Vertical;
fesat.fec = eDVBFrontendParametersSatellite::FEC_3_4;
fesat.inversion = eDVBFrontendParametersSatellite::Inversion_Off;
fesat.orbital_position = 192;
eDVBFrontendParameters *fe = new eDVBFrontendParameters();
fe->setDVBS(fesat);
if (m_mgr->allocateRawChannel(m_channel))
eDebug("shit it failed!");
// init.setRunlevel(eAutoInitNumbers::main);
eDebug("starting scan...");
std::list<ePtr<iDVBFrontendParameters> > list;
list.push_back(fe);
m_scan = new eDVBScan(m_channel);
m_scan->start(list);
m_scan->connectEvent(slot(*this, &eMain::scanEvent), m_scan_event_connection);
}
示例6:
void eServiceMP3::gstPoll(ePtr<GstMessageContainer> const &msg)
{
switch (msg->getType())
{
case 1:
{
GstMessage *gstmessage = *((GstMessageContainer*)msg);
if (gstmessage)
{
gstBusCall(gstmessage);
}
break;
}
case 2:
{
GstBuffer *buffer = *((GstMessageContainer*)msg);
if (buffer)
{
pullSubtitle(buffer);
}
break;
}
case 3:
{
GstPad *pad = *((GstMessageContainer*)msg);
gstTextpadHasCAPS_synced(pad);
break;
}
}
}
示例7: stopRecordService
RESULT eNavigation::stopRecordService(ePtr<iRecordableService> &service)
{
service->stop();
std::set<ePtr<iRecordableService> >::iterator it =
m_simulate_recordings.find(service);
if (it != m_simulate_recordings.end())
{
m_simulate_recordings.erase(it);
return 0;
}
else
{
std::map<ePtr<iRecordableService>, ePtr<eConnection> >::iterator it =
m_recordings.find(service);
if (it != m_recordings.end())
{
m_recordings.erase(it);
/* send stop event */
m_record_event(service, iRecordableService::evEnd);
return 0;
}
}
eDebug("try to stop non running recording!!"); // this should not happen
return -1;
}
示例8: streamingDataToDict
void streamingDataToDict(ePyObject &dest, ePtr<iStreamData> data)
{
if (dest && PyDict_Check(dest))
{
int pmt, pcr, txt, adapter, demux, default_audio_pid;
std::vector<int> video, audio, subtitle;
unsigned int i;
ePyObject l = PyList_New(0);
PyList_AppendSteal(l, createTuple(0, "pat"));
data->getPmtPid(pmt);
if (pmt != -1)
PyList_AppendSteal(l, createTuple(pmt, "pmt"));
data->getVideoPids(video);
for (i = 0; i < video.size(); i++)
{
PyList_AppendSteal(l, createTuple(video[i], "video"));
}
data->getAudioPids(audio);
for (i = 0; i < audio.size(); i++)
{
PyList_AppendSteal(l, createTuple(audio[i], "audio"));
}
data->getSubtitlePids(subtitle);
for (i = 0; i < subtitle.size(); i++)
{
PyList_AppendSteal(l, createTuple(subtitle[i], "subtitle"));
}
data->getPcrPid(pcr);
PyList_AppendSteal(l, createTuple(pcr, "pcr"));
data->getTxtPid(txt);
if (txt != -1)
PyList_AppendSteal(l, createTuple(txt, "text"));
PutToDict(dest, "pids", l);
data->getAdapterId(adapter);
PutToDict(dest, "adapter", adapter);
data->getDemuxId(demux);
PutToDict(dest, "demux", demux);
data->getDefaultAudioPid(default_audio_pid);
PutToDict(dest, "default_audio_pid", default_audio_pid);
}
}
示例9: addCachedPids
int eRTSPStreamClient::addCachedPids(ePtr<eDVBService> service, eServiceReferenceDVB s)
{
int found = 0;
for (int x = 0; x < 5; ++x)
{
int entry = service->getCacheEntry((eDVBService::cacheID)x);
if (entry != -1)
{
eDebug("Found cached pid %d [%x]", entry, entry);
pid_sr[entry] = s;
found = 1;
}
}
return !found;
}
示例10: frontendStatusToDict
void frontendStatusToDict(ePyObject &dest, ePtr<iDVBFrontendStatus> status)
{
if (dest && PyDict_Check(dest))
{
PutToDict(dest, "tuner_state", status->getStateDescription().c_str());
PutToDict(dest, "tuner_locked", status->getLocked());
PutToDict(dest, "tuner_synced", status->getSynced());
PutToDict(dest, "tuner_bit_error_rate", status->getBER());
PutToDict(dest, "tuner_signal_quality", status->getSNR());
int snrdb = status->getSNRdB();
if (snrdb >= 0) PutToDict(dest, "tuner_signal_quality_db", snrdb);
PutToDict(dest, "tuner_signal_power", status->getSignalPower());
}
}
示例11:
void eServiceMP3Record::gstPoll(ePtr<GstMessageContainer> const &msg)
{
switch (msg->getType())
{
case 1:
{
GstMessage *gstmessage = *((GstMessageContainer*)msg);
if (gstmessage)
{
gstBusCall(gstmessage);
}
break;
}
default:
eDebug("[eMP3ServiceRecord] gstPoll error unknown message type");
}
}
示例12: getDecodeDemux
int eDVBServicePMTHandler::getDecodeDemux(ePtr<iDVBDemux> &demux)
{
int ret=0;
/* if we're using the decoding demux as data source
(for example in pvr playbacks), return that one. */
if (m_use_decode_demux)
{
demux = m_demux;
return ret;
}
ASSERT(m_channel); /* calling without a previous ::tune is certainly bad. */
ret = m_channel->getDemux(demux, iDVBChannel::capDecode);
if (!ret)
demux->getCADemuxID(m_decode_demux_num);
return ret;
}
示例13: m_record_event
RESULT eNavigation::stopRecordService(ePtr<iRecordableService> &service)
{
service->stop();
std::set<ePtr<iRecordableService> >::iterator it =
m_simulate_recordings.find(service);
if (it != m_simulate_recordings.end())
{
m_simulate_recordings.erase(it);
return 0;
}
else
{
std::map<ePtr<iRecordableService>, ePtr<eConnection> >::iterator it =
m_recordings.find(service);
if (it != m_recordings.end())
{
m_recordings.erase(it);
/* send stop event */
m_record_event(service, iRecordableService::evEnd);
std::map<ePtr<iRecordableService>, eServiceReference >::iterator it_services =
m_recordings_services.find(service);
if (it_services != m_recordings_services.end())
{
m_recordings_services.erase(it_services);
}
std::map<ePtr<iRecordableService>, pNavigation::RecordType >::iterator it_types =
m_recordings_types.find(service);
if (it_types != m_recordings_types.end())
{
m_recordings_types.erase(it_types);
}
//for (std::map<ePtr<iRecordableService>, eServiceReference >::iterator it2(m_recordings_services.begin()); it2 != m_recordings_services.end(); ++it2)
// eDebug("[core.cpp] after stopRecordService: ref %s", (it2->second).toString().c_str());
//for (std::map<ePtr<iRecordableService>, pNavigation::RecordType >::iterator it3(m_recordings_types.begin()); it3 != m_recordings_types.end(); ++it3)
// eDebug("[core.cpp] after stopRecordService: type %d", it3->second);
return 0;
}
}
eDebug("try to stop non running recording!!"); // this should not happen
return -1;
}
示例14: ASSERT
RESULT eNavigation::recordService(const eServiceReference &ref, ePtr<iRecordableService> &service, bool simulate)
{
ASSERT(m_servicehandler);
RESULT res = m_servicehandler->record(ref, service);
if (res)
{
eDebug("record: %d", res);
service = 0;
}
else
{
if (simulate)
m_simulate_recordings.insert(service);
else
{
ePtr<eConnection> conn;
service->connectEvent(slot(*this, &eNavigation::recordEvent), conn);
m_recordings[service]=conn;
}
}
return res;
}
示例15: main
int main(int argc, char **argv)
{
#ifdef MEMLEAK_CHECK
atexit(DumpUnfreed);
#endif
#ifdef OBJECT_DEBUG
atexit(object_dump);
#endif
gst_init(&argc, &argv);
for (int i = 0; i < argc; i++)
{
if (!(strcmp(argv[i], "--debug-no-color")) or !(strcmp(argv[i], "--nc")))
{
logOutputColors = 0;
}
}
m_erroroutput = new eErrorOutput();
m_erroroutput->run();
// set pythonpath if unset
setenv("PYTHONPATH", eEnv::resolve("${libdir}/enigma2/python").c_str(), 0);
printf("PYTHONPATH: %s\n", getenv("PYTHONPATH"));
printf("DVB_API_VERSION %d DVB_API_VERSION_MINOR %d\n", DVB_API_VERSION, DVB_API_VERSION_MINOR);
bsodLogInit();
ePython python;
eMain main;
#if 1
ePtr<gMainDC> my_dc;
gMainDC::getInstance(my_dc);
//int double_buffer = my_dc->haveDoubleBuffering();
ePtr<gLCDDC> my_lcd_dc;
gLCDDC::getInstance(my_lcd_dc);
/* ok, this is currently hardcoded for arabic. */
/* some characters are wrong in the regular font, force them to use the replacement font */
for (int i = 0x60c; i <= 0x66d; ++i)
eTextPara::forceReplacementGlyph(i);
eTextPara::forceReplacementGlyph(0xfdf2);
for (int i = 0xfe80; i < 0xff00; ++i)
eTextPara::forceReplacementGlyph(i);
eWidgetDesktop dsk(my_dc->size());
eWidgetDesktop dsk_lcd(my_lcd_dc->size());
dsk.setStyleID(0);
dsk_lcd.setStyleID(my_lcd_dc->size().width() == 96 ? 2 : 1);
/* if (double_buffer)
{
eDebug(" - double buffering found, enable buffered graphics mode.");
dsk.setCompositionMode(eWidgetDesktop::cmBuffered);
} */
wdsk = &dsk;
lcddsk = &dsk_lcd;
dsk.setDC(my_dc);
dsk_lcd.setDC(my_lcd_dc);
dsk.setBackgroundColor(gRGB(0,0,0,0xFF));
#endif
/* redrawing is done in an idle-timer, so we have to set the context */
dsk.setRedrawTask(main);
dsk_lcd.setRedrawTask(main);
eDebug("Checking box...");
FILE *infile;
char line[100];
char command[64];
if((infile = fopen("/proc/stb/info/boxtype", "r")) != NULL)
{
fgets(line, sizeof(line), infile);
if(strcmp(line, "ini-5000sv\n") == 0)
{
eDebug("Miraclebox Premium Twin detected");
}
else if(strcmp(line, "ini-1000sv\n") == 0)
{
eDebug("Miraclebox Premium Mini detected");
}
else if(strcmp(line, "ini-2000sv\n") == 0)
{
eDebug("Miraclebox Premium Mini+ detected");
}
else if(strcmp(line, "ini-8000sv\n") == 0)
{
//.........这里部分代码省略.........