/*
  ==============================================================================

    This file contains the basic framework code for a JUCE plugin editor.

  ==============================================================================
*/


/*
   Tento kód byl sestaven na základě tutoriálů, dostupných na adrese:
   https://docs.juce.com/master/tutorial_playing_sound_files.html,
   https://docs.juce.com/master/tutorial_audio_thumbnail.html a
   https://docs.juce.com/master/tutorial_audio_device_manager.html

   This code was built based on tutorials, which can be found on address:
   https://docs.juce.com/master/tutorial_playing_sound_files.html,
   https://docs.juce.com/master/tutorial_audio_thumbnail.html and
   https://docs.juce.com/master/tutorial_audio_device_manager.html

  ==============================================================================

   Some of the code is part of the JUCE tutorials.
   Copyright (c) 2020 - Raw Material Software Limited

   The code included in this file is provided under the terms of the ISC license
   http://www.isc.org/downloads/software-support-policy/isc-license. Permission
   To use, copy, modify, and/or distribute this software for any purpose with or
   without fee is hereby granted provided that the above copyright notice and
   this permission notice appear in all copies.

   THE SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES,
   WHETHER EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR
   PURPOSE, ARE DISCLAIMED.

  ==============================================================================
*/

#pragma once

#include <JuceHeader.h>
#include "PluginProcessor.h"
#include "midiKomunikace.h"


//==============================================================================
/**
*/
class GranularSynthAudioProcessorEditor  : public juce::AudioProcessorEditor,
                                           public midiComunication
{
public:
    GranularSynthAudioProcessorEditor (GranularSynthAudioProcessor&);
    ~GranularSynthAudioProcessorEditor() override;

    //==============================================================================
    void paint (juce::Graphics&) override;
    void resized() override;
    void paintIfNoFileLoaded(juce::Graphics& g, const juce::Rectangle<int>& thumbnailBounds);
    void paintIfFileLoaded(juce::Graphics& g, const juce::Rectangle<int>& thumbnailBounds);
    void releaseList();


private:
    GranularSynthAudioProcessor& audioProcessor;

    juce::GroupComponent group6;
    juce::GroupComponent group7;

    void timerCallback() override;
    void mouseDown(const juce::MouseEvent& event) override;

    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GranularSynthAudioProcessorEditor)
};
