Project

General

Profile

Feature #2509 » vdr-plugin-live.diff

Xcoder, 10/22/2018 12:03 AM

View differences:

epgsearch.cpp
}
SearchTimer* SearchTimers::GetBySearch( std::string const& s )
{
for (SearchTimers::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer)
if (!timer->Search().compare(s))
return &*timer;
return NULL;
}
bool SearchTimers::ToggleActive(std::string const& id)
{
SearchTimer* search = GetByTimerId( id );
epgsearch.h
iterator end() { return m_timers.end(); }
const_iterator end() const { return m_timers.end(); }
SearchTimer* GetByTimerId( std::string const& id );
SearchTimer* GetBySearch( std::string const& s );
bool ToggleActive(std::string const& id);
bool Delete(std::string const& id);
void TriggerUpdate();
pages/channels_widget.ecpp
%
% std::string listChannelId = *listChannel->GetChannelID().ToString();
<option value="<? channelid ? *listChannel->GetChannelID().ToString() ?><? !channelid ? listChannel->Number() ?>"
<{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Name() $></option>
<{ reply.out() << ( listChannelId == selected ? "selected=\"selected\"" : "" ); }>><$ listChannel->Number() $>: <$ listChannel->Name() $></option>
% }
</select>
pages/multischedule.ecpp
{
std::string thisChannel;
try {
if ( cur_group_count != 0 )
channel_groups_names.back() += std::string( " - " );
size_t channelSep = thisGroup.find(',');
thisChannel = thisGroup.substr(0, channelSep );
if ( cur_group_count++ != 0 )
channel_groups_names.back() += std::string( " - " );
else
channel_groups_names.back() += thisChannel += std::string( ": " );
if ( channelSep != thisGroup.npos )
thisGroup.erase( 0, channelSep+1 );
else
......
}
channel_groups_names.back() += std::string( Channel->Name() );
channel_groups_numbers.back().push_back( Channel->Number() );
cur_group_count++;
if ( cur_group_count>=MAX_CHANNELS )
{
// start new group if group gets too large
pages/recordings.ecpp
string dayLen(lexical_cast<string, int>(day.length() - 1) + ".25em;");
// TRANSLATORS: recording duration format HH:MM
string duration(recItem->Duration() < 0 ? "" : FormatDuration(tr("(%d:%02d)"), recItem->Duration() / 60, recItem->Duration() % 60));
string newR(recItem->GetResume() <= 0 ? "(NEW) " : "");
string shortDescr(recItem->RecInfo()->ShortText() ? recItem->RecInfo()->ShortText() : "");
string description(recItem->RecInfo()->Description() ? recItem->RecInfo()->Description() : "");
string hint(tr("Click to view details."));
if (!shortDescr.empty()) hint = shortDescr + "<br />" + hint;
else if (!description.empty()) hint = description + "<br />" + hint;
#ifdef HAVE_LIBPCRECPP
pcrecpp::RE re(filter.c_str(), pcrecpp::UTF8());
pcrecpp::RE re(filter.c_str(), pcrecpp::UTF8().set_caseless(true));
if (filter.empty() || re.PartialMatch(recItem->Name()) || re.PartialMatch(shortDescr) || re.PartialMatch(description))
#endif
{
</%cpp>
<li class="recording">
<& rec_item_file name=(recItem->Name()) level=(recItem->Level()) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) duration=(duration) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
<& rec_item_file name=(recItem->Name()) level=(level) id=(recItem->Id()) day=(day) dayLen=(dayLen) startTime=(recItem->StartTime()) duration=(duration) newR=(newR) hint=(hint) shortDescr=(shortDescr) archived=(RecordingsManager::GetArchiveDescr(recItem->Recording())) &>
</li>
<%cpp>
}
......
string duration;
string hint;
string shortDescr;
string newR;
string archived;
</%args>
<div class="recording_item">
......
<div class="recording_spec">
<div class="recording_day"><$ FormatDateTime(tr("%a,"), startTime) + string(" ") + FormatDateTime(tr("%b %d %y"), startTime) + string(" ") + FormatDateTime(tr("%I:%M %p"), startTime) $></div>
<div class="recording_duration"><$ duration $></div>
<div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span>&nbsp;</span><%cpp> } </%cpp></a></div>
<div class="recording_name"><a <& tooltip.hint text=(hint) &><& tooltip.display domId=(id) &>><$ newR $><$ name $><br /><%cpp>if ((name != shortDescr) && (!shortDescr.empty())) {</%cpp><span><$ shortDescr $></span><%cpp> } else { </%cpp><span>&nbsp;</span><%cpp> } </%cpp></a></div>
</div>
<div class="recording_actions">
<%cpp>
pages/timers.ecpp
EpgInfoPtr epgEvent;
string longDescription;
string searchTimName;
int searchTimId;
#if VDRVERSNUM >= 20301
if (!timer->Event()) {
LOCK_SCHEDULES_READ;
......
+ StringEscapeAndBreak(StringWordTruncate(epgEvent->LongDescr(), maximumDescriptionLength))
+ "<br/><br/>" + tr("Click to view details.");
searchTimName = SortedTimers::SearchTimerName(*timer);
searchTimId = SortedTimers::SearchTimerId(*timer);
}
string currentDay = SortedTimers::GetTimerDays(*timer);
SortedTimers::iterator nextTimer = timer; ++nextTimer;
......
% }
><$ timer->File() $></a></div>
</td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><$ searchTimName $></div></td>
<td class="<? bottom ? "bottomrow" ?>"><div class="withmargin"><a href="edit_searchtimer.html?searchtimerid=<$ searchTimId $>"><$ searchTimName $></a></div></td>
<td class="action <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=toggle"><img src="<$ LiveSetup().GetThemedLink("img", (timer->Flags() & tfActive) ? "active.png" : "inactive.png") $>" alt="" <& tooltip.hint text=(tr("Toggle timer active/inactive")) &>></img></a></td>
<td class="action <? bottom ? "bottomrow" ?>"><& pageelems.edit_timer timerId=(timers.GetTimerId(*timer)) &></td>
<td class="action rightcol <? bottom ? "bottomrow" ?>"><a href="timers.html?timerid=<$ SortedTimers::EncodeDomId(timers.GetTimerId(*timer)) $>&action=delete"><img src="<$ LiveSetup().GetThemedLink("img", "del.png") $>" alt="" <& tooltip.hint text=(tr("Delete timer")) &>></img></a></td>
recman.cpp
return m_recording->LengthInSeconds() / 60;
}
long RecordingsItemRec::GetResume() const
{
if (!m_recording->FileName()) return 0;
return m_recording->GetResume();
}
/**
* Implementation of class RecordingsTree:
*/
recman.h
virtual time_t StartTime() const = 0;
virtual bool IsDir() const = 0;
virtual long Duration() const = 0;
virtual long GetResume() const = 0;
virtual const std::string& Name() const { return m_name; }
virtual const std::string Id() const = 0;
......
virtual time_t StartTime() const { return 0; }
virtual long Duration() const { return 0; }
virtual bool IsDir() const { return true; }
virtual long GetResume() const { return 0; }
virtual std::string const Id() const { return ""; }
private:
......
virtual time_t StartTime() const;
virtual long Duration() const;
virtual bool IsDir() const { return false; }
virtual long GetResume() const;
virtual const std::string Id() const { return m_id; }
virtual const cRecording* Recording() const { return m_recording; }
timers.cpp
#include "timers.h"
#include "epgsearch.h"
#include "exception.h"
#include "tools.h"
......
return info.str();
}
int SortedTimers::SearchTimerId(cTimer const& timer)
{
string st = SortedTimers::SearchTimerName(timer);
SearchTimers stimers;
SearchTimer* search = stimers.GetBySearch(st);
if (search) return search->Id();
return 0;
}
#if VDRVERSNUM >= 20301
bool SortedTimers::Modified()
{
timers.h
static std::string GetTimerDays(cTimer const& timer);
static std::string GetTimerInfo(cTimer const& timer);
static std::string SearchTimerName(cTimer const& timer);
static int SearchTimerId(cTimer const& timer);
private:
SortedTimers();
(1-1/5)