Fix build for Qt 5.3

This commit is contained in:
Felix Kauselmann 2017-11-05 17:56:39 +01:00
parent 237cb02638
commit a0e3046be7
2 changed files with 92 additions and 80 deletions

View File

@ -24,15 +24,15 @@ struct Preset defaultYACReaderFlowConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
3.f, //Animation_Fade_out_dis sets the distance of view 3.f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation 3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.01f, //View_rotate_add sets the speed of the rotation 0.01f, //View_rotate_add sets the speed of the rotation
0.02f, //View_rotate_sub sets the speed of reversing the rotation 0.02f, //View_rotate_sub sets the speed of reversing the rotation
20.f, //View_angle sets the maximum view angle 20.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
0.f, //CF_Y the Y Position of the Coverflow 0.f, //CF_Y the Y Position of the Coverflow
-8.f, //CF_Z the Z Position of the Coverflow -8.f, //CF_Z the Z Position of the Coverflow
@ -43,7 +43,7 @@ struct Preset defaultYACReaderFlowConfig = {
-50.f, //Rotation sets the rotation of each cover -50.f, //Rotation sets the rotation of each cover
0.18f, //X_Distance sets the distance between the covers 0.18f, //X_Distance sets the distance between the covers
1.f, //Center_Distance sets the distance between the centered and the non centered covers 1.f, //Center_Distance sets the distance between the centered and the non centered covers
0.1f, //Z_Distance sets the pushback amount 0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount 0.0f, //Y_Distance sets the elevation amount
30.f //zoom level 30.f //zoom level
@ -54,15 +54,15 @@ struct Preset presetYACReaderFlowClassicConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
2.f, //Animation_Fade_out_dis sets the distance of view 2.f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation 3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.08f, //View_rotate_add sets the speed of the rotation 0.08f, //View_rotate_add sets the speed of the rotation
0.08f, //View_rotate_sub sets the speed of reversing the rotation 0.08f, //View_rotate_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle 30.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow -0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow -7.f, //CF_Z the Z Position of the Coverflow
@ -73,9 +73,9 @@ struct Preset presetYACReaderFlowClassicConfig = {
-40.f, //Rotation sets the rotation of each cover -40.f, //Rotation sets the rotation of each cover
0.18f, //X_Distance sets the distance between the covers 0.18f, //X_Distance sets the distance between the covers
1.f, //Center_Distance sets the distance between the centered and the non centered covers 1.f, //Center_Distance sets the distance between the centered and the non centered covers
0.1f, //Z_Distance sets the pushback amount 0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount 0.0f, //Y_Distance sets the elevation amount
22.f //zoom level 22.f //zoom level
}; };
@ -84,15 +84,15 @@ struct Preset presetYACReaderFlowStripeConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
6.f, //Animation_Fade_out_dis sets the distance of view 6.f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
4.f, //View_rotate_light_strenght sets the light strenght on rotation 4.f, //View_rotate_light_strenght sets the light strenght on rotation
0.08f, //View_rotate_add sets the speed of the rotation 0.08f, //View_rotate_add sets the speed of the rotation
0.08f, //View_rotate_sub sets the speed of reversing the rotation 0.08f, //View_rotate_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle 30.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow -0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow -7.f, //CF_Z the Z Position of the Coverflow
@ -103,7 +103,7 @@ struct Preset presetYACReaderFlowStripeConfig = {
0.f, //Rotation sets the rotation of each cover 0.f, //Rotation sets the rotation of each cover
1.1f, //X_Distance sets the distance between the covers 1.1f, //X_Distance sets the distance between the covers
0.2f, //Center_Distance sets the distance between the centered and the non centered covers 0.2f, //Center_Distance sets the distance between the centered and the non centered covers
0.01f, //Z_Distance sets the pushback amount 0.01f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount 0.0f, //Y_Distance sets the elevation amount
22.f //zoom level 22.f //zoom level
@ -114,15 +114,15 @@ struct Preset presetYACReaderFlowOverlappedStripeConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
2.f, //Animation_Fade_out_dis sets the distance of view 2.f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation 3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.08f, //View_rotate_add sets the speed of the rotation 0.08f, //View_rotate_add sets the speed of the rotation
0.08f, //View_rotate_sub sets the speed of reversing the rotation 0.08f, //View_rotate_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle 30.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow -0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow -7.f, //CF_Z the Z Position of the Coverflow
@ -133,7 +133,7 @@ struct Preset presetYACReaderFlowOverlappedStripeConfig = {
0.f, //Rotation sets the rotation of each cover 0.f, //Rotation sets the rotation of each cover
0.18f, //X_Distance sets the distance between the covers 0.18f, //X_Distance sets the distance between the covers
1.f, //Center_Distance sets the distance between the centered and the non centered covers 1.f, //Center_Distance sets the distance between the centered and the non centered covers
0.1f, //Z_Distance sets the pushback amount 0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount 0.0f, //Y_Distance sets the elevation amount
22.f //zoom level 22.f //zoom level
@ -144,15 +144,15 @@ struct Preset pressetYACReaderFlowUpConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
2.5f, //Animation_Fade_out_dis sets the distance of view 2.5f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation 3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.08f, //View_rotate_add sets the speed of the rotation 0.08f, //View_rotate_add sets the speed of the rotation
0.08f, //View_rotate_sub sets the speed of reversing the rotation 0.08f, //View_rotate_sub sets the speed of reversing the rotation
5.f, //View_angle sets the maximum view angle 5.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow -0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow -7.f, //CF_Z the Z Position of the Coverflow
@ -163,7 +163,7 @@ struct Preset pressetYACReaderFlowUpConfig = {
-50.f, //Rotation sets the rotation of each cover -50.f, //Rotation sets the rotation of each cover
0.18f, //X_Distance sets the distance between the covers 0.18f, //X_Distance sets the distance between the covers
1.f, //Center_Distance sets the distance between the centered and the non centered covers 1.f, //Center_Distance sets the distance between the centered and the non centered covers
0.1f, //Z_Distance sets the pushback amount 0.1f, //Z_Distance sets the pushback amount
-0.1f, //Y_Distance sets the elevation amount -0.1f, //Y_Distance sets the elevation amount
22.f //zoom level 22.f //zoom level
@ -174,15 +174,15 @@ struct Preset pressetYACReaderFlowDownConfig = {
0.08f, //Animation_step sets the speed of the animation 0.08f, //Animation_step sets the speed of the animation
1.5f, //Animation_speedup sets the acceleration of the animation 1.5f, //Animation_speedup sets the acceleration of the animation
0.1f, //Animation_step_max sets the maximum speed of the animation 0.1f, //Animation_step_max sets the maximum speed of the animation
2.5f, //Animation_Fade_out_dis sets the distance of view 2.5f, //Animation_Fade_out_dis sets the distance of view
1.5f, //pre_rotation sets the rotation increasion 1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation 3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.08f, //View_rotate_add sets the speed of the rotation 0.08f, //View_rotate_add sets the speed of the rotation
0.08f, //View_rotate_sub sets the speed of reversing the rotation 0.08f, //View_rotate_sub sets the speed of reversing the rotation
5.f, //View_angle sets the maximum view angle 5.f, //View_angle sets the maximum view angle
0.f, //CF_X the X Position of the Coverflow 0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow -0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow -7.f, //CF_Z the Z Position of the Coverflow
@ -193,14 +193,14 @@ struct Preset pressetYACReaderFlowDownConfig = {
-50.f, //Rotation sets the rotation of each cover -50.f, //Rotation sets the rotation of each cover
0.18f, //X_Distance sets the distance between the covers 0.18f, //X_Distance sets the distance between the covers
1.f, //Center_Distance sets the distance between the centered and the non centered covers 1.f, //Center_Distance sets the distance between the centered and the non centered covers
0.1f, //Z_Distance sets the pushback amount 0.1f, //Z_Distance sets the pushback amount
0.1f, //Y_Distance sets the elevation amount 0.1f, //Y_Distance sets the elevation amount
22.f //zoom level 22.f //zoom level
}; };
/*Constructor*/ /*Constructor*/
YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p) YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p)
:QGLWidget(QGLFormat(QGL::SampleBuffers), parent),numObjects(0),lazyPopulateObjects(-1),bUseVSync(false),hasBeenInitialized(false) :QGLWidget(QGLFormat(QGL::SampleBuffers), parent),numObjects(0),lazyPopulateObjects(-1),bUseVSync(false),hasBeenInitialized(false),flowRightToLeft(false)
{ {
updateCount = 0; updateCount = 0;
config = p; config = p;
@ -251,7 +251,7 @@ void YACReaderFlowGL::timerEvent(QTimerEvent * event)
{ {
if(timerId == event->timerId()) if(timerId == event->timerId())
updateGL(); updateGL();
//if(!worker->isRunning()) //if(!worker->isRunning())
//worker->start(); //worker->start();
} }
@ -354,6 +354,9 @@ void YACReaderFlowGL::udpatePerspective(int width, int height)
/*Private*/ /*Private*/
void YACReaderFlowGL::calcPos(YACReader3DImage & image, int pos) void YACReaderFlowGL::calcPos(YACReader3DImage & image, int pos)
{ {
if(flowRightToLeft){
pos = pos * -1;
}
if(pos == 0){ if(pos == 0){
image.current = centerPos; image.current = centerPos;
}else{ }else{
@ -414,7 +417,7 @@ void YACReaderFlowGL::drawCover(const YACReader3DImage & image)
float w = image.width; float w = image.width;
float h = image.height; float h = image.height;
//fadeout //fadeout
float opacity = 1-1/(config.animationFadeOutDist+config.viewRotateLightStrenght*fabs(viewRotate))*fabs(0-image.current.x); float opacity = 1-1/(config.animationFadeOutDist+config.viewRotateLightStrenght*fabs(viewRotate))*fabs(0-image.current.x);
glLoadIdentity(); glLoadIdentity();
@ -492,7 +495,7 @@ void YACReaderFlowGL::drawCover(const YACReader3DImage & image)
glEnd(); glEnd();
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
if(showMarks && loaded[image.index] && marks[image.index] != Unread) if(showMarks && loaded[image.index] && marks[image.index] != Unread)
{ {
glEnable(GL_TEXTURE_2D); glEnable(GL_TEXTURE_2D);
@ -526,7 +529,7 @@ void YACReaderFlowGL::drawCover(const YACReader3DImage & image)
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
} }
glPopMatrix(); glPopMatrix();
} }
@ -598,7 +601,7 @@ void YACReaderFlowGL::showPrevious()
viewRotateActive = 1; viewRotateActive = 1;
} }
} }
void YACReaderFlowGL::showNext() void YACReaderFlowGL::showNext()
@ -778,7 +781,7 @@ void YACReaderFlowGL::populate(int n)
loaded = QVector<bool>(n,false); loaded = QVector<bool>(n,false);
//marks = QVector<bool>(n,false); //marks = QVector<bool>(n,false);
//worker->start(); //worker->start();
} }
@ -870,7 +873,7 @@ void YACReaderFlowGL::setCenter_Distance(int distance)
config.centerDistance = distance/100.0; config.centerDistance = distance/100.0;
} }
//sets the pushback amount //sets the pushback amount
void YACReaderFlowGL::setZ_Distance(int distance) void YACReaderFlowGL::setZ_Distance(int distance)
{ {
startAnimationTimer(); startAnimationTimer();
@ -1025,6 +1028,11 @@ void YACReaderFlowGL::render()
//do nothing //do nothing
} }
void YACReaderFlowGL::setFlowRightToLeft(bool b)
{
flowRightToLeft = b;
}
//EVENTOS //EVENTOS
void YACReaderFlowGL::wheelEvent(QWheelEvent * event) void YACReaderFlowGL::wheelEvent(QWheelEvent * event)
{ {
@ -1045,7 +1053,7 @@ void YACReaderFlowGL::wheelEvent(QWheelEvent * event)
void YACReaderFlowGL::keyPressEvent(QKeyEvent *event) void YACReaderFlowGL::keyPressEvent(QKeyEvent *event)
{ {
if(event->key() == Qt::Key_Left) if((event->key() == Qt::Key_Left && !flowRightToLeft) || (event->key() == Qt::Key_Right && flowRightToLeft))
{ {
if(event->modifiers() == Qt::ControlModifier) if(event->modifiers() == Qt::ControlModifier)
setCurrentIndex((currentSelected-10<0)?0:currentSelected-10); setCurrentIndex((currentSelected-10<0)?0:currentSelected-10);
@ -1055,7 +1063,7 @@ void YACReaderFlowGL::keyPressEvent(QKeyEvent *event)
return; return;
} }
if(event->key() == Qt::Key_Right) if((event->key() == Qt::Key_Right && !flowRightToLeft) || (event->key() == Qt::Key_Left && flowRightToLeft))
{ {
if(event->modifiers() == Qt::ControlModifier) if(event->modifiers() == Qt::ControlModifier)
setCurrentIndex((currentSelected+10>=numObjects)?numObjects-1:currentSelected+10); setCurrentIndex((currentSelected+10>=numObjects)?numObjects-1:currentSelected+10);
@ -1067,7 +1075,7 @@ void YACReaderFlowGL::keyPressEvent(QKeyEvent *event)
if(event->key() == Qt::Key_Up) if(event->key() == Qt::Key_Up)
{ {
//emit selected(centerIndex()); //emit selected(centerIndex());
return; return;
} }
@ -1098,7 +1106,7 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ); gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);
if(posX >= 0.5) if((posX >= 0.5 && !flowRightToLeft) || (posX <=-0.5 && flowRightToLeft))
{ {
//int index = currentSelected+1; //int index = currentSelected+1;
//while((cfImages[index].current.x-cfImages[index].width/(2.0*config.rotation)) < posX) //while((cfImages[index].current.x-cfImages[index].width/(2.0*config.rotation)) < posX)
@ -1106,7 +1114,7 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
//setCurrentIndex(index-1); //setCurrentIndex(index-1);
showNext(); showNext();
} }
else if(posX <=-0.5) else if((posX <=-0.5 && !flowRightToLeft) || (posX >= 0.5 && flowRightToLeft) )
showPrevious(); showPrevious();
} else } else
QGLWidget::mousePressEvent(event); QGLWidget::mousePressEvent(event);
@ -1199,7 +1207,7 @@ void YACReaderComicFlowGL::updateImageData()
} }
} }
// try to load only few images on the left and right side // try to load only few images on the left and right side
// i.e. all visible ones plus some extra // i.e. all visible ones plus some extra
int count=8; int count=8;
switch(performance) switch(performance)
@ -1224,7 +1232,7 @@ void YACReaderComicFlowGL::updateImageData()
{ {
indexes[j*2+1] = center+j+1; indexes[j*2+1] = center+j+1;
indexes[j*2+2] = center-j-1; indexes[j*2+2] = center-j-1;
} }
for(int c = 0; c < 2*count+1; c++) for(int c = 0; c < 2*count+1; c++)
{ {
int i = indexes[c]; int i = indexes[c];
@ -1332,7 +1340,7 @@ void YACReaderPageFlowGL::updateImageData()
} }
} }
// try to load only few images on the left and right side // try to load only few images on the left and right side
// i.e. all visible ones plus some extra // i.e. all visible ones plus some extra
int count=8; int count=8;
switch(performance) switch(performance)
@ -1357,17 +1365,17 @@ void YACReaderPageFlowGL::updateImageData()
{ {
indexes[j*2+1] = center+j+1; indexes[j*2+1] = center+j+1;
indexes[j*2+2] = center-j-1; indexes[j*2+2] = center-j-1;
} }
for(int c = 0; c < 2*count+1; c++) for(int c = 0; c < 2*count+1; c++)
{ {
int i = indexes[c]; int i = indexes[c];
if((i >= 0) && (i < numObjects)) if((i >= 0) && (i < numObjects))
if(rawImages.size()>0) if(rawImages.size()>0)
if(!loaded[i]&&imagesReady[i])//slide(i).isNull()) if(!loaded[i]&&imagesReady[i])//slide(i).isNull())
{ {
worker->generate(i, rawImages.at(i)); worker->generate(i, rawImages.at(i));
delete[] indexes; delete[] indexes;
return; return;
} }
@ -1416,7 +1424,7 @@ QImage ImageLoaderGL::loadImage(const QString& fileName)
return image; return image;
} }
ImageLoaderGL::ImageLoaderGL(YACReaderFlowGL * flow): ImageLoaderGL::ImageLoaderGL(YACReaderFlowGL * flow):
QThread(),flow(flow),restart(false), working(false), idx(-1) QThread(),flow(flow),restart(false), working(false), idx(-1)
{ {
@ -1433,7 +1441,7 @@ ImageLoaderGL::~ImageLoaderGL()
bool ImageLoaderGL::busy() const bool ImageLoaderGL::busy() const
{ {
return isRunning() ? working : false; return isRunning() ? working : false;
} }
void ImageLoaderGL::generate(int index, const QString& fileName) void ImageLoaderGL::generate(int index, const QString& fileName)
{ {
@ -1491,9 +1499,9 @@ void ImageLoaderGL::run()
} }
} }
QImage ImageLoaderGL::result() QImage ImageLoaderGL::result()
{ {
return img; return img;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -1526,7 +1534,7 @@ QImage ImageLoaderByteArrayGL::loadImage(const QByteArray& raw)
return image; return image;
} }
ImageLoaderByteArrayGL::ImageLoaderByteArrayGL(YACReaderFlowGL * flow): ImageLoaderByteArrayGL::ImageLoaderByteArrayGL(YACReaderFlowGL * flow):
QThread(),flow(flow),restart(false), working(false), idx(-1) QThread(),flow(flow),restart(false), working(false), idx(-1)
{ {
@ -1543,7 +1551,7 @@ ImageLoaderByteArrayGL::~ImageLoaderByteArrayGL()
bool ImageLoaderByteArrayGL::busy() const bool ImageLoaderByteArrayGL::busy() const
{ {
return isRunning() ? working : false; return isRunning() ? working : false;
} }
void ImageLoaderByteArrayGL::generate(int index, const QByteArray& raw) void ImageLoaderByteArrayGL::generate(int index, const QByteArray& raw)
{ {
@ -1591,8 +1599,7 @@ void ImageLoaderByteArrayGL::run()
} }
} }
QImage ImageLoaderByteArrayGL::result() QImage ImageLoaderByteArrayGL::result()
{ {
return img; return img;
} }

