Jump to content
(Public Beta) HyperSpin 2 is now available for everyone ×

HyperSpin Event Dispatch System (EDS)


Antos

Recommended Posts

Posted

NEWS UPDATE - 2014/07/12 EDS (Beta Release version 0.4.53) is now available for download. This is an evaluation version for beta testers only.

What's new,

- Add a System Filter option. (Very useful to restrict an application to one system, like HiToText for MAME only and let other systems have their own HiScore app. See docs for all the details).

- Default settings have been added when the user starts the app for the first time.

- Fonts have been added to the package.

- Minor bugs got corrected.

Cheers,

HyperMarquee & Event Dispatch System

  • Replies 686
  • Created
  • Last Reply
Posted

Nice, system filter makes sense.

Any chance of looking into relative path support btw? That's the major problem for me as it makes EDS not usable with my portable install.

Posted
Nice, system filter makes sense.

Any chance of looking into relative path support btw? That's the major problem for me as it makes EDS not usable with my portable install.

Sure, I will tackle this very soon. Probably tomorrow as the weather forecast is rain here in Ottawa. Can you give me a concrete example and how (GUI wise) you would like to see this implemented?

HyperMarquee & Event Dispatch System

Posted

I'd simply have a global setting where you set if you want the paths for your newly added applications to be absolute or relative. Then when you browser for the file if that option is set to relative convert the path you get from the FileDialog to relative and that's what you save on your settings file.

And I mean relative from the EDS folder.

So if you have EDS installed in:

C:\HyperSpin\EDS

And your application installed in:

C:\Program Files\AppDir

the path would become:

..\..\Program Files\AppDir

Posted

Would it be ok if I convert the path to relative on the fly (dynamic) without overwriting the config file? Since the EDS path and the Application Path are known, I believe I can launch apps from relative if a flag specifies it within the new GlobalSettings form. Any thoughts?

Something like;

string pathA = @"C:\App\program.cs";

string pathB = @"C:\program files\software\abc.exe";

System.Uri uriA = new Uri(pathA);

System.Uri uriB = new Uri(pathB);

Uri relativeUri = uriA.MakeRelativeUri(uriB); // on the fly conversion

string relativeToA = relativeUri.ToString();

This yields "../program%20files/software/abc.exe" for the relative path.

HyperMarquee & Event Dispatch System

Posted

I'm not sure if I fully understood what you mean sorry. You mean always storing absolute paths in the config file, but converting them to relative on the fly before running the actual applications?

If that's what you mean I'm not sure how that would work because:

1) I don't see why you would need to convert any paths to relative. You should be converting relative paths to absolute ones before launching the applications;

2) Imagine this very likely scenario, you setup EDS on your portable HDD on a certain PC. That drive is K: on that PC, so you have the path for your LedWiz application set to K:\LedWiz. EDS will be at K:\EDS.

Now you take your HDD to another machine and the drive letter will become F: for your conversion you'd have:

string pathA = @"F:\EDS"

string pathB = @"K:\LedWiz"

On the fly path conversion would fail because the drive letters are different and you would end up trying to launch LedWiz from K: instead. This is why relative paths should be stored instead of absolute ones, because on portable setups the drive letter will always change from machine to machine.

This should be pretty simple to implement, before launching an application you can simply do something like:

if (isRelativePath(appPath))

appPath = convertToAbsolutePath(appPath,EDSPath);

Run(appPath);

This is basically what I do throughout the whole HLHQ application where you can store any path as absolute or relative.

Like I said not sure if I understood your idea though, I might have got it wrong.

Posted

That's also what we do in HyperLaunch also. All paths get stored as relative and HL does the conversion.

FYI, your default ledblinky settings have no event filters.

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted

Thanks for the scenario! I exactly understand now.

EDS will support Relative path very soon.

HyperMarquee & Event Dispatch System

Posted

Done, I have made some tests at home and it seems to work fine.

There is a Global Settings button to specify Absolute or Relative Path. Both paths are kept in a config file.

I have updated the download section with a folder called testForBrolly. just copy those 2 files into the most recent EDS version folder.

See first post for the download link.

Let me know, thanks!!

