-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeckGUI.h
90 lines (70 loc) · 2.68 KB
/
DeckGUI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
==============================================================================
DeckGUI.h
Created: 2 Mar 2022 3:14:33pm
Author: 13z79
==============================================================================
*/
#pragma once
#include <JuceHeader.h>
#include "DJApplication.h"
#include "WaveformDisplay.h"
#include "Playlist.h"
//==============================================================================
// enum the state for different types of clicking on buttons
enum class TransportState {
Stopped,
Starting,
Playing,
Pausing,
Paused,
Stopping
};
// extend the necessary classes for the deckGUI
class DeckGUI : public juce::Component,
public juce::Slider::Listener,
public juce::LookAndFeel_V4,
public juce::FileDragAndDropTarget,
public juce::Timer
{
public:
DeckGUI(DJApplication* player,
juce::AudioFormatManager& formatManagerToUse,
juce::AudioThumbnailCache& cacheToUse);
~DeckGUI() override;
void paint(juce::Graphics&) override;
void resized() override;
/** implement Slider::Listener */
void sliderValueChanged(juce::Slider* slider) override;
// implement drag function
bool isInterestedInFileDrag(const juce::StringArray& files) override;
void filesDropped(const juce::StringArray& files, int x, int y) override;
// implement the timer function
void timerCallback() override;
// implement the change state function when user presses the buttons
void changeState(TransportState newState);
// setup fucntions for play button, stop button, and load button to be clicked
void playButtonClicked();
void stopButtonClicked();
void loadButtonClicked();
private:
// Your private member variables go here
juce::TextButton playButton{ "PLAY" };
juce::TextButton stopButton{ "STOP" };
juce::TextButton loadButton{ "LOAD" };
// three slider for the audio sample
juce::Slider volSlider;
juce::Slider speedSlider;
juce::Slider posSlider;
// Look for the three different sliders
juce::LookAndFeel_V4 volSliderLook;
juce::LookAndFeel_V4 speedSliderLook;
juce::LookAndFeel_V4 posSliderLook;
// pointer for the player and also need to be called in the constructor function
DJApplication* player;
// waveformdisplay object, further for the WaveformDisplay.cpp
WaveformDisplay waveformDisplay;
// add the state for the player
TransportState state;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DeckGUI)
};