mse-org / mseide-msegui

MSEide is a Rapid Application Development IDE for platform independent rich GUI applications in the Pascal language. It comes with its own GUI toolkit called MSEgui. Binaries: https://github.com/mse-org/mseide-msegui/releases
GNU General Public License v2.0
124 stars 15 forks source link

New warning message since refactory of mclasses. #15

Closed fredvs closed 4 years ago

fredvs commented 4 years ago

Hello.

When compiling with last release of msegui there is a new warning message:

mclasses.pas(94,15) Warning: (3057) An inherited method is hidden by "GetOwner:tpersistentbridge;"

Could it give problems?

fredvs commented 4 years ago

Hello.

Following the advice from here: https://www.freepascal.org/docs-html/ref/refsu27.html

It writes that the keyword ’dynamic’ = the keyword 'virtual' and that, with such warning, it should be replaced by 'override'.

So I did try this: changing that:

function GetOwner: tpersistentbridge; dynamic; //shadows

with this:

function GetOwner: tpersistentbridge; overload; override; //shadows

And now the compiler is happy, no more warning, all runs perfectly.

What do you think, should it be committed?

fredvs commented 4 years ago

Also I do not understand why some methods are removed:

 {$ifndef FPC}
    function Equals(Obj: TObject) : boolean;virtual;
    { IUnknown }
    function QueryInterface(const IID: TGUID;out Obj): Hresult; stdcall; // removed
    function _AddRef: Integer; stdcall;  // removed
    function _Release: Integer; stdcall;  // removed
  {$endif}
rchastain commented 4 years ago

Hello Fred!

I haven't yet had time to study the question and, to say the truth, I am not a master of Object Pascal.

By the way, a warning isn't necessarily a bad thing.

For the MSElang code, it will always be possible to restore it if needed.

Good night!

fredvs commented 4 years ago

Hello Roland.

By the way, a warning isn't necessarily a bad thing.

Indeed and here it is good because only one word to change and all is ok.

For the MSElang code, it will always be possible to restore it if needed.

Yes, of course, but now that I am in the code, maybe few {$ifdef something} will arrange all.

Good night too!

fredvs commented 4 years ago

What do you think to use a define no_class_bridge that will be not set as default but that you can define with the compiler param -dno_class_bridge

 {.$define no_class_bridge} // not set as default and use `-dno_class_bridge` as param if you dont need the bridge

...

    {$if defined(no_class_bridge)}
     use the old code without bridge
   {$else}
     use the new code with bridge
   {$endif}

?

(I am ok to do it)

fredvs commented 4 years ago

Hello everybody.

I am sorry but I could not resist. My conscience was boring me.

So I did commit 0a0ce3a and e6ddabb with this (of course it can be removed but so you may try it before).

Voila, to resume, if you want to use the bridge, dont do nothing, it will be like it is in version 5.2.0.

But if you dont want to use the bridge, just add -dno_class_bridge in compiler option.

Maybe everybody will be happy with this. (for me I am happy with it, it is so good to have the choice).

I did test it with BGRABitmap (of course without define -dno_class_bridge) and it works perfectly.

It works also perfectly if the bridge is not needed , for example compiling MSEide with -dno_class_bridge. (of course, MSEide can be compiled without -dno_class_bridge too).

circular17 commented 4 years ago

Hiding the inherited method was intentional. That's why I have written //shadows next to it. That's a keyword you would use in VB.Net to say you know your are hiding a method and it is on purpose.

Though in this case, that's correct, one can use override. I am pleasantly surprised that it works, as tpersistentbridge type is not the same as Classes.TPersistent, so it is not the same signature, but it accepts to override because tpersistentbridge is derived from Classes.TPersistent.

Learning new things every day. I will use it in BGRABitmap for sure.

Regarding deactivating the class bridge, it makes maintenance more complicated to have both codes. On the other hand, if we add more class bridges that could be done with the reassuring thought that users would have a fallback.

Also I do not understand why some methods are removed:

 {$ifndef FPC}
    function Equals(Obj: TObject) : boolean;virtual;
    { IUnknown }
    function QueryInterface(const IID: TGUID;out Obj): Hresult; stdcall; // removed
    function _AddRef: Integer; stdcall;  // removed
    function _Release: Integer; stdcall;  // removed
  {$endif}

I think the word removed means that the reference counting has been tweaked. Normally these functions are for interfaces, for example they increment/decrement the reference count. But the object itself is not reference counted here. The interface instead is redirected to FVCLComObject if it is defined. Not sure why this was done.

The functions are not as such removed but inside an IFDEF because they are defined like this specifically for FPC. It may be different with another compiler. Though I don't know if any other compiler could be used.

fredvs commented 4 years ago

Hello Circular.

I really appreciate your open mind and the fact that you accepted some change in your code without shouting.

Your bridge is genius and is a a big plus for MSEgui.

Though I don't know if any other compiler could be used.

Yes, even if it not yet totally operational, mselang is working (and wait to be completed). And can use msegui.

With the {$if defined(no_class_bridge)} new feature, it is exactly in the same status than before.

fredvs commented 4 years ago

Hey guys, I think we did all a great work for MSEgui. My ruthless tests did not find any problems now.

Thank you for your fabulous contributions Circular.

I need to do a break with computing for some moment.

Take care of you.

Fre;D

circular17 commented 4 years ago

You're welcome.

I've applied the override in BGRABitmap as well: https://github.com/bgrabitmap/bgrabitmap/commit/3d843768e6d06029bfcb6815160c4612a8609f48

So now you don't need to add as TBGRABitmap after Resample, GetPart etc.

fredvs commented 4 years ago

Hello.

So now you don't need to add as TBGRABitmap after Resample, GetPart etc.

Sorry I dont catch it, where to not add what?

