Closed devolution2409 closed 5 years ago
TODO: Implement the QMap<QString,QString> in the controller. Implement the "add a game" menu Implement the deletion of a game from this stuff. (except default obv) Implement the relevant slots to change game based on autodetected (have to stop processing signals to avoid emit indexchanged on the combobox and calling the other slot for nothing) Implement a game field in the wrappers Avoid the overlay for showing if the executable name isn't in the map :)
Hell thats quite some work
Actually it is a QMap<std::pair<Qstring,Qstring>> And the "games" are going to be stored in Profiles so that several games can share the same profile :)
connect void ProfileConfigurationChanged(); signal from settings controller to trigger a refreshing on the main UI displayed profiles
probably should have used QSet of pointers? IDK KEV PepeS
TODO:
[x] Profiles are now stored as pointers (QSet<Profiles*>)
[x] Hooks are handled by a dedicated singleton (HookController)
[x] Profiles are handled by a dedicated singleton (ProfileController) (see 4984bb3)
[x] Make profile and mainUI use std::shared_ptr to reference the sounds
[ ] Be careful about memory leaks pajaS
[x] Can add a profile with game in it
[x] Can edit a profile (see 57fa4b3)
[x] Can delete a profile
[x] Loaded profile reflects on the soundboard main UI
[x] Soundboard correctly detects game change
[x] and load according profile (see 3166887)
[ ] Profile lock is implemented (stop listening to everything but winapi close event and match the opened program i guess)
[x] Profiles can be read and saved on the json Write a ToJsonObject for each thing that needs to be saved Profiles
Profiles wrappers
Save correctly the following aswell:
[x] Rewrite SaveSoundBoardState to account for profiles
[x] SoundboardMainUI::ClearAll need to delete profiles (except default) aswell
(deleting a profile will call its destructor which will delete its associated _sounds aswell, so maybe deleting profiles, and then deleting everything from default profile should do the trick)
[x] Write a slot in main UI to swap the QVector<SoundWrapper *> by the one from the new active profile, regenerate the shortcut, and re-load view.
-> actually changing a profile store the sounds in a temp QVector of shared ptr, deletes them from the profile, emit a singal that will be caught by main UI. It will clear its QVector<std::shared_ptr
[x] Changing a profile correctly loads the sounds
[x] Changing a profile correctly show the associated auto-hold PTT (see f2289fa)
[x] Changing a profile correctly changes audio device
Audio devices are now "soundboard wide"
[x] Changing a profile correctly changes the stop button
Stop button is now "soundboard wide"
[x] Probably move all the Open function (aswell as the worker thread from AddSeveralSounds) in Settings Controller or ProfileController SaveController 🤔
[x] Switching a profile should clear mainUI sounds and copy them from the profile, but not re-add them to the profile Actually it will remove them from the profile and re-add them eShrug
[ ] Implement ProfileController::AddProfile(Profile profile, LIDL::PROFILE_COPY_MODE) to account for the _parent field in the Profile, and the COPY_MODE)
[x] load the device aswell when loading soundboard files
[x] Replace every occurence of LIDL::Controller::SettingsController::GetInstance()->CompareSaves(* this->GenerateSaveFile(). And write a method in save controller that asks if we wanna save (like CheckState() for instance)
[ ] (make singletons thread safe and try to re-build the loading widget Loading a soundboard file should account for the total number of sounds, and probably say something like "parsing profile" or whatever)
[x] if auto detected profile is already loaded, return inside of reloading it (see 8288088)
Overlay is kind of working, finish implementing what is described in main:
add event processing for maximizing (same as resizing/moving and foreground)
and also for minimizing (then we search for topmost window)
implement a map<string,string> that links, <userfriendly name, executable> somewhere. (probably in GameDetectionController or something)
implement something to be able to select which currently running executable should be detected
then a bunch of other stuff such as: being able to link a sound to default (when nothing is detected), link a wrapper to a specific game etc etc
being able to import config from another game or blank would be cool