HyperMarquee & Event Dispatch System

Posted

Thanks Antos, I probably won't have time to check it today, but will give it a test run tomorrow and let you know how it goes.

Posted

Works good Antos. Curious why you are using 2 different settings (Path or RelativePath) to store them. Why don't you use the same setting (Path) and a conditional on load if the value starts with .. (relative) else everything else (absolute). It's confusing opening the config file up and seeing 2 different path settings.

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted
Works good Antos. Curious why you are using 2 different settings (Path or RelativePath) to store them. Why don't you use the same setting (Path) and a conditional on load if the value starts with .. (relative) else everything else (absolute). It's confusing opening the config file up and seeing 2 different path settings.

So it worked on your side, that's good news! For the Absolute and Relative path, I do not have a good grasp of all the possible scenarios. Is it possible that a user may like to go back to the original absolute path? I am afraid of loosing the absolute path once converted to relative. Also is there a possible scenario where some apps could use relative and others absolute? Right now it's all absolute or all relative.

Although, this proposal is a good improvement to EDS thanks! Once fully tested I will do some clean up/ improvements to this feature.

Question, I am doing the same thing for HyperMarquee today. My approach is a little different but answering the same purpose. I would love to get your impressions. Here it is, considering brolly given scenario of HDD swapping, instead of converting to relative path, I am just comparing the root directory of path between HM and a given Artwork and fix it on run time if needed. This way the user doesn't even have to think or set option flag between absolute or relative. After some tests this approach is also working fine here. Ex: 1. I put EDS and HM on a HHD, set all config and then, 2. I brought the HDD on another PC with under a different drive letter. The Results: everything continues to work like magic, even if no relative path have been set initially.

My c# code;

        private string ReplaceDriveLetter(string FileFullPath)
       {
           // This will remap at run time the root directory of remote file path to HyperMarquee root directory of path if the file path do not exists or not found.

           if (File.Exists(@FileFullPath) == false)
           {
               try
               {
                   // get file path Root
                   FileInfo _fi = new FileInfo(@FileFullPath);
                   string pathRoot = System.IO.Path.GetPathRoot(_fi.FullName);

                   // get HyperMarquee path Root
                   FileInfo hyperMarqueeFI = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);
                   string HyperMarqueedrive = System.IO.Path.GetPathRoot(hyperMarqueeFI.FullName);

                   // replace file path root
                   FileFullPath = FileFullPath.Replace(pathRoot, HyperMarqueedrive);
               }
               catch (Exception ex)
               {
                   Console.WriteLine("ReplaceDriveLetter function error: " + ex.Message);
               }
           }

           return FileFullPath;
       }

HyperMarquee & Event Dispatch System

Posted

There are only two scenarios relative or absolute. You simply need to read the setting and determine if its relative or absolute . If relative then convert to absolute first and do a file exists check . Else if its already absolute either run it through the conversion also or skip it entirely and go straight to the file exists check.

Sent from my Samsung S3 using Tapatalk

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted
There are only two scenarios relative or absolute. You simply need to read the setting and determine if its relative or absolute . If relative then convert to absolute first and do a file exists check . Else if its already absolute either run it through the conversion also or skip it entirely and go straight to the file exists check.

Sent from my Samsung S3 using Tapatalk

Yes, what you saying is exactly what I am doing for EDS already, and it is working fine based on my tests and yours. But I was proposing another approach to even simplify things more. I maybe have some difficulties to explain it clearly.

Thanks for your support. Please let me know if you need more features / capabilities within EDS, I will be happy to look at it.

HyperMarquee & Event Dispatch System

Posted

But you are not doing it, because you have an option to set to use absolute or relative. That option should be removed and be made completely automatic as described above.

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted
But you are not doing it, because you have an option to set to use absolute or relative. That option should be removed and be made completely automatic as described above.

Well, I am doing it in terms of functionality (behind the scene), but you are right I can simply don't ask for it. My only fear was to lose the original absolute path.

Just want to make sure to avoid confusions, have you tested it with success? (it seems to work fine on my end)

HyperMarquee & Event Dispatch System

Posted

