Commit Graph

307 Commits

Author SHA1 Message Date
Terry MacDonald
464545fbc7 Made Icons as reliable as possible
Icon logic works well now except for a single issue.
It will not change the shortcut image if the profile
or the game has been changed, and it needs to.
2020-10-19 22:58:23 +13:00
Terry MacDonald
e34d59c1f7 Cleaned up Icon creation (mostly)
Managed to fix large icon creation thanks to
work from Maurizio. Fied an issue with file
selection for Icon generation. Also found a
new issue with ShortcutList that needs
fixing shortly.

https://tabbles.net/how-to-have-large-file-icons-with-shgetfileinfo-in-c/
2020-10-19 21:50:42 +13:00
Terry MacDonald
683bf3d936 Fixed Bitmap processing for Shortcuts
The Bitmap processing wasm't working in the
listitemview. Traced it to a problem with a missing
GenerateThumbnailView call.

Also adjusted when the save to icon cache happens
so that it is part of the ShortcutItem and is called
when a new shortcut is created. This saves times.
2020-10-18 23:04:08 +13:00
Terry MacDonald
3b63953648 Revert "Revert "Refactored Common Base Games""
This reverts commit a71b866545.
2020-10-18 21:17:21 +13:00
Terry MacDonald
a71b866545 Revert "Refactored Common Base Games"
This reverts commit c2c11bd722.
2020-10-18 21:15:19 +13:00
Terry MacDonald
c2c11bd722 Refactored Common Base Games
Created a Common Base Game object in order
to support multiple additional libraries and games
in the future.
2020-10-18 21:02:00 +13:00
Terry MacDonald
ba54c9b99b [WIP] Fixing application runshortcut
Dies in ToBitmapOverlay because originalBitmap
isn't set.
2020-10-13 22:32:41 +13:00
Terry MacDonald
3992157793 Correctly close programs that we start
The StartPrograms processes now all correctly are added
to a list of processes to stop only if the user requested they
are stopped.

Additionally, a 300ms delay was added after SteamGame is
launched to give it time to actually run the darn game! It was
erroring due to testing for the launch too quickly. Steam
takes a wee bit of time to start the game, and we need to
account for that.
2020-10-13 22:02:46 +13:00
Terry MacDonald
86776f1aba SteamGame.IsRunning now works correctly
Changed from using the Steam 'Running' Registry
Key to using an actual Process detection method.
Now works reliably and waits as expected!
2020-10-13 21:25:10 +13:00
Terry MacDonald
706c225dc7 Fixed missing more than one steam library
The steam library code didn't handle multiple steam library locations
properly, but now it does!
2020-10-13 21:04:48 +13:00
Terry MacDonald
07d1c040cb Added ApplyProfile exceptions and StartPrograms 2020-10-13 20:22:42 +13:00
Terry MacDonald
12e3229f9d [WIP] Partially working RunShortcut command
The RunShortcut commandline option mostly works
but it fails to cleanly execute thanks to a partially broken
Program.ApplyProfile. The ApplyProfile exception logic
is not working properly and that is causing an exception
in Program.RunShortcut. Just needs some improved
ApplyProfile logic to detect when it does actually
(correctly) fail.
2020-10-11 21:12:52 +13:00
Terry MacDonald
7c34a02213 Start programs details saved and loaded
Next step is to make them actually do something.
2020-10-11 20:14:22 +13:00
Terry MacDonald
2fa3ce0eb5 Loads the start programs into form
This change loads the start programs into
the form. The structure of the ShortcutItem
changes are designed to be extensible to a
large number of start programs, but the UI
only supports 4. The plan is to add as many
as you want in the WPF version of this app,
but right now its not worth the effort :).
2020-10-11 18:21:06 +13:00
Terry MacDonald
c6408648ee [WIP] StartPrograms are now saved
This puts in place some logic to save start
programs to the shortcut so they get
saved automatically.
2020-10-11 18:11:08 +13:00
Terry MacDonald
66d9ee8b74 Program to start UI works
Program to start UI works as intended. It's
a bit basic but will be good enough until
I manage to get to the WPF rewrite in a
year or so! Next step is to start adding the
background changes to the ShortcutItem
to store the information in the JSON.
2020-10-11 17:38:46 +13:00
Terry MacDonald
383f7a114f Shortcut save button works on load
Had missed the shortcutsave button so it
wold be disabled on load, even if the shortcut
was a valid shortcut. This is now changed so
that it works fine on load.