View File

@ -57,13 +57,13 @@ struct Preset{
float animationSpeedUp; float animationSpeedUp;
//sets the maximum speed of the animation //sets the maximum speed of the animation
float animationStepMax; float animationStepMax;
//sets the distance of view //sets the distance of view
float animationFadeOutDist; float animationFadeOutDist;
//sets the rotation increasion //sets the rotation increasion
float preRotation; float preRotation;
//sets the light strenght on rotation //sets the light strenght on rotation
float viewRotateLightStrenght; float viewRotateLightStrenght;
//sets the speed of the rotation //sets the speed of the rotation
float viewRotateAdd; float viewRotateAdd;
//sets the speed of reversing the rotation //sets the speed of reversing the rotation
float viewRotateSub; float viewRotateSub;
@ -71,17 +71,17 @@ struct Preset{
float viewAngle; float viewAngle;
/*** Position Configuration ***/ /*** Position Configuration ***/
//the X Position of the Coverflow //the X Position of the Coverflow
float cfX; float cfX;
//the Y Position of the Coverflow //the Y Position of the Coverflow
float cfY; float cfY;
//the Z Position of the Coverflow //the Z Position of the Coverflow
float cfZ; float cfZ;
//the X Rotation of the Coverflow //the X Rotation of the Coverflow
float cfRX; float cfRX;
//the Y Rotation of the Coverflow //the Y Rotation of the Coverflow
float cfRY; float cfRY;
//the Z Rotation of the Coverflow //the Z Rotation of the Coverflow
float cfRZ; float cfRZ;
//sets the rotation of each cover //sets the rotation of each cover
float rotation; float rotation;
@ -89,7 +89,7 @@ struct Preset{
float xDistance; float xDistance;
//sets the distance between the centered and the non centered covers //sets the distance between the centered and the non centered covers
float centerDistance; float centerDistance;
//sets the pushback amount //sets the pushback amount
float zDistance; float zDistance;
//sets the elevation amount //sets the elevation amount
float yDistance; float yDistance;
@ -122,7 +122,7 @@ protected:
void drawCover(const YACReader3DImage & image); void drawCover(const YACReader3DImage & image);
void udpatePerspective(int width, int height); void udpatePerspective(int width, int height);
int updateCount; int updateCount;
WidgetLoader * loader; WidgetLoader * loader;
int fontSize; int fontSize;
@ -143,16 +143,19 @@ protected:
QVector<YACReader3DImage> images; QVector<YACReader3DImage> images;
bool hasBeenInitialized; bool hasBeenInitialized;
// sets flow direction right-to-left (manga mode)
bool flowRightToLeft;
Performance performance; Performance performance;
bool bUseVSync; bool bUseVSync;
/*** Animation Settings ***/ /*** Animation Settings ***/
Preset config; Preset config;
//sets/returns the curent selected cover //sets/returns the curent selected cover
int currentSelected; int currentSelected;
//defines the position of the centered cover //defines the position of the centered cover
YACReader3DVector centerPos; YACReader3DVector centerPos;
/*** Style ***/ /*** Style ***/
@ -172,7 +175,7 @@ protected:
void startAnimationTimer(); void startAnimationTimer();
void stopAnimationTimer(); void stopAnimationTimer();
public: public:
@ -198,7 +201,7 @@ public:
void draw(); void draw();
//updates the coverflow //updates the coverflow
void updatePositions(); void updatePositions();
//inserts a new item to the coverflow //inserts a new item to the coverflow
//if item is set to a value > -1 it updates a already set value //if item is set to a value > -1 it updates a already set value
//otherwise a new entry is set //otherwise a new entry is set
void insert(const char *name, GLuint Tex, float x, float y,int item = -1); void insert(const char *name, GLuint Tex, float x, float y,int item = -1);
@ -215,9 +218,9 @@ public:
public slots: public slots:
void setCF_RX(int value); void setCF_RX(int value);
//the Y Rotation of the Coverflow //the Y Rotation of the Coverflow
void setCF_RY(int value); void setCF_RY(int value);
//the Z Rotation of the Coverflow //the Z Rotation of the Coverflow
void setCF_RZ(int value); void setCF_RZ(int value);
//perspective //perspective
@ -228,7 +231,7 @@ public:
void setX_Distance(int distance); void setX_Distance(int distance);
//sets the distance between the centered and the non centered covers //sets the distance between the centered and the non centered covers
void setCenter_Distance(int distance); void setCenter_Distance(int distance);
//sets the pushback amount //sets the pushback amount
void setZ_Distance(int distance); void setZ_Distance(int distance);
void setCF_Y(int value); void setCF_Y(int value);
@ -248,6 +251,8 @@ public:
void useVSync(bool b); void useVSync(bool b);
void setFlowRightToLeft(bool b);
virtual void updateImageData() = 0; virtual void updateImageData() = 0;
void reset(); void reset();
@ -336,7 +341,7 @@ protected:
private: private:
QMutex mutex; QMutex mutex;
QWaitCondition condition; QWaitCondition condition;
bool restart; bool restart;
bool working; bool working;