Skip to content

Commit

Permalink
5A uint16 and 5A auto start bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jontio committed Nov 14, 2016
1 parent 585e27c commit 2b3f827
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion JMPX/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,6 @@ void MainWindow::songtitlecheck(const QString &title)

void MainWindow::pushdatato5a(const QByteArray &data)
{
if((!pJMPX)||!pJMPX.data()->IsActive())return;
if(!pJMPX)return;
pJMPX->RDS_Set_5A_data(data);
}
18 changes: 9 additions & 9 deletions libJMPX/rds.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ class RDS0AGroup : public RDSGroup
switch(c)
{
case 0:
blk=((((quint16)ba[0])<<8)|((quint16)ba[1]));
blk=((((quint16)((uchar)ba[0]))<<8)|((quint16)((uchar)ba[1])));
break;
case 1:
blk=((((quint16)ba[2])<<8)|((quint16)ba[3]));
blk=((((quint16)((uchar)ba[2]))<<8)|((quint16)((uchar)ba[3])));
break;
case 2:
blk=((((quint16)ba[4])<<8)|((quint16)ba[5]));
blk=((((quint16)((uchar)ba[4]))<<8)|((quint16)((uchar)ba[5])));
break;
case 3:
blk=((((quint16)ba[6])<<8)|((quint16)ba[7]));
blk=((((quint16)((uchar)ba[6]))<<8)|((quint16)((uchar)ba[7])));
break;
}
setBlock(blk,RDSGroup::Block_D);
Expand Down Expand Up @@ -289,11 +289,11 @@ class RDS2AGroup : public RDSGroup
setBlock(blk,RDSGroup::Block_B);

//C
blk=((((quint16)ba[4*c])<<8)|((quint16)ba[4*c+1]));
blk=((((quint16)((uchar)ba[4*c]))<<8)|((quint16)((uchar)ba[4*c+1])));
setBlock(blk,RDSGroup::Block_C);

//D
blk=((((quint16)ba[4*c+2])<<8)|((quint16)ba[4*c+3]));
blk=((((quint16)((uchar)ba[4*c+2]))<<8)|((quint16)((uchar)ba[4*c+3])));
setBlock(blk,RDSGroup::Block_D);

if((ba[4*c]==(char)0x0D)|(ba[4*c+1]==(char)0x0D)|(ba[4*c+2]==(char)0x0D)|(ba[4*c+3]==(char)0x0D))c=-1;
Expand Down Expand Up @@ -413,19 +413,19 @@ class RDS5AGroup : public RDSGroup
setBlock(pi,RDSGroup::Block_A);

//B
channel=ba[c];
channel=((uchar)ba[c]);
blk=0x5000;
if(tp)blk|=0x0400;
blk|=(((quint16)pty)<<5);
blk|=(((quint16)channel)&0x001F);
setBlock(blk,RDSGroup::Block_B);

//C
blk=((((quint16)ba[c+1])<<8)|((quint16)ba[c+2]));
blk=((((quint16)((uchar)ba[c+1]))<<8)|((quint16)((uchar)ba[c+2])));
setBlock(blk,RDSGroup::Block_C);

//D
blk=((((quint16)ba[c+3])<<8)|((quint16)ba[c+4]));
blk=((((quint16)((uchar)ba[c+3]))<<8)|((quint16)((uchar)ba[c+4])));
setBlock(blk,RDSGroup::Block_D);

c+=5;c%=ba.size();
Expand Down

0 comments on commit 2b3f827

Please sign in to comment.