From sysrpl at gmail.com Wed May 1 03:10:41 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Tue, 30 Apr 2019 21:10:41 -0400 Subject: [Lazarus] Cross platform font from file? Message-ID: Does anyone know if the LCL contains a wrapper to allow for loading and using a font from a file across Windows, Mac, and Linux platforms? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at kluug.net Wed May 1 06:59:27 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Wed, 1 May 2019 06:59:27 +0200 Subject: [Lazarus] Cross platform font from file? In-Reply-To: References: Message-ID: On 01.05.2019 03:10, Anthony Walter via lazarus wrote: > Does anyone know if the LCL contains a wrapper to allow for loading > and using a font from a file across Windows, Mac, and Linux platforms? Lazarus: http://wiki.freepascal.org/LazFreeType FPC has fpTTF: https://forum.lazarus.freepascal.org/index.php/topic,33141.0.html Ondrej From sysrpl at gmail.com Thu May 2 03:21:17 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 1 May 2019 21:21:17 -0400 Subject: [Lazarus] Image Shop, a tool for students learning to program Message-ID: I wanted to follow up on a concept OI ran past everyone last Friday. Here is the final product of a tool I created to encourage programming students to learn programming in a fun way. The tool called Image Shop, allows users to drop image manipulation functions on a design surface. They can wire up and organize their function to create new and different effects. They can also rebuild the program with more functions to create new and interesting image effects. An overview and video with links to sources and binaries is available here: https://www.getlazarus.org/learn/tutorials/examples/imageshop/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike.cornflake at gmail.com Thu May 2 03:28:14 2019 From: mike.cornflake at gmail.com (Michael Thompson) Date: Thu, 2 May 2019 09:28:14 +0800 Subject: [Lazarus] Image Shop, a tool for students learning to program In-Reply-To: References: Message-ID: > https://www.getlazarus.org/learn/tutorials/examples/imageshop/ Very nice. Reminds me of the power of DirectShow utility GraphEdit: back in the day that did a lot to de-mystify video processing for me. Many thanks (for this, and for the build scripts you provided, I still use them :-) ) Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From fluisgirardi at gmail.com Thu May 2 04:13:17 2019 From: fluisgirardi at gmail.com (Fabio Luis Girardi) Date: Wed, 1 May 2019 23:13:17 -0300 Subject: [Lazarus] LCL customdraw and LCL fpGUI bug Message-ID: Hi! I'm trying to test some features on LCL CustomDraw and fpGUI. CustomDraw compiles fine, fpGUI needs some fixes, but this isn't the problem. The problem is that both raises RunError 216 on file monitor.inc:34, on function: function TMonitor.GetPixelsPerInch: Integer; Tried with Lazarus fixes 2.0.3 with FPC 3.2.0 Did I forget anything? Should I report a bug? -- The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmpessoa at hotmail.com Thu May 2 05:27:36 2019 From: jmpessoa at hotmail.com (=?iso-8859-1?Q?Jos=E9_Marques_Pessoa?=) Date: Thu, 2 May 2019 03:27:36 +0000 Subject: [Lazarus] Image Shop, a tool for students learning to program In-Reply-To: References: Message-ID: In one word: brilliant! Thank you! ________________________________ From: lazarus on behalf of Anthony Walter via lazarus Sent: Wednesday, May 1, 2019 9:21 PM To: Lazarus mailing list Cc: Anthony Walter Subject: [Lazarus] Image Shop, a tool for students learning to program I wanted to follow up on a concept OI ran past everyone last Friday. Here is the final product of a tool I created to encourage programming students to learn programming in a fun way. The tool called Image Shop, allows users to drop image manipulation functions on a design surface. They can wire up and organize their function to create new and different effects. They can also rebuild the program with more functions to create new and interesting image effects. An overview and video with links to sources and binaries is available here: https://www.getlazarus.org/learn/tutorials/examples/imageshop/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Thu May 2 08:31:38 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 2 May 2019 02:31:38 -0400 Subject: [Lazarus] Image Shop, a tool for students learning to program In-Reply-To: References: Message-ID: Thanks, I have found one problem though. One some Linux systems it would seem when creating a 32 bpp png image occasionally the red and blue channels are reversed when accessing pixels through the scanline property of TPortableNetworkGraphic. I am not sure what is the determining factor that causes the red and blue channels to be swapped and thus cannot create a solution to correct the problem. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trayres at gmail.com Thu May 2 08:56:11 2019 From: trayres at gmail.com (Travis Ayres) Date: Wed, 1 May 2019 23:56:11 -0700 Subject: [Lazarus] Image Shop, a tool for students learning to program In-Reply-To: References: Message-ID: This is bad ass. Plus, not a game. Extremely impressive! On Wed, May 1, 2019 at 6:22 PM Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org> wrote: > I wanted to follow up on a concept OI ran past everyone last Friday. > > Here is the final product of a tool I created to encourage programming > students to learn programming in a fun way. > > The tool called Image Shop, allows users to drop image manipulation > functions on a design surface. They can wire up and organize their function > to create new and different effects. They can also rebuild the program with > more functions to create new and interesting image effects. > > An overview and video with links to sources and binaries is available > here: > > https://www.getlazarus.org/learn/tutorials/examples/imageshop/ > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From md at delfire.net Thu May 2 14:28:04 2019 From: md at delfire.net (Marcos Douglas B. Santos) Date: Thu, 2 May 2019 09:28:04 -0300 Subject: [Lazarus] Image Shop, a tool for students learning to program In-Reply-To: References: Message-ID: On Wed, May 1, 2019 at 10:21 PM Anthony Walter via lazarus wrote: > > I wanted to follow up on a concept OI ran past everyone last Friday. > > Here is the final product of a tool I created to encourage programming students to learn programming in a fun way. > > The tool called Image Shop, allows users to drop image manipulation functions on a design surface. They can wire up and organize their function to create new and different effects. They can also rebuild the program with more functions to create new and interesting image effects. > > An overview and video with links to sources and binaries is available here: > > https://www.getlazarus.org/learn/tutorials/examples/imageshop/ Very impressive! SN: there is a typo on README: "...functions using the Free Pascal langauge..." << "language" regards, Marcos Douglas From mailinglists at geldenhuys.co.uk Fri May 3 09:13:00 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 3 May 2019 08:13:00 +0100 Subject: [Lazarus] LCL customdraw and LCL fpGUI bug In-Reply-To: References: Message-ID: <39e61615-56e5-06e3-ccf0-dc597ee33a00@geldenhuys.co.uk> On 02/05/2019 03:13, Fabio Luis Girardi via lazarus wrote: > function TMonitor.GetPixelsPerInch: Integer; > > Tried with Lazarus fixes 2.0.3 with FPC 3.2.0 > > Did I forget anything? Should I report a bug? fpGUI already has that information. I'll take a look at LCL-fpGUI and supply a patch if needed for that. I'll also take a look at the other LCL-fpGUI issues you said appears. The LCL-fpGUI really needs a dedicated developer to get it out of alpha/beta stage. Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From mailinglists at geldenhuys.co.uk Fri May 3 12:56:33 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 3 May 2019 11:56:33 +0100 Subject: [Lazarus] FHandle causes AV in TMonitor.GetPixelsPerInch() Message-ID: <68f9c7c4-e365-8deb-3707-0cefd596c588@geldenhuys.co.uk> I'm debugging the issue reported about LCL-CustomDraw and lcl-fpgui causing an AV at application start up. I traced the issue back to TMonitor.GetPixelsPerInch() which is called in TCustomForm.AfterConstruction(). As soon as GetPixelsPerInch() tries to reference FHandle in any way, it throws an AV. Anybody got some hints as to why both custom drawn widgetsets have this issue? Would it be some window handle allocation timing issue for custom drawn widgetest? ie: The handles are allocated later that other non Object Pascal based widgetsets? Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From mailinglists at geldenhuys.co.uk Fri May 3 16:56:02 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 3 May 2019 15:56:02 +0100 Subject: [Lazarus] LCL customdraw and LCL fpGUI bug In-Reply-To: References: Message-ID: <6115664b-c772-44f8-0478-5470855d78f1@geldenhuys.co.uk> On 02/05/2019 03:13, Fabio Luis Girardi via lazarus wrote: > LCL-fpGUI needs some fixes I've just submitted a set of 11 patches for LCL-fpGUI: https://bugs.freepascal.org/view.php?id=35478 TLabel finally works. :-) Unfortunately the TMonitor.GetPixelsPerInch() issue is still not fixed. I manually commented out the code... if WidgetSet.GetDpiForMonitor(FHandle, MDT_EFFECTIVE_DPI, X, Y)=S_OK then ... else and only left the "Result = Screen.PixelsPerInch;" call in place. If you didn't guess, it is a temporary fix. ;-) Regards, Graeme -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp From sysrpl at gmail.com Mon May 6 00:44:15 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Sun, 5 May 2019 18:44:15 -0400 Subject: [Lazarus] Feedback Wanted: Next tutoring project Message-ID: As some of you may have been following, a little more than a week ago I asked for community feedback on an a project I was planning. The project turned out very well and if you haven't seen yet, or haven't checked out the git repository, I've made a few enhancements including fixing a few cross platform bugs and enhancing the way the node wires are drawn: https://www.getlazarus.org/learn/tutorials/examples/imageshop/ Now I am starting on a new project in the same vein , and that is to design an example program were students I am teaching can get immediate feedback on the functions they add to the project. I'd like to submit my new project idea to you again in the hopes that you can make some good suggestions before I start implementing it. Here is my idea: I want to design an example project that allows students to write functions that generate musical tones. These tones can then be mapped to their keyboard where they can play it like a piano. They will also have the ability visual the tones through an oscilloscope like graph that I draw. As tones are played they can see the graph chance in real time. Types of tones that students might create include square wave, saw wave, sin wave, and other wave types. I am also considering a simplified musical staff where tones can be placed on it, drags to be resized or move, and a lasso select can alter the tonal properties of their selections. Finally I might add the ability to save and load tones to and from musical staff so that songs can be created or loaded and played using their tones. Does anyone care to provide any feedback on this idea before I implement it? Thanks again. Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From trayres at gmail.com Mon May 6 01:59:10 2019 From: trayres at gmail.com (Travis Ayres) Date: Sun, 5 May 2019 16:59:10 -0700 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: References: Message-ID: Off topic: You seem to have nailed wire drawing algorithms - do you have a good resource for that? I have to do something similar. On topic: Bravo on the previous project, looking forward to the next one. Was shocked at how complete and awesome it was. By all means, continue. On Sun, May 5, 2019 at 3:44 PM Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org> wrote: > As some of you may have been following, a little more than a week ago I > asked for community feedback on an a project I was planning. The project > turned out very well and if you haven't seen yet, or haven't checked out > the git repository, I've made a few enhancements including fixing a few > cross platform bugs and enhancing the way the node wires are drawn: > > https://www.getlazarus.org/learn/tutorials/examples/imageshop/ > > Now I am starting on a new project in the same vein , and that is to > design an example program were students I am teaching can get immediate > feedback on the functions they add to the project. I'd like to submit my > new project idea to you again in the hopes that you can make some good > suggestions before I start implementing it. > > Here is my idea: > > I want to design an example project that allows students to write > functions that generate musical tones. These tones can then be mapped to > their keyboard where they can play it like a piano. They will also have the > ability visual the tones through an oscilloscope like graph that I draw. As > tones are played they can see the graph chance in real time. > > Types of tones that students might create include square wave, saw wave, > sin wave, and other wave types. > > I am also considering a simplified musical staff where tones can be placed > on it, drags to be resized or move, and a lasso select can alter the tonal > properties of their selections. > > Finally I might add the ability to save and load tones to and from musical > staff so that songs can be created or loaded and played using their tones. > > Does anyone care to provide any feedback on this idea before I implement > it? > > Thanks again. > Anthony > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Mon May 6 02:32:37 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Sun, 5 May 2019 20:32:37 -0400 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: References: Message-ID: You can view the logic related to both drawing the nodes and handling how they can connect to one another in the unit below. Note that I also check for circular references so that one node cannot indirectly lead back to itself. Also, the rendering only hits the nodes that are connected to the final output node TDisplayNode or FDisplay in the TNodeList by working its way backwards from it to only connected nodes. https://github.com/sysrpl/ImageShop/blob/master/src/imagenodes.pas Regarding the next project, I think I am going to concentrate two different programming tasks for my students. One task is to create various tones through simple functions, and the other is to create effects (again through simple functions) which manipulate a sound source. Examples of effects might include a chorus effect, pan effect, flanger effect, reverb effect, echo effect, and probably a few crazy original sounding effects that don't make much sense for musicians to use. In any case, I suspect that I will allow the user to again hook effects up together in a chain, possibly using the same node type user interface where one effect outputs samples that can be fed into other effects. And in place of the image drawn above like in the Image Shop example, I might just make the rendering take the shape of graphing real time wave forms and cut back slightly on the musical staff, at least until another point in time. -------------- next part -------------- An HTML attachment was scrubbed... URL: From hdpc at talktalk.net Mon May 6 10:02:20 2019 From: hdpc at talktalk.net (Howard Page-Clark) Date: Mon, 6 May 2019 09:02:20 +0100 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: References: Message-ID: On 06/05/2019 01:32, Anthony Walter via lazarus wrote: > Regarding the next project, I think I am going to concentrate two > different programming tasks for my students. One task is to create > various tones through simple functions, and the other is to create > effects (again through simple functions) which manipulate a sound > source. Examples of effects might include a chorus effect, pan effect, > flanger effect, reverb effect, echo effect, and probably a few crazy > original sounding effects that don't make much sense for musicians to > use. In any case, I suspect that I will allow the user to again hook > effects up together in a chain, possibly using the same node type user > interface where one effect outputs samples that can be fed into other > effects. > > And in place of the image drawn above like in the Image Shop example, > I might just make the rendering take the shape of graphing real time > wave forms and cut back slightly on the musical staff, at least until > another point in time. As well as effects to alter the tones, you could consider adding a repetitive mode in which beats/rhythm is introduced for one or more tones, such as various drumming styles, pizzicato, rock rhythms, hip hop, waltz and other dance beats etc. If the tones sounded concurrently this could add a ground bass effect. From list2010 at BrenemanLabs.com Mon May 6 12:57:40 2019 From: list2010 at BrenemanLabs.com (Paul Breneman) Date: Mon, 6 May 2019 06:57:40 -0400 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: References: Message-ID: <791afac1-2166-aa98-7197-208b8218eb12@BrenemanLabs.com> On 5/5/2019 6:44 PM, Anthony Walter via lazarus wrote: > Here is my idea: > > I want to design an example project that allows students to write functions > that generate musical tones. These tones... > ... They will also have the > ability visual the tones through an oscilloscope like graph that I draw. As > tones are played they can see the graph chance in real time. > > Types of tones that students might create include square wave, saw wave, > sin wave, and other wave types. That sounds *very* good to me! This would be nice to use to learn how to use a PicoScope by hooking it up to display the same graph. You get *fantastic* software for an inexpensive price: https://www.picotech.com/oscilloscope/2000/picoscope-2000-overview There are a few ideas and PicoScope links here: http://controlpascal.com/tutorial.htm Best Regards, Paul From sysrpl at gmail.com Mon May 6 13:55:07 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Mon, 6 May 2019 07:55:07 -0400 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: <791afac1-2166-aa98-7197-208b8218eb12@BrenemanLabs.com> References: <791afac1-2166-aa98-7197-208b8218eb12@BrenemanLabs.com> Message-ID: Thanks, those are some good ideas. I'll look at PicoScope. For the students I am going concentrate on having them writing tone functions and effect functions. Tones will return a left and right SmallInt given a time, and effects will have access to a history of the sound samples to alter the current left and right sample. Again the students will be able to connect tones to effects to generate an output, but in this case I think the output kill be a virtual on screen representation of black and white piano keys, such that each key can generate the tone / effect assigned to it through a chain of inputs and outputs. I believe having the wave form graphed above as you play the keys is still something I'll put into it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fluisgirardi at gmail.com Mon May 6 21:07:16 2019 From: fluisgirardi at gmail.com (Fabio Luis Girardi) Date: Mon, 6 May 2019 16:07:16 -0300 Subject: [Lazarus] LCL customdraw and LCL fpGUI bug In-Reply-To: <6115664b-c772-44f8-0478-5470855d78f1@geldenhuys.co.uk> References: <6115664b-c772-44f8-0478-5470855d78f1@geldenhuys.co.uk> Message-ID: I'll try apply your patch to Lazarus fixes. If something goes wrong I'll let you know. Em sex, 3 de mai de 2019 às 11:56, Graeme Geldenhuys via lazarus < lazarus at lists.lazarus-ide.org> escreveu: > On 02/05/2019 03:13, Fabio Luis Girardi via lazarus wrote: > > LCL-fpGUI needs some fixes > > > I've just submitted a set of 11 patches for LCL-fpGUI: > > https://bugs.freepascal.org/view.php?id=35478 > > > TLabel finally works. :-) > > > Unfortunately the TMonitor.GetPixelsPerInch() issue is still not fixed. > I manually commented out the code... > > if WidgetSet.GetDpiForMonitor(FHandle, MDT_EFFECTIVE_DPI, X, Y)=S_OK then > ... > else > > and only left the "Result = Screen.PixelsPerInch;" call in place. If you > didn't guess, it is a temporary fix. ;-) > > > Regards, > Graeme > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > My public PGP key: http://tinyurl.com/graeme-pgp > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- The best regards, Fabio Luis Girardi PascalSCADA Project http://sourceforge.net/projects/pascalscada http://www.pascalscada.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Tue May 7 09:37:23 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 07 May 2019 09:37:23 +0200 Subject: [Lazarus] How to install lazvlc? Message-ID: I would like to add a video player to my Lazarus program (currently on Windows using Laz 2.0.0). I have browsed through the article "Displaying video files using Free Pascal and Lazarus", which I found here: https://www.freepascal.org/~michael/articles/lazvlc/lazvlc.pdf Other web references also quote this document. Problem is that it states: Lazarus users can install thelazvlcpackage. But I can not find where one can obtain this package... Any ideas? Note: I am currently programming this application on Windopws 7 X64 and I have installed both the 32 and 64 bit versions of Lazarus 2.0.0. -- Bo Berglund Developer in Sweden From michael at freepascal.org Tue May 7 09:41:39 2019 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 7 May 2019 09:41:39 +0200 (CEST) Subject: [Lazarus] How to install lazvlc? In-Reply-To: References: Message-ID: On Tue, 7 May 2019, Bo Berglund via lazarus wrote: > I would like to add a video player to my Lazarus program (currently on > Windows using Laz 2.0.0). > > I have browsed through the article "Displaying video files using Free > Pascal and Lazarus", which I found here: > https://www.freepascal.org/~michael/articles/lazvlc/lazvlc.pdf > > Other web references also quote this document. > > Problem is that it states: > Lazarus users can install thelazvlcpackage. > > But I can not find where one can obtain this package... It's available in the lazarus installation: lazarus/components/vlc/lazvlc.lpk Michael. From michael at freepascal.org Tue May 7 09:41:39 2019 From: michael at freepascal.org (Michael Van Canneyt) Date: Tue, 7 May 2019 09:41:39 +0200 (CEST) Subject: [Lazarus] How to install lazvlc? In-Reply-To: References: Message-ID: On Tue, 7 May 2019, Bo Berglund via lazarus wrote: > I would like to add a video player to my Lazarus program (currently on > Windows using Laz 2.0.0). > > I have browsed through the article "Displaying video files using Free > Pascal and Lazarus", which I found here: > https://www.freepascal.org/~michael/articles/lazvlc/lazvlc.pdf > > Other web references also quote this document. > > Problem is that it states: > Lazarus users can install thelazvlcpackage. > > But I can not find where one can obtain this package... It's available in the lazarus installation: lazarus/components/vlc/lazvlc.lpk Michael. From lazarus2 at de-brouwerij.be Tue May 7 11:21:19 2019 From: lazarus2 at de-brouwerij.be (Koenraad Lelong) Date: Tue, 7 May 2019 11:21:19 +0200 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: References: Message-ID: <2f8b703e-c4cb-eec5-4d0b-3c338b8cbdb5@de-brouwerij.be> Op 6/05/19 om 00:44 schreef Anthony Walter via lazarus: > Does anyone care to provide any feedback on this idea before I implement it? > You could implement reading midi-files. So no need to "compose" your own tunes ;-) Koenraad. From bo.berglund at gmail.com Tue May 7 12:15:35 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 07 May 2019 12:15:35 +0200 Subject: [Lazarus] How to install lazvlc? References: Message-ID: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> On Tue, 7 May 2019 09:41:39 +0200 (CEST), Michael Van Canneyt via lazarus wrote: >> Lazarus users can install the lazvlc package. >> >> But I can not find where one can obtain this package... > >It's available in the lazarus installation: > >lazarus/components/vlc/lazvlc.lpk > Or rather I found it here: Package/Install_Uninstall_Packages/Available_for_Installation I actuially entered lazvlc into the search box and it appeared as version 1.0. So from there I installed and rebuilt the IDE... Now I have to get it working too, but youre document should help here. -- Bo Berglund Developer in Sweden From sysrpl at gmail.com Tue May 7 17:25:01 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Tue, 7 May 2019 11:25:01 -0400 Subject: [Lazarus] Feedback Wanted: Next tutoring project In-Reply-To: <2f8b703e-c4cb-eec5-4d0b-3c338b8cbdb5@de-brouwerij.be> References: <2f8b703e-c4cb-eec5-4d0b-3c338b8cbdb5@de-brouwerij.be> Message-ID: Thanks, but I think I've decided what I am going to do is allow for sounds to be applied to a virtual keyboard interface. Each sound might be different both in pitch and in actual sound. So are far as reading standard music file formats that won't work. Also along these lines, I will also want to allow for sound files such as wav or mp3 files to be used as sources, much like I allow for pictures to be used as sources in my Image Shop program. This will be in addition to tone generation sources which will be purely grammatically generated. The tones will then optionally be able to route through effect functions such as attack, sustain, pan, reverb, flanger, echo and so on to manipulate the tone before it reached the virtual keyboard. All the sources and effects will appear in the user interface as nodes with the end point being a specific virtual keyboard key. The layout of the keyboard to node binding will be able to be saved and loaded. Also users will be able to map virtual keyboard keys to their actual computer keys so that they can play the different node series using their computer keyboard. I do have one request though, which I shall make a new thread for. And that request is to ask for help from someone in writing an mp3 decoder with a few requirements. If anyone is interested helping me with in this project, the help with and an mp3 and wav decoder would be much appreciated. See the other thread for details. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Tue May 7 17:49:29 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Tue, 7 May 2019 11:49:29 -0400 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music Message-ID: In my current thread on the subject of "Next tutoring project" I believe I've nailed down my idea. The project will be a node based sound and effect generation program where students can create functions that either create tones or effects. I also want to add the ability to apply effects to sound files, in to generated tones, and from my previous experience with sound files I wanted to ask for some help from you the community to add this specific feature into the new music project for teaching kids how to program. What I need is the following: A function to take an mp3 stream and given a time and a duration to convert the mp3 data into left and right audio samples of a specific samples per second and sample type. So for example, if I load an entire mp3 into a memory stream it might be called: var MusicFile: TMemoryStream; .. MusicFile := TMemoryStream.Create; MusicFile.LoadFromStream('my_music.mp3'); WriteLn('The music file is ', Mp3StreamDuration(MusicFile), ' long in seconds'); I would need these functions: { Return the duration of the music or sounds in an Mp3 stream in seconds } function Mp3StreamDuration(Stream: TStream): Single; { Mp3StreamSamples outputs left and right audio samples from an mp3 stream given a Start, Duration, SamplesPerSecond, and buffer information. Buffer count will be = Duration * SamplesPerSecond rounded up to the nearest whole value } type TSoundSample = record Left: SmallInt; Right: SmallInt; end; PSoundSample = ^TSoundSample; procedure Mp3StreamSamples(Stream: TStream; Start, Duration: Single; SamplesPerSecond: Integer; Buffer: PSoundSample; BufferCount: Integer); If these functions could be repeated for the wav file format or other formats (ogg and such) that would be much appreciate. By the way, the mp3 format is now free of any licensing restrictions. If anyone has any questions or would like to help let me know. I can provide you with a test application to output the sound into the platform independent audio system if you need it for testing. Thanks again everyone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Tue May 7 19:21:31 2019 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Tue, 7 May 2019 19:21:31 +0200 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: References: Message-ID: El 07/05/2019 a las 17:49, Anthony Walter via lazarus escribió: > In my current thread on the subject of "Next tutoring project" I believe > I've nailed down my idea.  The project will be a node based sound and > effect generation program where students can create functions that > either create tones or effects. > > I also want to add the ability to apply effects to sound files, in to > generated tones, and from my previous experience with sound files I > wanted to ask for some help from you the community to add this specific > feature into the new music project for teaching kids how to program. > Hello, Use Bass library http://www.un4seen.com/ License extract: BASS is free for non-commercial use. If you are a non-commercial entity (eg. an individual) and you are not making any money from your product (through sales, advertising, etc), then you can use BASS in it for free. Otherwise, one of the following licences will be required. .... .... .... -- From sysrpl at gmail.com Tue May 7 22:30:03 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Tue, 7 May 2019 16:30:03 -0400 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: References: Message-ID: Jose, Thank you for the suggestion. I've used both BASS and FMOD extensively in the past. Those library are for playing sounds from files or streams using their abstracted concepts of channels. What I am looking for is something a bit more primitive, and that is manipulating sample sounds through a series of functions, which is something both of those are not suitable for. That is I need to be able to extract a section of an mp3 or wav file and convert it to left and right audio samples (in my case a pair of SmallInt values) at a given samples per second. Then that buffer of left and right SmallInt values are fed to student functions as a mix, where they can an echo to a left or right sample, pan the left or right sample, chorus the left or right sample, and so on. For example a student might create a simple pan effect by writing: procedure PanEffect(var Sample: TAudioSample; Time, Level: Single); var Mix: Single; begin if Level < 0.5 then begin Mix := 1 - Level / 0.5; Sample.Left := RoundSmallInt(Sample.Left + Sample.Right * Mix); Mix := Level / 0.5; Sample.Right := RoundSmallInt(Sample.Right * Mix); end else begin Level := 1 - Level; Mix := 1 - Level / 0.5; Sample.Right := RoundSmallInt(Sample.Right + Sample.Left * Mix); Mix := Level / 0.5; Sample.Left := RoundSmallInt(Sample.Left * Mix); end; end; end; Several effects can be chained together to alter the samples, then mix together all the samples from the various streams or tones being played and feed the mixed together samples to the sound driver producing the final sound effect. >From the perspective of the student their are either writing Tone procedures or Effect procedures, and from the application perspective we are working with samples per active virtual keyboard key and mixing them down into a single stereo buffer of left and right SmallInts which are then dispatched to the sound driver. In the case of mp3s or wav finds, I need a function to decode a part of a stream into a range of samples (left and right SmallInts). I don't need a black box library to play sounds with licensing attached and I've like to minimize the dependency on external restrictive third party libraries. And finally both FMOD and BASS introduce a lot of complexity if the goal is simply to retrieve audio samples as opposed to using them for playing streams using their abstracted design of sound channels. -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Wed May 8 09:52:12 2019 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Wed, 8 May 2019 09:52:12 +0200 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: References: Message-ID: <479decca-a1a6-fc2d-00f8-675354d50c10@gmail.com> El 07/05/2019 a las 22:30, Anthony Walter escribió: > Jose, > > Thank you for the suggestion. I've used both BASS and FMOD extensively > in the past. Those library are for playing sounds from files or streams > using their abstracted concepts of channels. What I am looking for is > something a bit more primitive, and that is manipulating sample sounds > through a series of functions, which is something both of those are not > suitable for. That is I need to be able to extract a section of an mp3 > or wav file and convert it to left and right audio samples (in my case a > pair of SmallInt values) at a given samples per second. Then that buffer [...] Hello, I suggested BASS to decode audio files and get a raw PCM audio, not to play it directly. Raw PCM in a WAV file is almost trivial to read but mp3 and others are too complex and you always be dependent of a external .DLL/.so, many times with their own dependencies. Of course, you can use, in example, ffmpeg command line program to convert any mp3/ogg/whatever to raw PCM files and use them from a "cache" of decompressed PCM files. -- From sysrpl at gmail.com Wed May 8 14:02:04 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 8 May 2019 08:02:04 -0400 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: <479decca-a1a6-fc2d-00f8-675354d50c10@gmail.com> References: <479decca-a1a6-fc2d-00f8-675354d50c10@gmail.com> Message-ID: Jose, I'd really like to reduce dependencies and not use black box code that comes with licencing restrictions and requires bundling of additional third party binary executable files. Thanks for the suggestion though. If anyone is actually interested in how to decode an mp3 into left and right audio samples, this single C file project handles this task well. It just need translation to Pascal. https://github.com/technosaurus/PDMP3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.e.sanliturk at gmail.com Wed May 8 19:20:15 2019 From: m.e.sanliturk at gmail.com (Mehmet Erol Sanliturk) Date: Wed, 8 May 2019 20:20:15 +0300 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: References: <479decca-a1a6-fc2d-00f8-675354d50c10@gmail.com> Message-ID: On Wed, May 8, 2019 at 3:02 PM Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org> wrote: > Jose, > > I'd really like to reduce dependencies and not use black box code that > comes with licencing restrictions and requires bundling of additional third > party binary executable files. > > Thanks for the suggestion though. > > If anyone is actually interested in how to decode an mp3 into left and > right audio samples, this single C file project handles this task well. It > just need translation to Pascal. > > https://github.com/technosaurus/PDMP3 > -- > _______________________________________________ > > I think you know SDL2 : https://www.libsdl.org/ There are its bindings to many languages : https://www.libsdl.org/languages.php SDL Language Bindings ( including Pascal ) Perhaps they may be useful for you . Mehmet Erol Sanliturk -------------- next part -------------- An HTML attachment was scrubbed... URL: From restrepopj at gmail.com Wed May 8 19:33:47 2019 From: restrepopj at gmail.com (Pedro Restrepo) Date: Wed, 8 May 2019 12:33:47 -0500 Subject: [Lazarus] Self-set breakpoint on a procedure? Message-ID: I have been using Lazarus IDE v2.0.0 r60307 with fpc 3.0.4 on a 64bit Windows 10 machine without major issues. However, the debugger inserted a breakpoint on the first procedure in the Implementation section. There are no breakpoints in the procedure. In fact, I wrote a dummy procedure without any body, just the begin and end statements besides the procedure name, and call it during the form activation. Is there any way to clear that breakpoint? If I remove that procedure, the debugger will stop at the procedure that becomes the first one after the removal of the dummy procedure. Debugger options: [image: image.png] Other options: C:\lazarus\fpc\3.0.4\bin\x86_64-win64\fpc.exe -MObjFPC -Scaghi -CirotR -O1 -g -gl -gv -Xg -WG -l -vewnhibq -Filib\x86_64-win64 -Fu..\LMath\uRegression\lib\x86_64-win64 -Fu..\LMath\UOptimum\lib\x86_64-win64 -Fu..\LMath\UPolinoms\lib\x86_64-win64 -Fu..\LMath\UMathStat\lib\x86_64-win64 -Fu..\LMath\URandoms\lib\x86_64-win64 -Fu..\LMath\uMathUtils\lib\x86_64-win64 -Fu..\LMath\ULineAlgebra\lib\x86_64-win64 -Fu..\LMath\UGenMath\lib\x86_64-win64 -FuC:\lazarus\components\bgrabitmap-9.9.3\bgrabitmap\lib\x86_64-win64\3.0.4 -FuC:\lazarus\lcl\units\x86_64-win64\win32 -FuC:\lazarus\lcl\units\x86_64-win64 -FuC:\lazarus\components\lazutils\lib\x86_64-win64 -FuC:\lazarus\packager\units\x86_64-win64 -Fu. -FUlib\x86_64-win64 -FE. -oBaroScanWin.exe -dLCL Is this documented anywhere? I can't find any mention on the web or on the documentation. Any help will be appreciated. Pedro -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 23062 bytes Desc: not available URL: From sysrpl at gmail.com Wed May 8 20:04:33 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 8 May 2019 14:04:33 -0400 Subject: [Lazarus] Soliciting help with next tutoring project, playing sounds and music In-Reply-To: References: <479decca-a1a6-fc2d-00f8-675354d50c10@gmail.com> Message-ID: Mehmet, Thanks for that information. You may not be aware of it, but I am the author of the first Pascal translation of the SDL 2 headers. What SDL 2 provides is a means to create cross platform graphical and audio applications. Unfortunately it does not provide an MP3 sample decoder, and it actually depends on yet another external library (libmpg123) to play MP3 audio. To be clear: Playing MP3 audio <> Decoding MP3 audio samples. Also, again as I replied previously, I am trying to avoid linking to black box third party libraries and am looking for actual Pascal code to handle the actual decoding of an MP3 stream into left and right audio samples. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Wed May 8 20:17:25 2019 From: lazarus at mfriebe.de (Martin Frb) Date: Wed, 8 May 2019 20:17:25 +0200 Subject: [Lazarus] Self-set breakpoint on a procedure? In-Reply-To: References: Message-ID: <62fdb248-7887-bea5-276b-cf7cd66a9652@mfriebe.de> On 08/05/2019 19:33, Pedro Restrepo via lazarus wrote: > I have been using Lazarus IDE v2.0.0 r60307 with fpc 3.0.4  on a 64bit > Windows 10 machine without major issues. However, the debugger > inserted a breakpoint on the first procedure in the Implementation > section. There are no breakpoints in the procedure. In fact, I wrote a > dummy procedure without any body, just the begin and end statements > besides the procedure name, and call it during the form activation. > > Is there any way to clear that breakpoint? If I remove that procedure, > the debugger will stop at the procedure that becomes the first one > after the removal of the dummy procedure. > You may have a breakpoint in the interface section. A breakpoint on a none code line, acts on the next code line found. A breakpoint in the interface section (none code), acts where? This is helpful, if the breakpoint is on an empty line, just ONE line above the code. But not helpful if it is 100 lines above.... It is a gdb "feature", and as of yet we have no workaround. You can also use the breakpoint window to find breakpoints... From restrepopj at gmail.com Wed May 8 20:29:21 2019 From: restrepopj at gmail.com (Pedro Restrepo) Date: Wed, 8 May 2019 13:29:21 -0500 Subject: [Lazarus] Self-set breakpoint on a procedure? In-Reply-To: <62fdb248-7887-bea5-276b-cf7cd66a9652@mfriebe.de> References: <62fdb248-7887-bea5-276b-cf7cd66a9652@mfriebe.de> Message-ID: Thank you very much Martin. Yes, there was a breakpoint in the interface section. I found it with the breakpoint window. Probably was the result of an accidental key stroke. I removed it and the issue is gone. Best regards, Pedro On Wed, May 8, 2019 at 1:17 PM Martin Frb via lazarus < lazarus at lists.lazarus-ide.org> wrote: > On 08/05/2019 19:33, Pedro Restrepo via lazarus wrote: > > I have been using Lazarus IDE v2.0.0 r60307 with fpc 3.0.4 on a 64bit > > Windows 10 machine without major issues. However, the debugger > > inserted a breakpoint on the first procedure in the Implementation > > section. There are no breakpoints in the procedure. In fact, I wrote a > > dummy procedure without any body, just the begin and end statements > > besides the procedure name, and call it during the form activation. > > > > Is there any way to clear that breakpoint? If I remove that procedure, > > the debugger will stop at the procedure that becomes the first one > > after the removal of the dummy procedure. > > > > You may have a breakpoint in the interface section. > > A breakpoint on a none code line, acts on the next code line found. > A breakpoint in the interface section (none code), acts where? > > This is helpful, if the breakpoint is on an empty line, just ONE line > above the code. But not helpful if it is 100 lines above.... > It is a gdb "feature", and as of yet we have no workaround. > > You can also use the breakpoint window to find breakpoints... > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Thu May 9 08:30:12 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 May 2019 08:30:12 +0200 Subject: [Lazarus] How to install lazvlc? References: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> Message-ID: <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> On Tue, 07 May 2019 12:15:35 +0200, Bo Berglund via lazarus wrote: >On Tue, 7 May 2019 09:41:39 +0200 (CEST), Michael Van Canneyt via >lazarus wrote: > >>> Lazarus users can install the lazvlc package. >>> >>> But I can not find where one can obtain this package... >> >>It's available in the lazarus installation: >> >>lazarus/components/vlc/lazvlc.lpk >> > >Or rather I found it here: > >Package/Install_Uninstall_Packages/Available_for_Installation > >I actuially entered lazvlc into the search box and it appeared as >version 1.0. >So from there I installed and rebuilt the IDE... > >Now I have to get it working too, but youre document should help here. Unfortunately (for me) the lazvlc package is not graphical so I cannot use it in RAD fashion... But I found another package PasLibVlc that does what I need: https://prog.olsztyn.pl/paslibvlc/ There is also a blog article describing how to get going: http://lazplanet.blogspot.com/2018/01/how-to-make-simple-video-player-in.html This made it possible for me to create my videoplayer and it works OK for the level of functionality described in the blog. I have run into difficulties trying to implement incremental position move buttons in the player, though. Described on the Lazarus forum here: https://forum.lazarus.freepascal.org/index.php?topic=45343.new#new -- Bo Berglund Developer in Sweden From michael at freepascal.org Thu May 9 08:57:53 2019 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 9 May 2019 08:57:53 +0200 (CEST) Subject: [Lazarus] How to install lazvlc? In-Reply-To: <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> References: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> Message-ID: On Thu, 9 May 2019, Bo Berglund via lazarus wrote: > On Tue, 07 May 2019 12:15:35 +0200, Bo Berglund via lazarus > wrote: > >> On Tue, 7 May 2019 09:41:39 +0200 (CEST), Michael Van Canneyt via >> lazarus wrote: >> >>>> Lazarus users can install the lazvlc package. >>>> >>>> But I can not find where one can obtain this package... >>> >>> It's available in the lazarus installation: >>> >>> lazarus/components/vlc/lazvlc.lpk >>> >> >> Or rather I found it here: >> >> Package/Install_Uninstall_Packages/Available_for_Installation >> >> I actuially entered lazvlc into the search box and it appeared as >> version 1.0. >> So from there I installed and rebuilt the IDE... >> >> Now I have to get it working too, but youre document should help here. > > Unfortunately (for me) the lazvlc package is not graphical so I cannot > use it in RAD fashion... What do you mean by this ? It's a component you can drop on a form, and on which you can set properties. Is this not RAD ? What is missing to make it usable for you ? Michael. From bo.berglund at gmail.com Thu May 9 09:36:18 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 May 2019 09:36:18 +0200 Subject: [Lazarus] How to install lazvlc? References: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> Message-ID: On Thu, 9 May 2019 08:57:53 +0200 (CEST), Michael Van Canneyt via lazarus wrote: >> Unfortunately (for me) the lazvlc package is not graphical so I cannot >> use it in RAD fashion... > >What do you mean by this ? >It's a component you can drop on a form, and on which you can set properties. >Is this not RAD ? > >What is missing to make it usable for you ? > What I mean is: when I drop the TLCLVLCPlayer component on my form I get a small VLC icon rather than a video viewer panel. It is similart to dropping a non-visual component like a TOpenDialog on the form.... With the alternative I found (also operating through VLC) I get a video screen item I can drag the size of and position RAD-fashion on the form. -- Bo Berglund Developer in Sweden From michael at freepascal.org Thu May 9 09:55:54 2019 From: michael at freepascal.org (Michael Van Canneyt) Date: Thu, 9 May 2019 09:55:54 +0200 (CEST) Subject: [Lazarus] How to install lazvlc? In-Reply-To: References: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> Message-ID: On Thu, 9 May 2019, Bo Berglund via lazarus wrote: > On Thu, 9 May 2019 08:57:53 +0200 (CEST), Michael Van Canneyt via > lazarus wrote: > >>> Unfortunately (for me) the lazvlc package is not graphical so I cannot >>> use it in RAD fashion... >> >> What do you mean by this ? >> It's a component you can drop on a form, and on which you can set properties. >> Is this not RAD ? >> >> What is missing to make it usable for you ? >> > > What I mean is: when I drop the TLCLVLCPlayer component on my form I > get a small VLC icon rather than a video viewer panel. It is similart > to dropping a non-visual component like a TOpenDialog on the form.... Yes. You must indicate a control (for example a panel) in which the video will be shown. (ParentWindow property) > > With the alternative I found (also operating through VLC) I get a > video screen item I can drag the size of and position RAD-fashion on > the form. Indeed. But you can shape the indicated control in any way you want. But creating a TCustomPanel descendent that embeds the player should not be difficult... Michael. From bo.berglund at gmail.com Thu May 9 21:39:34 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 09 May 2019 21:39:34 +0200 Subject: [Lazarus] How to install lazvlc? References: <1gm2de1ev1qlubooqnjs5311bkplqhavs4@4ax.com> <2rh7det7jatcnj14oacpgrf50i1s9udh3a@4ax.com> Message-ID: <9b09dedhcssolgshrc9anp8tovfqvnhspt@4ax.com> On Thu, 09 May 2019 08:30:12 +0200, Bo Berglund via lazarus wrote: >This made it possible for me to create my videoplayer and it works OK >for the level of functionality described in the blog. > >I have run into difficulties trying to implement incremental position >move buttons in the player, though. >Described on the Lazarus forum here: >https://forum.lazarus.freepascal.org/index.php?topic=45343.new#new > > Just to close this thread: I made a mistake in my code (!) where I assumed times into the video was in seconds where PasLibVlc actually uses ms. So my steps were 1000 times too small to be visible... Now working as I need. -- Bo Berglund Developer in Sweden From sysrpl at gmail.com Fri May 10 04:10:39 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 9 May 2019 22:10:39 -0400 Subject: [Lazarus] Bug: TPortableNetworkGraphic deson't work correclty on gtk2 Linux Message-ID: Can someone take a look at this bug? There are two issues here. 1) The ScanLine property of a 32 bpp TPortableNetworkGraphic misbehaves if the image width falls into some arbitrary values. It looks like the pixel stride isn't an even 32 bits. Pixels stride on a 32 bpp should always be 32 bits be regardless of image width. In my tests a 300 pixel wide image fails this test while a 400 pixel wide image succeeds. This problem does not present itself on Windows. 2) Occasionally, and without any discernible pattern, the red and blue components of 32 bpp png images are reversed by TPortableNetworkGraphic. This has nothing to do with the ScanLine property. Sometime simply loading a 32 bpp png with TPortableNetworkGraphic and drawing it on a Canvas shows a resulting image with red and blue components reversed. https://bugs.freepascal.org/view.php?id=35553 Your feedback would be appreciated. It's a bit concerning when I am teaching kids how to program using Lazarus and Linux and a bug like this presents itself during a class. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Fri May 10 08:37:09 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Fri, 10 May 2019 08:37:09 +0200 Subject: [Lazarus] TTrackBar alternative allowing slider move by clicking the bar? Message-ID: <555ade9vujtpums2o5i2fe88gabjro1r15@4ax.com> I am navigating a video using a TTrackBar component using an example from a blogpost. It works well to drag the handle and reposition the video when the handle is released. But I cannot for the life of me figure out how to set the handle position by clicking on the bar *outside* of the handle.... I.e. reposition by click rather than drag. (I want both possibilities) It seems like the handle moves a certain fixed distance on each click irrespective of where on the control the click is done. Typical video players allow grabbing the handle and sliding it to a new position *as well as* clicking on the bar outside of the handle to move the handle over *to that point*. The handle should move to the mouse pointer position, not using some unspecified increment. It seems like this is not possible with TTrackBar. :-( So is there an alternate TTrackBar available or any other position indicator that can be used to allow repositioning via a click? Or some code to add to change its behaviour? If I could get the value at the click point I could use the OnClick event to reposition it in code, but it seems like the X/Y values are pixel positions rather than actual trackbar påosition values. Note: The max value will be set by the length of the video in milliseconds when the video is loaded, so it is a quite large value... -- Bo Berglund Developer in Sweden From mailinglists at geldenhuys.co.uk Fri May 10 13:01:07 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 10 May 2019 12:01:07 +0100 Subject: [Lazarus] Info on the big-O notation Message-ID: <2af782f1-2702-1e2b-e65c-0da90e01aa39@geldenhuys.co.uk> Hi, [not Lazarus specific, but more a general programming question] Has anybody got a good URL or document or summary email that explains the big-O notation? It is often used to describe a task/method/algorithm to say how quick or efficient it runs, or how well coded your method might be. I kind-of have an idea how it works, but I would really like to solidify my knowledge of it. An example usage would be something like: There are multiple ways to implement a "find the longest palindrome" function. A simple solution would result in O(n^2) runtime, and a well optimised solution would produce a O(n) runtime. Regards, Graeme From mailinglists at geldenhuys.co.uk Fri May 10 13:46:05 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 10 May 2019 12:46:05 +0100 Subject: [Lazarus] Info on the big-O notation In-Reply-To: <2af782f1-2702-1e2b-e65c-0da90e01aa39@geldenhuys.co.uk> References: <2af782f1-2702-1e2b-e65c-0da90e01aa39@geldenhuys.co.uk> Message-ID: <653e7e14-0dbd-cdb9-b7c8-7903b2e00e97@geldenhuys.co.uk> On 10/05/2019 12:01 pm, Graeme Geldenhuys via lazarus wrote: > Has anybody got a good URL or document or summary email that explains > the big-O notation? Seems all I needed was just one extra search on the Internet. :-) I found the following URL which gives an excellent explanation. http://cooervo.github.io/Algorithms-DataStructures-BigONotation/big-O-notation.html Regards, Graeme From sysrpl at gmail.com Fri May 10 13:53:38 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Fri, 10 May 2019 07:53:38 -0400 Subject: [Lazarus] Dark theme suggestion Message-ID: Over on mantis I submitted a request to add a new dark theme for the Pascal Editor. Bellow are two screenshots, one is of the dark theme colors, and the other is of the default colors. https://cache.getlazarus.org/themes/dark-theme.png https://cache.getlazarus.org/themes/default-theme.png If you want to install the theme manually to test for yourself it requires a couple of steps. 1) Go to tools, options, display, colors 2) Hit the save button and create a new theme named dark.xml 3) Exit lazarus 3) Open you lazarus config userschemes folder 4) Overwrite dark.xml with this file https://cache.getlazarus.org/themes/dark.xml 5) Restart lazarus, go to tools, options, display, colors, and choose darker from the drop down The mantis request is here: https://bugs.freepascal.org/view.php?id=35557 Also, since theme display colors dialog has a save to button feature, it might make sense to have an import button as well. This would eliminate the steps 2-5 as outlined above. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mailinglists at geldenhuys.co.uk Fri May 10 14:00:26 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Fri, 10 May 2019 13:00:26 +0100 Subject: [Lazarus] Dark theme suggestion In-Reply-To: References: Message-ID: <746dee43-cb74-0178-8ffb-22a42ac897a3@geldenhuys.co.uk> On 10/05/2019 12:53 pm, Anthony Walter via lazarus wrote: > I submitted a request to add a new dark theme for the Pascal > Editor. I do love dark themes and have been using them for years. I especially like the Solarized (light and dark) themes - very useful for someone moving around with a laptop where light conditions change. Now the BIG question: Do dark themes save on battery power? ;-) Regards, Graeme From sysrpl at gmail.com Fri May 10 14:08:37 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Fri, 10 May 2019 08:08:37 -0400 Subject: [Lazarus] Dark theme suggestion In-Reply-To: <746dee43-cb74-0178-8ffb-22a42ac897a3@geldenhuys.co.uk> References: <746dee43-cb74-0178-8ffb-22a42ac897a3@geldenhuys.co.uk> Message-ID: It's doubtful that dark themes have any impact on battery life. To my knowledge unless you have an OLED display on your laptop, the light is generated by a flat panel with a uniform brightness. That is there is no local dimming. So in order to make any whites actually "white" the backlight needs to be a full brightness. That said, if you have a dark theme everywhere you might want to turn down the entire screen brightness at the system level. That definitely will impact your battery life. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lazarus at mfriebe.de Fri May 10 14:30:40 2019 From: lazarus at mfriebe.de (Martin Frb) Date: Fri, 10 May 2019 14:30:40 +0200 Subject: [Lazarus] Dark theme suggestion In-Reply-To: References: Message-ID: <9b08c413-b70b-f63a-c20c-8de77b3624d5@mfriebe.de> On 10/05/2019 13:53, Anthony Walter via lazarus wrote: > Over on mantis I submitted a request to add a new dark theme for the > Pascal Editor. There is a great selection of other schemes, including dark ones: http://wiki.lazarus.freepascal.org/UserSuppliedSchemeSettings This is also the way user supplied schemes are currently distributed. The IDE already comes with several dark schemes build in. Further schemes should use the above way. If someone wants to supply a package that allows to distribute schemes (and maybe other stuff) in an OPM like fashion, then that can be discussed independently. > > If you want to install the theme manually to test for yourself it > requires a couple of steps. > > 1) Go to tools, options, display, colors > 2) Hit the save button and create a new theme named dark.xml > 3) Exit lazarus > 3) Open you lazarus config userschemes folder > 4) Overwrite dark.xml with this file > https://cache.getlazarus.org/themes/dark.xml > 5) Restart lazarus, go to tools, options, display, colors, and choose > darker from the drop down > You do NOT need to save a scheme first. Just create the userscheme folder, and copy any scheme you like into it From sysrpl at gmail.com Fri May 10 16:07:07 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Fri, 10 May 2019 10:07:07 -0400 Subject: [Lazarus] Dark theme suggestion In-Reply-To: <9b08c413-b70b-f63a-c20c-8de77b3624d5@mfriebe.de> References: <9b08c413-b70b-f63a-c20c-8de77b3624d5@mfriebe.de> Message-ID: Okay thanks. I'll submit it to the wiki. -------------- next part -------------- An HTML attachment was scrubbed... URL: From klenin at gmail.com Sat May 11 07:57:57 2019 From: klenin at gmail.com (Alexander Klenin) Date: Sat, 11 May 2019 15:57:57 +1000 Subject: [Lazarus] Info on the big-O notation In-Reply-To: <653e7e14-0dbd-cdb9-b7c8-7903b2e00e97@geldenhuys.co.uk> References: <2af782f1-2702-1e2b-e65c-0da90e01aa39@geldenhuys.co.uk> <653e7e14-0dbd-cdb9-b7c8-7903b2e00e97@geldenhuys.co.uk> Message-ID: On Fri, May 10, 2019 at 9:46 PM Graeme Geldenhuys via lazarus wrote: > > On 10/05/2019 12:01 pm, Graeme Geldenhuys via lazarus wrote: > > Has anybody got a good URL or document or summary email that explains > > the big-O notation? > > > Seems all I needed was just one extra search on the Internet. :-) I > found the following URL which gives an excellent explanation. > > > http://cooervo.github.io/Algorithms-DataStructures-BigONotation/big-O-notation.html > Sorry for intervening, but I teach this topic frequently, so I feel compelled to make sure student is not mislead :) The site you mentioned is nicely looking and is not technically wrong, but still omits enough to create an illusion of understanding while being slightly misleading. This is ok for school pupils, but probably not for college / higher education. Main missing points: 1) Big-O notation is a generic concept from basic calculus. While it is commonly used for worst-case time analysis, it can as well be used for best, average, amortized times as well as for functions which have no relation to algorithmic complexity. 2) The whole point of using big-O in complexity analysis is to abstract away "small" implementation details like programming language, physical hardware, compiler quality etc. So that algorithms may be divided into sets of "similar" complexity. This is what O(f(n)) essentially is -- a set of functions which grow "no faster than" f(n) (in precisely defined sense). 3) Note the phrase "no faster than" as opposed to "as fast as" in previous paragraph. Big-O is actually an *upper bound* on growth. So a linear function f(n) = n is not only in O(n), but also in O(n^2), O(n^3) etc. There are similar notations for "no slower than" (small-o), "as fast as" (omega) etc. 3) While "beware of writing quadratic algorithm accidentally" is indeed a good rule of thumb for young, naive or just lazy programmers, the real trouble begins higher on the complexity ladder, around O(2^n). There is a long and fascinating story about P, NP and the most important unresolved question in math. You can read about it all around the Internet -- just do not limit yourself to oversimplified cartoon-style versions, you will miss most interesting stuff :) 4) I would recommend Wikipedia as a starting point of reading, including https://en.wikipedia.org/wiki/Analysis_of_algorithms -- Alexander S. Klenin From aaa5500 at ya.ru Sat May 11 12:06:19 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Sat, 11 May 2019 13:06:19 +0300 Subject: [Lazarus] Detailed message about "incompatible ppu=..." Message-ID: wsgrids.pp(13,30) Fatal: Cannot find WSGrids used by Grids, incompatible ppu=/home/user/lazarus/lcl/units/x86_64-linux/wsgrids.ppu, package LCLBase I didn't show that msg before, now I see it and show it. Can Laz show more detailed error here? with ppu version and platform? -- Regards, Alexey From aaa5500 at ya.ru Sat May 11 13:05:59 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Sat, 11 May 2019 14:05:59 +0300 Subject: [Lazarus] IDE: ColorBox not ok height Message-ID: In /Environment - Messages Window/ pane of options dialog, we have 2 colorbox'es. They have same height on Linux gtk2. On Win10 with High-dpi 150%, they have different height (by 4..6 pixels). Maybe some AutoSize is not set? (see also other colorbox'es in another panes - the same) -- Regards, Alexey From nc-gaertnma at netcologne.de Sat May 11 13:43:25 2019 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sat, 11 May 2019 13:43:25 +0200 Subject: [Lazarus] Detailed message about "incompatible ppu=..." In-Reply-To: References: Message-ID: <20190511134325.3cf873a0@limapholos.matflo.wg> On Sat, 11 May 2019 13:06:19 +0300 AlexeyT via lazarus wrote: > wsgrids.pp(13,30) Fatal: Cannot find WSGrids used by Grids, > incompatible > ppu=/home/user/lazarus/lcl/units/x86_64-linux/wsgrids.ppu, package > LCLBase When the compiler gives "Cannot find A used by B", the IDE checks what pas/pp/ppu files are in the search path, and if there is a ppu file it inserts "incompatible ppu=filename, package". > I didn't show that msg before, now I see it and show it. Can Laz show > more detailed error here? with ppu version and platform? The platform is probably x86_64-linux, unless you did something really stupid. The exact ppu "version" is never useful for the user. The important information is that fpc cannot use this ppu. Either because - it was compiled with another fpc version - or it was compiled with (depends on) some other ppu files, that are not in the search path. - or you misconfigured some search paths. Have you tried to compile clean? Mattias From aaa5500 at ya.ru Sat May 11 14:39:52 2019 From: aaa5500 at ya.ru (Alexey Tor.) Date: Sat, 11 May 2019 15:39:52 +0300 Subject: [Lazarus] Detailed message about "incompatible ppu=..." In-Reply-To: <20190511134325.3cf873a0@limapholos.matflo.wg> References: <20190511134325.3cf873a0@limapholos.matflo.wg> Message-ID: > Have you tried to compile clean? I tried, yes. It didn't help, same error. What helped: i updated date stamp of WSGrids.pas (touch). -- Regards, Alexey From bo.berglund at gmail.com Sat May 11 23:57:47 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Sat, 11 May 2019 23:57:47 +0200 Subject: [Lazarus] Lazarus throws error when trying to open an event procedure from the form Message-ID: <5jgede5h6jqdt4tfgajre46s4faevkqdev@4ax.com> FPC 3.0.4 / Lazarus 2.0.0 32 bit on Windows 7 x64 A project that builds without errors or warnings throws up an error dialog whenever in order to see its event function I do: 1) Doubleclick a button in the form view 2) Select the button, then use the events tab in object inspector to open OnClick The error box says: Unable to show method. Please fix the error shown in the message window which is normally below the source editor. And the message window has this: Codetools, Errors: 1 formmain.pas(119,4) Error: End of source not found. The editor cursor is set here (which is NOT where I wantde to get to): procedure TfrmMain.vlcPlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64); begin if trkPosition.Tag = 0 then // not dragging with mouse trkPosition.Position := vlcPlayer.GetVideoPosInMs(); lblTime.Caption := vlcPlayer.GetVideoPosStr('hh:mm:ss.ms'); end; Still as I said the project has no errors and builds just fine, why this message? If I close Lazarus and then start it over again, then this strange behaviour is not repeated..... Do I need to file a bug report or is this just a natural thing like restarting Windows to fix issues? -- Bo Berglund Developer in Sweden From lazarus at kluug.net Sun May 12 08:59:33 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Sun, 12 May 2019 08:59:33 +0200 Subject: [Lazarus] Lazarus throws error when trying to open an event procedure from the form In-Reply-To: <5jgede5h6jqdt4tfgajre46s4faevkqdev@4ax.com> References: <5jgede5h6jqdt4tfgajre46s4faevkqdev@4ax.com> Message-ID: <0fee66e2-d88b-0918-1e53-7cf1e9ab990a@kluug.net> On 11.05.2019 23:57, Bo Berglund via lazarus wrote: > Do I need to file a bug report or is this just a natural thing like > restarting Windows to fix issues? It's already been reported: https://bugs.freepascal.org/view.php?id=35289 Ondrej From aaa5500 at ya.ru Sun May 12 13:45:26 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Sun, 12 May 2019 14:45:26 +0300 Subject: [Lazarus] Qt4: circle painted with artifact Message-ID: <7391536b-24aa-46e9-5eed-4b79f271a5be@ya.ru> I noticed that Qt4 build of CudaText paints tabs' X on mouse-over wrong. Picture attached (1K). It is ATTabs code - see here https://github.com/Alexey-T/ATTabs/blob/master/attabs/attabs.pas#L1486 attabs.pas, procedure TATTabs.DoPaintXTo -- Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: qt-x.png Type: image/png Size: 1568 bytes Desc: not available URL: From zeljko at holobit.net Sun May 12 13:56:04 2019 From: zeljko at holobit.net (zeljko) Date: Sun, 12 May 2019 13:56:04 +0200 Subject: [Lazarus] Qt4: circle painted with artifact In-Reply-To: <7391536b-24aa-46e9-5eed-4b79f271a5be@ya.ru> References: <7391536b-24aa-46e9-5eed-4b79f271a5be@ya.ru> Message-ID: <23920ad1-2ed2-bf04-079f-5f8e120c8754@holobit.net> On 05/12/2019 01:45 PM, AlexeyT via lazarus wrote: > I noticed that Qt4 build of CudaText paints tabs' X on mouse-over wrong. > Picture attached (1K). It is ATTabs code - see here > > https://github.com/Alexey-T/ATTabs/blob/master/attabs/attabs.pas#L1486 > > attabs.pas, procedure TATTabs.DoPaintXTo Please open an issue about it and attach example project, I won't install any 3rd party components to fix that. Also, what about Qt5 ? zeljko From bo.berglund at gmail.com Mon May 13 00:31:55 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 13 May 2019 00:31:55 +0200 Subject: [Lazarus] Lazarus throws error when trying to open an event procedure from the form References: <5jgede5h6jqdt4tfgajre46s4faevkqdev@4ax.com> <0fee66e2-d88b-0918-1e53-7cf1e9ab990a@kluug.net> Message-ID: On Sun, 12 May 2019 08:59:33 +0200, Ondrej Pokorny via lazarus wrote: >It's already been reported: https://bugs.freepascal.org/view.php?id=35289 > Thanks for the info! So I checked the ticket when I had the same problem reappear again today. Turns out that when the problem is "active" I tested (as suggested in the ticket comments) adding the following immediately below implementation: uses Types; Then I tested again to get to the event function by doubleclicking the button and now it worked fine! And that is without restarting Lazarus. So it is definitely something fishy going on with codetools. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon May 13 14:37:32 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 13 May 2019 14:37:32 +0200 Subject: [Lazarus] PasLibVlc error handling? Message-ID: <5g6idehnvuup49ukr0j62ocqkour3pn4hk@4ax.com> Does anyone here know how to make PasLibVlc supply an error code or error message when an error occurs? I have implemented the event OnMediaPlayerEncounteredError in order to check what is happening. So in this event handler I just display the vlcPlayer.LastError and it is always an empty string... I would like to know exactly what has happeden when trying to open a media stream or file. There are numerous possibilities like: non-existing target, http login required, unsupported stream format etc. What I have encountered is the login required error when the media resides on a password protected directory on the webserver. Anyone who has used PasLibVlc and solved the error handling? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon May 13 15:06:31 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 13 May 2019 15:06:31 +0200 Subject: [Lazarus] PasLibVlc error handling? References: <5g6idehnvuup49ukr0j62ocqkour3pn4hk@4ax.com> Message-ID: On Mon, 13 May 2019 14:37:32 +0200, Bo Berglund via lazarus wrote: > >Does anyone here know how to make PasLibVlc supply an error code or >error message when an error occurs? >I have implemented the event OnMediaPlayerEncounteredError in order to >check what is happening. So in this event handler I just display the >vlcPlayer.LastError and it is always an empty string... > >I would like to know exactly what has happeden when trying to open a >media stream or file. > >There are numerous possibilities like: non-existing target, http login >required, unsupported stream format etc. >What I have encountered is the login required error when the media >resides on a password protected directory on the webserver. > >Anyone who has used PasLibVlc and solved the error handling? > Forgot to add the underlying event code from PasLibVlc: property LastError: string read FError write FError; procedure TPasLibVlcPlayer.WmMediaPlayerEncounteredError(var m: TVlcMessage); var tmp : PAnsiChar; begin tmp := libvlc_errmsg(); if (tmp <> NIL) then begin FError := {$IFDEF DELPHI_XE2_UP}UTF8ToWideString{$ELSE}UTF8Decode{$ENDIF}(tmp); end else begin FError := ''; end; if Assigned(FOnMediaPlayerEncounteredError) then FOnMediaPlayerEncounteredError(SELF); m.Result := 0; end; And here is my simple test code: procedure TfrmMain.vlcPlayerMediaPlayerEncounteredError(Sender: TObject); begin MessageDlg('Error: ' + vlcPlayer.LastError, mtError, [mbOk], 0); end; The message dialog always shows "Error: ", i.e the LastError string is always empty. -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon May 13 22:36:25 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 13 May 2019 22:36:25 +0200 Subject: [Lazarus] TBitBtn image, how to make background transparent? Message-ID: <2skjdellod746q41jp3nhpg83rootrkk0h@4ax.com> I am trying to make a bitmap image for a TBitBtn button such that the background of the image will be transpoarent and therefore the button color will be visible. But I don't succeed with this, the background I use for the image is visible on the button. Even if I set the same color as the buttonface to the background it becomes visible on the button because the button itself has gadient color.... So not the same color at the top of the button and at the bottom. I was under the impression that button images use the color of pixel (1, 1) as the define for the transparent color, so I have the complete border set to the same background color. Not working.... Or is a specific color defined as the transparent color, if so what is this color? (RGB please) What can I do to use glyphs on a TBitButton? -- Bo Berglund Developer in Sweden From lazarus at kluug.net Mon May 13 22:41:32 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Mon, 13 May 2019 22:41:32 +0200 Subject: [Lazarus] TBitBtn image, how to make background transparent? In-Reply-To: <2skjdellod746q41jp3nhpg83rootrkk0h@4ax.com> References: <2skjdellod746q41jp3nhpg83rootrkk0h@4ax.com> Message-ID: On 13.05.2019 22:36, Bo Berglund via lazarus wrote: > I am trying to make a bitmap image for a TBitBtn button such that the > background of the image will be transpoarent and therefore the button > color will be visible. What OS and WidgetSet? If you are on win32 - AFAIR a PNG works just fine. Ondrej From bo.berglund at gmail.com Mon May 13 23:42:23 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 13 May 2019 23:42:23 +0200 Subject: [Lazarus] TBitBtn image, how to make background transparent? References: <2skjdellod746q41jp3nhpg83rootrkk0h@4ax.com> Message-ID: <8fojdehaebqjalip8rojomrorm9tqa0qad@4ax.com> On Mon, 13 May 2019 22:41:32 +0200, Ondrej Pokorny via lazarus wrote: >On 13.05.2019 22:36, Bo Berglund via lazarus wrote: >> I am trying to make a bitmap image for a TBitBtn button such that the >> background of the image will be transpoarent and therefore the button >> color will be visible. > >What OS and WidgetSet? If you are on win32 - AFAIR a PNG works just fine. > Windows 7 x64, Lazarus 2.0.0 32 bit, fpc 3.0.4 I have tried creating a png image (24x24 pixels) with a gray background equal to the shade at the bottom of the TBitBtn. When I assign this image as the glyph of the TBitBtn I can see the image square against the button since the button's gray color is whiting out towards the top. So my gray shade is not transparent... ----- BUT WAIT A MINUTE! ------- Even as the button appears with the colored square inside the Lazarus IDE the background actually disappears (becomes transparent) when I compile the application and run it! So it seems like the form is displaying the button in a different way in the IDE from when the program is running. I did not know this and I had a number of other items I was coding on so I did not test it actually running, believing that what I see in the IDE is what I get when running. Issue resolved. -- Bo Berglund Developer in Sweden From lazarus at kluug.net Tue May 14 06:55:53 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Tue, 14 May 2019 06:55:53 +0200 Subject: [Lazarus] TBitBtn image, how to make background transparent? In-Reply-To: <8fojdehaebqjalip8rojomrorm9tqa0qad@4ax.com> References: <2skjdellod746q41jp3nhpg83rootrkk0h@4ax.com> <8fojdehaebqjalip8rojomrorm9tqa0qad@4ax.com> Message-ID: <34a196e3-35d7-ddd1-a75d-6b74cb7d32a8@kluug.net> On 13.05.2019 23:42, Bo Berglund via lazarus wrote: > I have tried creating a png image (24x24 pixels) with a gray > background equal to the shade at the bottom of the TBitBtn. > When I assign this image as the glyph of the TBitBtn I can see the > image square against the button since the button's gray color is > whiting out towards the top. > So my gray shade is not transparent... PNG supports alpha-channel - use it. Ondrej From aaa5500 at ya.ru Wed May 15 11:10:29 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Wed, 15 May 2019 12:10:29 +0300 Subject: [Lazarus] IDE target names Message-ID: <0c69c72a-f105-e0d9-030a-b6036aef6859@ya.ru> In the IDE "Target" sheet page we have OS names 1- "Beos"- consider to change to better casing "BeOS" (Wikipedia) 2- "go32v2" - the same--> "Go32v2" 3- "iphonesim" - the same 4- "nds"- I dunno what it is, maybe fix too 5- "Netware"- the same--> "NetWare" (Wikipedia) 6- "qnx"- the same--> "QNX" -- Regards, Alexey From fpc at pascalprogramming.org Wed May 15 11:16:10 2019 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Wed, 15 May 2019 11:16:10 +0200 Subject: [Lazarus] IDE target names In-Reply-To: <0c69c72a-f105-e0d9-030a-b6036aef6859@ya.ru> References: <0c69c72a-f105-e0d9-030a-b6036aef6859@ya.ru> Message-ID: Op 2019-05-15 om 11:10 schreef AlexeyT via lazarus: > > 4- "nds"- I dunno what it is, maybe fix too > Nintendo DS From bo.berglund at gmail.com Wed May 15 13:34:52 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 May 2019 13:34:52 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? Message-ID: I am trying to use a TProgressbar to display the position of a playing video. This works OK while playing. Now I want to reposition the video by clicking on the progress bar and it does work, but the bar progress to the new position when clicking is really slow.... When I click the bar the X position is read in the MouseUp event and the Video time value is calculated as the correspondinmg number of milliseconds as used by the VLC player component. Then the progressbar and the video are repositioned by setting their position properties to this value. What happens on screen is that the video *immediately* jumps to the wanted position and continues playing but the progress bar only *slowly* advances towards the playing point. For a jump from the start of the video until near the end it takes almost 3 seconds to complete. Why is the TProgressBar doing this when the TTrackBar I used before displays an instant move? (I can't use the TTrackBar because of other issues with it) Using Lazarus 2.0.0 32 bit and fpc 3.0.4 on Windows 7 x64 Pro. -- Bo Berglund Developer in Sweden From lazarus at kluug.net Wed May 15 13:38:19 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Wed, 15 May 2019 13:38:19 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? In-Reply-To: References: Message-ID: On 15.05.2019 13:34, Bo Berglund via lazarus wrote: > Why is the TProgressBar doing this when the TTrackBar I used before displays an instant move? Because WinAPI developers wanted it so - the drawing of TProgressBar is fully in charge of the OS. Ondrej From bo.berglund at gmail.com Wed May 15 16:39:14 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 May 2019 16:39:14 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? References: Message-ID: <219ode99tothd4lhgmmgnldeulv3q2f0fk@4ax.com> On Wed, 15 May 2019 13:38:19 +0200, Ondrej Pokorny via lazarus wrote: >On 15.05.2019 13:34, Bo Berglund via lazarus wrote: >> Why is the TProgressBar doing this when the TTrackBar I used before displays an instant move? > >Because WinAPI developers wanted it so - the drawing of TProgressBar is >fully in charge of the OS. > I feared as much... So is there an alternate control I can use to visualize the position in the video, which does not react so slowly? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Wed May 15 17:11:02 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 May 2019 17:11:02 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? References: Message-ID: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> On Wed, 15 May 2019 13:38:19 +0200, Ondrej Pokorny via lazarus wrote: >Because WinAPI developers wanted it so - the drawing of TProgressBar is >fully in charge of the OS. Strangely just discovered that the progressbar is painted "fast enough" if I click a position towards the lower side of the current position! So start and click towards the end (max) - it slowly paints the bar. Then click towards the start (min) - it *immediately* paints it correctly. There *must* be a way to enforce the latter paint method also for positive moves.... I really do not want to create a panel child to implement this behaviour unless I am really forced to.... -- Bo Berglund Developer in Sweden From lazarus at kluug.net Wed May 15 17:13:48 2019 From: lazarus at kluug.net (Ondrej Pokorny) Date: Wed, 15 May 2019 17:13:48 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? In-Reply-To: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> References: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> Message-ID: On 15.05.2019 17:11, Bo Berglund via lazarus wrote: > On Wed, 15 May 2019 13:38:19 +0200, Ondrej Pokorny via lazarus > wrote: > >> Because WinAPI developers wanted it so - the drawing of TProgressBar is >> fully in charge of the OS. > Strangely just discovered that the progressbar is painted "fast > enough" if I click a position towards the lower side of the current > position! > > So start and click towards the end (max) - it slowly paints the bar. > Then click towards the start (min) - it *immediately* paints it > correctly. > > There *must* be a way to enforce the latter paint method also for > positive moves.... Try to set DoubleBuffered:=True. That should disable all possible OS painting animations. > I really do not want to create a panel child to implement this > behaviour unless I am really forced to.... That's what I would do. (But not a panel child but a TGraphicControl descendant.) Ondrej From aaa5500 at ya.ru Wed May 15 17:16:32 2019 From: aaa5500 at ya.ru (Alexey) Date: Wed, 15 May 2019 18:16:32 +0300 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? In-Reply-To: References: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> Message-ID: I suggest to use ATScrollbar from ATFlatControls, but it needs the option for fast move- I can easily add it soon. From pascaldragon at googlemail.com Wed May 15 17:20:04 2019 From: pascaldragon at googlemail.com (Sven Barth) Date: Wed, 15 May 2019 17:20:04 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? In-Reply-To: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> References: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> Message-ID: Bo Berglund via lazarus schrieb am Mi., 15. Mai 2019, 17:11: > On Wed, 15 May 2019 13:38:19 +0200, Ondrej Pokorny via lazarus > wrote: > > >Because WinAPI developers wanted it so - the drawing of TProgressBar is > >fully in charge of the OS. > > Strangely just discovered that the progressbar is painted "fast > enough" if I click a position towards the lower side of the current > position! > > So start and click towards the end (max) - it slowly paints the bar. > Then click towards the start (min) - it *immediately* paints it > correctly. > > There *must* be a way to enforce the latter paint method also for > positive moves.... > > I really do not want to create a panel child to implement this > behaviour unless I am really forced to.... > One possible workaround I found (not tested) is this: === code begin === YourProgressbar.Position := YourTarget; YourProgressbar.Position := Your Target - 1; YourProgressbar.Position := YourTarget; === code end === You first tell the progress bar your new desired target value (which triggers a slow animation), then you go one step back (which will enforce a fast redraw) and then to the target again (which again will be a slow animation, but shouldn't be that slow with only one point difference). Note: I currently don't know whether the property on TProgressBar is Position or Value. It's been a while since I last used one ;) Note 2: you can put similar code into the click handler, though there without the first step probably. Regards, Sven > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Wed May 15 17:28:58 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Wed, 15 May 2019 17:28:58 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? References: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> Message-ID: On Wed, 15 May 2019 17:13:48 +0200, Ondrej Pokorny via lazarus wrote: >> I really do not want to create a panel child to implement this >> behaviour unless I am really forced to.... > >That's what I would do. (But not a panel child but a TGraphicControl >descendant.) After thinking a bit on the difference between going forwards and backwards, I did this test: MouseUp event used to reposition the video playing pos: procedure TfrmMain.pgbProgressMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); {Progressbar set to seconds resolution rather than milisec} var Pos: double; begin Pos := double(X) / pgbProgress.Width * (pgbProgress.Max - pgbProgress.Min); vlcPlayer.SetVideoPosInMs(Round(Pos) * 1000); end; The player's TimeChanged event updates the progress bar: procedure TfrmMain.vlcPlayerMediaPlayerTimeChanged(Sender: TObject; time: Int64); var P: int64; begin P := vlcPlayer.GetVideoPosInMs(); P := P div 1000; //Progressbar is in sec rather than ms pgbProgress.Position := P + 1; pgbProgress.Position := P ; end; end; Notice that I am now first setting the position 1 higher than requested and then immediately backing down by 1. AND IT WORKS!!!!! Now the progress bar immediately jumps to the wanted position without the "smooth scroll" that MS implemented! -- Bo Berglund Developer in Sweden From sysrpl at gmail.com Wed May 15 19:44:30 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 13:44:30 -0400 Subject: [Lazarus] Update sound shop my next tutoring project Message-ID: I have summer camp with several successive week long classes coming up and am trying to put together some fun programming materials to engage the kids and hopefully encourage them to explore more. Yesterday I created the start of my next project for teaching kids on the subject of computer programming using Lazarus and Free Pascal as the teaching tools. Here is a brief video demonstrating what I have so far along with a github page containing the sources. https://cache.getlazarus.org/videos/sound-shop-example.mp4 https://github.com/sysrpl/SoundShop/ What the Sound Shop program does: Sound Shop let's kids write functions and hear the results of those functions. Right now it's dead simple to write wave form functions, but I am going to enhance the program to allow for effect pipelines which map unto keys. These pipelines will be a lot like the node in my Image Shop program but will map to piano keys instead of the display. I need to take a break from these example projects for a few days and work on helping the school with schedules, but I thought I'd ask anyone who find this interesting for some help. Here are some of the things anyone can do to help: Write a routine to load a music or song that will play on the keyboard using the currently assigned piano keys. You can turn a key on or off by simply typing Piano.Key[Index] := True/False. This will light up or dim the key and play the corresponding mapped audio channel. Users can play already along with with music or songs, so there's that feature. Obviously this feature will also need a few demo music or song files. You can choose however you want to store and read a music or song file. Write an MP3 streamer that will convert in memory portions of an MP3 file to audio samples. This will allow piano key channels to be mapped to sounds other than computer generated waves. Also, I will eventually hook effects up to both wave and MP3 samples. Please no third part libraries to convert MP3 data to samples, only Pascal code. I will do this if no one takes up the task. Fix the issues with 32 bpp PNG images on Linux. Some of the things I am going to do: I am going to add a sound pipeline to the program to allow for effects and other things to modify sounds before they are routed from the piano keys to the underlying audio system. Each piano key will have its own pipeline. I am going to add an oscilloscope to visualize the all the collectively playing samples as they form waves. The scope will have a few controls to adjust the phase, stretch, and amplitude. I might add a bar staff allowing rectangular notes to be places on it and stretched. Moving notes up or down on the staff changes the mapped piano key, and stretching alters the note duration. If anyone want to contribute it would be much appreciated. Thanks Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From serbod at gmail.com Wed May 15 20:04:51 2019 From: serbod at gmail.com (Sergey Bodrov) Date: Wed, 15 May 2019 21:04:51 +0300 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Ported from PDMP3 Public domain MP3 decoder https://github.com/serbod/acs/blob/master/src/formats/general/mp3.pas but I don't tested it properly. Also, whole ACS components can be useful to build interactive pipeline for sound processing https://github.com/serbod/acs/ ср, 15 мая 2019 г. в 20:45, Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org>: > I have summer camp with several successive week long classes coming up and > am trying to put together some fun programming materials to engage the kids > and hopefully encourage them to explore more. > > Yesterday I created the start of my next project for teaching kids on the > subject of computer programming using Lazarus and Free Pascal as the > teaching tools. Here is a brief video demonstrating what I have so far > along with a github page containing the sources. > > https://cache.getlazarus.org/videos/sound-shop-example.mp4 > https://github.com/sysrpl/SoundShop/ > > What the Sound Shop program does: > > Sound Shop let's kids write functions and hear the results of those > functions. Right now it's dead simple to write wave form functions, but I > am going to enhance the program to allow for effect pipelines which map > unto keys. These pipelines will be a lot like the node in my Image Shop > program but will map to piano keys instead of the display. > > I need to take a break from these example projects for a few days and work > on helping the school with schedules, but I thought I'd ask anyone who find > this interesting for some help. > > Here are some of the things anyone can do to help: > > Write a routine to load a music or song that will play on the keyboard > using the currently assigned piano keys. You can turn a key on or off by > simply typing Piano.Key[Index] := True/False. This will light up or dim the > key and play the corresponding mapped audio channel. Users can play already > along with with music or songs, so there's that feature. Obviously this > feature will also need a few demo music or song files. You can choose > however you want to store and read a music or song file. > > Write an MP3 streamer that will convert in memory portions of an MP3 file > to audio samples. This will allow piano key channels to be mapped to sounds > other than computer generated waves. Also, I will eventually hook effects > up to both wave and MP3 samples. Please no third part libraries to convert > MP3 data to samples, only Pascal code. I will do this if no one takes up > the task. > > Fix the issues with 32 bpp PNG images on Linux. > > Some of the things I am going to do: > > I am going to add a sound pipeline to the program to allow for effects and > other things to modify sounds before they are routed from the piano keys to > the underlying audio system. Each piano key will have its own pipeline. > > I am going to add an oscilloscope to visualize the all the collectively > playing samples as they form waves. The scope will have a few controls to > adjust the phase, stretch, and amplitude. > > I might add a bar staff allowing rectangular notes to be places on it and > stretched. Moving notes up or down on the staff changes the mapped piano > key, and stretching alters the note duration. > > If anyone want to contribute it would be much appreciated. > > Thanks > > Anthony > > > > > > > > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- *Bodrov Sergey* software development, IT consulting http://www.serbod.com *Phone (Belarus):* +375(25)794-21-58 *Skype:* sergey.bodrov1 *e-mail:* serbod at gmail.com, oxotnuk at yandex.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Wed May 15 20:30:53 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 14:30:53 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Thank you so much for a link to your MP3 decoder! I will take a look at integrating it this coming weekend. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Wed May 15 20:35:12 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 14:35:12 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: I just looked at you MP3 decoder source. It looks like it mimics the mpg123 API which is perfect. The only question I have is what is the best way to seek to a time in an MP3 memory buffer for use with your pdmp3_feed and pdmp3_read functions? I don't want to decode whole MP3 streams into PCM wave data, rather I want to be able to do random moves using pointer given a time offset from the start of the MP3 sample data and decode a small portion. -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvioprog at gmail.com Wed May 15 20:57:28 2019 From: silvioprog at gmail.com (silvioprog) Date: Wed, 15 May 2019 15:57:28 -0300 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: On Wed, May 15, 2019 at 2:45 PM Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org> wrote: > I have summer camp with several successive week long classes coming up and > am trying to put together some fun programming materials to engage the kids > and hopefully encourage them to explore more. > > Yesterday I created the start of my next project for teaching kids on the > subject of computer programming using Lazarus and Free Pascal as the > teaching tools. Here is a brief video demonstrating what I have so far > along with a github page containing the sources. > > https://cache.getlazarus.org/videos/sound-shop-example.mp4 > https://github.com/sysrpl/SoundShop/ > > What the Sound Shop program does: > > Sound Shop let's kids write functions and hear the results of those > functions. Right now it's dead simple to write wave form functions, but I > am going to enhance the program to allow for effect pipelines which map > unto keys. These pipelines will be a lot like the node in my Image Shop > program but will map to piano keys instead of the display. > > I need to take a break from these example projects for a few days and work > on helping the school with schedules, but I thought I'd ask anyone who find > this interesting for some help. > > Here are some of the things anyone can do to help: > > Write a routine to load a music or song that will play on the keyboard > using the currently assigned piano keys. You can turn a key on or off by > simply typing Piano.Key[Index] := True/False. This will light up or dim the > key and play the corresponding mapped audio channel. Users can play already > along with with music or songs, so there's that feature. Obviously this > feature will also need a few demo music or song files. You can choose > however you want to store and read a music or song file. > > Write an MP3 streamer that will convert in memory portions of an MP3 file > to audio samples. This will allow piano key channels to be mapped to sounds > other than computer generated waves. Also, I will eventually hook effects > up to both wave and MP3 samples. Please no third part libraries to convert > MP3 data to samples, only Pascal code. I will do this if no one takes up > the task. > > Fix the issues with 32 bpp PNG images on Linux. > > Some of the things I am going to do: > > I am going to add a sound pipeline to the program to allow for effects and > other things to modify sounds before they are routed from the piano keys to > the underlying audio system. Each piano key will have its own pipeline. > > I am going to add an oscilloscope to visualize the all the collectively > playing samples as they form waves. The scope will have a few controls to > adjust the phase, stretch, and amplitude. > > I might add a bar staff allowing rectangular notes to be places on it and > stretched. Moving notes up or down on the staff changes the mapped piano > key, and stretching alters the note duration. > > If anyone want to contribute it would be much appreciated. > > Thanks > > Anthony > Hi Anthony, thanks for sharing this incredible work. Could you attach some license to this stuff? The question is just because you wrote nice classes like TPianoKeyboard which could be used in a final application. (for example, I could use it to produce alarm songs in my Raspberry board dynamically instead of playing them from files) best, -- Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Wed May 15 21:51:05 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 15:51:05 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: I usually add GPL licences to my repositories but I forgot this time. Thanks for reminding me. It's now attached. Regarding the TPianoKeyboard class here is some helpful information. It's a TGraphicControl. It relies on the Music unit, also in the same project, to convert keys to frequencies and also to format note names as strings. You can define the number of keys on the piano by setting the KeyCount property. KeyCount ignores attempts to set its value to less than 1. You can change the on screen size of the piano by setting the ScaleFactor property. Setting Key[Index] := False/True turns the piano key from an released state to a pressed state (when true). You can listen to the OnKeyToggle event to take action when a piano key is pressed or released. The KeyToFrequency method gives you the frequency in hertz of the piano key by index. The piano does its best to keep middle C in the middle of its key layout when you change KeyCount. If you (or anyone really) have any improvement ideas for TPianoKeyboard or any other code in the project, let me know and I'll do my best to accommodate. -------------- next part -------------- An HTML attachment was scrubbed... URL: From silvioprog at gmail.com Wed May 15 22:52:44 2019 From: silvioprog at gmail.com (silvioprog) Date: Wed, 15 May 2019 17:52:44 -0300 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: On Wed, May 15, 2019 at 4:51 PM Anthony Walter via lazarus < lazarus at lists.lazarus-ide.org> wrote: > I usually add GPL licences to my repositories but I forgot this time. > Thanks for reminding me. It's now attached. > > Regarding the TPianoKeyboard class here is some helpful information. > > It's a TGraphicControl. > It relies on the Music unit, also in the same project, to convert keys to > frequencies and also to format note names as strings. > You can define the number of keys on the piano by setting the KeyCount > property. KeyCount ignores attempts to set its value to less than 1. > You can change the on screen size of the piano by setting the ScaleFactor > property. > Setting Key[Index] := False/True turns the piano key from an > released state to a pressed state (when true). > You can listen to the OnKeyToggle event to take action when a piano key is > pressed or released. > The KeyToFrequency method gives you the frequency in hertz of the piano > key by index. > The piano does its best to keep middle C in the middle of its key layout > when you change KeyCount. > > If you (or anyone really) have any improvement ideas for TPianoKeyboard or > any other code in the project, let me know and I'll do my best to > accommodate. > Two useful features (suggestions :-D): * Split the "sound logic" from TPianoKeyboard to own class (TPianoSynthesizer?) allowing to use it in non-LCL based applications; * Supposing the feature above is done, the synthesizer could allow to record key sequences by typing or by string. (it would be useful to study applications like DefleMask project and play songs (strings only, without drums, bass etc.) like "Sonic - Green Hill Zone" https://www.youtube.com/watch?v=0YY13qh7X4A, "Spring Yard Zone" https://www.youtube.com/watch?v=_8LUfR1iH_0. (Castlevania, Zelda and so on <3) -- Silvio Clécio -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Thu May 16 00:08:57 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 18:08:57 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Silvio, Actually I am to add a node based system for mapping each key of the keyboard similar to this project . Instead of source images, like in the Image Shop program, there will be wave source nodes and file source nodes. The node between the source and the key will be effect nodes. Effects can be anything you program, such as delay, echo, pan, chorus, and anything you can imagine. Effects, like wave source, will be simple functions you write and register before running the program. I will also be adding an oscilloscope control to graph the source and effect in real time. If anyone wants to contribute an midi file read that converts midi files into time / frequencies, I'd love to add that. Thanks again. Anthony -------------- next part -------------- An HTML attachment was scrubbed... URL: From joshyfun at gmail.com Thu May 16 02:13:23 2019 From: joshyfun at gmail.com (=?UTF-8?Q?Jos=c3=a9_Mejuto?=) Date: Thu, 16 May 2019 02:13:23 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: El 15/05/2019 a las 20:35, Anthony Walter via lazarus escribió: > I just looked at you MP3 decoder source. It looks like it mimics the > mpg123 API which is perfect. The only question I have is what is the > best way to seek to a time in an MP3 memory buffer for use with > your pdmp3_feed and pdmp3_read functions? I don't want to decode whole > MP3 streams into PCM wave data, rather I want to be able to do random > moves using pointer given a time offset from the start of the MP3 sample > data and decode a small portion. > Hello, To perform random seek in mp3 streams you must process each header in the mp3 file and take note where each header start, so create some kind of index file. For mp3 in CBR mode you can calculate skips as each frame is constant in size, but in VBR you must create the index, the big problem is that to know if an mp3 is VBR or CBR you must read all headers :-( Some extensions in ID3 tags store the index for headers, others in ancillary data. To decode after seek you must skip back 9 frames (if available), start to decode and discard the sound associated with that 9 frames, and the continue decoding and using data. The reason is that mp3 frames can share data using "byte reservoir" fields across up to 9 frames and if you do not discard that sound you are in risk of start the play with some nice bleeps, blurps, shrrrss, or any other non expected sound. -- From sysrpl at gmail.com Thu May 16 02:19:05 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Wed, 15 May 2019 20:19:05 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Got it. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at dommelstein.nl Thu May 16 11:08:37 2019 From: marc at dommelstein.nl (Marc Weustink) Date: Thu, 16 May 2019 11:08:37 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Anthony Walter via lazarus wrote: > I have summer camp with several successive week long classes coming up > and am trying to put together some fun programming materials to engage > the kids and hopefully encourage them to explore more. > > Yesterday I created the start of my next project for teaching kids on > the subject of computer programming using Lazarus and Free Pascal as the > teaching tools. Here is a brief video demonstrating what I have so far > along with a github page containing the sources. > > https://cache.getlazarus.org/videos/sound-shop-example.mp4 > https://github.com/sysrpl/SoundShop/ Hi, I your video you talked about popping and clicking of the tones. You partly solved this by adding an Attack and a Release (you use attack here in in fact these are 2 different values, and while you're at it you can add a Decay too :)) Anyway, I haven't looked at the code itself (only what was shown in the video), but most likely those pops and clicks are caused by phase jumps when you switch from one frequency to another. Imagine your playing A -> B and you start generating the sine of B at phase=0, there is a big chance that A isn't at phase=0. So you get a sudden jump in your output. your ear is very sensitive for this and results in a click. What I've done in this case is based on the frequency/samplerate to play, is calculate the delta phase for each sample (for 220Hz/48k -> delta=220*2Pi/48000) and increase a global phase for each sample you calculate with this global phase. Therefore if if you change frequency, the phase of the new tone continues where the previous ended. To prevent your global phase to grow, substract 2Pi when it is larger than 2Pi. Or even better, leave out 2Pi in the delta phase, and use 2Pi*globalphase to calculate and globalphase=fraq(globalphase + deltaphase) Hope this solves your issue, Marc From bo.berglund at gmail.com Thu May 16 12:02:43 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Thu, 16 May 2019 12:02:43 +0200 Subject: [Lazarus] TProgressbar moves slowly, is there a hidden setting for faster response? References: <4oaode1a9mr8rl1p5oboqdhmihsljiv0rl@4ax.com> Message-ID: On Wed, 15 May 2019 17:20:04 +0200, Sven Barth via lazarus wrote: >One possible workaround I found (not tested) is this: > >=== code begin === > >YourProgressbar.Position := YourTarget; >YourProgressbar.Position := Your Target - 1; >YourProgressbar.Position := YourTarget; > >=== code end === > >You first tell the progress bar your new desired target value (which >triggers a slow animation), then you go one step back (which will enforce a >fast redraw) and then to the target again (which again will be a slow >animation, but shouldn't be that slow with only one point difference). > >Note: I currently don't know whether the property on TProgressBar is >Position or Value. It's been a while since I last used one ;) > >Note 2: you can put similar code into the click handler, though there >without the first step probably. > Before I saw this reply I had already tested successfully this structure: YourProgressbar.Position := YourTarget + 1; YourProgressbar.Position := YourTarget; And it really does work, no longer the animated slow move... -- Bo Berglund Developer in Sweden From sysrpl at gmail.com Thu May 16 12:40:39 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 16 May 2019 06:40:39 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: Marc, That is interesting and you've given me something to consider and perhaps adjust. Thank you. Also with regards to attack and release, I've opted to call it just attack. That is when the note is starting to play, or ending playing, I perform a short fade of the wave form on both ends using the same value. I also mix in a sustain which I am using to fade the note out over time after the initial attack. So the formula I am using is assuming a note is playing (StartTime >= CurrentTime): if StartTime - CurrentTime < Attack then Mix := StartTime - CurrentTime / Attack else Mix := 1; Then I used the Mix blend variable to adjust the wave amplitude (Volume) by multiplying it against the left and right channels. // Sample Left and Right are a 16 bit signed integers Sample.Left := Trunc(AudioWave(F) * Volume * Mix); Sample.Right := -Sample.Left; Where: F is the a value between 0.0..1.0 representing the current wave cycle AudioWave is the user defined function to convert F into a wave shape returning a value between -1.0..1.0 Volume is the peak we allow for the Left or Right on Sample (in my case the constant value 2048) Mix is between 0.0..1.0 and is used to fade in for attack, fade out for release, and fade out using sustain So I should fix this by adding a tiny bit of phase change to F based on which keyboard key is being processed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at dommelstein.nl Thu May 16 13:22:39 2019 From: marc at dommelstein.nl (Marc Weustink) Date: Thu, 16 May 2019 13:22:39 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: Message-ID: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> Anthony Walter via lazarus wrote: > Marc, > > That is interesting and you've given me something to consider and > perhaps adjust. Thank you. > > Also with regards to attack and release, I've opted to call it just > attack. That is when the note is starting to play, or ending playing, I > perform a short fade of the wave form on both ends using the same value. > I also mix in a sustain which I am using to fade the note out over time > after the initial attack. > > So the formula I am using is assuming a note is playing (StartTime >= > CurrentTime): > > if StartTime - CurrentTime < Attack then >   Mix := StartTime - CurrentTime / Attack > else >   Mix := 1; > > Then I used the Mix blend variable to adjust the wave amplitude (Volume) > by multiplying it against the left and right channels. > > // Sample Left and Right are a 16 bit signed integers > Sample.Left := Trunc(AudioWave(F) * Volume * Mix); > Sample.Right := -Sample.Left; > > Where: > > F is the a value between 0.0..1.0 representing the current wave cycle > AudioWave is the user defined function to convert F into a wave shape > returning a value between -1.0..1.0 > Volume is the peak we allow for the Left or Right on Sample (in my case > the constant value 2048) > Mix is between 0.0..1.0 and is used to fade in for attack, fade out for > release, and fade out using sustain > > So I should fix this by adding a tiny bit of phase change to F based on > which keyboard key is being processed. As long as you don't reset F to 0 when playing a new note this should work. To verify, you can use Audacity to record the generated audio (or write it to file as raw pcm). If you switch to spectogram view, you see those phase errors as a spike in the diagram Marc From sysrpl at gmail.com Thu May 16 21:08:10 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 16 May 2019 15:08:10 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> Message-ID: Just an update. I've added the ability to program music with it. You have the ability to either load music from a file or create music by adding notes to the piano Music property. http://cache.getlazarus.org/videos/sound-shop-music.mp4 Marc, The phase of each note is now set to a completely completely random value right before it a note is pressed, but I still get the pops and clicking. I am nearly 100% sure the problem is with Linux, SDL 2, or my hardware. I say this because I am experiencing multiple clicks or pops when within the holding of one constant tone. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at dommelstein.nl Thu May 16 21:37:16 2019 From: marc at dommelstein.nl (Marc Weustink) Date: Thu, 16 May 2019 21:37:16 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> Message-ID: Just to verify that it isn't caused by your program, just open a temp filestream and write every sample you write to the sdl library also to that stream. When the pops happen. Stop running, close the stream and import the raw file into audacity. If the spectral view is clean, it is not your generation of tones. One other thing what can happen is that your buffer underflows. Ie there are no samples to play anymore Marc On May 16, 2019 9:08:10 PM GMT+02:00, Anthony Walter wrote: >Just an update. I've added the ability to program music with it. You >have >the ability to either load music from a file or create music by adding >notes to the piano Music property. > >http://cache.getlazarus.org/videos/sound-shop-music.mp4 > >Marc, > >The phase of each note is now set to a completely completely random >value >right before it a note is pressed, but I still get the pops and >clicking. I >am nearly 100% sure the problem is with Linux, SDL 2, or my hardware. I >say >this because I am experiencing multiple clicks or pops when within the >holding of one constant tone. From sysrpl at gmail.com Thu May 16 22:12:15 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Thu, 16 May 2019 16:12:15 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> Message-ID: I will take you advice and write the samples out to a PCM wave file then examine them in audacity. Regarding the underflow, I always wipe the buffer with zeros before I play a note and the popping occurs sometimes when only one note is playing. That is when there is the least amount of processing, but you might be onto something. I am using the smallest buffer size of 512 samples and the threading system might not invoke my audio callback in time to fill the buffer before the sound should be playing. I will try to increase the buffer size which should relieve the race condition, but increasing the buffer size also increases the resolution where notes can be played making them less accurate. And right now I just tested the buffer size and simplifying the computation of Left and Right samples. This greatly reduced the popping, so I am thinking the problem is related to my callback is taking too long to compute. That or SDL and Linux are not scheduling the audio callback as aggressively as they should. I will test on Windows with a lower end CPU (a different machine) and see if the problem presents itself there as well. If the problem lays in my computation taking too long, perhaps I will try compiling with different optimization levels or simplifying my audio callback. I am using doubles with division and multiplication (and the Sin function with some waveforms) quite a bit during my callback. Perhaps FPC generates less than ideal instructions to perform math on the double type. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at dommelstein.nl Thu May 16 22:34:05 2019 From: marc at dommelstein.nl (Marc Weustink) Date: Thu, 16 May 2019 22:34:05 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> Message-ID: AW: I will take you advice and write the samples out to a PCM wave file then examine them in audacity. Regarding the underflow, I always wipe the buffer with zeros before I play a note and the popping occurs sometimes when only one note is playing. That is when there is the least amount of processing, but you might be onto something. I am using the smallest buffer size of 512 samples and the threading system might not invoke my audio callback in time to fill the buffer before the sound should be playing. I will try to increase the buffer size which should relieve the race condition, but increasing the buffer size also increases the resolution where notes can be played making them less accurate. MW: 512 samples, thats about 10 msec @48k, thats pretty short. At work I work with streaming voice and we try to keep atleast 30ms of audio in the soundbuffers. And this is lowlevel winapi. I don’t know the overhead on Linux (it’s one of my todos) AW: And right now I just tested the buffer size and simplifying the computation of Left and Right samples. This greatly reduced the popping, so I am thinking the problem is related to my callback is taking too long to compute. That or SDL and Linux are not scheduling the audio callback as aggressively as they should. I will test on Windows with a lower end CPU (a different machine) and see if the problem presents itself there as well. MW: Maybe ofload the sample calculation in another thread. So you only have to feed the samples at the time ther are needed, while in the mean time you can continue to generate them AW: If the problem lays in my computation taking too long, perhaps I will try compiling with different optimization levels or simplifying my audio callback. I am using doubles with division and multiplication (and the Sin function with some waveforms) quite a bit during my callback. Perhaps FPC generates less than ideal instructions to perform math on the double type. Marc -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaa5500 at ya.ru Fri May 17 01:43:06 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Fri, 17 May 2019 02:43:06 +0300 Subject: [Lazarus] Grids micro issue Message-ID: procedure TCustomGrid.AutoAdjustColumns;   For i:=0 to ColCount do     AutoAdjustColumn(i); //must be ColCount-1 -- Regards, Alexey From fpc at pascalprogramming.org Fri May 17 11:14:11 2019 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Fri, 17 May 2019 11:14:11 +0200 Subject: [Lazarus] small cleanup utf8process Message-ID: <48e34f90-76c3-579f-13ef-a84707c729aa@pascalprogramming.org> When I redid TProcess for trunk, I saw some legacy FPC 2.6.x code in utf8process (OLDTProcess define), I assume that can be cleaned up?  It mostly has to do with old manual unicode processing instead of FPC 3.0.0 automatic. Does current trunk still support 2.6.4 ? From sysrpl at gmail.com Fri May 17 20:07:24 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Fri, 17 May 2019 14:07:24 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: <20190516203615.120A328AC5@server.lazarus-ide.org> References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> <20190516203615.120A328AC5@server.lazarus-ide.org> Message-ID: So progressing with the program I've added the ability to both play songs and record audio. Up to date source are in the github repository. But I still have audio clicks and the waveform looks fine in Audacity. Here are two links demonstrating the clicking or pops: View and sound from Audacity: https://cache.getlazarus.org/videos/sound-clicks.mp4 Pure wave file: https://cache.getlazarus.org/videos/sound-clicks.wav When I zoom up on the samples in Audacity really close they look fine. They are smooth with no sharp jumps, but I still hear the clicking when either playing the wave. I am at a loss. Help! By the way, I don't hear these pops or click on Windows. Can some of you try the wave file on your Windows computers and tell me if you hear the pops and clicks? If you feel like it can you look at the wave file in Audacity and isolate the samples causing the problem? I don't see any problems with the wave samples. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Fri May 17 20:52:35 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Fri, 17 May 2019 14:52:35 -0400 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> <20190516203615.120A328AC5@server.lazarus-ide.org> Message-ID: I think I isolated some wave samples that don't look smooth. I will try fix my code. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc at dommelstein.nl Sat May 18 11:59:46 2019 From: marc at dommelstein.nl (Marc Weustink) Date: Sat, 18 May 2019 11:59:46 +0200 Subject: [Lazarus] Update sound shop my next tutoring project In-Reply-To: References: <9dd92d56-5c93-4464-d09e-fb82edb66fb0@dommelstein.nl> <20190516203615.120A328AC5@server.lazarus-ide.org> Message-ID: Hi, You have still some (possible) clicks in your source. Have a look at its spectrogram: https://paste.pics/e2acc70acd050d843565b21e4fed82b1 Almost the same you see in the output: https://paste.pics/0b5b5d895fbab3729888df8f2500f374 When looking at the output waveform you see missing audio: https://paste.pics/a5259cfe447e4cd2a1fd559cc89d7360 Marc From: Anthony Walter Sent: vrijdag 17 mei 2019 20:08 To: Lazarus mailing list Cc: Marc Weustink Subject: Re: [Lazarus] Update sound shop my next tutoring project So progressing with the program I've added the ability to both play songs and record audio. Up to date source are in the github repository. But I still have audio clicks and the waveform looks fine in Audacity. Here are two links demonstrating the clicking or pops: View and sound from Audacity: https://cache.getlazarus.org/videos/sound-clicks.mp4 Pure wave file: https://cache.getlazarus.org/videos/sound-clicks.wav When I zoom up on the samples in Audacity really close they look fine. They are smooth with no sharp jumps, but I still hear the clicking when either playing the wave. I am at a loss. Help! By the way, I don't hear these pops or click on Windows. Can some of you try the wave file on your Windows computers and tell me if you hear the pops and clicks? If you feel like it can you look at the wave file in Audacity and isolate the samples causing the problem? I don't see any problems with the wave samples. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Sat May 18 22:25:17 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Sat, 18 May 2019 16:25:17 -0400 Subject: [Lazarus] Another update sound shop Message-ID: For those that have been following along I've posted another update to my sound shop program. Sound shop is a program to help kids learn programming where they can write functions and interact with them visually to novel and interesting results. Since the last update I added song file support, programmatic song creation and saving, audio file recording, sound and mapping sound samples to keys. I've also fixed the problems with sounds popping and clicking and added a few sample song files. Here is a brief overview of some of those changes: https://cache.getlazarus.org/videos/sound-shop-another-update.mp4 If you have any feedback, suggestions, or questions I am more than happy to answer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesusrmx at gmail.com Sun May 19 00:36:12 2019 From: jesusrmx at gmail.com (Jesus Reyes A.) Date: Sat, 18 May 2019 17:36:12 -0500 Subject: [Lazarus] Grids micro issue In-Reply-To: References: Message-ID: En Thu, 16 May 2019 18:43:06 -0500, AlexeyT via lazarus escribió: > procedure TCustomGrid.AutoAdjustColumns; > For i:=0 to ColCount do > AutoAdjustColumn(i); > > //must be ColCount-1 Fixed in r61242. Thanks. Jesus Reyes A. From fpc at pascalprogramming.org Sun May 19 17:18:51 2019 From: fpc at pascalprogramming.org (Marco van de Voort) Date: Sun, 19 May 2019 17:18:51 +0200 Subject: [Lazarus] CHM doc snapshot (FPC 3.2, Lazarus trunk branches) Message-ID: Hello, I worked a bit on the chm package, and as a test I regenerated the CHMs as a test. So why not release for alpha testing? This contains both FPC 3.2 branch and Lazarus trunk (lcl,lazutils)  CHMs, interlinked. Please test, and let me know any anomalies. http://www.stack.nl/~marcov/doc-chm3.2.0alpha.zip (24MB) Greetings Marco P.s. the patch is not committed yet, needs some cleaning From werner.pamler at freenet.de Sun May 19 18:20:12 2019 From: werner.pamler at freenet.de (Werner Pamler) Date: Sun, 19 May 2019 18:20:12 +0200 Subject: [Lazarus] Displaying additional chm help files in the IDE for other packages Message-ID: <82fe21ec-4c01-caf2-ddda-be0474cc488a@freenet.de> Motivated by Don Siders' updates to lcl xml help files I began to add to the help files for TAChart, too. The new hints do show up in the code editor, and now I am able also to build the chm file from the xml files using fpdoc. But I cannot convince the IDE to display the help files when F1 (or Ctrl+F1 in classic keyboard mode) is pressed. I thought I'd have to register the new help file somehow in "Tools" > "Options" > "Help Options" > "Databases", but there's nothing to add a new package. Any help would be appreciated. From bo.berglund at gmail.com Sun May 19 22:13:22 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 19 May 2019 22:13:22 +0200 Subject: [Lazarus] Hints not working - what is wrong? Message-ID: 32 bit Lazarus 2.0.0, Fpc 3.0.4 on Windows 7 x64 I have tried in vain to make hints show up in the GUI of my application. I have set the hint strings for TButton, TBitBtn and TSpeedButton items via Object Inspector in the Lazarus IDE but nothing displays when I hover the mouse ove these items when running the program. What am I missing? Do I need to set some project property to make them appear? In Delphi simply entering the strings used to cause them to appear in runtime when the mouse hovers over the controls.... -- Bo Berglund Developer in Sweden From bartjunk64 at gmail.com Sun May 19 22:36:25 2019 From: bartjunk64 at gmail.com (Bart) Date: Sun, 19 May 2019 22:36:25 +0200 Subject: [Lazarus] Hints not working - what is wrong? In-Reply-To: References: Message-ID: On Sun, May 19, 2019 at 10:13 PM Bo Berglund via lazarus wrote: > Do I need to set some project property to make them appear? Set ShowHint to True? -- Bart From bo.berglund at gmail.com Sun May 19 23:04:31 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 19 May 2019 23:04:31 +0200 Subject: [Lazarus] Hints not working - what is wrong? References: Message-ID: On Sun, 19 May 2019 22:36:25 +0200, Bart via lazarus wrote: >On Sun, May 19, 2019 at 10:13 PM Bo Berglund via lazarus > wrote: > >> Do I need to set some project property to make them appear? > >Set ShowHint to True? Thanks, I found it as a property of the form on which the buttons are placed. So not a project option. Now working! -- Bo Berglund Developer in Sweden From zikon770 at gmail.com Mon May 20 10:09:33 2019 From: zikon770 at gmail.com (Tom Lisjac) Date: Mon, 20 May 2019 08:09:33 +0000 Subject: [Lazarus] Jedi Code Formatter (JCF) issues In-Reply-To: References: Message-ID: Waking up an old thread as I'm also having trouble getting some basic formatting options to work with JCF in 2.0.2. I want the code to look like the following, which the fpc tools ptop formatter does by default: if something then begin statement; statement end But no matter what combination of settings I try, JCF insists on doing either this: if something then begin statement; statement end or this: if something then begin statement; statement end I'd like to get this working out of the ide rather then having to break out to run ptop from the command line. Any suggestions would be greatly appreciated. Thanks, -Tom On Tue, Feb 28, 2017 at 11:45 AM Graeme Geldenhuys via Lazarus < lazarus at lists.lazarus-ide.org> wrote: > Hi, > > Is there an actual JCF (included with Lazarus) maintainer? I've recently > been using it quite a bit and noticed a couple of problems. I'll > obviously try and fix them myself (free time is very limited, but I'll > try my best). > > The two most important ones for me: > > * Some code formatting is not applied (ignored) based on configuration > settings. > * Some configuration changes are not persisted, so user defined options > can't actually be applied in the code formatting. > > Regards, > Graeme > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > My public PGP key: http://tinyurl.com/graeme-pgp > -- > _______________________________________________ > Lazarus mailing list > Lazarus at lists.lazarus-ide.org > http://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zikon770 at gmail.com Mon May 20 10:09:33 2019 From: zikon770 at gmail.com (Tom Lisjac) Date: Mon, 20 May 2019 08:09:33 +0000 Subject: [Lazarus] Jedi Code Formatter (JCF) issues In-Reply-To: References: Message-ID: Waking up an old thread as I'm also having trouble getting some basic formatting options to work with JCF in 2.0.2. I want the code to look like the following, which the fpc tools ptop formatter does by default: if something then begin statement; statement end But no matter what combination of settings I try, JCF insists on doing either this: if something then begin statement; statement end or this: if something then begin statement; statement end I'd like to get this working out of the ide rather then having to break out to run ptop from the command line. Any suggestions would be greatly appreciated. Thanks, -Tom On Tue, Feb 28, 2017 at 11:45 AM Graeme Geldenhuys via Lazarus < lazarus at lists.lazarus-ide.org> wrote: > Hi, > > Is there an actual JCF (included with Lazarus) maintainer? I've recently > been using it quite a bit and noticed a couple of problems. I'll > obviously try and fix them myself (free time is very limited, but I'll > try my best). > > The two most important ones for me: > > * Some code formatting is not applied (ignored) based on configuration > settings. > * Some configuration changes are not persisted, so user defined options > can't actually be applied in the code formatting. > > Regards, > Graeme > > -- > fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal > http://fpgui.sourceforge.net/ > > My public PGP key: http://tinyurl.com/graeme-pgp > -- > _______________________________________________ > Lazarus mailing list > Lazarus at lists.lazarus-ide.org > http://lists.lazarus-ide.org/listinfo/lazarus > -------------- next part -------------- An HTML attachment was scrubbed... URL: From serbod at gmail.com Mon May 20 10:10:49 2019 From: serbod at gmail.com (Sergey Bodrov) Date: Mon, 20 May 2019 11:10:49 +0300 Subject: [Lazarus] Displaying additional chm help files in the IDE for other packages In-Reply-To: <82fe21ec-4c01-caf2-ddda-be0474cc488a@freenet.de> References: <82fe21ec-4c01-caf2-ddda-be0474cc488a@freenet.de> Message-ID: It's hardcoded in: lazarus/ide/idehelpmanager.pas procedure TIDEHelpManager.RegisterIDEHelpDatabases; вс, 19 мая 2019 г. в 19:23, Werner Pamler via lazarus < lazarus at lists.lazarus-ide.org>: > Motivated by Don Siders' updates to lcl xml help files I began to add to > the help files for TAChart, too. The new hints do show up in the code > editor, and now I am able also to build the chm file from the xml files > using fpdoc. But I cannot convince the IDE to display the help files > when F1 (or Ctrl+F1 in classic keyboard mode) is pressed. I thought I'd > have to register the new help file somehow in "Tools" > "Options" > > "Help Options" > "Databases", but there's nothing to add a new package. > > Any help would be appreciated. > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus > -- *Bodrov Sergey* software development, IT consulting http://www.serbod.com *Phone (Belarus):* +375(25)794-21-58 *Skype:* sergey.bodrov1 *e-mail:* serbod at gmail.com, oxotnuk at yandex.ru -------------- next part -------------- An HTML attachment was scrubbed... URL: From sysrpl at gmail.com Tue May 21 02:15:42 2019 From: sysrpl at gmail.com (Anthony Walter) Date: Mon, 20 May 2019 20:15:42 -0400 Subject: [Lazarus] Another update sound shop In-Reply-To: References: Message-ID: Update I added a piano roll control and a note designer to allow notes to be created and edited on the roll: http://cache.getlazarus.org/videos/player-piano.mp4 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aaa5500 at ya.ru Sat May 25 13:49:09 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Sat, 25 May 2019 14:49:09 +0300 Subject: [Lazarus] Patch for TreeFontTyle AVLTree Message-ID: <760132ab-8925-535a-9f7d-0d8d2529f396@ya.ru> https://github.com/graemeg/lazarus/commit/34d02cea12df535b67cb07f45d02e2b06134dc66 better this (Result can be any int!) begin   Result:= TFreeTypeGlyph(Item1).Index - TFreeTypeGlyph(Item2).Index; end; -- Regards, Alexey -------------- next part -------------- An HTML attachment was scrubbed... URL: From bo.berglund at gmail.com Sun May 26 08:29:35 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 26 May 2019 08:29:35 +0200 Subject: [Lazarus] Compile time varies dependiong on usage, why? Message-ID: Lazarus 2.0.0 / FPC 3.0.4 (both 32 bit) on Windows 7-x64 When I am working on my project and for example make a small change like moving a few controls on the form, then build the executable (Run/Compile) the time taken to complete varies a LOT as follows: 1) I have not done anything inside Lazarus for a number of hours, say overnight, but the IDE has been running all the time. Then after I move the controls it takes a rather long time to compile the exe file. 2) I am active in Lazarus for example some minutes after the situation above (move the controls a bit more), then the compile is a LOT faster and only takes a few seconds. What causes this behaviour? Is there some "user activity timeout" built into Lazarus that puts it into a sleep mode regarding compiles or what? The IDE itself works normally. Not a big issue but irritating nevertheless. At first I thought that it was caused by my hard drive going to sleep, but I have an application that writes a file on the disk drive every 10 seconds to keep it from sleeping (Windows 7 otherwise stops it from running) and this is displaying the write time. So I checked it before testing today. No problems there, the drive write time is displayed as 0 ms in that app.... -- Bo Berglund Developer in Sweden From nc-gaertnma at netcologne.de Sun May 26 08:44:21 2019 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 26 May 2019 08:44:21 +0200 Subject: [Lazarus] Compile time varies dependiong on usage, why? In-Reply-To: References: Message-ID: <20190526084421.014319c1@limapholos.matflo.wg> On Sun, 26 May 2019 08:29:35 +0200 Bo Berglund via lazarus wrote: > Lazarus 2.0.0 / FPC 3.0.4 (both 32 bit) on Windows 7-x64 > > When I am working on my project and for example make a small change > like moving a few controls on the form, then build the executable > (Run/Compile) the time taken to complete varies a LOT as follows: > > 1) I have not done anything inside Lazarus for a number of hours, say > overnight, but the IDE has been running all the time. Then after I > move the controls it takes a rather long time to compile the exe file. > > 2) I am active in Lazarus for example some minutes after the situation > above (move the controls a bit more), then the compile is a LOT faster > and only takes a few seconds. > > What causes this behaviour? Probably your OS file cache. For example antivirus and Windows update scans. Or you used some other programs. >[...] Mattias From michael at freepascal.org Sun May 26 08:54:23 2019 From: michael at freepascal.org (Michael Van Canneyt) Date: Sun, 26 May 2019 08:54:23 +0200 (CEST) Subject: [Lazarus] Compile time varies dependiong on usage, why? In-Reply-To: References: Message-ID: On Sun, 26 May 2019, Bo Berglund via lazarus wrote: > Lazarus 2.0.0 / FPC 3.0.4 (both 32 bit) on Windows 7-x64 > > When I am working on my project and for example make a small change > like moving a few controls on the form, then build the executable > (Run/Compile) the time taken to complete varies a LOT as follows: > > 1) I have not done anything inside Lazarus for a number of hours, say > overnight, but the IDE has been running all the time. Then after I > move the controls it takes a rather long time to compile the exe file. > > 2) I am active in Lazarus for example some minutes after the situation > above (move the controls a bit more), then the compile is a LOT faster > and only takes a few seconds. > > What causes this behaviour? Is there some "user activity timeout" > built into Lazarus that puts it into a sleep mode regarding compiles > or what? The IDE itself works normally. > > Not a big issue but irritating nevertheless. Just a guess: The IDE invokes the compiler as a separate process, so as far as the IDE is concerned, every compile is a 'fresh' compile. So it looks like you're simply observing the effects of the Windows filesystem cache. If you compile regularly, the filesystem cache is filled with files that the compiler needs and compiling goes fast. If you do nothing for a long time the OS starts slowly putting other files in the cache, and when you compile it must actually go and fetch the files from disk, which takes more time. Your write program will not notice such things, but it would notice such things if it opened randomly a lot of files. There may be other factors involved (maybe lazarus decides to recompile the LCL or other packages, altough it would really surprise me to hear that) , but I think the above is the most likely. Michael. From luca at ventoso.org Sun May 26 10:09:29 2019 From: luca at ventoso.org (Luca Olivetti) Date: Sun, 26 May 2019 10:09:29 +0200 Subject: [Lazarus] Compile time varies dependiong on usage, why? In-Reply-To: References: Message-ID: El 26/5/19 a les 8:54, Michael Van Canneyt via lazarus ha escrit: > There may be other factors involved (maybe lazarus decides to recompile the > LCL or other packages, altough it would really surprise me to hear that) > , but I think the above is the most likely. > Unrelated, but it does that quite a lot here: In "Addition and overrides" I added the build mode in the output directory. That shouldn't be a problem, but I have some projects with "default" and some other with "Default" (the default, no pun intended, changed for new projects some time ago) and that triggers a recompile (even under windows). There are other cases when I see the lcl and other packages recompiled when they shouldn't, but I didn't pinpoint the cause (it doesn't worry me that much). Bye -- Luca From nc-gaertnma at netcologne.de Sun May 26 10:23:40 2019 From: nc-gaertnma at netcologne.de (Mattias Gaertner) Date: Sun, 26 May 2019 10:23:40 +0200 Subject: [Lazarus] Compile time varies dependiong on usage, why? In-Reply-To: References: Message-ID: <20190526102340.720e7088@limapholos.matflo.wg> On Sun, 26 May 2019 10:09:29 +0200 Luca Olivetti via lazarus wrote: >[...]There are other cases when I see the lcl and other packages > recompiled when they shouldn't, but I didn't pinpoint the cause (it > doesn't worry me that much). You can see the reason for recompile in the pop menu of the message "About ..." Mattias From bo.berglund at gmail.com Sun May 26 14:47:41 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Sun, 26 May 2019 14:47:41 +0200 Subject: [Lazarus] Compile time varies dependiong on usage, why? References: Message-ID: On Sun, 26 May 2019 08:54:23 +0200 (CEST), Michael Van Canneyt via lazarus wrote: >So it looks like you're simply observing the effects of the Windows filesystem >cache. If you compile regularly, the filesystem cache is filled with files >that the compiler needs and compiling goes fast. If you do nothing for a >long time the OS starts slowly putting other files in the cache, and when >you compile it must actually go and fetch the files from disk, which takes >more time. Seems like this is the likely cause... My project is a video player tool and I use it at times to go over a number of video files (large files) then I go back to Lazarus and change things to improve the tool, compile and then I try my new additions/changes for a while (not via Lazarus debug even though the Lazarus IDE remains running). So if the cache concerns the files I work on then most likely the videos will replace the other files in the OS cache... Note to clarify: I have two disks on my system, one a 512 GB SSD system disk (houses Windows C:) and one a 2TB SATA mechanical drive (D:) housing all of my work files. I install programs (like Lazarus) on C: but try to keep all work files on the D: drive. Obviously the C: drive access is MUCH faster since it is an SSD, so program loads etc should be very quick. -- Bo Berglund Developer in Sweden From dec12 at avidsoft.com.hk Mon May 27 06:43:48 2019 From: dec12 at avidsoft.com.hk (Dennis) Date: Mon, 27 May 2019 12:43:48 +0800 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? Message-ID: I am hoping one that supports different column types editing without much coding on my side. thanks in advance. Dennis -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmlandmesser at gmx.de Mon May 27 11:02:10 2019 From: jmlandmesser at gmx.de (John Landmesser) Date: Mon, 27 May 2019 11:02:10 +0200 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: References: Message-ID: <0229cc65-9c7f-145e-c055-2087d35e2a00@gmx.de> perhaps TSortGrid from Online Package Manager that handles String, Float, Integer as you would expect?! Am 27.05.19 um 06:43 schrieb Dennis via lazarus: > I am hoping one that supports different column types editing without > much coding on my side. > thanks in advance. > > Dennis > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmlandmesser at gmx.de Mon May 27 11:21:52 2019 From: jmlandmesser at gmx.de (John Landmesser) Date: Mon, 27 May 2019 11:21:52 +0200 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: <0229cc65-9c7f-145e-c055-2087d35e2a00@gmx.de> References: <0229cc65-9c7f-145e-c055-2087d35e2a00@gmx.de> Message-ID: <6aef5ad6-99a8-6fcf-6c45-ea9f37964cbc@gmx.de> See attached demo that works without installing TSortGrid. m 27.05.19 um 11:02 schrieb John Landmesser via lazarus: > perhaps TSortGrid from Online Package Manager that handles String, > Float, Integer as you would expect?! > > Am 27.05.19 um 06:43 schrieb Dennis via lazarus: >> I am hoping one that supports different column types editing without >> much coding on my side. >> thanks in advance. >> >> Dennis >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Demo.zip Type: application/zip Size: 66062 bytes Desc: not available URL: From werner.pamler at freenet.de Mon May 27 12:00:11 2019 From: werner.pamler at freenet.de (Werner Pamler) Date: Mon, 27 May 2019 12:00:11 +0200 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: References: Message-ID: <0ac95410-b761-ee22-0a39-171ad8ff202b@freenet.de> Am 27.05.2019 um 06:43 schrieb Dennis via lazarus: > I am hoping one that supports different column types editing without > much coding on my side. That's what the standard TStringGrid can do.  Just use Columns. You can pick an editor in the ButtonStyle property. In case of the picklist editor specify the combobox items in property PickList; in case of the checkbox column specify the value assigned to the checked and unchecked state in properties ValueChecked and ValueUnChecked. Of course, these editor types require the grid to be in edit mode (i.e. goEditing in Options). -------------- next part -------------- An HTML attachment was scrubbed... URL: From luca at ventoso.org Mon May 27 12:51:47 2019 From: luca at ventoso.org (Luca Olivetti) Date: Mon, 27 May 2019 12:51:47 +0200 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: <0ac95410-b761-ee22-0a39-171ad8ff202b@freenet.de> References: <0ac95410-b761-ee22-0a39-171ad8ff202b@freenet.de> Message-ID: <47f882a8-69d0-f462-8ab1-87e16a1f4ef2@ventoso.org> El 27/5/19 a les 12:00, Werner Pamler via lazarus ha escrit: > Am 27.05.2019 um 06:43 schrieb Dennis via lazarus: >> I am hoping one that supports different column types editing without >> much coding on my side. > That's what the standard TStringGrid can do.  Just use Columns. You can > pick an editor in the ButtonStyle property. In case of the picklist > editor specify the combobox items in property PickList; in case of the > checkbox column specify the value assigned to the checked and unchecked > state in properties ValueChecked and ValueUnChecked. Of course, these > editor types require the grid to be in edit mode (i.e. goEditing in > Options). And if that's not enough you can implement a custom editor (though that needs some extra coding) http://wiki.freepascal.org/Grids_Reference_Page#Grid_Cell_Editors http://www.freepascal.org/~michael/articles/grids/grids.pdf Bye -- Luca From dec12 at avidsoft.com.hk Mon May 27 17:07:49 2019 From: dec12 at avidsoft.com.hk (Dennis) Date: Mon, 27 May 2019 23:07:49 +0800 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: <6aef5ad6-99a8-6fcf-6c45-ea9f37964cbc@gmx.de> References: <0229cc65-9c7f-145e-c055-2087d35e2a00@gmx.de> <6aef5ad6-99a8-6fcf-6c45-ea9f37964cbc@gmx.de> Message-ID: <5a9c1bf1-a145-dd09-1011-f14e149bde53@avidsoft.com.hk> John Landmesser via lazarus wrote: > See attached demo that works without installing TSortGrid. > >  I opened your zip and Lazarus complained that Laz_SortGrid is missing. After I used Online Package Manager ot install SortGrid, it complained the Sortgrid.pas file is missing Dennis From bo.berglund at gmail.com Mon May 27 17:49:31 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 27 May 2019 17:49:31 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? Message-ID: I started out on a project using Lazarus/Fpc 32 bit (2.0.0/3.0.4) and now I want to switch to the 64 bit version of Lazarus/Fpc. I have installed both 32 and 64 bit versions using the downloadable installers so they are separate programs in their separate folder trees. I thought that I could start Lazarus 64 bit and then open the 32 bit project and save it as a 64 bit project afterwards, but that failed completely... Turns out I have to also install some dependencies that the project uses. Most important is the PasLibVlc library... Since Lazarus can compile across platforms, can it also be directed to compile on the *same* platform (Windows) but using different bit versions (32 bit and 64 bit)? Since I have both installed on my laptop it would be nice to be able to manage both 32 and 64 bit versions from the same environment, if possible. But how should I go about telling my Lazarus 32 bit about the 64 bit compiler already installed (it is the same version)? And how do I differentiate between the different target executables when building? Can Lazarus be told to build both at the same time? -- Bo Berglund Developer in Sweden From bo.berglund at gmail.com Mon May 27 23:35:32 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Mon, 27 May 2019 23:35:32 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? References: Message-ID: On Mon, 27 May 2019 17:49:31 +0200, Bo Berglund via lazarus wrote: >Since I have both installed on my laptop it would be nice to be able >to manage both 32 and 64 bit versions from the same environment, if >possible. I found the following method: Build modes can be used to handle this. I have enabled build modes Win32 and Win64 and set these to different executable output names. I also modified the target OS and CPU family correspondingly. Still it is a manual operation to select the correct build mode depending on which IDE I have opened. Is there some way to automatically select build mode depending on the version of the IDE (32 or 64 bit on Windows)? In the 64 bit IDE I can now build both 32 and 64 bit executables just by switching the build mode. But if I use Lazarus 32 bit then it it works fine to build the 32 bit version but complains when I try to build the 64 bit version: "Compiler: C:\Programs\lazarus_2.0\fpc\3.0.4\bin\i386-...\fpc.exe does not support target x86_64-win64" It seems like the 64 bit fpc compiler can handle both targets but the 32 bit one not.... Is this solvable? OTH, if the 64 bit Lazarus can handle both 32 and 64 bit Windows, why bother with the 32 bit Lazarus? -- Bo Berglund Developer in Sweden From pch at ap-i.net Tue May 28 09:13:36 2019 From: pch at ap-i.net (Patrick Chevalley) Date: Tue, 28 May 2019 07:13:36 +0000 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? In-Reply-To: References: Message-ID: <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> This is easy to do that, you only need one Lazarus, the 64bit version and the cross-i386 fpc compiler, you can remove Lazarus 32. The only point to be careful is the default target for a new project will be Win64 and you have to add a Win32 build mode to all your projects. But the default target is saved with the project so this is a one time setup. And to not overlap 32 and 64 build files you must be sure the Output directory path contain $(TargetCPU). The files to install are lazarus-2.0.2-fpc-3.0.4-win64 first, then lazarus-2.0.2-fpc-3.0.4-cross-i386-win32-win64, both available from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.2/ Patrick From bo.berglund at gmail.com Tue May 28 10:40:28 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 28 May 2019 10:40:28 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? References: <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> Message-ID: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> On Tue, 28 May 2019 07:13:36 +0000, Patrick Chevalley via lazarus wrote: >This is easy to do that, you only need one Lazarus, the 64bit version and the cross-i386 fpc compiler, you can remove Lazarus 32. >The only point to be careful is the default target for a new project will be Win64 and you have to add a Win32 build mode to all your projects. But the default target is saved with the project so this is a one time setup. >And to not overlap 32 and 64 build files you must be sure the Output directory path contain $(TargetCPU). > >The files to install are lazarus-2.0.2-fpc-3.0.4-win64 first, then lazarus-2.0.2-fpc-3.0.4-cross-i386-win32-win64, both available from https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.2/ > >Patrick Thanks for the description! Right now I have the following installed in my Win7 x64 environment: Lazarus 1.6 Lazarus 1.8 Lazarus 1.8.4 32 bit Lazarus 2.0.0 32 bit Lazarus 2.0.0 64 bit All of these have internbal fpc directories containing the correspondiing fpc compiler files. Do you recommend uninstalling ALL of these and instead get and install Lazarus 2.0.2 as described above? What happens with the project history of the removed versions? Is there some file I can save to keep that available? -- Bo Berglund Developer in Sweden From pch at ap-i.net Tue May 28 11:13:32 2019 From: pch at ap-i.net (Patrick Chevalley) Date: Tue, 28 May 2019 09:13:32 +0000 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? In-Reply-To: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> References: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> Message-ID: <4cd0abc2f86ef66b87194898bc584d92@ap-i.net> I don't know your workflow and why you keep the old version of Lazarus? for maintenance of older version of your applications? In this case do not remove them but install the 2.0.2 Lazarus and cross-compiler in a new Lazarus 2.0.2 directory then create a new config for 2.0.2 as usual. Patrick From jmlandmesser at gmx.de Tue May 28 11:56:35 2019 From: jmlandmesser at gmx.de (John Landmesser) Date: Tue, 28 May 2019 11:56:35 +0200 Subject: [Lazarus] is there a free Grid component better than the default TStringGrid? In-Reply-To: <5a9c1bf1-a145-dd09-1011-f14e149bde53@avidsoft.com.hk> References: <0229cc65-9c7f-145e-c055-2087d35e2a00@gmx.de> <6aef5ad6-99a8-6fcf-6c45-ea9f37964cbc@gmx.de> <5a9c1bf1-a145-dd09-1011-f14e149bde53@avidsoft.com.hk> Message-ID: <3dfb9167-c088-cc5d-b435-d9a3ea9eaeaa@gmx.de> Yes, sorry in ProjectIInspector there is a dependency that should have been removed by me: second possibility ignore the warning and compile: works here! m 27.05.19 um 17:07 schrieb Dennis via lazarus: > > > John Landmesser via lazarus wrote: >> See attached demo that works without installing TSortGrid. >> >> >  I opened your zip and Lazarus complained that Laz_SortGrid is missing. > After I used Online Package Manager ot install SortGrid, it complained > the Sortgrid.pas file is missing > > Dennis -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: oajdlbjodggjialf.png Type: image/png Size: 40082 bytes Desc: not available URL: From bo.berglund at gmail.com Tue May 28 11:59:34 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 28 May 2019 11:59:34 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? References: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> <4cd0abc2f86ef66b87194898bc584d92@ap-i.net> Message-ID: On Tue, 28 May 2019 09:13:32 +0000, Patrick Chevalley via lazarus wrote: >I don't know your workflow and why you keep the old version of Lazarus? >for maintenance of older version of your applications? Not really, I tend to instal the latest version now and then and so I build up a library of older versions, which I don't use anymore... So I will remove them shortly, but first install 2.0.2 as you suggested. > >In this case do not remove them but install the 2.0.2 Lazarus and cross-compiler >in a new Lazarus 2.0.2 directory then create a new config for 2.0.2 as usual. > Is there a cross-compiler which allows building the programs for Linux too (Linux running on the same CPU)? Maybe also for Linux on ARM (Raspberry Pi)? Currently I install Lazarus/FPC on the linux machines and then I use Subversion to get the sources over to Linux and build there. It would be more convenient to be able to build the tools in my main environment and use on Linux by moving the binary over. -- Bo Berglund Developer in Sweden From werner.pamler at freenet.de Tue May 28 12:07:10 2019 From: werner.pamler at freenet.de (Werner Pamler) Date: Tue, 28 May 2019 12:07:10 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? In-Reply-To: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> References: <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> Message-ID: <5de2fb78-f21f-015e-1ebe-34467a83086d@freenet.de> Am 28.05.2019 um 10:40 schrieb Bo Berglund via lazarus: > Right now I have the following installed in my Win7 x64 environment: > Lazarus 1.6 > Lazarus 1.8 > Lazarus 1.8.4 32 bit > Lazarus 2.0.0 32 bit > Lazarus 2.0.0 64 bit > > All of these have internbal fpc directories containing the > correspondiing fpc compiler files. The same with me (plus some more, in particular trunk installations for Lazarus and fpc). This is indispensable for testing when your code should not be tied to the newest IDE version. Normally, it is no problem to switch between different versions. But be aware: When loading an project in a new version may change the project in a way that it is not readable by the old version again. Laz 2.0, for example, can add the line "Application.Scaled" to the project unit when you use the High-dpi features - this is a problem for 1.6. (You may enclose the line by an $IFDEF which helps for some time, but after some changes the IDE is very persistent and adds the line again). Or Lazarus trunk introduces a new file structure, you must save every new project with checed "Maximize compatibility of project files" in "Project options" > "Miscellaneous"; otherwise the project will have no files in Laz 2.0.2 or older. From pch at ap-i.net Tue May 28 13:03:36 2019 From: pch at ap-i.net (Patrick Chevalley) Date: Tue, 28 May 2019 11:03:36 +0000 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? In-Reply-To: References: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> <4cd0abc2f86ef66b87194898bc584d92@ap-i.net> Message-ID: It is probably possible to cross compile from Windows to Linux (Gtk2) but this is difficult to setup because you need to copy a lot a Linux library to your Windows system. I don't know if Fpcupdeluxe can help with that? The other way is much more easy because the win32 LCL do not expect the Windows DLL to be there for linking. So compiling for Win32 or Win64 from Linux is just a matter of changing the target in the build mode. Patrick From bo.berglund at gmail.com Tue May 28 13:20:50 2019 From: bo.berglund at gmail.com (Bo Berglund) Date: Tue, 28 May 2019 13:20:50 +0200 Subject: [Lazarus] How to switch a project from 32 to 64 bit (on Windows 7 x64)? References: <7ospeehlnao24hnukfvn6ap78asve54jbo@4ax.com> <71ab0a35b0cd1d16eae829c7480b6c32@ap-i.net> <4cd0abc2f86ef66b87194898bc584d92@ap-i.net> Message-ID: <486qeed6g3r89qv7091a66n82gd5qudrlu@4ax.com> On Tue, 28 May 2019 11:03:36 +0000, Patrick Chevalley via lazarus wrote: >It is probably possible to cross compile from Windows to Linux (Gtk2) but this is difficult to setup because you need to copy a lot a Linux library to your Windows system. >I don't know if Fpcupdeluxe can help with that? > >The other way is much more easy because the win32 LCL do not expect the Windows DLL to be there for linking. So compiling for Win32 or Win64 from Linux is just a matter of changing the target in the build mode. OK, I see... Meanwhile I have installed 2.0.2 as you suggested with the cross-compiler and used OPM to get Indy installed and then manually installed the PasLibVlc package. Next I opened the old project and built the two targets WIn 32 and 64 and it all went well! So I will start uninstalling the old versions now (freeing up 6+ GB of disk), and I also found Lazarus 1.4 in my disk... -- Bo Berglund Developer in Sweden From aaa5500 at ya.ru Wed May 29 23:10:13 2019 From: aaa5500 at ya.ru (AlexeyT) Date: Thu, 30 May 2019 00:10:13 +0300 Subject: [Lazarus] Win32 TPenStyle psDot is ugly Message-ID: <52c60be3-e91a-9a3e-dabf-a16182016449@ya.ru> According to MS docs, psDot style must give nice looking 1 pixel dots. https://docs.microsoft.com/en-us/windows/desktop/gdi/pen-style Lazarus creates pen via Widgetset's ExtCreatePen which calls Win32 ExtCreatePen. reality: If I set psDot to StringGrid.GridLineStyle, I get ugly dots: each of about 3 pixels fragments. psDash is ugly too: dashes are very long. Why? -- Regards, Alexey From luca at ventoso.org Thu May 30 12:07:19 2019 From: luca at ventoso.org (Luca Olivetti) Date: Thu, 30 May 2019 12:07:19 +0200 Subject: [Lazarus] Lazarus 2.0.2 can no longer rename procedures/methods? Message-ID: <83ec9ef9-ec37-fca9-7108-b528a2244d24@ventoso.org> As per the subject, right clicking on a procedure/method, the "refactoring->rename identifier" item is greyed out. It was available in 1.8.x. Is there some setting to re-enable it? Bye -- Luca From luca at wetron.es Thu May 30 12:08:52 2019 From: luca at wetron.es (Luca Olivetti) Date: Thu, 30 May 2019 12:08:52 +0200 Subject: [Lazarus] Lazarus 2.0.2 can no longer rename procedures/methods? In-Reply-To: <83ec9ef9-ec37-fca9-7108-b528a2244d24@ventoso.org> References: <83ec9ef9-ec37-fca9-7108-b528a2244d24@ventoso.org> Message-ID: <6f705197-a157-fafc-b9c1-9b13a7212121@wetron.es> El 30/5/19 a les 12:07, Luca Olivetti via lazarus ha escrit: > As per the subject, right clicking on a procedure/method, the > "refactoring->rename identifier" item is greyed out. > It was available in 1.8.x. > Is there some setting to re-enable it? Mmh, in spite of it being greyed out, F2 works. Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007 From mailinglists at geldenhuys.co.uk Thu May 30 13:25:47 2019 From: mailinglists at geldenhuys.co.uk (Graeme Geldenhuys) Date: Thu, 30 May 2019 12:25:47 +0100 Subject: [Lazarus] tiOPF is looking for a new project maintainer Message-ID: <4c7ecb02-0c37-eeef-450a-a159c42ea954@geldenhuys.co.uk> Hello everybody, I have really enjoyed working with tiOPF for 15+ years and have written tons of database and non-database applications that used tiOPF. It was also the project that introduced me to Design Patterns and Test Driven Development, and I'll forever be grateful for that. However, due to the decline in Delphi/Object Pascal popularity for paid work (at least here in the UK), I've moved full time to another programming language. With that, I feel it is time to hand over the reins to someone else that still uses Delphi/Object Pascal on a daily basis. So if you feel up to the challenge and don't want to see a great project become abandon-ware, please let me know. I'll keep running the support newsgroup - I have no intention in stopping that. I'll also continue running the daily/hourly unit tests for tiOPF as it is fully automated anyway. I'll also still be around to answer questions, but will be moving away from maintenance and new development work for tiOPF and tiOPF related utility applications. So if you have any interest in keeping tiOPF alive, please contact me here or in private. ps: If I've done it correctly, all replies should go to the fpc-other mailing list. Regards, - Graeme - -- My public PGP key: http://tinyurl.com/graeme-pgp From Special at Joepgen.com Thu May 30 15:26:10 2019 From: Special at Joepgen.com (Joe) Date: Thu, 30 May 2019 15:26:10 +0200 Subject: [Lazarus] tiOPF is looking for a new project maintainer In-Reply-To: <4c7ecb02-0c37-eeef-450a-a159c42ea954@geldenhuys.co.uk> References: <4c7ecb02-0c37-eeef-450a-a159c42ea954@geldenhuys.co.uk> Message-ID: Am 30.05.2019 um 13:25 schrieb Graeme Geldenhuys via lazarus: > Hello everybody, > > I have really enjoyed working with tiOPF for 15+ years and have written > tons of database and non-database applications that used tiOPF. It was > also the project that introduced me to Design Patterns and Test Driven > Development, and I'll forever be grateful for that. > > However, due to the decline in Delphi/Object Pascal popularity for paid > work (at least here in the UK), I've moved full time to another > programming language. With that, I feel it is time to hand over the > reins to someone else that still uses Delphi/Object Pascal on a daily > basis. So if you feel up to the challenge and don't want to see a great > project become abandon-ware, please let me know. > > I'll keep running the support newsgroup - I have no intention in > stopping that. I'll also continue running the daily/hourly unit tests > for tiOPF as it is fully automated anyway. I'll also still be around to > answer questions, but will be moving away from maintenance and new > development work for tiOPF and tiOPF related utility applications. > > So if you have any interest in keeping tiOPF alive, please contact me > here or in private. > > > ps: > If I've done it correctly, all replies should go to the fpc-other > mailing list. > > > Regards, > - Graeme - > Graeme, what's the programming language you have moved to? Good luck and best wishes for this new episode in your career. Regards, Hans-Georg Joepgen From nigel.lightfoot at gmail.com Fri May 31 15:39:55 2019 From: nigel.lightfoot at gmail.com (Nigel Lightfoot) Date: Fri, 31 May 2019 14:39:55 +0100 Subject: [Lazarus] Win32 TPenStyle psDot is ugly In-Reply-To: <52c60be3-e91a-9a3e-dabf-a16182016449@ya.ru> References: <52c60be3-e91a-9a3e-dabf-a16182016449@ya.ru> Message-ID: <0B0A1CF5-CD4E-4CEE-B2CA-5B163F11A941@gmail.com> Line styles are dependent on the ‘Cosmetic’ and ‘EndCap’ settings. For Cosmetic pens with 1-pixel wide lines the dots are elongated. For wider lines it is possible to get round dots by using the ‘pecRound’ cap style. If you want to get 1 pixel dots followed by 1 pixel spaces then this works for dotted Geometric (Cosmetic = false) pen but only looks OK for horizontal and vertical lines. Guess this is good for grid cell borders. Regard, Nigel > On 29 May 2019, at 22:10, AlexeyT via lazarus wrote: > > According to MS docs, psDot style must give nice looking 1 pixel dots. https://docs.microsoft.com/en-us/windows/desktop/gdi/pen-style > > Lazarus creates pen via Widgetset's ExtCreatePen which calls Win32 ExtCreatePen. > > reality: If I set psDot to StringGrid.GridLineStyle, I get ugly dots: each of about 3 pixels fragments. psDash is ugly too: dashes are very long. > > Why? > > -- > Regards, > Alexey > > -- > _______________________________________________ > lazarus mailing list > lazarus at lists.lazarus-ide.org > https://lists.lazarus-ide.org/listinfo/lazarus From luca at wetron.es Fri May 31 17:16:35 2019 From: luca at wetron.es (Luca Olivetti) Date: Fri, 31 May 2019 17:16:35 +0200 Subject: [Lazarus] really strange messagedlg hang Message-ID: <0ae3847a-5bb0-6dc9-d131-c81d699c7b97@wetron.es> Hello, I have a relatively complex, multithreaded application, compiled with lazarus 1.6.4/fpc 2.6.4 (it's the same application I reported in fpc-devel having a problem with tthread.synchronize but I cannot find in in the archive right now, the thread was "Suspicion about TThread.Synchronize"). The customer is in the process of migrating their PCs still running windows xp to windows 7 (yes, I know, I know...) In this application, and this application only, upon the switch to windows 7, a call to MessageDlg hangs for a long time (around one minute) before returning. I saw that on my development machine but I didn't mind since on the target machine it ran fine (when it was running under windows xp that is). It's not MessageDlg itself (in other applications migrated to windows 7 and compiled with the same lazarus/fpc versions we don't see the problem), but some strange interaction with my application, alas I cannot find where the problem lies. If I recompile it with lazarus 2.0.2[*]/fpc 3.2.beta (cannot use 3.0.2 due to the above mentioned thread issue) the problem disappears. Any idea? [*] would somebody pleas take a look at this bug? The solution seems simple but I'm not sure it's correct. https://bugs.freepascal.org/view.php?id=35646 Bye -- Luca Olivetti Wetron Automation Technology http://www.wetron.es/ Tel. +34 93 5883004 (Ext.3010) Fax +34 93 5883007