PLEASE HELP Inheritance in Juce

Sorry if this is a beginner topic and ive posted it in the wrong place, I am a complete begginer. I'm using Juce and want to make a load button class but having trouble getting it to inherit from a class like FileChooser so i can use it to select an audio file. Can someone point me in the write direction i'm really struggling to understand JUCE api documentation and topics like pointers.

here is the cpp and h sections of my load button so far which ive succesfully managed to build and make clickable to callback function which prints hello world. can anyone code me a callback function which loads in an audio file or just a file as a starting point.

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
#ifndef H_BUTTON
#define H_BUTTON

#include <juce.h>
#include "LoadButton.h"


/**
 play button component for the applicaiton
 */
class LoadButton :	public TextButton,
					public Button::Listener
					
{
public:
	//==============================================================================
    /**
     Constructor
     */
	LoadButton();
    
    /**
     Destructor
     */
	~LoadButton();
    
	
	
	void buttonClicked (Button* button);
	

    
	
private:
	//==============================================================================
	//Add data members here
	
	int button;
	
};

#endif //H_BUTTON 


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

#include "LoadButton.h"

LoadButton::LoadButton()
{
	addListener(this);
}

LoadButton::~LoadButton()
{
	
	
}


void LoadButton::buttonClicked(Button* button)
{
	

	



	
	printf("hello world");
}


Further guidance on JUCE classes can be sought here for those better at c++ than me but not familiar with JUCE.

http://www.rawmaterialsoftware.com/api/
Topic archived. No new replies allowed.