Yes it works for both ledblinky and hyper marquee here. You won't lose any functionality. Every app that supports relative paths has done so using the same key.

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted

NEWS UPDATE - 2014/07/13 EDS (Beta Release version 0.5.53) is now available for download. Please remember this is an evaluation version for beta testers only.

Improvements

- Now supporting relative paths.

- Bugs got corrected.

HyperMarquee & Event Dispatch System

Posted

You should still leave the option for the user to be able to select an absolute or relative path, there might be cases when you actually want to store an absolute path. No need to store both of them though one is enough.

When you are only reading the paths there's no need for a setting since you can automatically figure if you are reading a relative or absolute path, but same isn't true when you are actually storing them.

I can't test it now, but not really sure your function above will work for all cases, seems to me it simply replaces the drive letter? What if you have relative paths with multiple ..\? Did you test if that works properly?

Posted

Relative paths only apply when storing on the same drive as EDS itself. So you don't need an option. If a path is given that is not the same drive, it has to be absolute. ..\..\C:\myapp.exe doesn't exactly make any sense, if that would even work.

Stored my paths as <RelativePath>../../LEDBlinky/LEDBlinky.exe</RelativePath>

So it does work fine.

I did test an SMB share, does not look right:

<RelativePath>file://blackpc/Backups/Arcade/EMU/dxwebsetup.exe</RelativePath>

Not sure why it put that in bold, unless that is being handled in EDS properly.

It did store it fine here though:

<Path>\\BLACKPC\Backups\Arcade\EMU\dxwebsetup.exe</Path>

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."

RocketLauncher's Official Home

If you appreciate my work:
donate_button.png

My Apps:
Window Logger
Idle Volume Adjuster
ExplorerRestorer
Rom Folder Cleaner
Module Updater
My Guides:
How To Mod Guncons with Aimtrak

Posted
Relative paths only apply when storing on the same drive as EDS itself. So you don't need an option. If a path is given that is not the same drive, it has to be absolute. ..\..\C:\myapp.exe doesn't exactly make any sense, if that would even work.

Where did I mention storing ..\..\C:\myapp.exe? Of course that wouldn't work, if the file is in a different drive absolute paths are stored regardless of the option value.

I was talking about the parsing method Antos posted above which for what I understood isn't the same he is currently using on EDS.

Personally I'd leave that option as there might be scenarios where you want to store an absolute path and that way you can do it.

Posted

To clarify things, the option in the settings is to specify if the user wants to use the stored relative path or the absolute path for apps execution. Right of the bath, both paths are stored when the user sets an application (regardless). That may change, possibly not optimal, not sure. I try to keep the focus to develop a very light EDS which saves has much CPU cycle has possible to let hyperspin leverage on most pc ressouces as possible. EDS should be transparent and not intrusive for HS (we all agree with that). If EDS works correctly, the time will tell us how it can fit best the community demand. I am convince that together we have the time that we need to make this app a real asset. But this wouldn't be possible without you. On other fronts, I have ideas for other apps, where some might be very suprizing, but I would like to finish HM and EDS before anything else. To give you a first glance, it is about creating a strong developpement team for an open source multiplatform project that may challenge the status quo. But nothing will be done in a shell, it will be inclusive and collaborative by and for the comunity benefits.

HyperMarquee & Event Dispatch System

Posted

NEWS UPDATE - 2014/07/14 EDS (Beta Release version 0.6.53) is now available for download.

My apology guys, the previous version include an important bug related to CLI application launch. It is fixed now.

The application handle was not working for CLI, has a result, each event of new launched app was launched without closing the previous one. the results: ever increasing number of apps.

It is fixed now, sorry for any inconveniences.

Just to underline that I have no stable version as yet. This is an evaluation version for beta testers only.

HyperMarquee & Event Dispatch System

  • 3 weeks later...
Posted

I'm having a problem where EDS is making my MAME wheel move to the previous game every second or two. makes it impossible to select a game. I isolated it to EDS by running every configuration possible using HyperMarquee, HyperSpeech, and LEDBlink. Only when commands are routed through EDS does the wheel jump backwards

EDIT: URGH somehow the trackball was enabled in hyperspin... caused a whole heap of a mess. all fixed now!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...