Уроки PureBasic

Categories

Other Sites

Other Sites

Other Sites



             Поиск по сайту

     

                


    Оставить мне сообщение:



Онлайн FM-radio

Уроки PureBasic

Онлайн FM приемник, с использованием библиотеки Bass.dll

Radio_bass

;-------------------------Radio bass----------------------------------------- ; ; (c) 2009 - mirashic ; ;---------------------------------------------------------------------------- UsePNGImageDecoder() UseJPEGImageDecoder() ;{----------------------Запрет на запуск больше одного раза------------------ *a = CreateSemaphore_(NULL,0,1,GetProgramName()) If *a <> 0 And GetLastError_()= #ERROR_ALREADY_EXISTS CloseHandle_(*a) End EndIf ;}--------------------------------------------------------------------------- ;{----------------------Заставка--------------------------------------------- hWnd = OpenWindow(0,0,0, 500, 434, "Window Name", #WS_POPUP|#PB_Window_Invisible|#PB_Window_ScreenCentered) ; CatchImage(44, ?Im2, ?Im2End-?Im2) ; ижоброжение в exe файле hBitmap = LoadImage(0, "489537.png") ; hBitmap = ImageID(44) ; ижоброжение в exe файле SkinWin(hWnd, hBitmap) HideWindow(0,#False) Delay(1000); время работы заставки ;}--------------------------------------------------------------------------- ;{----------------------Таймер----------------------------------------------- Global g,b Procedure.s Secundomer() ;----- Сама процедура таймера - всего 3 строчки! g+1 If g=10:g=0:b=b+1:EndIf SetGadgetText(18,FormatDate("%ii:%ss", b)+":"+ Str(g)) EndProcedure ;}--------------------------------------------------------------------------- ;{----------------------Cпектроанализатор------------------------------------ IncludeFile "bass.pbi" Global Handle Global Event #SPECWIDTH = 400 #SPECHEIGHT = 80 Structure BITMAPINFO256 bmiHeader.BITMAPINFOHEADER bmiColors.RGBQUAD[256] EndStructure Global specpos = 0, specmode = 1 Global bh.BITMAPINFO256 Global Dim specbuf.b(#SPECWIDTH*(#SPECHEIGHT+1)) With bh\bmiHeader \biBitCount = 8 \biPlanes = 1 \biSize = SizeOf(BITMAPINFOHEADER) \biWidth = #SPECWIDTH \biHeight = #SPECHEIGHT EndWith For a = 1 To 127 ;bh\bmiColors[a]\rgbGreen = 256 - 2 * a ;256 - 2 * a bh\bmiColors[a]\rgbRed = 2 * a ;2 * a Next a Procedure IIF(expr,y,n) If expr ProcedureReturn y Else ProcedureReturn n EndIf EndProcedure Procedure UpdateSpectrum() ; Функция для создания спектроанализатора Define x.l, y.l, y1.l Dim FFT.f(1024) BASS_ChannelGetData(Handle,@FFT(),#BASS_DATA_FFT2048) Dim buf.f(0) Define c.l, ci.BASS_CHANNELINFO Dim specbuf(#SPECWIDTH * (#SPECHEIGHT + 1)) BASS_ChannelGetInfo(Handle, @ci) Dim buf(ci\chans * #SPECWIDTH * 4) BASS_ChannelGetData(Handle, @buf(0), (ci\chans * #SPECWIDTH * 4) | #BASS_DATA_FLOAT) For c = 0 To ci\chans - 1 For X = 0 To #SPECWIDTH - 1 v.l = (1 - buf(X * ci\chans + c)) * #SPECHEIGHT / 2 If (v < 0) v = 0 ElseIf (v >= #SPECHEIGHT) v = #SPECHEIGHT - 1 EndIf If (X = 0) : Y = v : EndIf Repeat If (Y < v) Y = Y + 1 ElseIf (Y > v) Y = Y - 1 EndIf specbuf(Y * #SPECWIDTH + X) = IIf(c And 1, 127, 1) Until (Y = v) Next X Next c DC=GetDC_(WindowID(0)) SetDIBitsToDevice_(DC, 12, 27, 385, 80, 0, 0, 0, #SPECHEIGHT, @specbuf(0), @bh, 0) ReleaseDC_(WindowID(0), DC) EndProcedure ;}--------------------------------------------------------------------------- ;{----Функция для создания потокового звука, получаемыми из сети Интернет---- Procedure Loadfile(url_1$,N) BASS_StreamFree(Handle) ; Закроем все существующие каналы воспроизведения и освободим системные ресурсы Handle=BASS_StreamCreateURL(url_1$, 0, 0, #Null, 0) BASS_ChannelPlay(Handle,0) SetGadgetText(444,url_1$) SetGadgetText(16,"Станция : "+GetGadgetText(N)+" 128 kbps") g=0:b=0 StartTimer( 1 , 100 , @Secundomer()) EndProcedure ;}--------------------------------------------------------------------------- Enumeration #Window_0 #Image_1 #Image_2 #Image_3 #Image_5 EndEnumeration CatchImage(#Image_1, ?Im, ?ImEnd-?Im) CatchImage(#Image_2, ?Im1, ?Im1End-?Im1) CatchImage(67, ?Im4, ?Im4End-?Im4) CatchImage(68, ?Im5, ?Im5End-?Im5) CatchImage(#Image_3, ?Im7, ?Im7End-?Im7) ;{--Эта процедура определяет находится ли курсор мышки над заданым окном или гаджетом Procedure IsMouseOver(wnd) GetWindowRect_(wnd,re.RECT) GetCursorPos_(pt.POINT) Result.l = PtInRect_(@re, pt\x | (pt\y<<32) ) ProcedureReturn Result EndProcedure Procedure EventButton1(Event, Gadget, Type, ImageGadget) Static Button, Buton_DOWN If Event=#WM_MOUSEMOVE ; Переместилась мышка If IsMouseOver(GadgetID(62)) myCursor=LoadCursor_(0,#IDC_HAND) ; курсор рука SetCursor_(myCursor) ; курсор рука EndIf EndIf EndProcedure ;}--------------------------------------------------------------------------- ;{----------------------Основное окно---------------------------------------- OpenWindow(#Window_0, 0, 0, 410, 250, "Radio bass", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_Invisible) BackgroundImage_Window_0_Brush = CreatePatternBrush_(ImageID(#Image_3)) If BackgroundImage_Window_0_Brush SetClassLong_(WindowID(#Window_0), #GCL_HBRBACKGROUND, BackgroundImage_Window_0_Brush) RedrawWindow_(WindowID(#Window_0), 0, 0, #RDW_ERASE | #RDW_FRAME | #RDW_INVALIDATE | #RDW_ALLCHILDREN) EndIf HyperLinkGadget(15, 318, 12, 55, 15, "Стоп", RGB(255,0,0)) TextGadget(16, 25, 110, 260, 15, "Выбери станцию") TextGadget(17, 25, 12, 155, 15, "Информация") TextGadget(18, 318, 110, 45, 15, "00:00:0") HyperLinkGadget(19, 388, 12, 10, 15, "?",RGB(255,0,0)) For k=15 To 19 SetGadgetColor(k, #PB_Gadget_FrontColor,RGB(1, 161, 254)) SetGadgetColor(k,#PB_Gadget_BackColor,RGB(0, 0, 0)) Next k TextGadget (20, 387,186,30,15,"50") HyperLinkGadget(21,10, 160,70,15,"A-ROCK", RGB(255,0,0)) HyperLinkGadget(22,90, 160,70,15,"Kiss FM", RGB(255,0,0)) HyperLinkGadget(23,170,160,70,15,"Makkirus", RGB(255,0,0)) HyperLinkGadget(24,250,160,70,15,"Радио 13", RGB(255,0,0)) HyperLinkGadget(25,330,160,70,15,"Luga Radio", RGB(255,0,0)) HyperLinkGadget(26, 295, 215, 55, 15, "Загрузка", RGB(255,0,0)) HyperLinkGadget(27, 355, 215, 55, 15, "Плейлист", RGB(255,0,0)) StringGadget(444, 12, 216, 273, 15, "http://207.200.96.225:8020",#PB_String_BorderLess) PureCOLOR_SetGadgetColor(444, RGB(129, 129, 129), RGB(29, 26, 26)) ButtonID=ImageGadget(62, 380, 107, 23, 23, ImageID(67)) For h=20 To 27 SetGadgetColor(h, #PB_Gadget_FrontColor,RGB(129, 129, 129)) SetGadgetColor(h,#PB_Gadget_BackColor,RGB(29, 26, 26)) Next h ImageGadget(#Image_2, 0, 0, 0, 0, ImageID(#Image_1)) ImageGadget(#Image_1, 0, 0, 0, 0, ImageID(#Image_2)) SplitterGadget(99, 8, 187, 370, 14, #Image_2,#Image_1, #PB_Splitter_Vertical) BASS_Init(-1, 44100, 0, WindowID(0), #Null) BASS_SetVolume(0.5) ;}------------------------------------------------------------------------------ HideWindow(#Window_0,0) Repeat Event= WaitWindowEvent(1) Window=EventWindow() Gadget=EventGadget() Select Event Case #PB_Event_Gadget Select EventGadget() Case 15 BASS_StreamFree(Handle) EndTimer(1) Case 21 Loadfile("http://stream4.radiostyle.ru:8004/a-rock",21) Case 22 Loadfile("http://217.20.164.164:8000/kissfm.mp3",22) Case 23 Loadfile("http://w02-sw01.akadostream.ru:8111/makkirus128.mp3",23) Case 24 Loadfile("http://play.radio13.ru:8000/radio13-128-mp3",24) Case 25 Loadfile("http://195.5.125.6:8000/",25) Case 26 Loadfile(GetGadgetText(444),26) Case 27 ;{-----------------------------Плейлист---------------------------------------- Enumeration #ListIconGadget_2 EndEnumeration 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 Loadfile(GetGadgetText(#ListIconGadget_2),27) ;}------------------------------------------------------------------------------- Case 19 ;{-----------------------------О программе------------------------------------- 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 71 RunProgram("http://www.mirashic.narod.ru/") Case 77 RunProgram("http://purebasic.info/") Case 62 Toggle = Toggle ! 1 If Toggle BASS_SetVolume(0) SetGadgetState(62,ImageID(68)) Else BASS_SetVolume(Value/100) SetGadgetState(62,ImageID(67)) EndIf Case 99 Value=GetGadgetState(99)/3.66 SetGadgetText(20,Str(Value)) BASS_SetVolume(Value/100) SetGadgetState(62,ImageID(67)) EndSelect EndSelect UpdateSpectrum() EventButton1(Event, Gadget, Type, 1) If Event=#PB_Event_CloseWindow CloseWindow(Window) EndIf Until Event=#PB_Event_CloseWindow And Window=#Window_0 ;{---------------------------загрузка изоброжений------------------------------ DataSection Im: IncludeBinary "ajy_13.png" ImEnd: Im1: IncludeBinary "ajy_12.png" Im1End: Im3: IncludeBinary "img_2.jpg" Im3End: Im4: IncludeBinary "24.png" Im4End: Im5: IncludeBinary "25.png" Im5End: Im6: IncludeBinary "info.png" Im6End: Im7: IncludeBinary "фон1.png" Im7End: EndDataSection ;}----------------------------------------------------------------------------- </plaintext> </div><br><br><br> Скачать <a href="fail/Radio_bass11111.rar">исходник</a><br><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> Использование браузера в качестве плеера:<br><br> <center><img src="img/fm_1.png" width="356" height="369" alt="Radio_bass"></center><br><br> Cкачать <a href="fail/fm_1.rar">исходник</a><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> Другой вариант:<br><br> <center><img src="img/fm_11.png" width="366" height="429" alt="Radio_bass"></center><br><br> Cкачать <a href="fail/metal.rar">исходник</a><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> <h2 align="center">Онлайн TV</h2> <center><img src="img/fm_12.png" width="486" height="669" alt="OnLine_TV"></center><br><br> Cкачать <a href="fail/OnLine_TV.rar">исходник</a><br><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> Добавил другой вариант кода <b>Online TV</b> плеера, лучше и проще реализован:<br><br> Скачать <a href="fail/OnLine_TV_1.rar">архив</a> <div class="con3"> <plaintext id="PureBasic"> Enumeration #Window #WebGadget EndEnumeration OpenWindow(#Window,0,0,480,600,"Онлайн TV",#PB_Window_SystemMenu|#PB_Window_ScreenCentered) SetWindowColor(0,RGB(0, 0, 0)) ;{/////////////////////////////////Кнопки каналов////////////////////////////////////////////////// HyperLinkGadget(31, 25, 390, 190, 15, "Вести ( Russia | Новости )", $ffffff ) HyperLinkGadget(32, 25, 410, 190, 15, "РТР-Планета ( Russia | Новости )", $ffffff ) HyperLinkGadget(33, 25, 430, 190, 15, "Первый ( Russia | Новости )", $ffffff ) HyperLinkGadget(34, 25, 450, 190, 15, "EuroSport ( Russia | Спорт )", $ffffff ) ;///////////////////////////////////////////////////////////////////////////////////////////////// HyperLinkGadget(35, 270, 390, 190, 15, "O-TV ( Ukraine | Музыка )", $ffffff ) HyperLinkGadget(36, 270, 410, 190, 15, "Корбина ТВ ( Russia | Музыка )", $ffffff ) HyperLinkGadget(37, 270, 430, 190, 15, "A-ONE ( Russia | Музыка )", $ffffff ) HyperLinkGadget(38, 270, 450, 190, 15, "MTV ( Russia | Музыка )", $ffffff ) HyperLinkGadget(39, 270, 470, 190, 15, "icq tv онлайн ( Russia | Музыка )", $ffffff ) ;///////////////////////////////////////////////////////////////////////////////////////////////// HyperLinkGadget(40, 25, 490, 190, 15, "Твой строй ( Russia | Научный )", $ffffff ) HyperLinkGadget(41, 25, 510, 190, 15, "NASA TV ( Eng | Научный )", $ffffff ) ;///////////////////////////////////////////////////////////////////////////////////////////////// HyperLinkGadget(42, 270, 510, 190, 15, "Первый Игровой ( Russia | Образов)", $ffffff ) HyperLinkGadget(43, 270, 530, 190, 15, "Discover Greece ( Russia | Образов)", $ffffff ) HyperLinkGadget(44, 270, 550, 190, 15, "Nat Geo WILD ( Russia | Образов)", $ffffff ) HyperLinkGadget(45, 270, 570, 190, 15, "National Geograph ( Russia | Образов)", $ffffff ) ;///////////////////////////////////////////////////////////////////////////////////////////////// HyperLinkGadget(46, 25, 550, 190, 15, "Comedy Club ( Russia | Юмор )", $ffffff ) HyperLinkGadget(47, 25, 570, 190, 15, "НСТ ТВ ( Russia | Юмор )", $ffffff ) ;}///////////////////////////////////////////////////////////////////////////////////////////////// For h=31 To 47 SetGadgetColor(h, #PB_Gadget_FrontColor, $5C5C5C) ;цвет SetGadgetColor(h, #PB_Gadget_BackColor, $000000) ;фон Next h Procedure TV_File(pol.s, str.s) ;{---------Загрузка изобр.-------------------------------- Buffer$=Space(512) GetFullPathName_(str.s, Len(Buffer$),@Buffer$,@FilePart) img$ = PeekS(@Buffer$) ;}-------------------------------------------------------- Html.s Html + "<style type='text/css'>" Html + ".con{ position: absolute; left: 0px; top: 0px; width: 470px; height: 300px;}" Html + "body {margin:0px; padding:0px; background-color: #000000;}" Html + "</style>" Html + "" Html + "" Html + "<object CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' width='470' height='370' >" Html + "<param name='FileName' value='"+pol.s+"'>" Html + "<param name='ShowStatusBar' value='true'>" Html + "</object>" Html + "" Html + "<div class='con'><img src='"+img$+ "' width='470' height='300'></div>" SetGadgetItemText(#WebGadget, #PB_Web_HtmlCode, Html) EndProcedure Procedure TV_File_2(pol.s) Html.s Html + "<style type='text/css'>" Html + ".con{ position: absolute; left:0px; top:0px; width:470px; height:300px;}" Html + "body {margin:0px; padding:0px; background-color:#000000;}" Html + "</style>" Html + "" Html + "<script type='text/javascript' src="+pol.s+"></script>" Html + "<script type='text/javascript'>counter()</script>" SetGadgetItemText(#WebGadget, #PB_Web_HtmlCode, Html) EndProcedure ;{------------------------Web Плеер------------------------------------------ ;{---------Загрузка изобр.--------------------------------------------------- FileName$="imgs/img_3.png" Buffer$=Space(512) GetFullPathName_(FileName$,Len(Buffer$),@Buffer$,@FilePart) img$ = PeekS(@Buffer$) ;}--------------------------------------------------------------------------- Html.s Html + "<style type='text/css'>" Html + "body{ background-color: #000000; margin:0px; padding:0px; color: #AAAAAA; font-family: Arial; font-size: 36px; }" Html + ".con{ border: 1px solid #6C6C6C; width: 470px; height: 370px; }" Html + "</style>" Html + "<div class='con'><br>" Html + "<center><img src='"+img$+"'></center>" Html + "<center>Выбери телеканал</center>" Html + "</div>" WebGadget(#WebGadget,5,5,480,380,"about:blank",#PB_Web_Mozilla) While GetGadgetAttribute(#WebGadget, #PB_Web_Busy) <> 0 While WindowEvent() Delay(0) Wend Wend SetGadgetItemText(#WebGadget, #PB_Web_HtmlCode, Html) ;}---------------------------------------------------------------------------- Repeat Event= WaitWindowEvent() Window=EventWindow() Gadget=EventGadget() Select Event Case #PB_Event_Gadget Select EventGadget() Case 31 TV_File("http://www.vesti.ru/video1.asx?vid=onair","imgs/вести_2.png") Case 32 TV_File("mms://live.rfn.ru/rtr-planeta_128","imgs/РТР-Планета.png") Case 33 TV_File("http://www.1tv.ru/owa/win/ort6_itv.asx_file_z?p_ch=1tvdoc&p_bt=500","imgs/первый_канал.png") Case 34 TV_File("http://a1439.l3192233438.c31922.g.lm.akamaistream.net/D/1439/31922/v0001/reflector:33438","imgs/EuroSport.png") Case 35 TV_File("http://212.26.146.148/asxgen/wmtencoder/otv","imgs/O-TV.png") Case 36 TV_File("mms://85.21.138.210/mclips4","imgs/Корбина.png") Case 37 TV_File("http://www.aillin.ru/stream/aone2_client_sl","imgs/a_one.png") Case 38 TV_File("http://76.73.49.218/mtvl2j3nkj34?MSWMExt=.asf","imgs/mtv_1.png") Case 39 TV_File("http://s52wm.castup.net/995090001-52.wmv?ct=RU&rg=EE&aid=509&st=0&ts=0&cu=EBE016AC-731E-4F23-B225-31AC8EF602B3","imgs/icq.png") Case 40 TV_File("mms://212.1.238.70/ts_tv4","imgs/Твой-строй.png") Case 41 TV_File("http://playlist.yahoo.com/makeplaylist.dll?id=1369080&segment=149773","imgs/NASA.png") Case 42 TV_File("mms://217.20.164.164:8000/1gtv.asf","imgs/Первый-Игровой.png") Case 43 TV_File("mms://84.254.38.223:35900","imgs/discovery.png") ;---------------------------------------------------------------- Case 44 TV_File_2("http://nashgorod.pnz.ru/xxx/Nat_Geo_Wild.js") Case 45 TV_File_2("http://nashgorod.pnz.ru/xxx/National_Geo.js") Case 46 TV_File_2("http://nashgorod.pnz.ru/xxx/Comedy_Club.js") Case 47 TV_File_2("http://nashgorod.pnz.ru/xxx/NST.js") EndSelect EndSelect If Event=#PB_Event_CloseWindow Break EndIf ForEver </plaintext> </div><br><br><br> <img src="img/lin.jpg" width="700" height="20" alt="Уроки PureBasic"><br><br> </div> </div> <!-- copyright (t4) --><div align="center">Используются технологии <a href="http://www.ucoz.ru/" title="Создать сайт бесплатно"><b>uCoz</b></a><br /></div><!-- /copyright --> </body> </html>