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
34 //==============================================================================
39 ~JUCEDemoApplication()
43 //==============================================================================
44 void initialise (const String
& /*commandLine*/)
46 #if JUCE_IOS || JUCE_ANDROID
47 theMainWindow
.setVisible (true);
48 theMainWindow
.setFullScreen (true);
50 theMainWindow
.centreWithSize (700, 600);
51 theMainWindow
.setVisible (true);
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.
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()
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.
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()
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()
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
)