CSL  6.0
MainServer.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 "juce.h"
6 
7 Component * createCSLComponent(); // extern function that creates the window
8 
9 class CSLWindow : public DocumentWindow {
10 public:
11  CSLWindow() : DocumentWindow (T("CSL 5.0 OSC/MIDI Server"),
12  Colours::lightgrey, DocumentWindow::allButtons, true) {
13  setContentComponent (createCSLComponent()); // create app window
14  setResizable (false, false);
15  setVisible (true);
16  setUsingNativeTitleBar(true);
17  centreWithSize(308, 200); // top window size 8 @ 24 larger than the component
18  }
19 
20  ~CSLWindow() { }
21 
23  JUCEApplication::quit();
24  }
25 };
26 
27 // This is the application object that is started up when Juce starts.
28 
29 class JUCECSLApplication : public JUCEApplication {
31 
32 public:
33  JUCECSLApplication() : mCSLWindow (0) { }
34 
36 
37  void initialise (const String& commandLine) {
38  mCSLWindow = new CSLWindow();
39  }
40 
41  void shutdown() {
42  if (mCSLWindow != 0)
43  delete mCSLWindow;
44  }
45 
46  const String getApplicationName() {
47  return T("JUCE/CSL");
48  }
49 
50  const String getApplicationVersion() {
51  return T("1.0");
52  }
53 
55  return true;
56  }
57 
58  void anotherInstanceStarted (const 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 unsigned argCnt; // globals for argc/v
68 char **argVals;
69 
70 int main (int argc, char* argv[]) {
71  argCnt = argc;
72  argVals = argv;
74 }
unsigned argCnt
Definition: MainServer.cpp:67
const String getApplicationVersion()
Definition: MainServer.cpp:50
bool moreThanOneInstanceAllowed()
Definition: MainServer.cpp:54
const String getApplicationName()
Definition: MainServer.cpp:46
CSLWindow * mCSLWindow
Definition: Main.cpp:30
void initialise(const String &commandLine)
Definition: MainServer.cpp:37
void closeButtonPressed()
Definition: MainServer.cpp:22
char ** argVals
Definition: MainServer.cpp:68
Component * createCSLComponent()
void anotherInstanceStarted(const String &commandLine)
Definition: MainServer.cpp:58
int main(int argc, char *argv[])
Definition: MainServer.cpp:70