CSL  6.0
Main.cpp
Go to the documentation of this file.
1 //
2 // Stripped Juce top-level window code, based on the hello world example
3 //
4 
5 #include "JuceHeader.h"
6 
7 juce::Component * createCSLComponent(); // extern function that creates the window
8 
9 class CSLWindow : public juce::DocumentWindow {
10 public:
11  CSLWindow() : juce::DocumentWindow ("CSL 6.0 Demos",
12  juce::Colours::lightgrey, DocumentWindow::allButtons, true) {
13  setContentOwned(createCSLComponent(), true); // create app window
14  setResizable (true, false);
15  setVisible (true);
16  setUsingNativeTitleBar(true);
17  centreWithSize (1000, 700); // top window size 8 @ 24 larger than the component
18  }
19 
20  ~CSLWindow() { }
21 
23  juce::JUCEApplication::quit();
24  }
25 };
26 
27 // This is the application object that is started up when Juce starts.
28 
29 class JUCECSLApplication : public juce::JUCEApplication {
31 
32 public:
33  JUCECSLApplication() : mCSLWindow (0) { }
34 
36 
37  void initialise (const juce::String& commandLine) {
38  mCSLWindow = new CSLWindow();
39  }
40 
41  void shutdown() {
42  if (mCSLWindow != 0)
43  delete mCSLWindow;
44  }
45 
46  const juce::String getApplicationName() {
47  return "JUCE/CSL";
48  }
49 
50  const juce::String getApplicationVersion() {
51  return "5.2";
52  }
53 
55  return true;
56  }
57 
58  void anotherInstanceStarted (const juce::String& commandLine) { }
59 };
60 
61 // This macro creates the application's main() function..
62 
63 START_JUCE_APPLICATION (JUCECSLApplication)
64 
65 // I do this by hand so that I can keep argc/argv
66 
67 //extern unsigned argCnt; // globals for argc/v
68 //extern const char **argVals;
69 
70 //int main (int argc, const char* argv[]) {
71 // argCnt = argc;
72 // argVals = argv;
73 // return JUCE_NAMESPACE::JUCEApplication::main (argc, argv /*, new JUCECSLApplication() */);
74 //}
juce::Component * createCSLComponent()
void anotherInstanceStarted(const juce::String &commandLine)
Definition: Main.cpp:58
CSLWindow()
Definition: Main.cpp:11
bool moreThanOneInstanceAllowed()
Definition: Main.cpp:54
CSLWindow * mCSLWindow
Definition: Main.cpp:30
void shutdown()
Definition: Main.cpp:41
void closeButtonPressed()
Definition: Main.cpp:22
const juce::String getApplicationName()
Definition: Main.cpp:46
~CSLWindow()
Definition: Main.cpp:20
void initialise(const juce::String &commandLine)
Definition: Main.cpp:37
const juce::String getApplicationVersion()
Definition: Main.cpp:50