Have also changed the shortcut library selection
colours to match the rest of the application.
2020-10-11 17:26:11 +13:00
Terry MacDonald
3835840e78 Fixed profile selection colour highlighting 2020-10-11 17:16:06 +13:00
Terry MacDonald
b7bdefa705 Fixing default profile selection in shortcut form 2020-10-11 17:04:36 +13:00
Terry MacDonald
959bfe62aa Added start prog checkbox for usability
Adding these checkboxes will let the user
easily temporarily disable running a program
without losing the very complicated arguments
passed to the program. This is especially true if
it is a thing like SimHub or something like that!
2020-10-11 13:52:28 +13:00
Terry MacDonald
250e6c477f Renamed 'happens before' UI components
Renamed the UI bits to make more sense in prep
for actually making them do things :).
2020-10-11 13:38:47 +13:00
Terry MacDonald
e43e6d945c [WIP] Create initial design for 'Before' tab
This is the first design for a simple form to
detail the programs that the user wants us to start
before the main Game. This is a first go and
is only the initial draft.
2020-10-10 18:09:19 +13:00
Terry MacDonald
4fb5865fd9 Removing DisplayNotification class
No longer require the DisplayNotification class
as was able to do similar tasks without it.
2020-10-10 17:52:34 +13:00
Terry MacDonald
a39a9d202c Improving Profile Form messages 2020-10-10 17:50:27 +13:00
Terry MacDonald
54f3f5271a Fixed NVIDIA IsPossible screen detection
Made the IsPossible deviceIdentification work
correctly with the NvAPIWrapper logic. Issue
was caused by me not really understanding what
the NVIDIA documentation meant. This has been
rectified. HeliosPlus will now invalidate any profiles
that won't work with the currntly attached screens.
2020-10-10 15:18:30 +13:00
Terry MacDonald
7fd4a8117d Fixed error with Paths and Topologies equality
I'd made a revision to the Paths and Topologies
equality comparison and it  used Equals for
sequences rather than SequenceEqual as it should.
Comparison works correctly now.
2020-10-09 17:14:23 +13:00
Terry MacDonald
8421acbd8d CurrentProfile detected in loadedProfiles
Fixed up some broken logic around detecting
loadedProfiles as the currentProfile. Now when
we load the profiles from disk we also correctly
check whether one of the profiles is in use now
and if it is then we use that profile instead of
creating a new one.
2020-10-09 16:27:59 +13:00
Terry MacDonald
189e3271a0 Fixed incorrectly displaying progressBar
I broke the circularProgressBar but now it works
fine. Messed with the style a bit to get the look
I wanted. Also adjusted the positioning of the
text in the middle.
2020-10-08 22:03:02 +13:00
Terry MacDonald
ca7c696b06 Bypassed NVIDIA Grid Topology if not needed
Added some logic to check if either the from or to
profile conatins an NVIDIA surround screen. If not,
then there is no need to apply a GridTopology as it
is all single devices! Saves up to 15 seconds on
swap over.
2020-10-07 21:58:05 +13:00
Terry MacDonald
0ccf5176b7 First working surround to non-surround conversion
Was missing a SetTopologies  command from upstream
and the latest GeForce devices don't seem to be able to
read EDID which means the Topologies dont have a
DisplayName peroperty, which in turn causes issues when
trying to change to that topology! So now detect empty
DisplayName and fill it with a default.
2020-10-07 21:32:12 +13:00
Terry MacDonald
8c4604bc58 Renaming Viewports back to Paths 2020-10-07 20:08:36 +13:00
Terry MacDonald
f0088d08e2 [WIP] trying to fix path error 2020-10-06 23:49:10 +13:00
Terry MacDonald
95d87e92f1 Fixed WindowsDisplayAPI Device Identifcation
Fixed the WindowsDisplayAPI Device Identifcation
logic so that it reliably detects the displays in a way
that works when some displays are disabled as well
as when they are enabled. Also divided up the
DeviceIdentification into two separate functions so
that one will list all attached devices, and the other
will only report the devices currently in use.
2020-10-06 21:32:31 +13:00
Terry MacDonald
c716b88068 [WIP] Fixed the profile.IsPossible detection for NVidia
Still need to fix the non-NVIDIA card deviceidentifier logic
2020-10-06 20:59:59 +13:00
Terry MacDonald
0b5937d25c Removing old ApplyingChangesForm 2020-10-06 20:08:36 +13:00
Terry MacDonald
267dfbe9f3 Initial working ApplyProfile
Works with the new DisplayIdentification code but
as the profile.IsPossible logic is incorrect it's not
working as intended. That's the next project.
2020-10-06 20:07:21 +13:00
Terry MacDonald
3847bae972 [WIP] DisplayUI works but needs error handling
DisplayUI is mostly working but it needs some work
fixing the error situations when the PathInfo can't be
applied properly. Need a way of setting the Task
result from the Task Action. Don't know how to do that
so something new to learn!
2020-10-05 00:18:22 +13:00
Terry MacDonald
17cc302d17 [WIP] Partial refactor of applying profile display UI 2020-10-04 23:01:03 +13:00
Terry MacDonald
227caa2230 Fixing applying profile console messages 2020-10-02 18:47:39 +13:00
Terry MacDonald
3af60257ce Removing DisplayIndentifier class 2020-10-02 18:39:48 +13:00
Terry MacDonald
77ae3c4789 Basic working code to apply a display profile change
This code makes the display profile change work. There
are a few things broken still.... namely the showing of a
timer when the profile is being applied, the accuracy of
the display detection code, and the correct logic for
determining a profile can be used.
2020-10-02 18:10:34 +13:00
Terry MacDonald
466cdc647e [WIP] Attempt to fix the display detection for checking valid profiles
Initial work in progress profile 'IsPossible' logic update.
2020-09-30 22:49:02 +13:00
Terry MacDonald
9d5a5ebd62 [WIP] Creates different displayIdentifiers for NVIDIA or other
There are different displayIdentifiers created if the video card
is an NVidia card, or if it is anything else. These identifiers
are saved in the display profiles, and that allows us to compare
the display identifiers we currently have with the ones in various
profiles, and then work out which profiles are valid.