circular17 commented 4 years ago

For example:

var
  bmp1, bmp2: TBGRABitmap;
begin
  bmp1 := TBGRABitmap.Create('image.png');
  bmp2 := bmp1.Resample(bmp1.width*2, bmp1.height*2);
  ...
end;
fredvs commented 4 years ago

Ha, ok, nice and thanks.

circular17 commented 4 years ago

Thank you too

fredvs commented 4 years ago

I will (asap) jump deeper into BGABitmap and sure, it will be used for that project: https://github.com/fredvs/strumpract

See you soon!

circular17 commented 4 years ago

Oh music software, that looks interesting.

fredvs commented 4 years ago

Yes, I am thinking now how to do for Jam session.

I did note that some time it is complicated to initiate the Jam. Or people always come with same chords, or are not tuned, etc.

One of the idea is a "Chord randomize", like a lottery, that will give how many chords '1-4', the name of the random chords, with tablature guitare/piano/bass + chord for other instruments (at the moment Saxo), the random tempo with a metronome.

And people have to improvise with that.

Are you musician?

fredvs commented 4 years ago

Huh, about renaming all the files in /fpcompatibility

Did you know that all thej***.pas files are used by fpimage (via fpreadjpeg) So it would be logical to remove those files too for your bridge, no?

But, dont worry, no need to delete them because they are re-named now.

;-)

circular17 commented 4 years ago

One of the idea is a "Chord randomize", like a lottery, that will give how many chords '1-4', the name of the random chords, with tablature guitare/piano/bass + chord for other instruments (at the moment Saxo), the random tempo with a metronome.

That's a good idea. Did you put some relation ships to be between the chords or is it totally random?

Are you musician?

To some extent indeed. Here are some of my compositions: https://www.youtube.com/playlist?list=PLRE0IICPofOVS-W5X2Rd7d9d3qzhxMnJN

circular17 commented 4 years ago

Huh, about renaming all the files in /fpcompatibility

Did you know that all thej***.pas files are used by fpimage (via fpreadjpeg) So it would be logical to remove those files too for your bridge, no?

But, dont worry, no need to delete them because they are re-named now.

;-)

Well to be honest I was wondering about deleteing the whole folder, but I did not mention it not to scare you.

fredvs commented 4 years ago

Did you put some relation ships to be between the chords or is it totally random?

At the moment it is totally random and only for chords, major, minor with-or-without sharp. And only for this is already deep work. Of course it should be done for each kind of cords (so lot of).

And relation between chords too, why not.

Well to be honest I was wondering about deleteing the whole folder, but I did not mention it not to scare you.

To be honest too, all that tweaked fpc files not renamed disturbed my conscience and your bridge was a perfect occasion to make it quiet.

But deleting will hurt my conscience too, so renaming, imho, makes everybody happy. Also, some files are much more tweaked than only add 'mclasses', so re-imho, it is better to still use it for msegui-widget himself (but re-named with adaptation in msegui "uses" sections).

fredvs commented 4 years ago

To some extent indeed. Here are some of my compositions: https://www.youtube.com/playlist?list=PLRE0IICPofOVS-W5X2Rd7d9d3qzhxMnJN

Wow, good meat for this week-end.

Write you later.

fredvs commented 4 years ago

https://www.youtube.com/playlist?list=PLRE0IICPofOVS-W5X2Rd7d9d3qzhxMnJN

Ha, ok, piano + synthé + ukulele + many others.

Wow, impressed, and the images also, wow.

I like all, maybe more particularly "deep but not too much", the idea to de-tune some time some chord makes the song happy and more human and strange.

What did you use for recording, Fruity Loop ?

And for image, BGRABitmap?

circular17 commented 4 years ago

Glad you enjoyed it.

About "deep but not too much" I am using supermajor thirds, which are part of 31-edo, a subdivision of the octave I like very much. It is a mesotonic tuning.

Many of the musics are made with OpenMPT, a module editor. Some I made with a DGX-660. And some with real instruments.

About images, it was mainly about finding images and applying effects in the video editor.

fredvs commented 4 years ago

Ha, ok, I am not up-to-date with the new software.

I did use during centuries mainly Cubase, CakeWalk and FruityLoop. Now I am more concentrated with live music and use for recording-mixing a digital PortaStudio Tascam DP-32.

It can record 8 tracks at once and has 32 independent tracks for mixing.

Also I like to be, sometime, totally far away from my computer, and with that machine, no need to be connected to a computer.

Anyway, chapeau, your tunes sound very good and original.

fredvs commented 4 years ago

About images, it was mainly about finding images and applying effects in the video editor.

Hum, IMHO, with all the options that offer BGRABitmap, with some timers that change some parameters of the image, you could do even better, with one executable.

And to make simple, a screen-recorder will save the animations done by the BGRABimap-executable.

[EDIT] You can even imagine to link some BGRABimap parameters with a sound, like frequencies, volume, etc, ... (uos) and then no need of timers, the sound will be the timer.

circular17 commented 4 years ago

Sounds like doing a demo. :-)

Ha, ok, I am not up-to-date with the new software.

OpenMPT is rather an old software. That's an opensource version of ModPlugTracker. It works with modules, the music files you would have on an Amiga.

I did use during centuries mainly Cubase, CakeWalk and FruityLoop.

I have heard of some of them but never used them. Somehow I got stuck on modules.

Now I am more concentrated with live music and use for recording-mixing a digital PortaStudio Tascam DP-32.

It can record 8 tracks at once and has 32 independent tracks for mixing.

Also I like to be, sometime, totally far away from my computer, and with that machine, no need to be connected to a computer.

I can relate to that. I am also more on the acoustic guitar now. I tweaked it a bit for 31edo / mesotonic.