Add TAL-Reverb-II plugin to test
[juce-lv2.git] / juce / source / extras / JuceDemo / Source / ApplicationStartup.cpp
blob62a5bd54db451650b6070e61d0b8113a95a71cc4
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-9 by Raw Material Software Ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the GNU General
10 Public License (Version 2), as published by the Free Software Foundation.
11 A copy of the license is included in the JUCE distribution, or can be found
12 online at www.gnu.org/licenses.
14 JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 ------------------------------------------------------------------------------
20 To release a closed-source product which uses JUCE, commercial licenses are
21 available: visit www.rawmaterialsoftware.com/juce for more information.
23 ==============================================================================
26 #include "jucedemo_headers.h"
27 #include "MainDemoWindow.h"
30 //==============================================================================
31 class JUCEDemoApplication : public JUCEApplication
33 public:
34 //==============================================================================
35 JUCEDemoApplication()
39 ~JUCEDemoApplication()
43 //==============================================================================
44 void initialise (const String& /*commandLine*/)
46 #if JUCE_IOS || JUCE_ANDROID
47 theMainWindow.setVisible (true);
48 theMainWindow.setFullScreen (true);
49 #else
50 theMainWindow.centreWithSize (700, 600);
51 theMainWindow.setVisible (true);
52 #endif
54 // this little function just demonstrates a few system info calls
55 Logger::outputDebugString (collectSomeSystemInfo());
57 /* on return from this method, the app will go into its the main event
58 dispatch loop, and this will run until something calls
59 JUCEAppliction::quit().
61 In this case, JUCEAppliction::quit() will be called by the
62 demo window when the user clicks on its close button.
66 void shutdown()
68 // This method is where your app should do any cleaning-up that's needed
69 // before being shut down.
72 //==============================================================================
73 const String getApplicationName()
75 // When you use the Jucer to auto-generate a project, it puts the project's name and version in
76 // this constant, so we can use that here as our return value. Alternatively you can return
77 // your own string here, of course.
78 return ProjectInfo::projectName;
81 const String getApplicationVersion()
83 // When you use the Jucer to auto-generate a project, it puts the project's name and version in
84 // this constant, so we can use that here as our return value. Alternatively you can return
85 // your own string here, of course.
86 return ProjectInfo::versionString;
89 bool moreThanOneInstanceAllowed()
91 return true;
94 void anotherInstanceStarted (const String& /*commandLine*/)
96 // This will get called if the user launches another copy of the app, but
97 // there's nothing that the demo app needs to do here.
100 private:
101 // This is the main demo window component.
102 MainDemoWindow theMainWindow;
104 //==============================================================================
105 // this little function just demonstrates a few system info calls
106 static const String collectSomeSystemInfo()
108 String systemInfo;
110 systemInfo
111 << "Time and date: " << Time::getCurrentTime().toString (true, true)
112 << "\nUser logon name: " << SystemStats::getLogonName()
113 << "\nFull user name: " << SystemStats::getFullUserName()
114 << "\nHost name: " << SystemStats::getComputerName()
115 << "\nOperating system: " << SystemStats::getOperatingSystemName()
116 << "\nCPU vendor: " << SystemStats::getCpuVendor()
117 << "\nCPU speed: " << SystemStats::getCpuSpeedInMegaherz() << "MHz"
118 << "\nNumber of CPUs: " << SystemStats::getNumCpus()
119 << "\nCPU has MMX: " << (SystemStats::hasMMX() ? "yes" : "no")
120 << "\nCPU has SSE: " << (SystemStats::hasSSE() ? "yes" : "no")
121 << "\nCPU has SSE2: " << (SystemStats::hasSSE2() ? "yes" : "no")
122 << "\nCPU has 3DNOW: " << (SystemStats::has3DNow() ? "yes" : "no")
123 << "\nMemory size: " << SystemStats::getMemorySizeInMegabytes() << "MB"
124 << "\nFound network card MAC addresses: " << getMacAddressList()
125 << "\nCurrent executable file: " << File::getSpecialLocation (File::currentExecutableFile).getFullPathName()
126 << "\nCurrent application file: " << File::getSpecialLocation (File::currentApplicationFile).getFullPathName()
127 << "\nCurrent working directory: " << File::getCurrentWorkingDirectory().getFullPathName()
128 << "\nUser home directory: " << File::getSpecialLocation (File::userHomeDirectory).getFullPathName()
129 << "\nUser documents directory: " << File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName()
130 << "\nUser application data directory: " << File::getSpecialLocation (File::userApplicationDataDirectory).getFullPathName()
131 << "\nCommon application data directory: " << File::getSpecialLocation (File::commonApplicationDataDirectory).getFullPathName()
132 << "\nTemp directory: " << File::getSpecialLocation (File::tempDirectory).getFullPathName()
133 << "\n\n";
135 return systemInfo;
138 static const String getMacAddressList()
140 Array <MACAddress> macAddresses;
141 MACAddress::findAllAddresses (macAddresses);
143 StringArray addressStrings;
144 for (int i = 0; i < macAddresses.size(); ++i)
145 addressStrings.add (macAddresses[i].toString());
147 return addressStrings.joinIntoString (", ");
152 //==============================================================================
154 This macro creates the application's main() function..
156 START_JUCE_APPLICATION (JUCEDemoApplication)