Création d'un dossier photo, crétation d'un dossier comportant les image des boutons multimedia. Changement des logos pour play et pause et ajout des logo next et previous.

This commit is contained in:
Guillaume Archambault 2023-04-17 16:41:01 +02:00
parent b4c871a212
commit 344fa1a3fc
18 changed files with 76 additions and 5 deletions

3
.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,10 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

4
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/slideshow.iml" filepath="$PROJECT_DIR$/.idea/slideshow.iml" />
</modules>
</component>
</project>

8
.idea/slideshow.iml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

1
Logos/lien logos.txt Normal file
View File

@ -0,0 +1 @@
https://www.flaticon.com/packs/music-player

BIN
Logos/next.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
Logos/pause.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
Logos/play.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
Logos/previous.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
Logos/shuffle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

35
main.py
View File

@ -6,9 +6,9 @@ import threading
# import exifread
# Chemin du dossier contenant les photos
PHOTO_FOLDER = "C:/Users/archa/OneDrive/Pictures/test"
PHOTO_FOLDER = "./photos"
# Temps affichage photos (1000 = 1 seconde)
TIMER = 5000
TIMER = 8000
# Liste des fichiers dans le dossier
@ -56,12 +56,25 @@ def load_photos():
threading.Thread(target=load_photos, daemon=True).start()
# Création du logo de pause
pause_logo = pygame.image.load("pause_logo.png")
# Logos Play, Pause, Next, Previous
LOGO_SIZE = (200, 200)
pause_logo = pygame.image.load("./Logos/pause.png")
pause_logo = pygame.transform.smoothscale(pause_logo, LOGO_SIZE)
pause_logo_rect = pause_logo.get_rect(center=screen.get_rect().center)
play_logo = pygame.image.load("play_logo.png")
play_logo = pygame.image.load("./Logos/play.png")
play_logo = pygame.transform.smoothscale(play_logo, LOGO_SIZE)
play_logo_rect = play_logo.get_rect(center=screen.get_rect().center)
next_logo = pygame.image.load("./Logos/next.png")
next_logo = pygame.transform.smoothscale(next_logo, LOGO_SIZE)
next_logo_rect = next_logo.get_rect(midright=(screen.get_rect().right - 50, screen.get_rect().centery))
previous_logo = pygame.image.load("./Logos/previous.png")
previous_logo = pygame.transform.smoothscale(previous_logo, LOGO_SIZE)
previous_logo_rect = previous_logo.get_rect(midleft=(screen.get_rect().left + 50, screen.get_rect().centery))
while running:
# Gestion des événements
for event in pygame.event.get():
@ -72,13 +85,25 @@ while running:
if not auto_change:
screen.blit(pause_logo, pause_logo_rect)
pygame.display.flip()
pygame.time.delay(1000) # Pause de 1 secondes avant de masquer le logo
screen.fill((0, 0, 0))
else:
screen.blit(play_logo, play_logo_rect)
pygame.display.flip()
pygame.time.delay(1000) # Pause de 1 secondes avant de masquer le logo
screen.fill((0, 0, 0))
elif event.type == KEYDOWN and event.key == K_LEFT:
photo_index = (photo_index - 1) % len(photo_files)
screen.blit(previous_logo, previous_logo_rect)
pygame.display.flip()
pygame.time.delay(1000) # Pause de 1 secondes avant de masquer le logo
screen.fill((0, 0, 0))
elif event.type == KEYDOWN and event.key == K_RIGHT:
photo_index = (photo_index + 1) % len(photo_files)
screen.blit(next_logo, next_logo_rect)
pygame.display.flip()
pygame.time.delay(1000) # Pause de 1 secondes avant de masquer le logo
screen.fill((0, 0, 0))
elif event.type == KEYDOWN and event.key == K_f:
fullscreen = not fullscreen
if fullscreen:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB