From 73b2d0dd753532e55653d3a2a026fd22a980ed1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 1 Aug 2014 01:37:56 +0000 Subject: [PATCH] [GB.FORM] * BUG: FileChooser: Fix an infinite loop when trying to initialize the path with an unknown file. [GB.MEDIA.FORM] * NEW: New component based on gb.media that includes a full media player widget with controls. [GB.NET.SMTP] * NEW: SmtpClient is now a virtual control. git-svn-id: svn://localhost/gambas/trunk@6408 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form/.project | 2 +- .../.src/File/Bookmark/CBookmarkList.class | 3 + .../.src/File/Chooser/FDirChooser.class | 25 +- comp/src/gb.form/.src/Test/FLCDLabel.form | 8 +- comp/src/gb.media.form/.component | 4 + comp/src/gb.media.form/.directory | 2 + comp/src/gb.media.form/.gitignore | 13 + .../.hidden/control/mediaview.png | Bin 0 -> 1477 bytes comp/src/gb.media.form/.icon.png | Bin 0 -> 4255 bytes comp/src/gb.media.form/.info | 31 +++ comp/src/gb.media.form/.list | 1 + comp/src/gb.media.form/.project | 14 ++ .../src/gb.media.form/.src/FMediaPlayer.class | 235 ++++++++++++++++++ comp/src/gb.media.form/.src/FMediaPlayer.form | 57 +++++ comp/src/gb.media.form/.src/FTest.class | 2 + comp/src/gb.media.form/.src/FTest.form | 10 + comp/src/gb.media.form/.src/MediaView.class | 60 +++++ comp/src/gb.media.form/.startup | 11 + comp/src/gb.media.form/video.png | Bin 0 -> 2448 bytes .../.hidden/control/pop3client.png | Bin 0 -> 1125 bytes comp/src/gb.net.pop3/.info | 2 +- comp/src/gb.net.pop3/.src/Pop3Client.class | 2 +- comp/src/gb.net.smtp/.component | 2 +- .../.hidden}/control/smtpclient.png | Bin comp/src/gb.net.smtp/.info | 16 ++ comp/src/gb.net.smtp/.project | 3 +- comp/src/gb.net.smtp/.src/SmtpClient.class | 5 + comp/src/gb.net.smtp/.startup | 2 +- comp/src/order | 2 +- .../Multimedia/MediaPlayer/.src/FMain.form | 3 +- gb.media/src/c_media.c | 6 +- main/gbx/gbx_stream.c | 3 - 32 files changed, 495 insertions(+), 29 deletions(-) create mode 100644 comp/src/gb.media.form/.component create mode 100644 comp/src/gb.media.form/.directory create mode 100644 comp/src/gb.media.form/.gitignore create mode 100644 comp/src/gb.media.form/.hidden/control/mediaview.png create mode 100644 comp/src/gb.media.form/.icon.png create mode 100644 comp/src/gb.media.form/.info create mode 100644 comp/src/gb.media.form/.list create mode 100644 comp/src/gb.media.form/.project create mode 100644 comp/src/gb.media.form/.src/FMediaPlayer.class create mode 100644 comp/src/gb.media.form/.src/FMediaPlayer.form create mode 100644 comp/src/gb.media.form/.src/FTest.class create mode 100644 comp/src/gb.media.form/.src/FTest.form create mode 100644 comp/src/gb.media.form/.src/MediaView.class create mode 100644 comp/src/gb.media.form/.startup create mode 100644 comp/src/gb.media.form/video.png create mode 100644 comp/src/gb.net.pop3/.hidden/control/pop3client.png rename {app/src/gambas3/img => comp/src/gb.net.smtp/.hidden}/control/smtpclient.png (100%) diff --git a/comp/src/gb.form/.project b/comp/src/gb.form/.project index 72e8e6ce5..9b1cbe8f9 100644 --- a/comp/src/gb.form/.project +++ b/comp/src/gb.form/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 # Compiled with Gambas 3.5.90 Title=More controls for graphical components -Startup=FIconView +Startup=FLCDLabel Version=3.5.90 VersionFile=1 Component=gb.image diff --git a/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class b/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class index 6f0c9fb01..47c876ccb 100644 --- a/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class +++ b/comp/src/gb.form/.src/File/Bookmark/CBookmarkList.class @@ -111,11 +111,13 @@ Public Sub FindBookmark({Link} As String) As CBookmark Dim hBookmark As CBookmark For Each hBookmark In Me + If Not hBookmark.Exist() Then Continue If hBookmark.Link = {Link} Then Return hBookmark Next If Left({Link}) = "/" Then For Each hBookmark In Me + If Not hBookmark.Exist() Then Continue If hBookmark.Path = {Link} Then Return hBookmark Next Endif @@ -134,6 +136,7 @@ Public Sub FindBest(sDir As String) As CBookmark aDir = Split(sDir, "/") For Each hBookmark In Me + If Not hBookmark.Exist() Then Continue aBook = Split(hBookmark.Path, "/") For iInd = 0 To Min(aDir.Max, aBook.Max) If aBook[iInd] <> aDir[iInd] Then Break diff --git a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class index 572955103..115d8a3fb 100644 --- a/comp/src/gb.form/.src/File/Chooser/FDirChooser.class +++ b/comp/src/gb.form/.src/File/Chooser/FDirChooser.class @@ -257,7 +257,7 @@ End Public Sub SetDir(sDir As String) If sDir = dvwChoose.Current Then Return - + If IsBookmarkVisible() Then SetBookmark($hBookmarkList.FindBest(sDir)) Endif @@ -356,25 +356,30 @@ Public Function GetPath() As String End Public Sub SetPath(sPath As String) + + Dim bError As Boolean + If Not Exist(sPath) Then bError = True + If txtFile.ReadOnly Then SetDir(sPath) Else SetDir(File.Dir(sPath)) Endif - If GetMulti() Then Return + If Not GetMulti() Then - 'DEBUG dvwChoose.Current;; File.Dir(sPath) - 'IF dvwChoose.Current = File.Dir(sPath) THEN - fvwChoose.Current = File.Name(sPath) - If txtFile.ReadOnly Then - txtFile.Text = fvwChoose.Current - Else - txtFile.Text = File.Name(sPath) + fvwChoose.Current = File.Name(sPath) + If txtFile.ReadOnly Then + txtFile.Text = fvwChoose.Current + Else + txtFile.Text = File.Name(sPath) + Endif + Endif - 'ENDIF + If bError Then Message.Error(("Path not found:") & "\n\n" & sPath) + End diff --git a/comp/src/gb.form/.src/Test/FLCDLabel.form b/comp/src/gb.form/.src/Test/FLCDLabel.form index 82ada39da..eab50ac3e 100644 --- a/comp/src/gb.form/.src/Test/FLCDLabel.form +++ b/comp/src/gb.form/.src/Test/FLCDLabel.form @@ -2,14 +2,14 @@ { Form Form MoveScaled(0,0,44,19) + Background = &H000000& Arrangement = Arrange.Fill { LCDLabel2 LCDLabel - MoveScaled(2,3,29,11) - Background = &H000000& - Foreground = &HCFFFBF& + MoveScaled(5,3,29,11) + Foreground = &HFFFFFF& + Text = ("12:34") Alignment = Align.Center Padding = 8 - HighlightColor = &HFF7F00& } { Timer1 #Timer #MoveScaled(36,11) diff --git a/comp/src/gb.media.form/.component b/comp/src/gb.media.form/.component new file mode 100644 index 000000000..f5dfafb72 --- /dev/null +++ b/comp/src/gb.media.form/.component @@ -0,0 +1,4 @@ +[Component] +Key=gb.media.form +Version=3.5.90 +Needs=Form diff --git a/comp/src/gb.media.form/.directory b/comp/src/gb.media.form/.directory new file mode 100644 index 000000000..06dab1c8a --- /dev/null +++ b/comp/src/gb.media.form/.directory @@ -0,0 +1,2 @@ +[Desktop Entry] +Icon=./.icon.png diff --git a/comp/src/gb.media.form/.gitignore b/comp/src/gb.media.form/.gitignore new file mode 100644 index 000000000..cb95c3b71 --- /dev/null +++ b/comp/src/gb.media.form/.gitignore @@ -0,0 +1,13 @@ +#---- Gambas files to ignore (v1) +*.gambas +.lock +*~ +core +core.* +vgcore +vgcore.* +.kdbg* +.*.prof +.lang/*.pot +.gambas/* +#---- diff --git a/comp/src/gb.media.form/.hidden/control/mediaview.png b/comp/src/gb.media.form/.hidden/control/mediaview.png new file mode 100644 index 0000000000000000000000000000000000000000..014d6632090b2486f3788f6073c19e39ed937e2b GIT binary patch literal 1477 zcmV;$1v>hPP)C-GeH;?t!i5X_a{1`!C>HxX_8owH(uOextuv~3IqqYay}v|24DC;v%zcQ6y+G;X(D1H}^MgB5PPH_l{rnz^|}lrl_AO!4`?qYMlTF*q>H(Sae3KmP)mOa{xcFvjej zf$95GRI4*I>U9cVdV}#xf1p%=zkPZb+p?)nReAaBX&lEv#W6w%`aky!&DAEhWuvu5 zN*fi&^!7fr_cSbb_mItb00h-*y#AV@e{hIWHYQREOISRZuk-Q8pRn3&GBtIVD2fQf zfZKN_@S8r@ufIzi$21xXd)L63(=U;xnjfBfol5T^=A&M`!aaWa=9@GY=ZT^u@ebO|=vJHz%3-t8%u+UiG*6mxIc=0|F23($OPkA=uW_XBDU9AuWQL4{ z55{k_MJQl?VTqT{oWgTmq?9|C;vft;eexs&M+b1TdBQm5+-v73S1PC|CTN8SVF-ed zFp9RB3Z-J!f`A|lSz8N`(%zdFq^ZXDo4Bq^xzbG-226i;pXqyZJUjB-da2&SFncf~ zfgsf>wOXA*At#xOHI z#rgAZ;AS>HZrhTxXMcbt1buz|%+AiTyt2&r_+L7u*sOVIu7;uI?MhNw%xAreTR?W zNJ)QxAFFA45|ePU{Z_I0K<58K|*c~7}Q*7LTUk=u1b09h|fZLUVB0)!A~tx3}q z*LBI|vLs2&H@<$HjFZ9hT%;q>sUb-cRICWY5RBkgzx>VaG|-8YF`bJht5v#+d6G22 z7{kOrZu9ihhmmrgtmmO(h0z9WG;y4uR7@PVXB4T9NTVpiw(X7|Je*tVfH7_KVHgrc z5te0f;6Mq#>64}jT5CS~21T5r*wX zW^;eAg@H6pQL0T}v)SbM^Izf0)iL~)#fPPVci#Cu`FsHZ==H``>$XVSjckh6?RCd- zxOwv?LqkIp3I#mR>xlAUmn1h@vG$^rl1wH;S63IujvZrgaIj;cJ9Rc&+d9!XFN7eM z%aO@skWy}B#iI-eA&^pbJUg4sQY;pCed$hM9zJgK+!ny2ar{p&f0U8!(p2u{@c-|x f+34u#z5)0bY`eIjx;t)l00000NkvXXu0mjfcoxpW literal 0 HcmV?d00001 diff --git a/comp/src/gb.media.form/.icon.png b/comp/src/gb.media.form/.icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f45d027f8383e886d0b9c912f19c5e135c874cd1 GIT binary patch literal 4255 zcmV;Q5Mb|#P)Hw)h^UDQSfYX< zpcs;ngeGL~bb3$Hd%xG+@4k1JbLNki?sPYuy@`--)v0>#p7r;AzwMlRp5Q%((seIk zv<7W(`y1%nboY6UCnsrL7X)RuZvr4ME5xkI9Au>UyvMZ8dxQ&sicf4pYk?Ai&#fuv z>+5FFbj)GZJqhf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t2{!XD5UCHSmQFayqf#}Vf88dP1=36j^{r+ zSwo!@N{X@xTWNwI#rnrS$GWFBQB-vPf3Cjh@&COXZ$}?X literal 0 HcmV?d00001 diff --git a/comp/src/gb.media.form/.info b/comp/src/gb.media.form/.info new file mode 100644 index 000000000..36fb0c938 --- /dev/null +++ b/comp/src/gb.media.form/.info @@ -0,0 +1,31 @@ +#MediaView +UserControl +C +_IsControl +C +b +-1 +_Group +C +s +Media +_Properties +C +s +*,Border,Control=True,URL{Path} +URL +p +s + +Border +p +b + +Control +p +b + +_new +m + + diff --git a/comp/src/gb.media.form/.list b/comp/src/gb.media.form/.list new file mode 100644 index 000000000..461807bf8 --- /dev/null +++ b/comp/src/gb.media.form/.list @@ -0,0 +1 @@ +MediaView diff --git a/comp/src/gb.media.form/.project b/comp/src/gb.media.form/.project new file mode 100644 index 000000000..a3de939d2 --- /dev/null +++ b/comp/src/gb.media.form/.project @@ -0,0 +1,14 @@ +# Gambas Project File 3.0 +# Compiled with Gambas 3.5.90 +Title=gb.media.form +Startup=FTest +Icon=video.png +Version=3.5.90 +VersionFile=1 +Component=gb.image +Component=gb.gui +Component=gb.form +Component=gb.media +TabSize=2 +Type=Component +Packager=1 diff --git a/comp/src/gb.media.form/.src/FMediaPlayer.class b/comp/src/gb.media.form/.src/FMediaPlayer.class new file mode 100644 index 000000000..0a6501fc3 --- /dev/null +++ b/comp/src/gb.media.form/.src/FMediaPlayer.class @@ -0,0 +1,235 @@ +' Gambas class file + +'Static Private $hLogo As Image + +Private $hPlayer As MediaPlayer +Private $hImage As MediaControl +Private $fPos As Float +Private $fLength As Float + +Private $hPause1 As Panel +Private $hPause2 As Panel +Private $iMute As Integer + +Private Sub MakeMediaPlayer() + + If $hPlayer Then Return + + $hPlayer = New MediaPlayer As "MediaPlayer" + '$hFilter = New MediaFilter($hPlayer) + $hImage = New MediaControl($hPlayer, "ximagesink") + $hPlayer.Video.Output = $hImage + '$hImage.SetWindow(dwgVideo) + + ' $aVisualisation = New MediaControl[] + ' AddVisualisation("", "") + ' AddVisualisation("goom", "Goom") + ' AddVisualisation("goom2k1", "Goom2") + ' AddVisualisation("libvisual_bumpscope", "Bump") + ' AddVisualisation("libvisual_corona", "Corona") + ' AddVisualisation("libvisual_infinite", "Infinite") + ' AddVisualisation("libvisual_jakdaw", "Jakdaw") + ' AddVisualisation("libvisual_jess", "Jess") + ' AddVisualisation("monoscope", "Mono") + ' AddVisualisation("libvisual_oinksie", "Oinksie") + ' AddVisualisation("libvisual_lv_analyzer", "Analyzer") + ' AddVisualisation("libvisual_lv_scope", "Scope") + ' AddVisualisation("spacescope", "Space") + ' AddVisualisation("spectrascope", "Spectra") + ' AddVisualisation("synaescope", "Synae") + ' AddVisualisation("wavescope", "Wave") + ' + ' $iVisualisation = 0 + ' UpdateVisualisation + +End + +Private Sub ShowPause() + + If $hPause1 Then Return + Object.Lock(dwgVideo) + $hPause1 = New Panel(dwgVideo) + $hPause1.Background = Color.White + $hPause2 = New Panel(dwgVideo) + $hPause2.Background = Color.White + Object.Unlock(dwgVideo) + dwgVideo_Arrange + +End + +Private Sub HidePause() + + If Not $hPause1 Then Return + Object.Lock(dwgVideo) + $hPause1.Delete + $hPause2.Delete + $hPause1 = Null + $hPause2 = Null + Object.Unlock(dwgVideo) + +End + + +Public Sub SetUrl(sUrl As String) + + MakeMediaPlayer + $hPlayer.URL = Media.URL(sUrl) + +End + +Public Sub btnPlay_Click() + + If Not $hPlayer Then Return + timTime.Start + dwgTime.Refresh + sldVolume_Change + $hImage.SetWindow(dwgVideo) + $hPlayer.Play + HidePause + +End + +Public Sub btnPause_Click() + + If Not $hPlayer Then Return + $hPlayer.Pause + ShowPause + timTime.Stop + +End + +Public Sub btnStop_Click() + + If Not $hPlayer Then Return + $hPlayer.Stop + HidePause + timTime.Stop + $fLength = 0 + +End + +Public Sub dwgVideo_Arrange() + + Dim W, H As Integer + + H = Desktop.Scale * 8 + W = H * 2 + + 'lblTime.Move(dwgVideo.W - W, dwgVideo.H - H, W, H) + + If $hPause1 Then $hPause1.Move(dwgVideo.W \ 2 - 32, dwgVideo.H \ 2 - 32, 24, 64) + If $hPause2 Then $hPause2.Move(dwgVideo.W \ 2 + 8, dwgVideo.H \ 2 - 32, 24, 64) + +End + +Public Sub GetShowControl() As Boolean + + Return panControl.Visible + +End + +Public Sub SetShowControl(bShow As Boolean) + + panControl.Visible = bShow + dwgTime.Visible = bShow + +End + +Public Sub GetBorder() As Boolean + + Return panBorder.Border <> Border.None + +End + +Public Sub SetBorder(bBorder As Boolean) As Boolean + + If bBorder Then + panBorder.Border = Border.Plain + panBorder.Margin = True + Else + panBorder.Border = Border.None + panBorder.Margin = False + Endif + +End + +Private Sub UpdateTime() + + Dim fPos As Float + + fPos = $hPlayer.Position + If fPos = 0 Then Return + $fPos = fPos + If $fLength = 0 Then $fLength = $hPlayer.Duration + dwgTime.Refresh + +End + + +Public Sub timTime_Timer() + + UpdateTime + +End + +Public Sub dwgTime_Draw() + + Dim sText As String + + If Not $hPlayer Or If $hPlayer.State = Media.Null Then Return + + If $fLength > 0 Then Paint.FillRect(4, 6, (dwgTime.W - 8) * Min(1, $fPos / $fLength), dwgTime.H - 12, &HC0C0C0&) + + If $fPos = 0 Then + sText = "00:00:00" + Else + sText = Format(CDate(($fPos + 0.5) / 86400), "hh:nn:ss") '& " / " & Format(CDate($fLength / 86400), "hh:nn:ss") + Endif + Paint.DrawText(sText, 0, 0, dwgTime.W - 4, dwgTime.H, Align.Right) + +End + +Private Sub SetPos(fPos As Float) + + If $hPlayer.State = Media.Paused Or If $hPlayer.State = Media.Playing Then + If $fLength Then + $fPos = fPos * $fLength + $hPlayer.Position = $fPos + dwgTime.Refresh + Endif + Endif + +End + + +Public Sub dwgTime_MouseDown() + + If Mouse.Left Then SetPos(Mouse.X / dwgTime.W) + +End + +Public Sub dwgTime_MouseMove() + + If Mouse.Left Then SetPos(Mouse.X / dwgTime.W) + +End + +Public Sub sldVolume_Change() + + sldVolume.Tooltip = CStr(sldVolume.Value) & "%" + If Not $hPlayer Then Return + $hPlayer.Audio.Volume = sldVolume.Value / 100 + +End + +Public Sub btnVolume_Click() + + If sldVolume.Enabled Then + $iMute = sldVolume.Value + sldVolume.Value = 0 + Else + sldVolume.Value = $iMute + Endif + sldVolume.Enabled = Not sldVolume.Enabled + +End diff --git a/comp/src/gb.media.form/.src/FMediaPlayer.form b/comp/src/gb.media.form/.src/FMediaPlayer.form new file mode 100644 index 000000000..e5fa2c8a7 --- /dev/null +++ b/comp/src/gb.media.form/.src/FMediaPlayer.form @@ -0,0 +1,57 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,64,64) + Arrangement = Arrange.Fill + { panBorder Panel + MoveScaled(2,3,58,55) + Arrangement = Arrange.Vertical + { panViewer Panel + MoveScaled(11,2,43,30) + Background = &H000000& + Expand = True + Arrangement = Arrange.Fill + { dwgVideo DrawingArea + MoveScaled(0,0,24,24) + Background = &H000000& + Expand = True + } + } + { dwgTime DrawingArea + MoveScaled(9,37,36,3) + Mouse = Mouse.Pointing + } + { panControl HBox + MoveScaled(0,45,57,4) + { btnPlay ToolButton + MoveScaled(0,0,4,4) + Picture = Picture["icon:/small/play"] + } + { btnPause ToolButton + MoveScaled(4,0,4,4) + Picture = Picture["icon:/small/pause"] + } + { btnStop ToolButton + MoveScaled(8,0,4,4) + Picture = Picture["icon:/small/stop"] + } + { Panel1 Panel + MoveScaled(13,0,3,4) + Expand = True + } + { btnVolume ToolButton + MoveScaled(26,0,4,4) + Picture = Picture["icon:/small/volume"] + } + { sldVolume Slider + MoveScaled(32,0,20,4) + ToolTip = ("100%") + Value = 100 + } + } + } + { timTime #Timer + #MoveScaled(3,11) + Delay = 250 + } +} diff --git a/comp/src/gb.media.form/.src/FTest.class b/comp/src/gb.media.form/.src/FTest.class new file mode 100644 index 000000000..0a5fa73ac --- /dev/null +++ b/comp/src/gb.media.form/.src/FTest.class @@ -0,0 +1,2 @@ +' Gambas class file + diff --git a/comp/src/gb.media.form/.src/FTest.form b/comp/src/gb.media.form/.src/FTest.form new file mode 100644 index 000000000..98b545e7f --- /dev/null +++ b/comp/src/gb.media.form/.src/FTest.form @@ -0,0 +1,10 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,79,64) + Arrangement = Arrange.Fill + { MediaView1 MediaView + MoveScaled(4,5,66,40) + URL = "/media/benoit/Sauvegarde/Les Labos/crap2.mp4" + } +} diff --git a/comp/src/gb.media.form/.src/MediaView.class b/comp/src/gb.media.form/.src/MediaView.class new file mode 100644 index 000000000..a37908b40 --- /dev/null +++ b/comp/src/gb.media.form/.src/MediaView.class @@ -0,0 +1,60 @@ +' Gambas class file + +Export + +Inherits UserControl + +Public Const _IsControl As Boolean = True +Public Const _Group As String = "Media" +Public Const _Properties As String = "*,Border,Control=True,URL{Path}" + +Property URL As String +Property Border As Boolean +Property Control As Boolean + +Private $hView As FMediaPlayer +Private $sUrl As String + +Public Sub _new() + + $hView = New FMediaPlayer(Me) + +End + +Private Function URL_Read() As String + + Return $sUrl + +End + +Private Sub URL_Write(Value As String) + + $sUrl = Value + If Me.Design Then Return + $hView.SetUrl($sUrl) + +End + +Private Function Control_Read() As Boolean + + Return $hView.GetShowControl() + +End + +Private Sub Control_Write(Value As Boolean) + + $hView.SetShowControl(Value) + +End + +Private Function Border_Read() As Boolean + + Return $hView.GetBorder() + +End + +Private Sub Border_Write(Value As Boolean) + + $hView.SetBorder(Value) + +End diff --git a/comp/src/gb.media.form/.startup b/comp/src/gb.media.form/.startup new file mode 100644 index 000000000..86cddad0d --- /dev/null +++ b/comp/src/gb.media.form/.startup @@ -0,0 +1,11 @@ +FTest +gb.media.form +0 +0 +3.5.90 + +gb.image +gb.gui +gb.form +gb.media + diff --git a/comp/src/gb.media.form/video.png b/comp/src/gb.media.form/video.png new file mode 100644 index 0000000000000000000000000000000000000000..cbd7c5cbfde12823f74d4ed5e243afe0f2c219bd GIT binary patch literal 2448 zcmV;B32*j^P)-U91e5p^eGC(9I3QZH&PB)He4BqAdWB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6&iqBYB zSm4m1gR~@DSXo&?YmH$TD5dD@>x){f)*9dUDHIB11_pTiILG{*JEYSGP-d*mhFHVe zKm%2QNTeZf-4)zN4>^_{L>Y=)E?3@4l^Sk!pUdSi3`O?nAnv1wxb6zlsBS}1*9TNx zACQ7lsl@%|`?T-fOMF)x*L5R+?HoF#QVG{}NvHSowD6SWeGgp1TU4H;3fwQv%t*xyKuIuJigMij8B4!4n-}Ucb#GexY{WsmS zv!ZDwsLObha&WRN{ssm%rEU}3%D+0d;W}j|wAyy`+wiZ|N`v1d0B4#~g7xBTunIV5 zXHTo=&2l@X+0wrP-umg^r``42u<2HldBa(-Bj8$p$k?sZ_5X^m>`(yt;zxY)$EgiJ rPC40s95~)I@LwK2VCtWb`9Ipf4mW8q1XC;{00000NkvXXu0mjfTLvKT literal 0 HcmV?d00001 diff --git a/comp/src/gb.net.pop3/.info b/comp/src/gb.net.pop3/.info index ad06ede0d..9dff33fe1 100644 --- a/comp/src/gb.net.pop3/.info +++ b/comp/src/gb.net.pop3/.info @@ -27,7 +27,7 @@ Network _Properties C s -Host,Port,Debug,Encrypt{Net.None;SSL} +Host,Port,User,Password,Encrypt{Net.None;SSL},Debug Encrypt p i diff --git a/comp/src/gb.net.pop3/.src/Pop3Client.class b/comp/src/gb.net.pop3/.src/Pop3Client.class index fcfc994d7..59770f57f 100644 --- a/comp/src/gb.net.pop3/.src/Pop3Client.class +++ b/comp/src/gb.net.pop3/.src/Pop3Client.class @@ -36,7 +36,7 @@ Export Public Const _IsControl As Boolean = True Public Const _IsVirtual As Boolean = True Public Const _Group As String = "Network" -Public Const _Properties As String = "Host,Port,Debug,Encrypt{Net.None;SSL}" +Public Const _Properties As String = "Host,Port,User,Password,Encrypt{Net.None;SSL},Debug" Private Const SERVER_POSITIVE_RESPONSE As String = "+OK" Private Const SERVER_NEGATIVE_RESPONSE As String = "-ERR" diff --git a/comp/src/gb.net.smtp/.component b/comp/src/gb.net.smtp/.component index ecf12a5d6..dc179f38e 100644 --- a/comp/src/gb.net.smtp/.component +++ b/comp/src/gb.net.smtp/.component @@ -1,4 +1,4 @@ [Component] Key=gb.net.smtp -Version=0.0.4 +Version=3.5.90 Requires=gb.net diff --git a/app/src/gambas3/img/control/smtpclient.png b/comp/src/gb.net.smtp/.hidden/control/smtpclient.png similarity index 100% rename from app/src/gambas3/img/control/smtpclient.png rename to comp/src/gb.net.smtp/.hidden/control/smtpclient.png diff --git a/comp/src/gb.net.smtp/.info b/comp/src/gb.net.smtp/.info index 4362a27bb..83143451b 100644 --- a/comp/src/gb.net.smtp/.info +++ b/comp/src/gb.net.smtp/.info @@ -16,6 +16,22 @@ i #SmtpClient C +_IsControl +C +b +-1 +_IsVirtual +C +b +-1 +_Group +C +s +Network +_Properties +C +s +Host,Port,User,Password,Encrypt{Net.None;SSL;TLS}=None Debug p b diff --git a/comp/src/gb.net.smtp/.project b/comp/src/gb.net.smtp/.project index 414811bc0..3ac8b1e00 100644 --- a/comp/src/gb.net.smtp/.project +++ b/comp/src/gb.net.smtp/.project @@ -2,7 +2,8 @@ # Compiled with Gambas 3.5.90 Title=gb.net.smtp Startup=Main -Version=0.0.9 +Version=3.5.90 +VersionFile=1 Component=gb.net TabSize=2 Type=Component diff --git a/comp/src/gb.net.smtp/.src/SmtpClient.class b/comp/src/gb.net.smtp/.src/SmtpClient.class index bcbad540f..14bdb6e9b 100644 --- a/comp/src/gb.net.smtp/.src/SmtpClient.class +++ b/comp/src/gb.net.smtp/.src/SmtpClient.class @@ -5,6 +5,11 @@ Export Static Private $aDay As String[] Static Private $aMonth As String[] +Public Const _IsControl As Boolean = True +Public Const _IsVirtual As Boolean = True +Public Const _Group As String = "Network" +Public Const _Properties As String = "Host,Port,User,Password,Encrypt{Net.None;SSL;TLS}=None" + Property Debug As Boolean Property Host As String diff --git a/comp/src/gb.net.smtp/.startup b/comp/src/gb.net.smtp/.startup index cc045b3d1..ef347a0eb 100644 --- a/comp/src/gb.net.smtp/.startup +++ b/comp/src/gb.net.smtp/.startup @@ -2,7 +2,7 @@ Main gb.net.smtp 0 0 -0.0.9 +3.5.90 gb.net diff --git a/comp/src/order b/comp/src/order index 8fa8d3eaf..dfe07cf3c 100644 --- a/comp/src/order +++ b/comp/src/order @@ -1 +1 @@ -gb.eval.highlight gb.args gb.settings gb.gui.base gb.form gb.form.stock gb.form.dialog gb.form.mdi gb.db.form gb.desktop gb.web gb.report gb.chart gb.mysql gb.net.smtp gb.net.pop3 gb.memcached gb.map gb.logging gb.markdown +gb.eval.highlight gb.args gb.settings gb.gui.base gb.form gb.form.stock gb.form.dialog gb.form.mdi gb.db.form gb.desktop gb.web gb.report gb.chart gb.mysql gb.net.smtp gb.net.pop3 gb.memcached gb.map gb.logging gb.markdown gb.media.form diff --git a/examples/examples/Multimedia/MediaPlayer/.src/FMain.form b/examples/examples/Multimedia/MediaPlayer/.src/FMain.form index f76419056..401369b33 100644 --- a/examples/examples/Multimedia/MediaPlayer/.src/FMain.form +++ b/examples/examples/Multimedia/MediaPlayer/.src/FMain.form @@ -3,11 +3,10 @@ { Form Form MoveScaled(0,0,110,85) Icon = Picture["icon.png"] - Border = False Maximized = True Arrangement = Arrange.Vertical { dwgVideo DrawingArea - MoveScaled(11,25,24,24) + MoveScaled(12,27,24,24) Background = &H000000& Expand = True } diff --git a/gb.media/src/c_media.c b/gb.media/src/c_media.c index 758f654fc..1076f921b 100644 --- a/gb.media/src/c_media.c +++ b/gb.media/src/c_media.c @@ -1617,12 +1617,12 @@ BEGIN_PROPERTY(MediaPipeline_Position) } else { - guint64 pos = VPROP(GB_FLOAT) * 1E9; + gint64 pos = VPROP(GB_FLOAT) * 1E9; if (pos < 0) pos = 0; - - gst_element_seek_simple(ELEMENT, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, pos); + + gst_element_seek_simple(ELEMENT, GST_FORMAT_TIME, GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT, (guint64)pos); } END_PROPERTY diff --git a/main/gbx/gbx_stream.c b/main/gbx/gbx_stream.c index 5b0e08ed3..f18d6b2e2 100644 --- a/main/gbx/gbx_stream.c +++ b/main/gbx/gbx_stream.c @@ -721,13 +721,10 @@ static char *input(STREAM *stream, bool line, char *escape) } if (len > 0) - //add_string(addr, &len_str, stream->common.buffer + start, len); addr = STRING_add(addr, buffer + start, len); else if (len < 0) addr = STRING_extend(addr, STRING_length(addr) + len); - //STRING_extend_end(addr); - stream->common.buffer = buffer; stream->common.buffer_pos = buffer_pos; stream->common.buffer_len = buffer_len;