Поочерёдное проигрывание mp3 файлов
Попытка создания плейлиста и поочередное проигрывание музыкальных файлов из
заданной директории с использованием библиотеки
Bass.dll
Все подключаемые файлы в архиве:
bass.dll
bass.lib
bass.pbi
Код реализации для версии PB 4.30 :
;--------------------- MP3 плеер на Bass.dll---------------------------------
;
; PureBasic 4.30
;
; Попытка создания плейлиста
;
; (c) 4 января 2010 - mirashic
;
;-----------------------------------------------------------------------------
IncludeFile "bass.pbi"
#Window_0 = 0
#Play = 1
#File_path = 2
#Play_ListMP3 = 3
#OPEN = 4
#NEXT = 5
#INF = 6
#PREV = 7
#Pause = 8
#PlayAll = 9
#Text = 10
#Volume = 11
#Vol = 12
#VolumeTxt = 13
#Txt = 14
#Tamer = 15
Global Handle,Rep.s,n
;{----------------------Таймер-----------------------------------------------
Global a,b
Procedure.s Secundomer()
time = BASS_ChannelBytes2Seconds(Handle, BASS_ChannelGetPosition(Handle, #BASS_POS_BYTE))
text$ = Str(time/60) + ":" + RSet(Str(time % 60), 2, "00")
SetGadgetText(#Tamer, text$)
EndProcedure
;}---------------------------------------------------------------------------
Structure ID3v1
id.s{3};
title.s{30};
artist.s{30};
album.s{30};
year.s{4};
comment.s{30};
genre.b;
EndStructure
Global *tag.ID3v1
;{---------------------------------------------------
Procedure Play()
BASS_StreamFree(Handle)
File.s = GetGadgetText(#File_path)+GetGadgetText(#Play_ListMP3)
Handle=BASS_StreamCreateFile(0, @File, 0, 0, 0)
BASS_ChannelPlay(Handle,0)
;------------------------------------------------
len=BASS_ChannelGetLength(Handle, #BASS_POS_BYTE)
time=BASS_ChannelBytes2Seconds(Handle, len)
minute$ = Str(Minute(time))
sekunde$ = Str(Second(time))
rez$ = minute$+":"+sekunde$
SetGadgetText(#Txt , rez$+" минут")
;------------------------------------------------
StartTimer( 1 , 100 , @Secundomer())
;------------------Тег---------------------------
If ReadFile(0,Rep.s)
MemPointer = AllocateMemory(128)
FileSeek(0,Lof(0)-128)
ReadData(0,MemPointer, 128)
artist.s = Trim(PeekS(MemPointer + 33,30)) ; артист
album.s = Trim(PeekS(MemPointer + 63,30)) ; альбом
year.s = Trim(PeekS(MemPointer + 93, 4)) ; год
EndIf
SetGadgetText(#INF,artist.s+" "+GetGadgetText(#Play_ListMP3)+" "+year.s)
EndProcedure
;}--------------------------------------------------
;{------------------Окно--------------------------------
OpenWindow(#Window_0, 0, 0, 380, 200, "Плейлист", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
TextGadget (#INF , 10, 10, 365, 15, "Имя mp3: " )
TextGadget (#File_path , 0, 0, 0, 0, "Путь" )
ButtonGadget (#PREV , 20, 150, 60, 24, "<<<<" )
ButtonGadget (#Play , 90, 150, 60, 24, "Играть" )
ButtonGadget (#NEXT , 160, 150, 60, 24, ">>>>" )
ButtonGadget (#OPEN , 230, 150, 60, 24, "Открыть")
ButtonGadget (#Pause , 300, 150, 60, 24, "Пауза" )
ComboBoxGadget(#Play_ListMP3 , 10, 40, 360, 20)
TextGadget (#Vol , 10, 110, 60, 15, "Громкость" )
TextGadget (#VolumeTxt , 75, 110, 20, 15, "50")
TextGadget (#Txt ,240, 80, 60, 15, "0:00 минут")
TextGadget (#Tamer ,318, 80, 45, 15, "00:00:0")
;PureCOLOR_SetGadgetColor(#Play_ListMP3, $FFFFFF, RGB(29, 26, 26))
TrackBarGadget(#Volume,100,110,270,20,0,100)
SetGadgetState(#Volume,50)
CheckBoxGadget(#PlayAll,10, 80, 190 , 20, "Играем весь список, по очереди.")
SetGadgetState(#PlayAll, 1)
BASS_Init(-1, 44100, 0, WindowID(0), #Null)
BASS_SetVolume(0.5)
;}------------------------------------------------------
;{-----------------Главный цикл-------------------------
Repeat
Event= WaitWindowEvent(1)
;{------------------Следующий mp3-----------------------
If GetGadgetState(#PlayAll)
If BASS_ChannelIsActive(handle)
Else
SongPlaying = GetGadgetState(#Play_ListMP3)+ 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
EndIf
EndIf
;}------------------------------------------------------
Select Event
Case #PB_Event_Gadget
Select EventGadget()
;{------------------Открыть mp3-------------------------
Case #OPEN
NbSongs = 0
Rep.s = OpenFileRequester("","","*.*|*.*",0)
SetGadgetText(#File_path, GetPathPart(Rep))
ClearGadgetItems(#Play_ListMP3)
If ExamineDirectory(0, GetPathPart(Rep), "*.*")
Repeat
FileType = NextDirectoryEntry(0)
If FileType
FileName.s = DirectoryEntryName(0)
If FileName.s <> "." And FileName.s <> ".."
Ext$ = LCase(Right(FileName.s,4))
If Ext$ = ".wav" Or Ext$ = ".mp3" Or Ext$ = ".mid"
AddGadgetItem(#Play_ListMP3, -1, FileName.s)
NbSongs = NbSongs + 1
EndIf
EndIf
EndIf
SetGadgetState(#Play_ListMP3,0 )
Until FileType = 0
EndIf
Nasd.s= GetFilePart(Rep.s)
For n=0 To 1000
SetGadgetState(#Play_ListMP3, n)
If Nasd.s =GetGadgetText(#Play_ListMP3)
SetGadgetState(#Play_ListMP3, n)
Break
EndIf
Next
BASS_StreamFree(Handle)
Handle=BASS_StreamCreateFile(0, @Rep, 0, 0, 0)
BASS_ChannelPlay(Handle,0)
;-------------Время звучания------------------------
len=BASS_ChannelGetLength(Handle, #BASS_POS_BYTE)
time=BASS_ChannelBytes2Seconds(Handle, len)
minute$ = Str(Minute(time))
sekunde$ = Str(Second(time))
rez$ = minute$+":"+sekunde$
SetGadgetText(#Txt , rez$+" минут")
;---------------------------------------------------
StartTimer( 1 , 100 , @Secundomer())
;------------------------------------------------
If ReadFile(0,Rep.s)
MemPointer = AllocateMemory(128)
FileSeek(0,Lof(0)-128)
ReadData(0,MemPointer, 128)
artist.s = Trim(PeekS(MemPointer + 33,30)) ; артист
album.s = Trim(PeekS(MemPointer + 63,30)) ; альбом
year.s = Trim(PeekS(MemPointer + 93, 4)) ; год
EndIf
Name.s= GetFilePart(Rep.s)
SetGadgetText(#INF,artist.s+" "+Name.s+" "+year.s)
;}-------------------------------------------------------
Case #PREV
SongPlaying = GetGadgetState(#Play_ListMP3)- 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
;-------------------------------------------------------
Case #Play
Play()
;-------------------------------------------------------
Case #Next
SongPlaying = GetGadgetState(#Play_ListMP3)+ 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
;-------------------------------------------------------
Case #Pause
Triger = Triger ! 1
If Triger
BASS_ChannelPause(Handle)
EndTimer(1)
Else
BASS_ChannelPlay(Handle,0)
StartTimer( 1 , 100 , @Secundomer())
EndIf
;-------------------------------------------------------
Case #Volume
x=GetGadgetState(#Volume)
SetGadgetText(#VolumeTxt, Str(x))
BASS_SetVolume(x/100)
;-------------------------------------------------------
Case #Play_ListMP3
If EventType()=1
Play()
EndIf
EndSelect
EndSelect
If Event=#PB_Event_CloseWindow
Break
EndIf
ForEver
;}-------------------------------------------------------
Скачать
архив
Практически закончил mp3 плеер и FM радио
Скачать
архив
Код реализации:
;-------------------Плеер MP3, Онлайн радио но Bass.dll----------------------
;
; (c) 2010 - mirashic
;
;-----------------------------------------------------------------------------
Enumeration
#WebGadget
#Image_3
#im1
#im2
EndEnumeration
Enumeration
#ListIconGadget_2
EndEnumeration
UsePNGImageDecoder()
UseJPEGImageDecoder()
#Window_0 = 0
#File_path = 1
#Play_ListMP3 = 2
#Play_ListMP4 = 4
#PlayAll = 5
Global Handle ,Rep.s,NbSongs, SongPlaying
Global width1,height1,color1,m1
Global column,width,height,color,Row,Name$
Structure ID3v1
id.s{3};
title.s{30};
artist.s{30};
album.s{30};
year.s{4};
comment.s{30};
genre.b;
EndStructure
Structure D3
id.s{13}
title.s{40}
EndStructure
Global *tag.ID3v1, *tg.D3
;{----------------------Параметры уровня-------------------------------------
x1=15 ;позиция от начала x
y1=96 ;позиция от начала y
width1=380 ;ширина столба
height1=3 ;высота столба
m1=3 ;ширина между столбами
color1=RGB(53, 246, 12) ;цвет
;}----------------------------------------------------------------------------
;{----------------------Параметры спектра-----------------------------------
x=10 ;позиция от начала x
y=22 ;позиция от начала y
column=42 ;колличество столбов
width=8 ;ширина столба
height=70 ;высота столба
h=1 ;ширина между столбами
color=RGB(1, 72, 187) ;цвет
;}----------------------------------------------------------------------------
Procedure LOWOR(Value)
ProcedureReturn Value & $FFFF
EndProcedure
Procedure HIWOR(Value)
ProcedureReturn (Value >> 16) & $FFFF
EndProcedure
;{----------------------Индикатор уровня и спектра---------------------------
IncludeFile "bass.pbi"
CreateImage(0,width,height)
CreateImage(#im1,385,9)
Procedure UpdateSpectrum(*xx) ; Функция для создания индикатора
Dim FFT.f(1024)
Repeat
;----------------------------------спектр------------------------------------
BASS_ChannelGetData(Handle,@FFT(),#BASS_DATA_FFT2048)
For f=0 To column
Val= Sqr(fft(f)) * 180 ;получение параметра по частотам
StartDrawing(ImageOutput(0))
Box(0,0,20,height,RGB(17, 17, 17))
Box(0,height-Val,20,Val,color)
a=height
For d=0 To 21
LineXY(0, a-4, width, a-4, RGB(0, 0, 0))
a=a-4
Next d
StopDrawing()
SetGadgetState(303+f,ImageID(0))
Next f
;-----------------------------------------------------------------------------
;-----------------------------уровень-----------------------------------------
If BASS_ChannelIsActive(handle) ; если канал активен
level=BASS_ChannelGetLevel(handle)
L=HIWOR(level)
R=LOWOR(level)
;----------------
Lal= L*width1/32768
StartDrawing(ImageOutput(#im1))
Box(0,0,width1,height1,RGB(17, 17, 17))
Box(0,0,Lal,height1,color1)
Ral= R*width1/32768
Box(0,6,width1,height1,RGB(17, 17, 17))
Box(0,6,Ral,height1,color1)
a1=width1
For d1=0 To 100
LineXY(a1-8, 0, a1-8, height1*2+m1, RGB(0, 0, 0))
a1=a1-8
Next d1
StopDrawing()
SetGadgetState(302,ImageID(#im1))
EndIf
If Handle
*tg = BASS_ChannelGetTags(Handle, #BASS_TAG_META)
If *tg
title.s = *tg\title ; название песни
SetGadgetText(230," " + title + " ")
Else ; если нет тега выводим название файла
;SetGadgetText(230, GetGadgetText(#Play_ListMP3))
EndIf
EndIf
;--------------------------Таймер--------------------------------------------
time = BASS_ChannelBytes2Seconds(Handle, BASS_ChannelGetPosition(Handle, #BASS_POS_BYTE))
text$ = Str(time/60) + ":" + RSet(Str(time % 60), 2, "00")
If BASS_ChannelIsActive(Handle) = #BASS_ACTIVE_STOPPED
SetGadgetText(233, "0:00")
Else
SetGadgetText(233, text$)
EndIf
Delay(50)
ForEver
EndProcedure
;}---------------------------------------------------------------------------
;{---------------Play mp3--------------------------
Procedure Play1()
BASS_ChannelPlay(Handle,0)
;------------------------------------------------
len=BASS_ChannelGetLength(Handle, #BASS_POS_BYTE)
time=BASS_ChannelBytes2Seconds(Handle, len)
minute$ = Str(Minute(time))
sekunde$ = Str(Second(time))
rez$ = minute$+":"+sekunde$
SetGadgetText(235 , rez$+" minute")
;-------------------------------------------------
If Handle
*tag = BASS_ChannelGetTags(Handle, #BASS_TAG_ID3)
If *tag
artist.s = *tag\artist ; артист
title.s = *tag\title ; название песни
album.s = *tag\album ; альбом
year.s = *tag\year ; год
ResizeGadget (230, 40, #PB_Ignore, 340, #PB_Ignore)
ResizeGadget (238, 10, #PB_Ignore, 30, #PB_Ignore)
SetGadgetText(230,artist +" " + title.s + " " + year)
SetGadgetText(238,"")
Else ; если нет тега выводим название файла
SetGadgetText(230, GetGadgetText(#Play_ListMP3))
EndIf
EndIf
SetGadgetText(243, GetPathPart(Rep))
SetGadgetState(#PlayAll, 1)
EndProcedure
Procedure Play()
BASS_StreamFree(Handle)
File.s = GetGadgetText(#File_path)+GetGadgetText(#Play_ListMP3)
Handle=BASS_StreamCreateFile(0, @File, 0, 0, 0)
Play1()
EndProcedure
;}--------------------------------------------------
;{---------------Ск. директории---------------------
Procedure Direct()
NbSongs = 0
SetGadgetText(#File_path, GetPathPart(Rep))
ClearGadgetItems(#Play_ListMP3)
If ExamineDirectory(0, GetPathPart(Rep), "*.*")
Repeat
FileType = NextDirectoryEntry(0)
If FileType
FileName.s = DirectoryEntryName(0)
If FileName.s <> "." And FileName.s <> ".."
Ext$ = LCase(Right(FileName.s,4))
If Ext$ = ".wav" Or Ext$ = ".mp3" Or Ext$ = ".mid"
AddGadgetItem(#Play_ListMP3, -1, FileName.s)
NbSongs = NbSongs + 1
EndIf
EndIf
EndIf
SetGadgetState(#Play_ListMP3, SongPlaying )
Until FileType = 0
EndIf
EndProcedure
;}------------------------------------------------
;{----Функция для создания потокового звука, получаемыми из сети Интернет----
Procedure Loadfile(url_1$)
BASS_StreamFree(Handle) ; Закроем все существующие каналы воспроизведения и освободим системные ресурсы
Handle=BASS_StreamCreateURL(url_1$, 0, 0, #Null, 0)
BASS_ChannelPlay(Handle,0)
SetGadgetText(444, url_1$)
SetGadgetText(235, "0:00 minute")
ResizeGadget (230, 120, #PB_Ignore, 270, #PB_Ignore)
ResizeGadget (238, 10, #PB_Ignore, 110, #PB_Ignore)
EndProcedure
;}---------------------------------------------------------------------------
CatchImage(#Image_3, ?Im7, ?Im7End-?Im7)
;{----------------------Основное окно----------------------------------------
OpenWindow(#Window_0, 0, 0, 410, 230, "Radio Bass", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_Invisible)
SetWinBackgroundImage(WindowID(#Window_0), ImageID(#Image_3) )
ImageGadget(302,x1,y1,0,0,ImageID(#im1)) ; вывод индикатора уровня
TextGadget (#File_path , 0, 0, 0, 0, "Путь" )
For f=0 To column
ImageGadget(303+f,x, y,0,0,ImageID(0)) ; вывод спектра
x=x+(width+h)
Next f
HyperLinkGadget(218,24, 190,30,15,"Vol -",RGB(255,0,0))
HyperLinkGadget(219,59, 190,30,15,"Vol +",RGB(255,0,0))
For j=218 To 219
PureCOLOR_SetGadgetColor(j, #PureCOLOR_SystemColor, #PureCOLOR_DontSetBackColor)
SetGadgetColor(j,#PB_Gadget_FrontColor,RGB(1, 161, 254))
Next j
HyperLinkGadget(221,20, 138,70,15,"A-ROCK", RGB(255,0,0))
HyperLinkGadget(222,100,138,70,15,"Kiss FM", RGB(255,0,0))
HyperLinkGadget(223,180,138,70,15,"Makkirus", RGB(255,0,0))
HyperLinkGadget(224,260,138,70,15,"Радио 13", RGB(255,0,0))
HyperLinkGadget(225,330,138,70,15,"Luga Radio", RGB(255,0,0))
HyperLinkGadget(226,20, 210,180,15,"Show / Hide playlist mp3", RGB(255,0,0))
For h=221 To 226
SetGadgetColor(h,#PB_Gadget_FrontColor,RGB(129,129,129))
SetGadgetColor(h,#PB_Gadget_BackColor, RGB(29, 26, 26))
Next h
HyperLinkGadget(240, 270, 163, 55, 15, "Playlist FM", RGB(255,0,0))
HyperLinkGadget(241, 340, 163, 55, 15, "Load FM", RGB(255,0,0))
TextGadget (242,100,190,20,15,"50")
TextGadget (243, 20, 236, 370,15, "", #PB_Text_Center)
For o=240 To 243
SetGadgetColor(o,#PB_Gadget_FrontColor,RGB(1, 161, 254))
SetGadgetColor(o,#PB_Gadget_BackColor, RGB(29, 26, 26))
Next o
;{-----Чтение громкость--------
If OpenPreferences("vol.pcs")
SetGadgetText(242,ReadPreferenceString("Громкость", "Нет"))
ClosePreferences()
EndIf
q=Val(GetGadgetText(242))
;}-----------------------------
HyperLinkGadget(227, 110, 111,55,15,"Open mp3",RGB(255,0,0))
HyperLinkGadget(228, 45, 111, 25, 15, "Play", RGB(255,0,0))
HyperLinkGadget(229, 180, 111, 33, 15, "Pause",RGB(255,0,0))
TextGadget (230, 120, 8, 270,15, "")
HyperLinkGadget(231, 388, 8, 10, 15, "?", RGB(255,0,0))
HyperLinkGadget(232, 388, 111, 10, 12, "#", RGB(255,0,0))
TextGadget (233, 318, 111, 45, 15, "00:00")
HyperLinkGadget(234, 375, 111, 10, 12, "#", RGB(255,0,0))
TextGadget (235, 240, 111, 60, 15, "0:00 minute")
HyperLinkGadget(236, 10, 111, 25, 15, "<<<<", RGB(255,0,0))
HyperLinkGadget(237, 75, 111, 25, 15, ">>>>", RGB(255,0,0))
TextGadget (238, 10, 8, 110,15, "Information", #PB_Text_Center)
For b=227 To 229
SetGadgetColor(b,#PB_Gadget_FrontColor,RGB(1, 161, 254))
PureCOLOR_SetGadgetColor(b, #PureCOLOR_SystemColor, #PureCOLOR_DontSetBackColor)
Next b
For g=230 To 235
SetGadgetColor(g,#PB_Gadget_FrontColor,RGB(1, 161, 254))
SetGadgetColor(g,#PB_Gadget_BackColor, RGB(0, 0, 0))
Next g
For h=236 To 237
SetGadgetColor(h,#PB_Gadget_FrontColor,RGB(1, 161, 254))
PureCOLOR_SetGadgetColor(h, #PureCOLOR_SystemColor, #PureCOLOR_DontSetBackColor)
Next h
For j=238 To 238
SetGadgetColor(j,#PB_Gadget_FrontColor,RGB(1, 161, 254))
SetGadgetColor(j,#PB_Gadget_BackColor, RGB(0, 0, 0))
Next j
StringGadget(444, 132, 189, 270, 15, "http://207.200.96.225:8020",#PB_String_BorderLess)
PureCOLOR_SetGadgetColor(444, RGB(129, 129, 129), RGB(29, 26, 26))
ListViewGadget(#Play_ListMP3, 15, 253, 380, 330)
BASS_Init(-1, 44100, 0, WindowID(0), #Null)
BASS_SetVolume(q/100)
CheckBoxGadget(#PlayAll,0, 0, 0 , 0, "")
SetGadgetState(#PlayAll, 0)
;{-----Чтение пути-----------------
If OpenPreferences("vol.pcs")
Rep.s = ReadPreferenceString("Путь", "Нет")
Poz.s = ReadPreferenceString("Позиция", "Нет")
ClosePreferences()
EndIf
SongPlaying = Val(Poz.s)
Direct()
;}-----------------------------
;}------------------------------------------------------------------------------
CreateThread(@UpdateSpectrum(),0)
HideWindow(#Window_0,0)
Repeat
Event= WaitWindowEvent(10)
Window=EventWindow()
Gadget=EventGadget()
;-----------------------------------------
If GetGadgetState(#PlayAll)
If BASS_ChannelIsActive(handle)
Else
SongPlaying = GetGadgetState(#Play_ListMP3)+ 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
EndIf
EndIf
;-----------------------------------------
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 221
Loadfile("http://stream4.radiostyle.ru:8004/a-rock")
SetGadgetText(238,"A-ROCK")
Case 222
Loadfile("http://217.20.164.164:8000/kissfm.mp3")
SetGadgetText(238,"Kiss FM")
Case 223
Loadfile("http://w02-sw01.akadostream.ru:8111/makkirus128.mp3")
SetGadgetText(238,"Makkirus")
Case 224
Loadfile("http://play.radio13.ru:8000/radio13-128-mp3")
SetGadgetText(238,"Радио 13")
Case 225
Loadfile("http://195.5.125.6:8000/")
SetGadgetText(238,"Luga Radio")
Case 227
;{----------Открытие mp3-------------------------------------------------------------------
Rep.s = OpenFileRequester("","","*.*|*.*",0)
Direct()
;---Совпадение плейлиста и открыт. mp3-------------------
Nasd.s= GetFilePart(Rep.s)
For n=0 To 1000
SetGadgetState(#Play_ListMP3, n)
If Nasd.s =GetGadgetText(#Play_ListMP3)
SetGadgetState(#Play_ListMP3, n)
Break
EndIf
Next
;--------------------------------------------------------
BASS_StreamFree(Handle)
Handle=BASS_StreamCreateFile(0, @Rep, 0, 0, 0)
Play1()
;}------------------------------------------------------------------------------------------
Case 236
SongPlaying = GetGadgetState(#Play_ListMP3)- 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
;-------------------------------------------------------
Case 228
Play()
;-------------------------------------------------------
Case 237
SongPlaying = GetGadgetState(#Play_ListMP3)+ 1
If SongPlaying < NbSongs
SetGadgetState(#Play_ListMP3, SongPlaying )
Play()
EndIf
;-------------------------------------------------------
Case 229
Triger = Triger ! 1
If Triger
BASS_ChannelPause(Handle)
Else
BASS_ChannelPlay(Handle,0)
EndIf
Case 231
;{-----------------------------О программе-------------------------------------
CatchImage(69, ?Im6, ?Im6End-?Im6)
OpenWindow(59, 0, 0, 320, 320, "Информация о программе", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
BackgroundImage_Window_0_Brush = CreatePatternBrush_(ImageID(69))
If BackgroundImage_Window_0_Brush
SetClassLong_(WindowID(59), #GCL_HBRBACKGROUND, BackgroundImage_Window_0_Brush)
RedrawWindow_(WindowID(59), 0, 0, #RDW_ERASE | #RDW_FRAME | #RDW_INVALIDATE | #RDW_ALLCHILDREN)
EndIf
TextGadget (70, 20, 295, 95, 15, "Сайт программы :")
HyperLinkGadget(71, 140, 295, 150,15,"http://www.mirashic.narod.ru",RGB(255, 4, 0))
TextGadget (72, 120, 124, 65, 15, "Версия : 1.0")
TextGadget (73, 30, 250, 165, 15, "Автор : Мирошниченко Олег")
TextGadget (74, 30, 144, 265, 15, "Онлайн проигрыватель FM радио")
TextGadget (75, 30, 160, 265, 15, "Бесплатная версия")
TextGadget (76, 30, 176, 265, 15, "Сделано в программной среде : ")
HyperLinkGadget(77, 50, 200, 130, 30, "PureBasic",RGB(255, 4, 0))
SetGadgetFont (77, LoadFont(77, "Arial", 20, 16))
SetGadgetColor(77, #PB_Gadget_FrontColor,RGB(255, 81, 78))
SetGadgetColor(77, #PB_Gadget_BackColor, RGB(0, 0, 0))
For k=70 To 76
SetGadgetColor(k, #PB_Gadget_FrontColor,RGB(129, 129, 129))
SetGadgetColor(k,#PB_Gadget_BackColor,RGB(0, 0, 0))
Next k
;}-----------------------------------------------------------------------------
Case 232
Toggle = Toggle ! 1
If Toggle
color1=RGB(228, 17, 1)
Else
color1=RGB(53, 246, 12)
EndIf
Case 234
Toggle = Toggle ! 1
If Toggle
color=RGB(53, 246, 12)
Else
color=RGB(1, 72, 187)
EndIf
Case 218
If q >0
SetGadgetText(242,""+Str(q-2))
q-2
Val=q
BASS_SetVolume(Val/100)
EndIf
Case 219
If q <100
SetGadgetText(242,""+Str(q+2))
q+2
Val=q
BASS_SetVolume(Val/100)
EndIf
Case 241
Loadfile(GetGadgetText(444))
SetGadgetText(238,"Bluemars")
Case 240
;{-----------------------------Плейлист----------------------------------------
CatchImage(3, ?Im3, ?Im3End-?Im3)
OpenWindow(60, 0, 0, 450, 480, "Плейлист", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered)
SetWindowColor(60,RGB(13, 13, 13))
ImageGadget(61, 0, 0, 450, 140, ImageID(3))
ListIconGadget(#ListIconGadget_2, 5, 100, 440, 350, " http адресс FM радиостанций", 280, #PB_ListIcon_AlwaysShowSelection|#PB_ListIcon_GridLines|#PB_ListIcon_FullRowSelect)
AddGadgetColumn(0, 1, "Название", 130)
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://16bit.fm:9500"+Chr(10)+"Радио 16BIT.FM")
AddGadgetItem(#ListIconGadget_2, -1, "http://94.103.95.39:9000"+Chr(10)+"BestDance.FM")
AddGadgetItem(#ListIconGadget_2, -1, "http://live1.radiogroup.com.ua:8000/europaplus128"+Chr(10)+"Europa Plus")
AddGadgetItem(#ListIconGadget_2, -1, "http://live.galaradio.com:8000/kiev"+Chr(10)+"Radio Gala")
AddGadgetItem(#ListIconGadget_2, -1, "http://stream.loveradio.ru:8000/Loveradio_96_stereo.mp3"+Chr(10)+"Love радио")
AddGadgetItem(#ListIconGadget_2, -1, "http://mixfm.com.ua:8128"+Chr(10)+"MixFm")
AddGadgetItem(#ListIconGadget_2, -1, "http://listen.radiopremium.ru:9000/premium32"+Chr(10)+"Радио Premium")
AddGadgetItem(#ListIconGadget_2, -1, "http://217.20.175.72:3200"+Chr(10)+"RadioBengel")
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://sanfm.ru:8000/live"+Chr(10)+"SanRadio")
AddGadgetItem(#ListIconGadget_2, -1, "http://shamrock.kiev.ua:8000/folk128"+Chr(10)+"ShamRock")
AddGadgetItem(#ListIconGadget_2, -1, "http://212.26.129.222:8001"+Chr(10)+"Наше Радио")
AddGadgetItem(#ListIconGadget_2, -1, "http://live.ncradio.ru/256.mp3"+Chr(10)+"Новое Чистое Радио")
AddGadgetItem(#ListIconGadget_2, -1, "http://62.80.190.246:8000/ProstoRadiO128"+Chr(10)+"Просто Ради.О")
AddGadgetItem(#ListIconGadget_2, -1, "http://play.radio13.ru:8000/radio13-128-mp3"+Chr(10)+"Радио 13")
AddGadgetItem(#ListIconGadget_2, -1, "http://server1.radioserver.fm:8000/radiozaryad"+Chr(10)+"Радио Заряд")
AddGadgetItem(#ListIconGadget_2, -1, "http://radioserver.fm:8000/obogrelov-fm"+Chr(10)+"Радио Obogrelov")
AddGadgetItem(#ListIconGadget_2, -1, "http://82.193.116.85:8888/radioplus_hi"+Chr(10)+"Eto Radio Plus")
AddGadgetItem(#ListIconGadget_2, -1, "http://91.193.68.87:8155"+Chr(10)+"Радио-Премьер")
AddGadgetItem(#ListIconGadget_2, -1, "http://213.159.71.19:8000/48.mp3"+Chr(10)+"Радио РОКС")
AddGadgetItem(#ListIconGadget_2, -1, "http://82.193.116.85:8888/eradio_hi"+Chr(10)+"Радио «Є»")
AddGadgetItem(#ListIconGadget_2, -1, "http://91.202.72.22:8000/rusradio-128"+Chr(10)+"Русское Радио (Украина)")
AddGadgetItem(#ListIconGadget_2, -1, "http://online1.uhradio.com.ua:8000/uhradio"+Chr(10)+"УХ радио 101,1 FM")
AddGadgetItem(#ListIconGadget_2, -1, "http://live.ipfm.net:8000/hit-fm-128"+Chr(10)+"Хит FM, Hit FM, XIT FM (Украина)")
AddGadgetItem(#ListIconGadget_2, -1, "http://83.222.4.42:8800/"+Chr(10)+"Радио Шансон (Россия)")
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://85.25.86.69:8400"+Chr(10)+"C H R O M A N O V A FM presents Ambient and Chillout Sets 247")
AddGadgetItem(#ListIconGadget_2, -1, "http://64.71.144.178:8060"+Chr(10)+"FM - Club")
AddGadgetItem(#ListIconGadget_2, -1, "http://64.71.145.130:8040"+Chr(10)+"FM - Trance")
AddGadgetItem(#ListIconGadget_2, -1, "http://72.13.93.117:8050"+Chr(10)+"FM - Dance Hits")
AddGadgetItem(#ListIconGadget_2, -1, "http://200.6.157.20:8211"+Chr(10)+"247online HQ High Quality radio - www.247onlineradio.com")
AddGadgetItem(#ListIconGadget_2, -1, "http://89.20.136.213:9800"+Chr(10)+"16BIT.FM IDEA Channel Intelligent Digital Experimental Sound ")
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://94.23.0.111:8020"+Chr(10)+"Ambient Lounge Radio")
AddGadgetItem(#ListIconGadget_2, -1, "http://207.200.96.225:8020"+Chr(10)+"Bluemars - Music for the Space Traveler")
AddGadgetItem(#ListIconGadget_2, -1, "http://64.57.105.178:8000"+Chr(10)+"Culture Failure")
AddGadgetItem(#ListIconGadget_2, -1, "http://207.200.96.225:8022"+Chr(10)+"Cryosleep - Zero Beat Guaranteed")
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://64.62.252.141:8100"+Chr(10)+"FM - Disco Ball")
AddGadgetItem(#ListIconGadget_2, -1, "http://64.71.145.130:8095"+Chr(10)+"FM - 80s Channel")
AddGadgetItem(#ListIconGadget_2, -1, "http://66.103.27.11:14700"+Chr(10)+"CLUB.FM 80 - Freestyle Express 128k")
AddGadgetItem(#ListIconGadget_2, -1, "http://66.103.27.11:13900"+Chr(10)+"000Audio.com - 90s Dance Hits 128k")
AddGadgetItem(#ListIconGadget_2, -1, "")
AddGadgetItem(#ListIconGadget_2, -1, "http://66.90.73.17:9000"+Chr(10)+"A9 RADIO")
AddGadgetItem(#ListIconGadget_2, -1, "http://stream.bollywoodmusicradio.com"+Chr(10)+"Индия Bollywood Music Radio")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
AddGadgetItem(#ListIconGadget_2, -1, ""+Chr(10)+"")
Case #ListIconGadget_2
Row = GetGadgetState(#ListIconGadget_2)
Name$=GetGadgetItemText(0, Row , 1)
;888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
SetGadgetText(238,Name$)
;888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
Loadfile(GetGadgetText(#ListIconGadget_2))
;}-------------------------------------------------------------------------------
Case 226
Tog = Tog ! 1
If Tog
ResizeWindow(#Window_0, #PB_Ignore, #PB_Ignore, #PB_Ignore, 600 )
Else
ResizeWindow(#Window_0, #PB_Ignore, #PB_Ignore, #PB_Ignore, 230 )
EndIf
Case #Play_ListMP3
If EventType()=0
Play()
EndIf
Case 71
RunProgram("http://www.mirashic.narod.ru/")
Case 77
RunProgram("http://purebasic.com/")
EndSelect
EndSelect
If Event=#PB_Event_CloseWindow
;{----Запись параметров-----------
OpenPreferences("vol.pcs")
WritePreferenceString("Громкость",GetGadgetText(242))
WritePreferenceString("Путь",Rep.s)
WritePreferenceString("Позиция",Str(GetGadgetState(#Play_ListMP3)))
ClosePreferences()
;}--------------------------------
CloseWindow(Window)
EndIf
Until Event=#PB_Event_CloseWindow And Window=#Window_0
;{---------------------------загрузка изоброжений------------------------------
DataSection
Im3:
IncludeBinary "img_2.jpg"
Im3End:
Im6:
IncludeBinary "info.png"
Im6End:
Im7:
IncludeBinary "фон6.png"
Im7End:
EndDataSection
;}-----------------------------------------------------------------------------