OriginalsSubfolderComponent.h (2664B)
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 "AboutComponent.h" 19 #include "CustomDrawableButton.h" 20 #include "TruncatableTextEditor.h" 21 #include "ValidatableTextEditor.h" 22 #include "WaapiNetworkTransferSettingsComponent.h" 23 #include "WildcardSelector.h" 24 25 #include <juce_gui_basics/juce_gui_basics.h> 26 #include <memory> 27 28 namespace AK::WwiseTransfer 29 { 30 class OriginalsSubfolderComponent 31 : public juce::Component 32 , private juce::ValueTree::Listener 33 , private juce::AsyncUpdater 34 { 35 public: 36 OriginalsSubfolderComponent(juce::ValueTree applicationState, const juce::String& applicationName, ApplicationProperties& applicationProperties, WaapiClientWatcher& waapiCW); 37 ~OriginalsSubfolderComponent(); 38 39 private: 40 juce::ValueTree applicationState; 41 juce::CachedValue<juce::String> projectPath; 42 juce::CachedValue<juce::String> originalsSubfolder; 43 juce::CachedValue<juce::String> originalsFolder; 44 juce::CachedValue<juce::String> languageSubfolder; 45 juce::Label projectPathLabel; 46 juce::Label originalsSubfolderLabel; 47 TruncatableTextEditor projectPathEditor; 48 ValidatableTextEditor originalsSubfolderEditor; 49 50 CustomDrawableButton fileBrowserButton; 51 WildcardSelector wildcardSelector; 52 53 std::unique_ptr<juce::FileChooser> fileChooser; 54 55 CustomDrawableButton aboutButton; 56 AboutComponent aboutComponent; 57 58 CustomDrawableButton crossMachineTransferSettingsButton; 59 WaapiNetworkTransferSettingsComponent crossMachineTransferSettingsComponent; 60 61 void resized() override; 62 void refreshComponent(); 63 void selectOriginalsSubfoler(); 64 void onWildcardSelected(const juce::String& wildcard); 65 void valueTreePropertyChanged(juce::ValueTree& treeWhosePropertyHasChanged, const juce::Identifier& property) override; 66 void handleAsyncUpdate() override; 67 68 void showAboutWindow(); 69 void showCrossMachineTransferSettingsWindow(); 70 71 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(OriginalsSubfolderComponent) 72 }; 73 } // namespace AK::WwiseTransfer