Compare commits

...

4 Commits
3.25 ... master

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;
return (OpenThreads::Thread::join() == 0);
}
#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(61, 1, 100)
bool CStreamInstance::Send(ssize_t r, const unsigned char *_buf)
#else
bool CStreamInstance::Send(ssize_t r, unsigned char * _buf)
#endif
{
// lock fds for thread-safety
stream_fds_t cfds;
mutex.lock();
cfds = fds;
mutex.unlock();
int flags = 0;
if (cfds.size() > 1)
flags = MSG_DONTWAIT;
// iterate through all client sockets
for (auto it = cfds.begin(); it != cfds.end(); ++it)
{
int i = 10;
// use a const pointer here to avoid conversion errors
const unsigned char *b = _buf ? _buf : buf;
ssize_t count = r;
do
{
// 'send' takes a const void*, so no cast needed
int ret = send(*it, b, count, flags);
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;
// OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);
stream_fds_t cfds;
mutex.lock();
cfds = fds;
mutex.unlock();
int flags = 0;
if (cfds.size() > 1)
flags = MSG_DONTWAIT;
for (stream_fds_t::iterator it = cfds.begin(); it != cfds.end(); ++it) {
int i = 10;
const unsigned char *b = _buf ? _buf : buf;
ssize_t count = r;
do {
int ret = send(*it, b, count, flags);
if (ret > 0) {
b += ret;
count -= ret;
}
} while ((count > 0) && (i-- > 0));
if (count)
printf("send err, fd %d: (%zd from %zd)\n", *it, r-count, r);
}
return true;
}
void CStreamInstance::Close()

View File

@@ -69,6 +69,10 @@ class CCPicture : public CComponentsShapeSquare
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
void setWidth(const int &w, bool keep_aspect = true);
///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);
//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
* @param[in] int w image width

View File

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

View File

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