mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 14:33:28 +02:00
2018-08-08 Fred Gleason <fredg@paravelsystems.com>
* Fixed regressions in rdlibrary(1) and rdlogedit(1) that broke display of the audio playhead cursor.
This commit is contained in:
parent
3e37fbefac
commit
523c93c461
@ -17341,3 +17341,6 @@
|
||||
that caused button legends to be misaligned.
|
||||
2018-08-08 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in 'RDAudioInfo' that caused segfaults.
|
||||
2018-08-08 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed regressions in rdlibrary(1) and rdlogedit(1) that broke
|
||||
display of the audio playhead cursor.
|
||||
|
@ -46,6 +46,7 @@ RDEditAudio::RDEditAudio(RDCart *cart,QString cut_name,int card,
|
||||
int port,int preroll,int trim_level,QWidget *parent)
|
||||
: QDialog(parent,"",true)
|
||||
{
|
||||
setAttribute(Qt::WA_PaintOutsidePaintEvent);
|
||||
edit_card=card;
|
||||
edit_port=port;
|
||||
edit_stream=-1;
|
||||
@ -2575,12 +2576,13 @@ void RDEditAudio::DrawCursors(int xpos,int ypos,int xsize,int ysize,int chan)
|
||||
|
||||
|
||||
prev_x[chan][RDEditAudio::Play]=DrawCursor(xpos,ypos,xsize,ysize,chan,
|
||||
edit_cursors[RDEditAudio::Play],
|
||||
prev_x[chan][RDEditAudio::Play],
|
||||
QColor(EDITAUDIO_PLAY_COLOR),
|
||||
RDEditAudio::None,20,RDEditAudio::Play);
|
||||
// Qt::XorROP);
|
||||
|
||||
edit_cursors[RDEditAudio::Play],
|
||||
prev_x[chan][RDEditAudio::Play],
|
||||
QColor(EDITAUDIO_PLAY_COLOR),
|
||||
RDEditAudio::None,20,
|
||||
RDEditAudio::Play,
|
||||
QPainter::RasterOp_SourceXorDestination);
|
||||
|
||||
prev_x[chan][RDEditAudio::SegueStart]=DrawCursor(xpos,ypos,xsize,ysize,chan,
|
||||
edit_cursors[RDEditAudio::SegueStart],
|
||||
prev_x[chan][RDEditAudio::SegueStart],
|
||||
@ -2658,7 +2660,8 @@ void RDEditAudio::DrawCursors(int xpos,int ypos,int xsize,int ysize,int chan)
|
||||
// RDEditAudio::CuePoints pt,Qt::RasterOp op)
|
||||
int RDEditAudio::DrawCursor(int xpos,int ypos,int xsize,int ysize,int chan,
|
||||
int samp,int prev,QColor color,Arrow arrow,int apos,
|
||||
RDEditAudio::CuePoints pt)
|
||||
RDEditAudio::CuePoints pt,
|
||||
QPainter::CompositionMode op)
|
||||
{
|
||||
int x;
|
||||
Q3PointArray *point;
|
||||
@ -2670,7 +2673,7 @@ int RDEditAudio::DrawCursor(int xpos,int ypos,int xsize,int ysize,int chan,
|
||||
if((x!=prev)||(pt!=RDEditAudio::Play)) {
|
||||
QPainter *p=new QPainter(this);
|
||||
p->setClipRect(xpos,ypos,xsize,ysize);
|
||||
// p->setRasterOp(op);
|
||||
p->setCompositionMode(op);
|
||||
p->translate(xpos,ypos);
|
||||
if((x>=0)&(x<EDITAUDIO_WAVEFORM_WIDTH)) {
|
||||
p->setPen(color);
|
||||
|
@ -152,7 +152,8 @@ class RDEditAudio : public QDialog
|
||||
// RDEditAudio::CuePoints pt,Qt::RasterOp op=Qt::CopyROP);
|
||||
int DrawCursor(int xpos,int ypos,int xsize,int ysize,int chan,
|
||||
int samp,int prev,QColor color,Arrow arrow,int apos,
|
||||
RDEditAudio::CuePoints pt);
|
||||
RDEditAudio::CuePoints pt,
|
||||
QPainter::CompositionMode op=QPainter::CompositionMode_SourceOver);
|
||||
void EraseCursor(int xpos,int ypos,int xsize,int ysize,int chan,
|
||||
int samp,int prev,QColor color,Arrow arrow,int apos);
|
||||
void DrawWave(int xsize,int ysize,int chan,QString label,QPixmap *pix);
|
||||
|
@ -109,16 +109,16 @@ void RDWavePainter::drawWaveBySamples(int x,int w,int startsamp,int endsamp,
|
||||
int center=pix->height()/2;
|
||||
RDWavePainter::Channel effective_channel=channel;
|
||||
switch(channel) {
|
||||
case RDWavePainter::Left:
|
||||
case RDWavePainter::Right:
|
||||
if(wave_channels==1) {
|
||||
effective_channel=RDWavePainter::Mono;
|
||||
}
|
||||
break;
|
||||
case RDWavePainter::Left:
|
||||
case RDWavePainter::Right:
|
||||
if(wave_channels==1) {
|
||||
effective_channel=RDWavePainter::Mono;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
effective_channel=channel;
|
||||
break;
|
||||
default:
|
||||
effective_channel=channel;
|
||||
break;
|
||||
}
|
||||
save();
|
||||
resetXForm();
|
||||
@ -128,83 +128,83 @@ void RDWavePainter::drawWaveBySamples(int x,int w,int startsamp,int endsamp,
|
||||
array.setPoint(0,0,center);
|
||||
array.setPoint(w+1,w+1,center);
|
||||
switch(effective_channel) {
|
||||
case RDWavePainter::Left:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RDWavePainter::Left:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDWavePainter::Right:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(1+2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RDWavePainter::Right:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(1+2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case RDWavePainter::Mono:
|
||||
switch(wave_channels) {
|
||||
case 1:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=((int)(time_scale*(double)i)+startblock))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>startclipblock))&&
|
||||
((endclipblock<0)||(dx<endclipblock))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*
|
||||
((double)wave_peaks->energy(dx)+
|
||||
(double)wave_peaks->energy(dx+1))/2.0));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case RDWavePainter::Mono:
|
||||
switch(wave_channels) {
|
||||
case 1:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=((int)(time_scale*(double)i)+startblock))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>startclipblock))&&
|
||||
((endclipblock<0)||(dx<endclipblock))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*(double)wave_peaks->energy(dx)));
|
||||
}
|
||||
break;
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
time_scale=(double)(endblock-startblock)/(double)w;
|
||||
gain_scale=(double)(pix->height()/65536.0)*
|
||||
pow(10.0,(double)gain/2000.0);
|
||||
for(int i=0;i<w;i++) {
|
||||
if(((dx=(2*((int)(time_scale*(double)i)+startblock)))<
|
||||
(int)wave_peaks->energySize())&&
|
||||
((startclipblock<0)||(dx>(startclipblock*2)))&&
|
||||
((endclipblock<0)||(dx<(endclipblock*2)))) {
|
||||
array.setPoint(i+1,i+1,
|
||||
center+(int)(gain_scale*
|
||||
((double)wave_peaks->energy(dx)+
|
||||
(double)wave_peaks->energy(dx+1))/2.0));
|
||||
}
|
||||
else {
|
||||
array.setPoint(i+1,i+1,center);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
drawPolygon(array);
|
||||
for(int i=0;i<(w+2);i++) {
|
||||
|
@ -71,6 +71,8 @@ VoiceTracker::VoiceTracker(const QString &logname,QString *import_path,
|
||||
QWidget *parent)
|
||||
: QDialog(parent,"",true)
|
||||
{
|
||||
setAttribute(Qt::WA_PaintOutsidePaintEvent);
|
||||
|
||||
edit_log_name=logname;
|
||||
edit_import_path=import_path;
|
||||
edit_coding=RDCae::Pcm16;
|
||||
@ -1738,6 +1740,7 @@ void VoiceTracker::positionData(int id,int msecs)
|
||||
p->setPen(Qt::black);
|
||||
p->setBrush(Qt::black);
|
||||
ClearCursor(p);
|
||||
// p->setCompositionMode(QPainter::RasterOp_SourceXorDestination);
|
||||
int x=-1;
|
||||
if(msecs>=0) {
|
||||
if((msecs>edit_wave_origin[id])&&
|
||||
|
Loading…
x
Reference in New Issue
Block a user