MainComponent.h (2856B)
1 /*---------------------------------------------------------------------------------------- 2 3 Copyright (c) 2023 AUDIOKINETIC Inc. 4 5 This file is licensed to use under the license available at: 6 https://github.com/audiokinetic/ReaWwise/blob/main/License.txt (the "License"). 7 You may not use this file except in compliance with the License. 8 9 Unless required by applicable law or agreed to in writing, software distributed 10 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 specific language governing permissions and limitations under the License. 13 14 ----------------------------------------------------------------------------------------*/ 15 16 #pragma once 17 18 #include "Core/DawContext.h" 19 #include "Core/DawWatcher.h" 20 #include "Core/Logger.h" 21 #include "Core/WaapiClient.h" 22 #include "ImportComponent.h" 23 #include "ImportConflictsComponent.h" 24 #include "ImportControlsComponent.h" 25 #include "ImportDestinationComponent.h" 26 #include "ImportPreviewComponent.h" 27 #include "OriginalsSubfolderComponent.h" 28 #include "OutputLogComponent.h" 29 #include "Persistance/ApplicationProperties.h" 30 #include "Persistance/ApplicationStateValidator.h" 31 #include "Persistance/FeatureSupport.h" 32 #include "Persistance/PersistanceSupport.h" 33 #include "Persistance/WwiseProjectSupport.h" 34 #include "Splitter.h" 35 #include "Theme/CustomLookAndFeel.h" 36 37 #include <memory> 38 39 namespace AK::WwiseTransfer 40 { 41 class MainComponent : public juce::Component 42 , juce::ValueTree::Listener 43 , juce::AsyncUpdater 44 { 45 public: 46 MainComponent(DawContext& dawContext, const juce::String& applicationName); 47 ~MainComponent(); 48 49 void resized() override; 50 bool hasScaleFactorOverride(); 51 52 void transferToWwise(); 53 54 private: 55 juce::ValueTree applicationState; 56 WaapiClient waapiClient; 57 58 ApplicationState::Validator validator; 59 ApplicationProperties applicationProperties; 60 WaapiClientWatcher waapiClientWatcher; 61 Logger logger; 62 DawWatcher dawWatcher; 63 64 FeatureSupport featureSupport; 65 PersistanceSupport persistanceSupport; 66 WwiseProjectSupport wwiseProjectSupport; 67 68 OutputLogComponent outputLog; 69 OriginalsSubfolderComponent originalsSubfolderComponent; 70 ImportDestinationComponent importDestinationComponent; 71 ImportComponent importComponent; 72 ImportConflictsComponent importConflictsComponent; 73 ImportPreviewComponent importPreviewComponent; 74 ImportControlsComponent importControlsComponent; 75 76 juce::TooltipWindow tooltipWindow; 77 78 Splitter splitter; 79 80 juce::CachedValue<bool> collapsedUI; 81 82 void valueTreePropertyChanged(juce::ValueTree& treeWhosePropertyHasChanged, const juce::Identifier& property) override; 83 void handleAsyncUpdate() override; 84 85 void refreshComponent(bool shouldResize); 86 87 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(MainComponent) 88 }; 89 } // namespace AK::WwiseTransfer