Compare commits

...

4 Commits

Author SHA1 Message Date
vanhofen
0a129a081f timerlist: mark remote timers with different text colors
Origin commit data
------------------
Branch: ni/coolstream
Commit: 23eb0168c1
Author: vanhofen <vanhofen@gmx.de>
Date: 2025-01-19 (Sun, 19 Jan 2025)

Origin message was:
------------------
- timerlist: mark remote timers with different text colors

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
2025-06-08 14:52:38 +02:00
vanhofen
bda8caf354 record-info: second try to fix rec/ts-icon for current channel
Origin commit data
------------------
Branch: ni/coolstream
Commit: 80220af4bf
Author: vanhofen <vanhofen@gmx.de>
Date: 2025-01-19 (Sun, 19 Jan 2025)

Origin message was:
------------------
- record-info: second try to fix rec/ts-icon for current channel

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
2025-06-08 14:52:21 +02:00
Thilo Graf
df3574bad5 streamts: Fix const-correctness issues in Send() and write_packet()
- Change Send() parameter from unsigned char* to const unsigned char*.
- Update write_packet() to accept const uint8_t*.
- Fix invalid conversion error with GCC 14.

Confirmed working by building generic neutrino with GCC 14.
2025-03-10 19:42:31 +01:00
Thilo Graf
afe0b116c0 cc_item_picture.h: fix build warnings
Import base class methods setWidth and setHeight to avoid
-Woverloaded-virtual warnings
2025-03-10 19:32:20 +01:00
4 changed files with 52 additions and 46 deletions

View File

@@ -113,49 +113,36 @@ bool CStreamInstance::Stop()
running = false; running = false;
return (OpenThreads::Thread::join() == 0); return (OpenThreads::Thread::join() == 0);
} }
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100) #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100)
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf) bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
#else #else
bool CStreamInstance::Send(ssize_t r, unsigned char * _buf) bool CStreamInstance::Send(ssize_t r, unsigned char * _buf)
#endif #endif
{ {
// lock fds for thread-safety // OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
stream_fds_t cfds; stream_fds_t cfds;
mutex.lock(); mutex.lock();
cfds = fds; cfds = fds;
mutex.unlock(); mutex.unlock();
int flags = 0;
int flags = 0; if (cfds.size() > 1)
if (cfds.size() > 1) flags = MSG_DONTWAIT;
flags = MSG_DONTWAIT; for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) {
int i = 10;
// iterate through all client sockets const unsigned char *b = _buf ? _buf : buf;
for (auto it = cfds.begin(); it != cfds.end(); ++it) ssize_t count = r;
{ do {
int i = 10; int ret = send(*it, b, count, flags);
if (ret > 0) {
// use a const pointer here to avoid conversion errors b += ret;
const unsigned char *b = _buf ? _buf : buf; count -= ret;
ssize_t count = r; }
} while ((count > 0) && (i-- > 0));
do if (count)
{ printf("send err, fd %d: (%zd from %zd)\n", *it, r-count, r);
// 'send' takes a const void*, so no cast needed }
int ret = send(*it, b, count, flags); return true;
if (ret > 0)
{
b += ret; // move pointer further
count -= ret; // reduce remaining bytes
}
} while ((count > 0) && (i-- > 0));
// if count didn't drop to zero, there was some error
if (count)
printf("CStreamInstance::%s: send error, fd %d: (%zd from %zd)\n", __FUNCTION__, *it, r - count, r);
}
return true;
} }
void CStreamInstance::Close() void CStreamInstance::Close()

View File

@@ -69,6 +69,10 @@ class CCPicture : public CComponentsShapeSquare
void SetTransparent(const int &mode) {setBodyBGImageTranparencyMode(mode);} void SetTransparent(const int &mode) {setBodyBGImageTranparencyMode(mode);}
///import base class methods for width and height to avoid -Woverloaded-virtual
using CCDraw::setWidth;
using CCDraw::setHeight;
///set width of object, keep_aspect = true keeps ratio related to height ///set width of object, keep_aspect = true keeps ratio related to height
void setWidth(const int &w, bool keep_aspect = true); void setWidth(const int &w, bool keep_aspect = true);
///set height of object, keep_aspect = true keeps ratio related to width ///set height of object, keep_aspect = true keeps ratio related to width
@@ -281,6 +285,10 @@ class CComponentsPicture : public CComponentsForm
*/ */
void SetTransparent(const int &mode); void SetTransparent(const int &mode);
//import base class methods for width and height to avoid -Woverloaded-virtual
using CCDraw::setWidth;
using CCDraw::setHeight;
/*! /*!
Sets width of object, keep_aspect = true keeps ratio related to height Sets width of object, keep_aspect = true keeps ratio related to height
* @param[in] int w image width * @param[in] int w image width

View File

@@ -1234,8 +1234,12 @@ void CTimerList::paintItem(int pos)
CTimerd::responseGetTimer &timer = timerlist[currpos]; CTimerd::responseGetTimer &timer = timerlist[currpos];
if (timer.eventType == CTimerd::TIMER_REMOTEBOX) if (timer.eventType == CTimerd::TIMER_REMOTEBOX)
{ {
color = COL_MENUCONTENTINACTIVE_TEXT; // mark remote timers with different text colors
bgcolor = COL_MENUCONTENTINACTIVE_PLUS_0; if (i_selected || i_marked)
color = COL_MENUCONTENTSELECTED_TEXT_PLUS_2;
else
color = COL_MENUCONTENTINACTIVE_TEXT;
} }
char zAlarmTime[25] = {0}; char zAlarmTime[25] = {0};
struct tm *alarmTime = localtime(&(timer.alarmTime)); struct tm *alarmTime = localtime(&(timer.alarmTime));

View File

@@ -81,9 +81,6 @@ void CRecInfo::init()
bool recordModeActive = crm->RecordingStatus(); bool recordModeActive = crm->RecordingStatus();
if (recordModeActive) if (recordModeActive)
{ {
rec_icon = NEUTRINO_ICON_REC_GRAY;
ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
// get current record count // get current record count
int records = crm->GetRecordCount(); int records = crm->GetRecordCount();
@@ -97,12 +94,22 @@ void CRecInfo::init()
int cur_rec_mode = crm->GetRecordMode(cur_chid); int cur_rec_mode = crm->GetRecordMode(cur_chid);
// set 'active' icon for record mode // set 'active' icon for record mode
if (cur_rec_mode & CRecordManager::RECMODE_REC) if (rec_mode & CRecordManager::RECMODE_REC)
rec_icon = NEUTRINO_ICON_REC; {
if (cur_rec_mode & CRecordManager::RECMODE_REC)
rec_icon = NEUTRINO_ICON_REC;
else
rec_icon = NEUTRINO_ICON_REC_GRAY;
}
// set 'active' icon for timeshift mode // set 'active' icon for timeshift mode
if (cur_rec_mode & CRecordManager::RECMODE_TSHIFT) if (rec_mode & CRecordManager::RECMODE_TSHIFT)
ts_icon = NEUTRINO_ICON_AUTO_SHIFT; {
if (cur_rec_mode & CRecordManager::RECMODE_TSHIFT)
ts_icon = NEUTRINO_ICON_AUTO_SHIFT;
else
ts_icon = NEUTRINO_ICON_AUTO_SHIFT_GRAY;
}
if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT) if (rec_mode == CRecordManager::RECMODE_REC_TSHIFT)
records--; // subtract ts records--; // subtract ts