This code committed today ensures that the nvidia device
identifier will always use the NVAPIWrapper lib (whether in
surround mode or not) so that the application allows both
surround mode profiles and non-surround mode profiles
to be selected if the same displays are present.

For all other display adapters it just uses the
WindowsDisplayAPI to create a different displayIdentifier
which isn't as smart. It means that if you have an AMD and
use EyeInfinity, then this isn't clever enough to understand
the profiles use the same matching screens. I will have to
fix this eventually when i build in native AMD support in
the future.
2020-09-18 22:52:18 +12:00
Terry MacDonald
f2dca27c02 [WIP] Testing logic for detecting displays
The existing logic for detecting displays connected to
an NVidia device doesn't allow matching for Nvidia
surround and normal surroundless profiles. This means
that you cannot determine which profiles are the valid
for your display setup. This is testing the NVAPIWRapper
scanning and the WindowsDisplayAPI libraries to see what
information will work for tracking the screen in the profiles.
2020-09-18 20:35:49 +12:00
Terry MacDonald
0912ee5896 Added DisplayIdentifiers to Profile storage
DisplayIdentifiers are the minimum GPU/Display
that will allow us to identify whether a profile
will actually work. We look for the same DisplayIdentifiers
or a subset of them to determine whether a profile
will be valid to show. This is different from the data
stored under DisplayTarget, as that is used for detailed
compatibility....
2020-08-19 18:55:50 +12:00
Terry MacDonald
32ad405904 Removed braces from UUID in filenames
Simplified UUID logic by removing braces from the
filenames and within the storage JSON files.
2020-08-19 10:16:04 +12:00
Terry MacDonald
b95e7bbd39 Fixing Repositories to work on first run 2020-08-07 15:59:23 +12:00
terrymacdonald
41c03c30b5 Saving initial MSTest configuration
First part of installing an MSTest suite.
Included some config file to read in
for testing the ShortcutRepository and
the ProfileRepository. Had the data
handy so it made sense to save it :)
2020-07-26 20:52:46 +12:00
terrymacdonald
85de9b0697 [WIP] Partially fixed Profile.IsPossible logic
The IsPossible logic in the ProfileItem incorrectly
uses the ToPathTargetInfo, when a better match is
to look for all the actual displays that are currently
turned on, and then allow all profiles that include
only the displays that are turned on. That involves
1. getting a list of the display devicepaths, and then
2. checking if this profile has all the devicepaths
needed to show the profile. If it does, then it
IsPossible.
2020-07-24 21:46:53 +12:00
terrymacdonald
5004f5f76a Silenced the System.Drawing.Image exceptions
The ProfileAdapter and ShortcutAdapters used
by the ImageListView Control unfortunately
have to access the sizes of the bitmaps being
loaded into the respective imagelistviews. I
can't find anyway of stopping the GDI+
from complaining about the Bitmap being
accessed by multiple different threads (as
ImageListView creates one thread per image.
This will be fixed once I move to this being a
WPF application as we'll use a different control.
2020-07-24 16:51:48 +12:00