opciones y configuraci?n integrados completamente con QSettings

goToFlow ya es sensible al nivel de rendimiento

a?adidos al repositorio ficheros que faltaban

corregidos varios warnings en la compilaci?n
This commit is contained in:
Luis Ángel San Martín
2012-10-11 08:16:57 +02:00
parent a4ecda4ae9
commit b4669c5b8b
20 changed files with 1150 additions and 294 deletions

View File

@ -125,6 +125,8 @@ QIcon YACReaderIconProvider::icon(const QFileInfo & info) const
return QIcon(":/images/folder.png");
if(info.isFile())
return QIcon(":/images/icon.png");
return QFileIconProvider::icon(info);
}
QString YACReaderIconProvider::type(const QFileInfo & info) const
{
@ -536,9 +538,9 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent)
connect(useGL,SIGNAL(stateChanged(int)),this,SLOT(saveUseGL(int)));
//sw CONNECTIONS
connect(sw->radio1,SIGNAL(toggled(bool)),this,SLOT(setClassicConfig()));
connect(sw->radio2,SIGNAL(toggled(bool)),this,SLOT(setStripeConfig()));
connect(sw->radio3,SIGNAL(toggled(bool)),this,SLOT(setOverlappedStripeConfig()));
connect(sw->radio1,SIGNAL(toggled(bool)),this,SLOT(setClassicConfigSW()));
connect(sw->radio2,SIGNAL(toggled(bool)),this,SLOT(setStripeConfigSW()));
connect(sw->radio3,SIGNAL(togg+led(bool)),this,SLOT(setOverlappedStripeConfigSW()));
//gl CONNECTIONS
connect(gl->radioClassic,SIGNAL(toggled(bool)),this,SLOT(setClassicConfig()));
@ -587,7 +589,7 @@ YACReaderOptionsDialog::YACReaderOptionsDialog(QWidget * parent)
void YACReaderOptionsDialog::savePerformance(int value)
{
settings->setValue("performance",value);
settings->setValue(PERFORMANCE,value);
}
void YACReaderOptionsDialog::saveOptions()
@ -610,65 +612,65 @@ void YACReaderOptionsDialog::saveUseGL(int b)
}
resize(0,0);
settings->setValue("useOpenGL",b);
settings->setValue(USE_OPEN_GL,b);
}
void YACReaderOptionsDialog::saveXRotation(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("xRotation",gl->xRotation->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(X_ROTATION,value);
}
void YACReaderOptionsDialog::saveYPosition(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("yPosition",gl->yPosition->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(Y_POSITION,value);
}
void YACReaderOptionsDialog::saveCoverDistance(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("coverDistance",gl->coverDistance->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(COVER_DISTANCE,value);
}
void YACReaderOptionsDialog::saveCentralDistance(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("centralDistance",gl->centralDistance->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(CENTRAL_DISTANCE,value);
}
void YACReaderOptionsDialog::saveZoomLevel(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("zoomLevel",gl->zoomLevel->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(ZOOM_LEVEL,value);
}
void YACReaderOptionsDialog::saveYCoverOffset(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("yCoverOffset",gl->yCoverOffset->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(Y_COVER_OFFSET,value);
}
void YACReaderOptionsDialog::saveZCoverOffset(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("zCoverOffset",gl->zCoverOffset->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(Z_COVER_OFFSET,value);
}
void YACReaderOptionsDialog::saveCoverRotation(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("coverRotation",gl->coverRotation->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(COVER_ROTATION,value);
}
void YACReaderOptionsDialog::saveFadeOutDist(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("fadeOutDist",gl->fadeOutDist->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(FADE_OUT_DIST,value);
}
void YACReaderOptionsDialog::saveLightStrength(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("lightStrength",gl->lightStrength->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(LIGHT_STRENGTH,value);
}
void YACReaderOptionsDialog::saveMaxAngle(int value)
{
settings->setValue("flowType",Custom);
settings->setValue("maxAngle",gl->maxAngle->getValue());
settings->setValue(FLOW_TYPE_GL,Custom);
settings->setValue(MAX_ANGLE,value);
}
void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
@ -677,7 +679,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
//FLOW CONFIG
if(settings->contains("useOpenGL") && settings->value("useOpenGL").toInt() == Qt::Checked)
if(settings->contains(USE_OPEN_GL) && settings->value(USE_OPEN_GL).toInt() == Qt::Checked)
{
sw->setVisible(false);
gl->setVisible(true);
@ -691,7 +693,7 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
}
if(!settings->contains("flowType"))
if(!settings->contains(FLOW_TYPE_GL))
{
setClassicConfig();
gl->radioClassic->setChecked(true);
@ -699,9 +701,9 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
return;
}
gl->performanceSlider->setValue(settings->value("performance").toInt());
gl->performanceSlider->setValue(settings->value(PERFORMANCE).toInt());
FlowType flowType;
switch(settings->value("flowType").toInt())
switch(settings->value(FLOW_TYPE_GL).toInt())
{
case 0:
flowType = CoverFlowLike;
@ -770,49 +772,65 @@ void YACReaderOptionsDialog::restoreOptions(QSettings * settings)
void YACReaderOptionsDialog::loadConfig()
{
gl->xRotation->setValue(settings->value("xRotation").toInt());
gl->yPosition->setValue(settings->value("yPosition").toInt());
gl->coverDistance->setValue(settings->value("coverDistance").toInt());
gl->centralDistance->setValue(settings->value("centralDistance").toInt());
gl->zoomLevel->setValue(settings->value("zoomLevel").toInt());
gl->yCoverOffset->setValue(settings->value("yCoverOffset").toInt());
gl->zCoverOffset->setValue(settings->value("zCoverOffset").toInt());
gl->coverRotation->setValue(settings->value("coverRotation").toInt());
gl->fadeOutDist->setValue(settings->value("fadeOutDist").toInt());
gl->lightStrength->setValue(settings->value("lightStrength").toInt());
gl->maxAngle->setValue(settings->value("maxAngle").toInt());
gl->xRotation->setValue(settings->value(X_ROTATION).toInt());
gl->yPosition->setValue(settings->value(Y_POSITION).toInt());
gl->coverDistance->setValue(settings->value(COVER_DISTANCE).toInt());
gl->centralDistance->setValue(settings->value(CENTRAL_DISTANCE).toInt());
gl->zoomLevel->setValue(settings->value(ZOOM_LEVEL).toInt());
gl->yCoverOffset->setValue(settings->value(Y_COVER_OFFSET).toInt());
gl->zCoverOffset->setValue(settings->value(Z_COVER_OFFSET).toInt());
gl->coverRotation->setValue(settings->value(COVER_ROTATION).toInt());
gl->fadeOutDist->setValue(settings->value(FADE_OUT_DIST).toInt());
gl->lightStrength->setValue(settings->value(LIGHT_STRENGTH).toInt());
gl->maxAngle->setValue(settings->value(MAX_ANGLE).toInt());
}
void YACReaderOptionsDialog::setClassicConfigSW()
{
settings->setValue(FLOW_TYPE_SW,CoverFlowLike);
}
void YACReaderOptionsDialog::setStripeConfigSW()
{
settings->setValue(FLOW_TYPE_SW,Strip);
}
void YACReaderOptionsDialog::setOverlappedStripeConfigSW()
{
settings->setValue(FLOW_TYPE_SW,StripOverlapped);
}
void YACReaderOptionsDialog::setClassicConfig()
{
settings->setValue("flowType",CoverFlowLike);
settings->setValue(FLOW_TYPE_GL,CoverFlowLike);
gl->setValues(presetYACReaderFlowClassicConfig);
}
void YACReaderOptionsDialog::setStripeConfig()
{
settings->setValue("flowType",Strip);
settings->setValue(FLOW_TYPE_GL,Strip);
gl->setValues(presetYACReaderFlowStripeConfig);
}
void YACReaderOptionsDialog::setOverlappedStripeConfig()
{
settings->setValue("flowType",StripOverlapped);
settings->setValue(FLOW_TYPE_GL,StripOverlapped);
gl->setValues(presetYACReaderFlowOverlappedStripeConfig);
}
void YACReaderOptionsDialog::setModernConfig()
{
settings->setValue("flowType",Modern);
settings->setValue(FLOW_TYPE_GL,Modern);
gl->setValues(defaultYACReaderFlowConfig);
}
void YACReaderOptionsDialog::setRouletteConfig()
{
settings->setValue("flowType",Roulette);
settings->setValue(FLOW_TYPE_GL,Roulette);
gl->setValues(pressetYACReaderFlowDownConfig);
}

View File

@ -293,6 +293,9 @@ protected slots:
virtual void setOverlappedStripeConfig();
virtual void setModernConfig();
virtual void setRouletteConfig();
virtual void setClassicConfigSW();
virtual void setStripeConfigSW();
virtual void setOverlappedStripeConfigSW();
signals:
void optionsChanged();

View File

@ -367,7 +367,7 @@ void PictureFlowAnimator::start(int slide)
{
step = (target < state->centerSlide.slideIndex) ? -1 : 1;
animateTimer.setSingleShot(true);
animateTimer.start(0); //TODO comprobar rendimiento, originalmente era 30
animateTimer.start(30); //TODO comprobar rendimiento, originalmente era 30
animating = true;
}
}

View File

@ -12,182 +12,182 @@
/*** Position Configuration ***/
struct Preset defaultYACReaderFlowConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
3, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
3.f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
3, //View_rotate_light_strenght sets the light strenght on rotation
0.01, //View_rotate_add sets the speed of the rotation
0.02, //View_rotate_sub sets the speed of reversing the rotation
20, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
3.f, //View_rotate_light_strenght sets the light strenght on rotation
0.01f, //View_rotate_add sets the speed of the rotation
0.02f, //View_rotate_sub sets the speed of reversing the rotation
20.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
0, //CF_Y the Y Position of the Coverflow
-12, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
0.f, //CF_Y the Y Position of the Coverflow
-12.f, //CF_Z the Z Position of the Coverflow
15, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
15.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
-50, //Rotation sets the rotation of each cover
0.18, //X_Distance sets the distance between the covers
1, //Center_Distance sets the distance between the centered and the non centered covers
0.1, //Z_Distance sets the pushback amount
0.0, //Y_Distance sets the elevation amount
-50.f, //Rotation sets the rotation of each cover
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
0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount
30 //zoom level
30.f //zoom level
};
struct Preset presetYACReaderFlowClassicConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
2, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
2.f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
3, //View_rotate_light_strenght sets the light strenght on rotation
0.08, //View_rotate_add sets the speed of the rotation
0.08, //View_rotate_sub sets the speed of reversing the rotation
30, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
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_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
-0.2, //CF_Y the Y Position of the Coverflow
-7, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow
0, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
0.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
-40, //Rotation sets the rotation of each cover
0.18, //X_Distance sets the distance between the covers
1, //Center_Distance sets the distance between the centered and the non centered covers
0.1, //Z_Distance sets the pushback amount
0.0, //Y_Distance sets the elevation amount
-40.f, //Rotation sets the rotation of each cover
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
0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount
22 //zoom level
22.f //zoom level
};
struct Preset presetYACReaderFlowStripeConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
6, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
6.f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
4, //View_rotate_light_strenght sets the light strenght on rotation
0.08, //View_rotate_add sets the speed of the rotation
0.08, //View_rotate_sub sets the speed of reversing the rotation
30, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
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_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
-0.2, //CF_Y the Y Position of the Coverflow
-7, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow
0, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
0.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
0, //Rotation sets the rotation of each cover
1.1, //X_Distance sets the distance between the covers
0.2, //Center_Distance sets the distance between the centered and the non centered covers
0.01, //Z_Distance sets the pushback amount
0.0, //Y_Distance sets the elevation amount
0.f, //Rotation sets the rotation of each cover
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.01f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount
22 //zoom level
22.f //zoom level
};
struct Preset presetYACReaderFlowOverlappedStripeConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
2, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
2.f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
3, //View_rotate_light_strenght sets the light strenght on rotation
0.08, //View_rotate_add sets the speed of the rotation
0.08, //View_rotate_sub sets the speed of reversing the rotation
30, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
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_sub sets the speed of reversing the rotation
30.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
-0.2, //CF_Y the Y Position of the Coverflow
-7, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow
0, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
0.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
0, //Rotation sets the rotation of each cover
0.18, //X_Distance sets the distance between the covers
1, //Center_Distance sets the distance between the centered and the non centered covers
0.1, //Z_Distance sets the pushback amount
0.0, //Y_Distance sets the elevation amount
0.f, //Rotation sets the rotation of each cover
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
0.1f, //Z_Distance sets the pushback amount
0.0f, //Y_Distance sets the elevation amount
22 //zoom level
22.f //zoom level
};
struct Preset pressetYACReaderFlowUpConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
2.5, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
2.5f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
3, //View_rotate_light_strenght sets the light strenght on rotation
0.08, //View_rotate_add sets the speed of the rotation
0.08, //View_rotate_sub sets the speed of reversing the rotation
5, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
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_sub sets the speed of reversing the rotation
5.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
-0.2, //CF_Y the Y Position of the Coverflow
-7, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow
0, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
0.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
-50, //Rotation sets the rotation of each cover
0.18, //X_Distance sets the distance between the covers
1, //Center_Distance sets the distance between the centered and the non centered covers
0.1, //Z_Distance sets the pushback amount
-0.1, //Y_Distance sets the elevation amount
-50.f, //Rotation sets the rotation of each cover
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
0.1f, //Z_Distance sets the pushback amount
-0.1f, //Y_Distance sets the elevation amount
22 //zoom level
22.f //zoom level
};
struct Preset pressetYACReaderFlowDownConfig = {
0.08, //Animation_step sets the speed of the animation
1.5, //Animation_speedup sets the acceleration of the animation
0.1, //Animation_step_max sets the maximum speed of the animation
2.5, //Animation_Fade_out_dis sets the distance of view
0.08f, //Animation_step sets the speed 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
2.5f, //Animation_Fade_out_dis sets the distance of view
1.5, //pre_rotation sets the rotation increasion
3, //View_rotate_light_strenght sets the light strenght on rotation
0.08, //View_rotate_add sets the speed of the rotation
0.08, //View_rotate_sub sets the speed of reversing the rotation
5, //View_angle sets the maximum view angle
1.5f, //pre_rotation sets the rotation increasion
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_sub sets the speed of reversing the rotation
5.f, //View_angle sets the maximum view angle
0, //CF_X the X Position of the Coverflow
-0.2, //CF_Y the Y Position of the Coverflow
-7, //CF_Z the Z Position of the Coverflow
0.f, //CF_X the X Position of the Coverflow
-0.2f, //CF_Y the Y Position of the Coverflow
-7.f, //CF_Z the Z Position of the Coverflow
0, //CF_RX the X Rotation of the Coverflow
0, //CF_RY the Y Rotation of the Coverflow
0, //CF_RZ the Z Rotation of the Coverflow
0.f, //CF_RX the X Rotation of the Coverflow
0.f, //CF_RY the Y Rotation of the Coverflow
0.f, //CF_RZ the Z Rotation of the Coverflow
-50, //Rotation sets the rotation of each cover
0.18, //X_Distance sets the distance between the covers
1, //Center_Distance sets the distance between the centered and the non centered covers
0.1, //Z_Distance sets the pushback amount
0.1, //Y_Distance sets the elevation amount
-50.f, //Rotation sets the rotation of each cover
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
0.1f, //Z_Distance sets the pushback amount
0.1f, //Y_Distance sets the elevation amount
22 //zoom level
22.f //zoom level
};
/*Constructor*/
YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p)
@ -198,21 +198,21 @@ YACReaderFlowGL::YACReaderFlowGL(QWidget *parent,struct Preset p)
currentSelected = 0;
centerPos.x = 0;
centerPos.y = 0;
centerPos.z = 1;
centerPos.rot = 0;
centerPos.x = 0.f;
centerPos.y = 0.f;
centerPos.z = 1.f;
centerPos.rot = 0.f;
/*** Style ***/
shadingTop = 0.8;
shadingBottom = 0.02;
reflectionUp = 0;
reflectionBottom = 0.6;
shadingTop = 0.8f;
shadingBottom = 0.02f;
reflectionUp = 0.f;
reflectionBottom = 0.6f;
/*** System variables ***/
numObjects = 0;
CFImage Dummy;
viewRotate = 0;
//CFImage Dummy;
viewRotate = 0.f;
viewRotateActive = 0;
stepBackup = config.animationStep/config.animationSpeedUp;
@ -301,8 +301,8 @@ void YACReaderFlowGL::resizeGL(int width, int height)
#ifdef QT_OPENGL_ES_1
//glOrthof(-0.5, +0.5, -0.5, +0.5, 4.0, 15.0);
#else
float sideX = ((float(width)/height)/2)*1.5;
float sideY = 0.5*1.5;
//float sideX = ((float(width)/height)/2)*1.5;
//float sideY = 0.5*1.5;
gluPerspective(20.0, (float)width / (float)height, 1.0, 200.0);
//glOrtho(-sideX, sideX, -sideY+0.2, +sideY+0.2, 4, 11.0);
@ -395,22 +395,22 @@ void YACReaderFlowGL::drawCover(CFImage *CF)
//esquina inferior izquierda
glColor4f(LDOWN*opacity,LDOWN*opacity,LDOWN*opacity,1);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(w/2*-1, -0.5, 0);
glVertex3f(w/2.f*-1.f, -0.5f, 0.f);
//esquina inferior derecha
glColor4f(RDOWN*opacity,RDOWN*opacity,RDOWN*opacity,1);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(w/2, -0.5, 0);
glVertex3f(w/2.f, -0.5f, 0.f);
//esquina superior derecha
glColor4f(RUP*opacity,RUP*opacity,RUP*opacity,1);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(w/2, -0.5+h, 0);
glVertex3f(w/2.f, -0.5f+h, 0.f);
//esquina superior izquierda
glColor4f(LUP*opacity,LUP*opacity,LUP*opacity,1);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(w/2*-1, -0.5+h, 0);
glVertex3f(w/2.f*-1.f, -0.5f+h, 0.f);
glEnd();
@ -422,20 +422,20 @@ void YACReaderFlowGL::drawCover(CFImage *CF)
//esquina inferior izquierda
glColor4f(LUP*opacity*reflectionUp,LUP*opacity*reflectionUp,LUP*opacity*reflectionUp,opacity*reflectionUp);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(w/2*-1, -0.5-h, 0);
glVertex3f(w/2.f*-1.f, -0.5f-h, 0.f);
//esquina inferior derecha
glTexCoord2f(1.0f, 0.0f);
glVertex3f(w/2, -0.5-h, 0);
glVertex3f(w/2.f, -0.5f-h, 0.f);
//esquina superior derecha
glColor4f(opacity*reflectionBottom,opacity*reflectionBottom,opacity*reflectionBottom,opacity*reflectionBottom);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(w/2, -0.5, 0);
glVertex3f(w/2.f, -0.5f, 0.f);
//esquina superior izquierda
glTexCoord2f(0.0f, 1.0f);
glVertex3f(w/2*-1, -0.5, 0);
glVertex3f(w/2.f*-1.f, -0.5f, 0.f);
glEnd();
glDisable(GL_TEXTURE_2D);
@ -449,22 +449,22 @@ void YACReaderFlowGL::drawCover(CFImage *CF)
//esquina inferior izquierda
glColor4f(LDOWN*opacity,LDOWN*opacity,LDOWN*opacity,1);
glTexCoord2f(0.0f, 1.0f);
glVertex3f(w/2-0.2, -0.5, 0.0001);
glVertex3f(w/2.f-0.2f, -0.5f, 0.0001f);
//esquina inferior derecha
glColor4f(RDOWN*opacity,RDOWN*opacity,RDOWN*opacity,1);
glTexCoord2f(1.0f, 1.0f);
glVertex3f(w/2, -0.5, 0.0001);
glVertex3f(w/2.f, -0.5f, 0.0001f);
//esquina superior derecha
glColor4f(RUP*opacity,RUP*opacity,RUP*opacity,1);
glTexCoord2f(1.0f, 0.0f);
glVertex3f(w/2, -0.3, 0.0001);
glVertex3f(w/2.f, -0.3f, 0.0001f);
//esquina superior izquierda
glColor4f(LUP*opacity,LUP*opacity,LUP*opacity,1);
glTexCoord2f(0.0f, 0.0f);
glVertex3f(w/2-0.2, -0.3, 0.0001);
glVertex3f(w/2.f-0.2f, -0.3f, 0.0001f);
glEnd();
glDisable(GL_TEXTURE_2D);
@ -515,10 +515,10 @@ void YACReaderFlowGL::draw()
glBegin( GL_TRIANGLES );
glColor4f( 1.0, 1.0, 1.0, 1.0 );
glVertex2f( -0.03, 0.98);
glVertex2f( 0.03, 0.98);
glVertex2f( 0, 0.949);
glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
glVertex2f( -0.03f, 0.98f);
glVertex2f( 0.03f, 0.98f);
glVertex2f( 0.f, 0.949f);
glEnd();
@ -605,6 +605,7 @@ void YACReaderFlowGL::updatePositions()
if(abs (cfImages[currentSelected].current.x - cfImages[currentSelected].animEnd.x) < 1)//viewRotate < 0.2)
{
cleanupAnimation();
if(updateCount >= 0) //TODO parametrizar
{
@ -682,7 +683,7 @@ void YACReaderFlowGL::populate(int n)
{
emit centerIndexChanged(0);
float x = 1;
float y = 1 * (700/480.0);
float y = 1 * (700.f/480.0f);
int i;
for(i = 0;i<n;i++){
@ -742,8 +743,8 @@ void YACReaderFlowGL::setZoom(int zoom)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
float sideX = ((float(width)/height)/2)*1.5;
float sideY = 0.5*1.5;
//float sideX = ((float(width)/height)/2)*1.5;
//float sideY = 0.5*1.5;
gluPerspective(zoom, (float)width / (float)height, 1.0, 200.0);
//glOrtho(-sideX, sideX, -sideY+0.2, +sideY+0.2, 4, 11.0);
@ -956,7 +957,8 @@ void YACReaderFlowGL::mousePressEvent(QMouseEvent *event)
void YACReaderFlowGL::mouseDoubleClickEvent(QMouseEvent* event)
{
emit selected(centerIndex());
emit selected(centerIndex());
event->accept();
}
YACReaderComicFlowGL::YACReaderComicFlowGL(QWidget *parent,struct Preset p )
@ -1173,12 +1175,6 @@ QImage ImageLoaderGL::loadImage(const QString& fileName)
QImage image;
bool result = image.load(fileName);
//QGLPixelBuffer * pb = new QGLPixelBuffer(image.size(),flow->format(),flow);
//resultTexture = pb->bindTexture(image,GL_TEXTURE_2D);
//resultTexture = flow->bindTexture(image,GL_TEXTURE_2D);
//TODO parametrizar
switch(flow->performance)
{
case low:
@ -1277,14 +1273,21 @@ QImage ImageLoaderByteArrayGL::loadImage(const QByteArray& raw)
QImage image;
bool result = image.loadFromData(raw);
//QGLPixelBuffer * pb = new QGLPixelBuffer(image.size(),flow->format(),flow);
//resultTexture = pb->bindTexture(image,GL_TEXTURE_2D);
//resultTexture = flow->bindTexture(image,GL_TEXTURE_2D);
//TODO parametrizar
image = image.scaledToWidth(128,Qt::SmoothTransformation);
switch(flow->performance)
{
case low:
image = image.scaledToWidth(128,Qt::SmoothTransformation);
break;
case medium:
image = image.scaledToWidth(196,Qt::SmoothTransformation);
break;
case high:
image = image.scaledToWidth(256,Qt::SmoothTransformation);
break;
case ultraHigh:
image = image.scaledToWidth(320,Qt::SmoothTransformation);
break;
}
if(!result)
return QImage();

View File

@ -18,7 +18,7 @@ class QGLContext;
class WidgetLoader;
class ImageLoaderByteArrayGL;
typedef enum Performance
enum Performance
{
low=0,
medium,
@ -27,7 +27,7 @@ typedef enum Performance
};
//Cover Vector
typedef struct RVect{
struct RVect{
float x;
float y;
float z;
@ -35,7 +35,7 @@ typedef struct RVect{
};
//the cover info struct
typedef struct CFImage{
struct CFImage{
GLuint img;
char name[256];

50
common/yacreader_global.h Normal file
View File

@ -0,0 +1,50 @@
#ifndef __YACREADER_GLOBAL_H
#define __YACREADER_GLOBAL_H
#define VERSION "5.0.0"
#define PATH "PATH"
#define MAG_GLASS_SIZE "MAG_GLASS_SIZE"
#define ZOOM_LEVEL "ZOOM_LEVEL"
#define SLIDE_SIZE "SLIDE_SIZE"
#define GO_TO_FLOW_SIZE "GO_TO_FLOW_SIZE"
#define FLOW_TYPE_SW "FLOW_TYPE_SW"
#define FIT "FIT"
#define FLOW_TYPE "FLOW_TYPE"
#define FULLSCREEN "FULLSCREEN"
#define FIT_TO_WIDTH_RATIO "FIT_TO_WIDTH_RATIO"
#define Y_WINDOW_POS "POS"
#define Y_WINDOW_SIZE "SIZE"
#define MAXIMIZED "MAXIMIZED"
#define DOUBLE_PAGE "DOUBLE_PAGE"
#define ADJUST_TO_FULL_SIZE "ADJUST_TO_FULL_SIZE"
#define BACKGROUND_COLOR "BACKGROUND_COLOR"
#define ALWAYS_ON_TOP "ALWAYS_ON_TOP"
#define FLOW_TYPE_GL "FLOW_TYPE_GL"
#define Y_POSITION "Y_POSITION"
#define COVER_DISTANCE "COVER_DISTANCE"
#define CENTRAL_DISTANCE "CENTRAL_DISTANCE"
#define ZOOM_LEVEL "ZOOM_LEVEL"
#define Z_COVER_OFFSET "Z_COVER_OFFSET"
#define COVER_ROTATION "COVER_ROTATION"
#define FADE_OUT_DIST "FADE_OUT_DIST"
#define LIGHT_STRENGTH "LIGHT_STRENGTH"
#define MAX_ANGLE "MAX_ANGLE"
#define PERFORMANCE "PERFORMANCE"
#define USE_OPEN_GL "USE_OPEN_GL"
#define X_ROTATION "X_ROTATION"
#define Y_COVER_OFFSET "Y_COVER_OFFSET"
enum FlowType
{
CoverFlowLike=0,
Strip,
StripOverlapped,
Modern,
Roulette,
Custom
};
#endif