Added panorama support to slideshow #1406

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
@ExtravagantAardvark

If "use pan & zoom effects" is on, this patch makes the slideshow treat panoramas different from the normal random slide effect.

A horizontal panorama is filled out in the height and scrolled completely (random right or left).

Vertical panorama's are filled out in the width and scrolled up or down.

Currently the patch treats every image with a ratio of at least 1.9:1 as a panorama. The amount of time the image is shown is lengthened from the normal slide time based on the ratio, so the visual impression matches the sliding speed of the normal random effect.

@da-anda

This comment has been minimized.

Show comment Hide comment
@da-anda

da-anda Sep 30, 2012

Member

@cptspiff is this something for Frodo?

Member

da-anda commented Sep 30, 2012

@cptspiff is this something for Frodo?

@akva2

This comment has been minimized.

Show comment Hide comment
@akva2

akva2 Oct 1, 2012

Contributor

if somebody takes charge and pulls it before the window closes.

Contributor

akva2 commented Oct 1, 2012

if somebody takes charge and pulls it before the window closes.

+ {
+ if (((m_fWidth / m_fHeight) > 1.9) || ((m_fHeight / m_fWidth) > 1.9))
+ m_displayEffect = EFFECT_PANORAMA;
+ else
m_displayEffect = (DISPLAY_EFFECT)((rand() % (EFFECT_RANDOM - 1)) + 1);

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Bad indentation

@Montellese

Montellese Oct 1, 2012

Member

Bad indentation

+ if (m_displayEffect == EFFECT_PANORAMA)
+ {
+ RESOLUTION iRes = g_graphicsContext.GetVideoResolution();
+ float fScreenWidth = (float)g_settings.m_ResInfo[iRes].Overscan.right - g_settings.m_ResInfo[iRes].Overscan.left;

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Bad indentation

@Montellese

Montellese Oct 1, 2012

Member

Bad indentation

+ m_fPosX = 0.5f - (fScreenWidth / fScreenHeight) * (m_fHeight / m_fWidth) * 0.5f;
+ if (rand() % 2) m_fPosX = -m_fPosX;
+ m_fVelocityX = -m_fPosX * 2.0f / m_iTotalFrames;
+ }

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Bad indentation (only 2 spaces per level), same in the else-block.

@Montellese

Montellese Oct 1, 2012

Member

Bad indentation (only 2 spaces per level), same in the else-block.

+ m_iTotalFrames = m_transistionStart.length + m_transistionEnd.length + iFrames;
+
+ m_fPosX = 0.5f - (fScreenWidth / fScreenHeight) * (m_fHeight / m_fWidth) * 0.5f;
+ if (rand() % 2) m_fPosX = -m_fPosX;

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Please put the actual code on a new line (no { } needed if it's only a single line). Same in the else-block.

@Montellese

Montellese Oct 1, 2012

Member

Please put the actual code on a new line (no { } needed if it's only a single line). Same in the else-block.

@@ -142,6 +175,9 @@ void CSlideShowPic::SetTexture(int iSlideNumber, CBaseTexture* pTexture, DISPLAY
m_fPosZ = 1.0f;
m_fVelocityZ = 0.0001f * g_advancedSettings.m_slideshowZoomAmount;
}

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Bad indentation of this whole block

@Montellese

Montellese Oct 1, 2012

Member

Bad indentation of this whole block

+ fScale *= m_fWidth / fScreenWidth * fScreenHeight / m_fHeight;
+ else
+ fScale *= m_fHeight / fScreenHeight * fScreenWidth / m_fWidth;
+ }

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Bad indentation (only 2 spaces per level)

@Montellese

Montellese Oct 1, 2012

Member

Bad indentation (only 2 spaces per level)

@Montellese

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Apart from the cosmetics the changes look fine. Will try later after I found some panorama photo somewhere in my collection.

Member

Montellese commented Oct 1, 2012

Apart from the cosmetics the changes look fine. Will try later after I found some panorama photo somewhere in my collection.

@ghost ghost assigned Montellese Oct 1, 2012

@ExtravagantAardvark

This comment has been minimized.

Show comment Hide comment
@ExtravagantAardvark

ExtravagantAardvark Oct 1, 2012

@Montellese: thanks for looking into this.
No idea how the indenting got this way, it looks fine on my local copy. But git/github is not my strong suit - took me many tries to even send in this patch... No idea what the timewindow is for Frodo, but I won't be able to dive into this again for weeks. If someone wants it in Frodo and knows how to fix the indenting feel free ;-)

@Montellese: thanks for looking into this.
No idea how the indenting got this way, it looks fine on my local copy. But git/github is not my strong suit - took me many tries to even send in this patch... No idea what the timewindow is for Frodo, but I won't be able to dive into this again for weeks. If someone wants it in Frodo and knows how to fix the indenting feel free ;-)

@Montellese

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

The bad indentations probably result from mixing tabs and spaces. In xbmc source code we use two spaces per indentation level.

This merge window (which lasts until october 10th) will be the last one before feature freeze. If it works I'll fix up the indentation and create a replacement PR for it. Otherwise I'll report back any problem.

Member

Montellese commented Oct 1, 2012

The bad indentations probably result from mixing tabs and spaces. In xbmc source code we use two spaces per indentation level.

This merge window (which lasts until october 10th) will be the last one before feature freeze. If it works I'll fix up the indentation and create a replacement PR for it. Otherwise I'll report back any problem.

@ExtravagantAardvark

This comment has been minimized.

Show comment Hide comment
@ExtravagantAardvark

ExtravagantAardvark Oct 1, 2012

Thanks for taking that up, much appreciated!

Thanks for taking that up, much appreciated!

@Montellese

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Tested it with two panorama photos I made with my phone and it works. Will fix up the cosmetics later.

Member

Montellese commented Oct 1, 2012

Tested it with two panorama photos I made with my phone and it works. Will fix up the cosmetics later.

@Montellese

This comment has been minimized.

Show comment Hide comment
@Montellese

Montellese Oct 1, 2012

Member

Closing in favour of #1520 which contains your changes with the necessary cosmetic fixes.

Member

Montellese commented Oct 1, 2012

Closing in favour of #1520 which contains your changes with the necessary cosmetic fixes.

@Montellese Montellese closed this Oct 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment