Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
jear
/
Multimedia_Final_Practice
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
61fe63fc
authored
May 24, 2025
by
jear
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
removed
parent
ae9197f0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
110 deletions
fillimi lojes.py
ppp.py
pyproject.py
fillimi lojes.py
deleted
100644 → 0
View file @
ae9197f0
import
pygame
,
sys
#kjo fillon procesin e pygame .init
pygame
.
init
()
screen
=
pygame
.
display
.
set_mode
((
500
,
600
))
clock
=
pygame
.
time
.
Clock
()
test_surface
=
pygame
.
Surface
((
100
,
200
))
test_surface
.
fill
((
0
,
0
,
225
))
while
True
:
#ky loop do tregoj tana elementet brenda boxit
for
event
in
pygame
.
event
.
get
():
if
event
.
type
==
pygame
.
QUIT
:
pygame
.
quit
()
sys
.
exit
()
screen
.
fill
((
175
,
215
,
70
))
screen
.
blit
(
test_surface
,(
200
,
250
))
pygame
.
display
.
update
()
#krijojme framerate, pra 60 times / second
clock
.
tick
(
60
)
\ No newline at end of file
ppp.py
deleted
100644 → 0
View file @
ae9197f0
import
tkinter
as
tk
from
tkinter
import
filedialog
,
messagebox
from
PIL
import
Image
,
ImageTk
from
mutagen.mp3
import
MP3
from
mutagen.id3
import
ID3
import
pygame
import
os
# Initialize Pygame mixer
pygame
.
mixer
.
init
()
class
MediaPlayer
:
def
__init__
(
self
,
root
):
self
.
root
=
root
self
.
root
.
title
(
"Python Media Player"
)
self
.
root
.
geometry
(
"600x400"
)
self
.
playlist
=
[]
self
.
current_index
=
0
# UI Elements
self
.
listbox
=
tk
.
Listbox
(
root
,
bg
=
"black"
,
fg
=
"white"
,
width
=
60
)
self
.
listbox
.
pack
(
pady
=
20
)
control_frame
=
tk
.
Frame
(
root
)
control_frame
.
pack
()
tk
.
Button
(
control_frame
,
text
=
"Add Songs"
,
command
=
self
.
add_songs
)
.
grid
(
row
=
0
,
column
=
0
)
tk
.
Button
(
control_frame
,
text
=
"Play"
,
command
=
self
.
play_song
)
.
grid
(
row
=
0
,
column
=
1
)
tk
.
Button
(
control_frame
,
text
=
"Pause"
,
command
=
self
.
pause_song
)
.
grid
(
row
=
0
,
column
=
2
)
tk
.
Button
(
control_frame
,
text
=
"Stop"
,
command
=
self
.
stop_song
)
.
grid
(
row
=
0
,
column
=
3
)
self
.
meta_label
=
tk
.
Label
(
root
,
text
=
"Metadata will appear here"
,
wraplength
=
500
)
self
.
meta_label
.
pack
(
pady
=
10
)
self
.
cover_label
=
tk
.
Label
(
root
)
self
.
cover_label
.
pack
()
def
add_songs
(
self
):
files
=
filedialog
.
askopenfilenames
(
filetypes
=
[(
"MP3 Files"
,
"*.mp3"
)])
for
f
in
files
:
self
.
playlist
.
append
(
f
)
self
.
listbox
.
insert
(
tk
.
END
,
os
.
path
.
basename
(
f
))
def
play_song
(
self
):
try
:
song_path
=
self
.
playlist
[
self
.
listbox
.
curselection
()[
0
]]
except
IndexError
:
return
pygame
.
mixer
.
music
.
load
(
song_path
)
pygame
.
mixer
.
music
.
play
()
self
.
display_metadata
(
song_path
)
def
pause_song
(
self
):
pygame
.
mixer
.
music
.
pause
()
def
stop_song
(
self
):
pygame
.
mixer
.
music
.
stop
()
def
display_metadata
(
self
,
song_path
):
audio
=
MP3
(
song_path
,
ID3
=
ID3
)
title
=
audio
.
get
(
"TIT2"
,
"Unknown Title"
)
artist
=
audio
.
get
(
"TPE1"
,
"Unknown Artist"
)
meta_text
=
f
"Title: {title}
\n
Artist: {artist}"
self
.
meta_label
.
config
(
text
=
meta_text
)
try
:
tags
=
ID3
(
song_path
)
for
tag
in
tags
.
values
():
if
tag
.
FrameID
==
'APIC'
:
# Album art
img
=
Image
.
open
(
tag
.
data
)
img
=
img
.
resize
((
100
,
100
))
photo
=
ImageTk
.
PhotoImage
(
img
)
self
.
cover_label
.
config
(
image
=
photo
)
self
.
cover_label
.
image
=
photo
return
except
:
self
.
cover_label
.
config
(
image
=
''
,
text
=
'No Cover Found'
)
if
__name__
==
'__main__'
:
root
=
tk
.
Tk
()
app
=
MediaPlayer
(
root
)
root
.
mainloop
()
pyproject.py
deleted
100644 → 0
View file @
ae9197f0
File mode changed
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment