müzik çalar kodları
------
import pygame
from tkinter import *
pencere = Tk()
pencere.tk_setPalette("#D0A9F5")
def çal1():
pygame.mixer.music.stop()
def çal2():
pygame.mixer.music.unpause()
def çal3():
pygame.mixer.music.pause()
def çal15():
pygame.mixer.music.rewind()
def çal4():
pygame.mixer.music.set_volume(0.0)
def çal5():
pygame.mixer.music.set_volume(0.1)
def çal6():
pygame.mixer.music.set_volume(0.2)
def çal7():
pygame.mixer.music.set_volume(0.3)
def çal8():
pygame.mixer.music.set_volume(0.4)
def çal9():
pygame.mixer.music.set_volume(0.5)
def çal10():
pygame.mixer.music.set_volume(0.6)
def çal11():
pygame.mixer.music.set_volume(0.7)
def çal12():
pygame.mixer.music.set_volume(0.
def çal13():
pygame.mixer.music.set_volume(0.9)
def çal14():
pygame.mixer.music.set_volume(1.0)
frame = Frame(pencere)
frame.pack(side = BOTTOM)
frame1 = Frame(pencere)
frame1.pack(side = BOTTOM)
buton1=Button(frame1)
buton1.config(text="baştan çal",command=çal15)
buton1.pack(side=RIGHT)
buton2=Button(frame1)
buton2.config(text="duraklat",command=çal3)
buton2.pack(side=RIGHT)
buton3=Button(frame1)
buton3.config(text="devam",command=çal2)
buton3.pack(side=RIGHT)
buton4=Button(frame1)
buton4.config(text="dur",command=çal1)
buton4.pack(side=RIGHT)
buton5=Button(frame)
buton5.config(text="Ses % 100",command=çal14)
buton5.pack(side=RIGHT)
buton6=Button(frame)
buton6.config(text="Ses % 90",command=çal13)
buton6.pack(side=RIGHT)
buton7=Button(frame)
buton7.config(text="Ses % 80",command=çal12)
buton7.pack(side=RIGHT)
buton8=Button(frame)
buton8.config(text="Ses % 70",command=çal10)
buton8.pack(side=RIGHT)
buton9=Button(frame)
buton9.config(text="Ses % 60",command=çal10)
buton9.pack(side=RIGHT)
buton10=Button(frame)
buton10.config(text="Ses % 50",command=çal9)
buton10.pack(side=RIGHT)
buton11=Button(frame)
buton11.config(text="Ses % 40",command=çal8)
buton11.pack(side=RIGHT)
buton12=Button(frame)
buton12.config(text="Ses % 30",command=çal7)
buton12.pack(side=RIGHT)
buton13=Button(frame)
buton13.config(text="Ses % 20",command=çal6)
buton13.pack(side=RIGHT)
buton14=Button(frame)
buton14.config(text="Ses % 10",command=çal5)
buton14.pack(side=RIGHT)
buton15=Button(frame)
buton15.config(text="Ses % 0",command=çal4)
buton15.pack(side=RIGHT)
def ça21():
pygame.mixer.init()
pygame.mixer.music.load("a.mp3")
pygame.mixer.music.play()
def ça22():
pygame.mixer.init()
pygame.mixer.music.load("b.mp3")
pygame.mixer.music.play()
def ça23():
pygame.mixer.init()
pygame.mixer.music.load("c.mp3")
pygame.mixer.music.play()
def ça24():
pygame.mixer.init()
pygame.mixer.music.load("d.mp3")
pygame.mixer.music.play()
def ça25():
pygame.mixer.init()
pygame.mixer.music.load("e.mp3")
pygame.mixer.music.play()
menu = Menu(pencere)
pencere.config(menu=menu)
dosya = Menu(menu, tearoff=0)
menu.add_cascade(label="Şarkılar",menu=dosya)
dosya.add_command(label="a.mp3",command= ça21)
dosya.add_command(label="b.mp3",command=ça22)
dosya.add_command(label="c.mp3",command=ça23)
dosya.add_command(label="d.mp3",command=ça24)
dosya.add_command(label="e.mp3",command=ça25)
çıkış = Menu(menu, tearoff=0)
menu.add_cascade(label="Çıkış",menu=çıkış)
çıkış.add_command(label="Çıkış",command=pencere.destroy)
mainloop()