ReaWwise

REAPER extension
Log | Files | Refs | Submodules

ImportDestinationComponent.h (2061B)


      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/WaapiClient.h"
     19 #include "CustomDrawableButton.h"
     20 #include "Model/Wwise.h"
     21 #include "ValidatableTextEditor.h"
     22 
     23 #include <juce_gui_basics/juce_gui_basics.h>
     24 
     25 namespace AK::WwiseTransfer
     26 {
     27 	class ImportDestinationComponent
     28 		: public juce::Component
     29 		, private juce::ValueTree::Listener
     30 		, private juce::AsyncUpdater
     31 	{
     32 	public:
     33 		ImportDestinationComponent(juce::ValueTree applicationState, WaapiClient& waapiClient);
     34 		~ImportDestinationComponent();
     35 
     36 	private:
     37 		juce::ValueTree applicationState;
     38 		juce::CachedValue<juce::String> importDestination;
     39 		juce::CachedValue<juce::String> projectPath;
     40 		juce::CachedValue<Wwise::ObjectType> importDestinationType;
     41 		juce::Label importDestinationLabel;
     42 		ValidatableTextEditor importDestinationEditor;
     43 
     44 		CustomDrawableButton updateImportDestinationButton;
     45 
     46 		WaapiClient& waapiClient;
     47 
     48 		void resized() override;
     49 		void refreshComponent();
     50 		void updateImportDestination();
     51 		void valueTreePropertyChanged(juce::ValueTree& treeWhosePropertyHasChanged, const juce::Identifier& property) override;
     52 		void handleAsyncUpdate() override;
     53 
     54 		juce::DrawableComposite objectTypeIconComposite;
     55 		std::unique_ptr<juce::Drawable> objectTypeIcon;
     56 
     57 		JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImportDestinationComponent);
     58 	};
     59 } // namespace AK::WwiseTransfer