From 6264cdcc2b24fbfc004a60b396174a45f1c0b285 Mon Sep 17 00:00:00 2001 From: jules Date: Sun, 17 Jun 2007 18:45:30 +0000 Subject: [PATCH] --- .../juce_win32_ASIO.cpp | 2 +- .../juce_win32_DirectSound.cpp | 38 +++++++++---------- .../juce_win32_Fonts.cpp | 6 +-- .../juce_win32_Messaging.cpp | 2 +- .../juce_win32_Midi.cpp | 2 +- .../juce_win32_Network.cpp | 4 +- .../juce_win32_Windowing.cpp | 2 +- extras/juce demo/src/demos/OpenGLDemo.cpp | 2 +- .../application/juce_Application.cpp | 8 ++-- .../juce_OggVorbisAudioFormat.cpp | 6 +-- .../audio/midi/juce_MidiMessage.cpp | 12 +++--- .../documents/juce_FileBasedDocument.cpp | 2 +- .../events/juce_InterprocessConnection.cpp | 2 +- .../juce_InterprocessConnectionServer.cpp | 2 +- src/juce_appframework/events/juce_Timer.cpp | 2 +- .../gui/components/buttons/juce_Button.cpp | 4 +- .../filebrowser/juce_FileBrowserComponent.cpp | 20 +++++----- .../juce_ImagePreviewComponent.cpp | 6 +-- .../gui/components/keyboard/juce_KeyPress.cpp | 14 +++---- .../lookandfeel/juce_LookAndFeel.cpp | 6 +-- .../lookandfeel/juce_ShinyLookAndFeel.cpp | 8 ++-- .../gui/components/menus/juce_PopupMenu.cpp | 6 +-- .../juce_AudioDeviceSelectorComponent.cpp | 22 +++++------ .../windows/juce_ThreadWithProgressWindow.cpp | 2 +- .../components/windows/juce_TooltipWindow.cpp | 2 +- src/juce_core/basics/juce_FileLogger.cpp | 12 +++--- src/juce_core/basics/juce_Logger.cpp | 4 +- src/juce_core/basics/juce_SystemStats.cpp | 2 +- src/juce_core/basics/juce_Time.cpp | 16 ++++---- src/juce_core/io/files/juce_File.cpp | 10 ++--- src/juce_core/io/network/juce_Socket.cpp | 2 +- .../misc/juce_PerformanceCounter.cpp | 24 +++++++----- src/juce_core/text/juce_String.cpp | 1 - src/juce_core/text/juce_XmlDocument.cpp | 26 ++++++------- src/juce_core/text/juce_XmlElement.cpp | 14 +++---- src/juce_core/threads/juce_Thread.cpp | 2 +- 36 files changed, 150 insertions(+), 145 deletions(-) diff --git a/build/win32/platform_specific_code/juce_win32_ASIO.cpp b/build/win32/platform_specific_code/juce_win32_ASIO.cpp index 132b1fa5e1..4a9a7c313f 100644 --- a/build/win32/platform_specific_code/juce_win32_ASIO.cpp +++ b/build/win32/platform_specific_code/juce_win32_ASIO.cpp @@ -135,7 +135,7 @@ public: ASIOAudioIODevice (const String& name_, CLSID classId_) : AudioIODevice (name_, T("ASIO")), - Thread (T("Juce ASIO")), + Thread ("Juce ASIO"), classId (classId_), currentBitDepth (16), currentSampleRate (0), diff --git a/build/win32/platform_specific_code/juce_win32_DirectSound.cpp b/build/win32/platform_specific_code/juce_win32_DirectSound.cpp index 077b12249f..6c93c7720e 100644 --- a/build/win32/platform_specific_code/juce_win32_DirectSound.cpp +++ b/build/win32/platform_specific_code/juce_win32_DirectSound.cpp @@ -153,60 +153,60 @@ BEGIN_JUCE_NAMESPACE static const String getDSErrorMessage (HRESULT hr) { - const tchar* result = 0; + const char* result = 0; switch (hr) { case MAKE_HRESULT(1, 0x878, 10): - result = T("Device already allocated"); + result = "Device already allocated"; break; case MAKE_HRESULT(1, 0x878, 30): - result = T("Control unavailable"); + result = "Control unavailable"; break; case E_INVALIDARG: - result = T("Invalid parameter"); + result = "Invalid parameter"; break; case MAKE_HRESULT(1, 0x878, 50): - result = T("Invalid call"); + result = "Invalid call"; break; case E_FAIL: - result = T("Generic error"); + result = "Generic error"; break; case MAKE_HRESULT(1, 0x878, 70): - result = T("Priority level error"); + result = "Priority level error"; break; case E_OUTOFMEMORY: - result = T("Out of memory"); + result = "Out of memory"; break; case MAKE_HRESULT(1, 0x878, 100): - result = T("Bad format"); + result = "Bad format"; break; case E_NOTIMPL: - result = T("Unsupported function"); + result = "Unsupported function"; break; case MAKE_HRESULT(1, 0x878, 120): - result = T("No driver"); + result = "No driver"; break; case MAKE_HRESULT(1, 0x878, 130): - result = T("Already initialised"); + result = "Already initialised"; break; case CLASS_E_NOAGGREGATION: - result = T("No aggregation"); + result = "No aggregation"; break; case MAKE_HRESULT(1, 0x878, 150): - result = T("Buffer lost"); + result = "Buffer lost"; break; case MAKE_HRESULT(1, 0x878, 160): - result = T("Another app has priority"); + result = "Another app has priority"; break; case MAKE_HRESULT(1, 0x878, 170): - result = T("Uninitialised"); + result = "Uninitialised"; break; case E_NOINTERFACE: - result = T("No interface"); + result = "No interface"; break; case S_OK: - result = T("No error"); + result = "No error"; break; default: @@ -982,7 +982,7 @@ public: const int index, const int inputIndex_) : AudioIODevice (deviceName, T("DirectSound")), - Thread (T("Juce DSound")), + Thread ("Juce DSound"), isOpen_ (false), isStarted (false), deviceIndex (index), diff --git a/build/win32/platform_specific_code/juce_win32_Fonts.cpp b/build/win32/platform_specific_code/juce_win32_Fonts.cpp index ccc0e97b6d..674818676f 100644 --- a/build/win32/platform_specific_code/juce_win32_Fonts.cpp +++ b/build/win32/platform_specific_code/juce_win32_Fonts.cpp @@ -211,9 +211,9 @@ void Font::getDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed) { - defaultSans = T("Verdana"); - defaultSerif = T("Times"); - defaultFixed = T("Lucida Console"); + defaultSans = "Verdana"; + defaultSerif = "Times"; + defaultFixed = "Lucida Console"; } //============================================================================== diff --git a/build/win32/platform_specific_code/juce_win32_Messaging.cpp b/build/win32/platform_specific_code/juce_win32_Messaging.cpp index 1a972354e1..da7bbb22e1 100644 --- a/build/win32/platform_specific_code/juce_win32_Messaging.cpp +++ b/build/win32/platform_specific_code/juce_win32_Messaging.cpp @@ -208,7 +208,7 @@ static const String getMessageWindowClassName() if (number == 0) number = 0x7fffffff & (int) Time::getHighResolutionTicks(); - return T("JUCEWindowClass_") + String (number); + return T("JUCEcs_") + String (number); } void MessageManager::doPlatformSpecificInitialisation() diff --git a/build/win32/platform_specific_code/juce_win32_Midi.cpp b/build/win32/platform_specific_code/juce_win32_Midi.cpp index ad0291962c..e27cb05c1b 100644 --- a/build/win32/platform_specific_code/juce_win32_Midi.cpp +++ b/build/win32/platform_specific_code/juce_win32_Midi.cpp @@ -55,7 +55,7 @@ public: //============================================================================== MidiInThread (MidiInput* const input_, MidiInputCallback* const callback_) - : Thread (T("Juce Midi")), + : Thread ("Juce Midi"), hIn (0), input (input_), callback (callback_), diff --git a/build/win32/platform_specific_code/juce_win32_Network.cpp b/build/win32/platform_specific_code/juce_win32_Network.cpp index 71def49067..80ac133f0a 100644 --- a/build/win32/platform_specific_code/juce_win32_Network.cpp +++ b/build/win32/platform_specific_code/juce_win32_Network.cpp @@ -226,7 +226,7 @@ static int getMACAddressViaGetAdaptersInfo (int64* addresses, int maxNum) { int numFound = 0; - DynamicLibraryLoader dll (T("iphlpapi.dll")); + DynamicLibraryLoader dll ("iphlpapi.dll"); DynamicLibraryImport (GetAdaptersInfo, getAdaptersInfo, DWORD, dll, (PIP_ADAPTER_INFO, PULONG)) if (getAdaptersInfo != 0) @@ -266,7 +266,7 @@ static int getMACAddressesViaNetBios (int64* addresses, int maxNum) { int numFound = 0; - DynamicLibraryLoader dll (T("netapi32.dll")); + DynamicLibraryLoader dll ("netapi32.dll"); DynamicLibraryImport (Netbios, NetbiosCall, UCHAR, dll, (PNCB)) if (NetbiosCall != 0) diff --git a/build/win32/platform_specific_code/juce_win32_Windowing.cpp b/build/win32/platform_specific_code/juce_win32_Windowing.cpp index f2764b0e7c..16ccb9a819 100644 --- a/build/win32/platform_specific_code/juce_win32_Windowing.cpp +++ b/build/win32/platform_specific_code/juce_win32_Windowing.cpp @@ -993,7 +993,7 @@ private: { public: JUCE_CALLTYPE WindowClassHolder() - : windowClassName (T("JUCE_")) + : windowClassName ("JUCE_") { // this name has to be different for each app/dll instance because otherwise // poor old Win32 can get a bit confused (even despite it not being a process-global diff --git a/extras/juce demo/src/demos/OpenGLDemo.cpp b/extras/juce demo/src/demos/OpenGLDemo.cpp index 7dadef9e06..d98dd70f14 100644 --- a/extras/juce demo/src/demos/OpenGLDemo.cpp +++ b/extras/juce demo/src/demos/OpenGLDemo.cpp @@ -138,7 +138,7 @@ public: glLoadIdentity(); glOrtho (0.0, getWidth(), 0.0, getHeight(), 0, 1); - glColor4f (1.0f, 1.0f, 1.0f, fabsf (sinf (rotation / 100.0f))); + glColor4f (1.0f, 1.0f, 1.0f, fabsf (::sinf (rotation / 100.0f))); glBegin(GL_QUADS); glTexCoord2i (0, 0); glVertex2f (50.0f, getHeight() - 50.0f); glTexCoord2i (1, 0); glVertex2f (getWidth() - 50.0f, getHeight() - 50.0f); diff --git a/src/juce_appframework/application/juce_Application.cpp b/src/juce_appframework/application/juce_Application.cpp index ddb4400431..36725fef74 100644 --- a/src/juce_appframework/application/juce_Application.cpp +++ b/src/juce_appframework/application/juce_Application.cpp @@ -134,9 +134,9 @@ void JUCEApplication::getCommandInfo (const CommandID commandID, ApplicationComm { if (commandID == StandardApplicationCommandIDs::quit) { - result.setInfo (T("Quit"), - T("Quits the application"), - T("Application"), + result.setInfo ("Quit", + "Quits the application", + "Application", 0); result.defaultKeypresses.add (KeyPress (T('q'), ModifierKeys::commandModifier, 0)); @@ -199,7 +199,7 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app) JUCE_TRY { - juce_setCurrentThreadName (T("Juce Message Thread")); + juce_setCurrentThreadName ("Juce Message Thread"); // let the app do its setting-up.. app->initialise (commandLine.trim()); diff --git a/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp b/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp index 8f63268b96..9d38f53308 100644 --- a/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp +++ b/src/juce_appframework/audio/audio_file_formats/juce_OggVorbisAudioFormat.cpp @@ -415,9 +415,9 @@ bool OggVorbisAudioFormat::isCompressed() const StringArray OggVorbisAudioFormat::getQualityOptions() { StringArray s; - s.add (T("Low Quality")); - s.add (T("Medium Quality")); - s.add (T("High Quality")); + s.add ("Low Quality"); + s.add ("Medium Quality"); + s.add ("High Quality"); return s; } diff --git a/src/juce_appframework/audio/midi/juce_MidiMessage.cpp b/src/juce_appframework/audio/midi/juce_MidiMessage.cpp index 9d10e35062..5919e115a3 100644 --- a/src/juce_appframework/audio/midi/juce_MidiMessage.cpp +++ b/src/juce_appframework/audio/midi/juce_MidiMessage.cpp @@ -974,13 +974,13 @@ const String MidiMessage::getMidiNoteName (int note, bool includeOctaveNumber, int octaveNumForMiddleC) throw() { - static const tchar* sharpNoteNames[] = { T("C"), T("C#"), T("D"), T("D#"), T("E"), - T("F"), T("F#"), T("G"), T("G#"), T("A"), - T("A#"), T("B") }; + static const char* const sharpNoteNames[] = { "C", "C#", "D", "D#", "E", + "F", "F#", "G", "G#", "A", + "A#", "B" }; - static const tchar* flatNoteNames[] = { T("C"), T("Db"), T("D"), T("Eb"), T("E"), - T("F"), T("Gb"), T("G"), T("Ab"), T("A"), - T("Bb"), T("B") }; + static const char* const flatNoteNames[] = { "C", "Db", "D", "Eb", "E", + "F", "Gb", "G", "Ab", "A", + "Bb", "B" }; if (note >= 0 && note < 128) { diff --git a/src/juce_appframework/documents/juce_FileBasedDocument.cpp b/src/juce_appframework/documents/juce_FileBasedDocument.cpp index 82602f29c4..de76a10dd2 100644 --- a/src/juce_appframework/documents/juce_FileBasedDocument.cpp +++ b/src/juce_appframework/documents/juce_FileBasedDocument.cpp @@ -105,7 +105,7 @@ bool FileBasedDocument::loadFrom (const File& newFile, } else { - error = T("The file doesn't exist"); + error = "The file doesn't exist"; } documentFile = oldFile; diff --git a/src/juce_appframework/events/juce_InterprocessConnection.cpp b/src/juce_appframework/events/juce_InterprocessConnection.cpp index a521dc5917..e8194831de 100644 --- a/src/juce_appframework/events/juce_InterprocessConnection.cpp +++ b/src/juce_appframework/events/juce_InterprocessConnection.cpp @@ -40,7 +40,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== InterprocessConnection::InterprocessConnection (const bool callbacksOnMessageThread, const uint32 magicMessageHeaderNumber) - : Thread (T("Juce IPC connection")), + : Thread ("Juce IPC connection"), socket (0), pipe (0), callbackConnectionState (false), diff --git a/src/juce_appframework/events/juce_InterprocessConnectionServer.cpp b/src/juce_appframework/events/juce_InterprocessConnectionServer.cpp index 5c4bc8feaa..96ffc855a8 100644 --- a/src/juce_appframework/events/juce_InterprocessConnectionServer.cpp +++ b/src/juce_appframework/events/juce_InterprocessConnectionServer.cpp @@ -38,7 +38,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== InterprocessConnectionServer::InterprocessConnectionServer() - : Thread (T("Juce IPC server")), + : Thread ("Juce IPC server"), socket (0) { } diff --git a/src/juce_appframework/events/juce_Timer.cpp b/src/juce_appframework/events/juce_Timer.cpp index dcce519c34..0670e4304c 100644 --- a/src/juce_appframework/events/juce_Timer.cpp +++ b/src/juce_appframework/events/juce_Timer.cpp @@ -164,7 +164,7 @@ private: public: InternalTimerThread() - : Thread (T("Juce Timer")), + : Thread ("Juce Timer"), firstTimer (0), callbackNeeded (false) { diff --git a/src/juce_appframework/gui/components/buttons/juce_Button.cpp b/src/juce_appframework/gui/components/buttons/juce_Button.cpp index 6bfb521974..f3f671d263 100644 --- a/src/juce_appframework/gui/components/buttons/juce_Button.cpp +++ b/src/juce_appframework/gui/components/buttons/juce_Button.cpp @@ -106,9 +106,9 @@ const String Button::getTooltip() String key (keyPresses.getUnchecked(i).getTextDescription()); if (key.length() == 1) - tt << T(" [shortcut: '") << key << T("']"); + tt << " [shortcut: '" << key << "']"; else - tt << T(" [") << key << T(']'); + tt << " [" << key << ']'; } return tt; diff --git a/src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp b/src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp index 4bea12fd9b..9cd8ed920d 100644 --- a/src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp +++ b/src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp @@ -450,7 +450,7 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr if (volume.isEmpty()) volume = TRANS("Hard Drive"); - name << T(" [") << drive->getVolumeLabel() << T(']'); + name << " [" << drive->getVolumeLabel() << ']'; } else if (drive->isOnCDRomDrive()) { @@ -463,18 +463,18 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr separators.setBit (rootPaths.size()); rootPaths.add (File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName()); - rootNames.add (T("Documents")); + rootNames.add ("Documents"); rootPaths.add (File::getSpecialLocation (File::userDesktopDirectory).getFullPathName()); - rootNames.add (T("Desktop")); + rootNames.add ("Desktop"); #endif #ifdef JUCE_MAC rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName()); - rootNames.add (T("Home folder")); + rootNames.add ("Home folder"); rootPaths.add (File::getSpecialLocation (File::userDocumentsDirectory).getFullPathName()); - rootNames.add (T("Documents")); + rootNames.add ("Documents"); rootPaths.add (File::getSpecialLocation (File::userDesktopDirectory).getFullPathName()); - rootNames.add (T("Desktop")); + rootNames.add ("Desktop"); separators.setBit (rootPaths.size()); @@ -495,12 +495,12 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr #endif #ifdef JUCE_LINUX - rootPaths.add (T("/")); - rootNames.add (T("/")); + rootPaths.add ("/"); + rootNames.add ("/"); rootPaths.add (File::getSpecialLocation (File::userHomeDirectory).getFullPathName()); - rootNames.add (T("Home folder")); + rootNames.add ("Home folder"); rootPaths.add (File::getSpecialLocation (File::userDesktopDirectory).getFullPathName()); - rootNames.add (T("Desktop")); + rootNames.add ("Desktop"); #endif return separators; diff --git a/src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp b/src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp index e64928c879..21b8262841 100644 --- a/src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp +++ b/src/juce_appframework/gui/components/filebrowser/juce_ImagePreviewComponent.cpp @@ -96,9 +96,9 @@ void ImagePreviewComponent::timerCallback() int h = currentThumbnail->getHeight(); currentDetails - << fileToLoad.getFileName() << T("\n") - << format->getFormatName() << T("\n") - << w << T(" x ") << h << T(" pixels\n") + << fileToLoad.getFileName() << "\n" + << format->getFormatName() << "\n" + << w << " x " << h << " pixels\n" << File::descriptionOfSizeInBytes (fileToLoad.getSize()); getThumbSize (w, h); diff --git a/src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp b/src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp index e42a998797..a5b0ee8e28 100644 --- a/src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp +++ b/src/juce_appframework/gui/components/keyboard/juce_KeyPress.cpp @@ -229,22 +229,22 @@ const String KeyPress::getTextDescription() const if (keyCode > 0) { if (mods.isCtrlDown()) - desc += T("ctrl + "); + desc << "ctrl + "; if (mods.isShiftDown()) - desc += T("shift + "); + desc << "shift + "; #ifdef JUCE_MAC // only do this on the mac, because on Windows ctrl and command are the same, // and this would get confusing if (mods.isCommandDown()) - desc += T("command + "); + desc << "command + "; if (mods.isAltDown()) - desc += T("option + "); + desc << "option + "; #else if (mods.isAltDown()) - desc += T("alt + "); + desc << "alt + "; #endif for (int i = 0; i < numElementsInArray (keyNameTranslations); ++i) @@ -252,13 +252,13 @@ const String KeyPress::getTextDescription() const return desc + keyNameTranslations[i].name; if (keyCode >= F1Key && keyCode <= F16Key) - desc << T("F") << (1 + keyCode - F1Key); + desc << 'F' << (1 + keyCode - F1Key); else if (keyCode >= numberPad0 && keyCode <= numberPad9) desc << numberPadPrefix << (keyCode - numberPad0); else if (keyCode >= 33 && keyCode < 176) desc += CharacterFunctions::toUpperCase ((tchar) keyCode); else - desc << T('#') << String::toHexString (keyCode); + desc << '#' << String::toHexString (keyCode); } return desc; diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp index e37f4d51ef..d07f547068 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_LookAndFeel.cpp @@ -1346,7 +1346,7 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) shape.addLineSegment (0.0f, 0.0f, 1.0f, 1.0f, 0.35f); shape.addLineSegment (1.0f, 0.0f, 0.0f, 1.0f, 0.35f); - ShapeButton* const b = new ShapeButton (T("close"), + ShapeButton* const b = new ShapeButton ("close", Colour (0x7fff3333), Colour (0xd7ff3333), Colour (0xf7ff3333)); @@ -1358,7 +1358,7 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) { shape.addLineSegment (0.0f, 0.5f, 1.0f, 0.5f, 0.25f); - DrawableButton* b = new DrawableButton (T("minimise"), DrawableButton::ImageFitted); + DrawableButton* b = new DrawableButton ("minimise", DrawableButton::ImageFitted); DrawablePath dp; dp.setPath (shape); dp.setSolidFill (Colours::black.withAlpha (0.3f)); @@ -1370,7 +1370,7 @@ Button* LookAndFeel::createDocumentWindowButton (int buttonType) shape.addLineSegment (0.5f, 0.0f, 0.5f, 1.0f, 0.25f); shape.addLineSegment (0.0f, 0.5f, 1.0f, 0.5f, 0.25f); - DrawableButton* b = new DrawableButton (T("maximise"), DrawableButton::ImageFitted); + DrawableButton* b = new DrawableButton ("maximise", DrawableButton::ImageFitted); DrawablePath dp; dp.setPath (shape); dp.setSolidFill (Colours::black.withAlpha (0.3f)); diff --git a/src/juce_appframework/gui/components/lookandfeel/juce_ShinyLookAndFeel.cpp b/src/juce_appframework/gui/components/lookandfeel/juce_ShinyLookAndFeel.cpp index c3513c06ce..df700c10f7 100644 --- a/src/juce_appframework/gui/components/lookandfeel/juce_ShinyLookAndFeel.cpp +++ b/src/juce_appframework/gui/components/lookandfeel/juce_ShinyLookAndFeel.cpp @@ -553,7 +553,7 @@ void ShinyLookAndFeel::drawLinearSlider (Graphics& g, Button* ShinyLookAndFeel::createSliderButton (const bool isIncrement) { - return new TextButton (isIncrement ? T("+") : T("-"), String::empty); + return new TextButton (isIncrement ? "+" : "-", String::empty); } ImageEffectFilter* ShinyLookAndFeel::getSliderEffect() @@ -735,13 +735,13 @@ Button* ShinyLookAndFeel::createDocumentWindowButton (int buttonType) shape.addLineSegment (0.0f, 0.0f, 1.0f, 1.0f, crossThickness * 1.4f); shape.addLineSegment (1.0f, 0.0f, 0.0f, 1.0f, crossThickness * 1.4f); - return new GlassWindowButton (T("close"), Colour (0xffdd1100), shape, shape); + return new GlassWindowButton ("close", Colour (0xffdd1100), shape, shape); } else if (buttonType == DocumentWindow::minimiseButton) { shape.addLineSegment (0.0f, 0.5f, 1.0f, 0.5f, crossThickness); - return new GlassWindowButton (T("minimise"), Colour (0xffaa8811), shape, shape); + return new GlassWindowButton ("minimise", Colour (0xffaa8811), shape, shape); } else if (buttonType == DocumentWindow::maximiseButton) { @@ -757,7 +757,7 @@ Button* ShinyLookAndFeel::createDocumentWindowButton (int buttonType) fullscreenShape.addRectangle (45.0f, 45.0f, 100.0f, 100.0f); PathStrokeType (30.0f).createStrokedPath (fullscreenShape, fullscreenShape); - return new GlassWindowButton (T("maximise"), Colour (0xff119911), shape, fullscreenShape); + return new GlassWindowButton ("maximise", Colour (0xff119911), shape, fullscreenShape); } jassertfalse diff --git a/src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp b/src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp index dad0a03c78..d384ee192c 100644 --- a/src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp +++ b/src/juce_appframework/gui/components/menus/juce_PopupMenu.cpp @@ -115,10 +115,10 @@ public: const String key (keyPresses.getUnchecked(i).getTextDescription()); if (shortcutKey.isNotEmpty()) - shortcutKey << T(", "); + shortcutKey << ", "; if (key.length() == 1) - shortcutKey << T("shortcut: '") << key << T("'"); + shortcutKey << "shortcut: '" << key << '\''; else shortcutKey << key; } @@ -126,7 +126,7 @@ public: shortcutKey = shortcutKey.trim(); if (shortcutKey.isNotEmpty()) - text << T("") << shortcutKey; + text << "" << shortcutKey; } } diff --git a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index 344fb919d7..f8df1b7132 100644 --- a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -277,7 +277,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& jassert (minOutputChannels >= 0 && minOutputChannels <= maxOutputChannels); jassert (minInputChannels >= 0 && minInputChannels <= maxInputChannels); - audioDeviceDropDown = new ComboBox (T("device")); + audioDeviceDropDown = new ComboBox ("device"); deviceManager_.addDeviceNamesToComboBox (*audioDeviceDropDown); audioDeviceDropDown->setSelectedId (-1, true); @@ -287,7 +287,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& audioDeviceDropDown->addListener (this); addAndMakeVisible (audioDeviceDropDown); - Label* label = new Label (T("l1"), TRANS ("audio device:")); + Label* label = new Label ("l1", TRANS ("audio device:")); label->attachToComponent (audioDeviceDropDown, true); if (showMidiOptions) @@ -298,7 +298,7 @@ AudioDeviceSelectorComponent::AudioDeviceSelectorComponent (AudioDeviceManager& TRANS("(no midi inputs available)"), 0, 0)); - midiInputsLabel = new Label (T("lm"), TRANS ("active midi inputs:")); + midiInputsLabel = new Label ("lm", TRANS ("active midi inputs:")); midiInputsLabel->setJustificationType (Justification::topRight); midiInputsLabel->attachToComponent (midiInputsList, true); } @@ -458,8 +458,8 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*) if (currentDevice != 0) { // sample rate - addAndMakeVisible (sampleRateDropDown = new ComboBox (T("samplerate"))); - sampleRateLabel = new Label (T("l2"), TRANS ("sample rate:")); + addAndMakeVisible (sampleRateDropDown = new ComboBox ("samplerate")); + sampleRateLabel = new Label ("l2", TRANS ("sample rate:")); sampleRateLabel->attachToComponent (sampleRateDropDown, true); const int numRates = currentDevice->getNumSampleRates(); @@ -476,8 +476,8 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*) sampleRateDropDown->addListener (this); // buffer size - addAndMakeVisible (bufferSizeDropDown = new ComboBox (T("buffersize"))); - bufferSizeLabel = new Label (T("l2"), TRANS ("audio buffer size:")); + addAndMakeVisible (bufferSizeDropDown = new ComboBox ("buffersize")); + bufferSizeLabel = new Label ("l2", TRANS ("audio buffer size:")); bufferSizeLabel->attachToComponent (bufferSizeDropDown, true); const int numBufferSizes = currentDevice->getNumBufferSizesAvailable(); @@ -509,10 +509,10 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*) addAndMakeVisible (outputChansBox = new AudioDeviceSelectorComponentListBox (deviceManager, AudioDeviceSelectorComponentListBox::audioOutputType, - TRANS("(no audio output channels found)"), + TRANS ("(no audio output channels found)"), minOutputChannels, maxOutputChannels)); - outputsLabel = new Label (T("l3"), TRANS ("active output channels:")); + outputsLabel = new Label ("l3", TRANS ("active output channels:")); outputsLabel->attachToComponent (outputChansBox, true); } @@ -522,10 +522,10 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*) addAndMakeVisible (inputChansBox = new AudioDeviceSelectorComponentListBox (deviceManager, AudioDeviceSelectorComponentListBox::audioInputType, - TRANS("(no audio input channels found)"), + TRANS ("(no audio input channels found)"), minInputChannels, maxInputChannels)); - inputsLabel = new Label (T("l4"), TRANS("active input channels:")); + inputsLabel = new Label ("l4", TRANS ("active input channels:")); inputsLabel->attachToComponent (inputChansBox, true); } diff --git a/src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp b/src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp index 7caed3826d..e16323e7d8 100644 --- a/src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp +++ b/src/juce_appframework/gui/components/windows/juce_ThreadWithProgressWindow.cpp @@ -43,7 +43,7 @@ ThreadWithProgressWindow::ThreadWithProgressWindow (const String& title, const bool hasProgressBar, const bool hasCancelButton, const int timeOutMsWhenCancelling_) - : Thread (T("Juce Progress Window")), + : Thread ("Juce Progress Window"), progress (0.0), alertWindow (title, String::empty, AlertWindow::NoIcon), timeOutMsWhenCancelling (timeOutMsWhenCancelling_) diff --git a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp index 7cd99c6189..825d71c8e5 100644 --- a/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp +++ b/src/juce_appframework/gui/components/windows/juce_TooltipWindow.cpp @@ -43,7 +43,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== TooltipWindow::TooltipWindow (Component* const parentComponent, const int millisecondsBeforeTipAppears_) - : Component (T("tooltip")), + : Component ("tooltip"), millisecondsBeforeTipAppears (millisecondsBeforeTipAppears_), mouseX (0), mouseY (0), diff --git a/src/juce_core/basics/juce_FileLogger.cpp b/src/juce_core/basics/juce_FileLogger.cpp index 3e2e368209..9504ea896d 100644 --- a/src/juce_core/basics/juce_FileLogger.cpp +++ b/src/juce_core/basics/juce_FileLogger.cpp @@ -58,11 +58,13 @@ FileLogger::FileLogger (const File& logFile_, logStream = logFile_.createOutputStream (256); jassert (logStream != 0); - logMessage (T("\r\n**********************************************************\r\n") - + welcomeMessage - + T("\r\nLog started: ") - + Time::getCurrentTime().toString (true, true) - + T("\r\n")); + String welcome; + welcome << "\r\n**********************************************************\r\n" + << welcomeMessage + << "\r\nLog started: " << Time::getCurrentTime().toString (true, true) + << "\r\n"; + + logMessage (welcome); } FileLogger::~FileLogger() diff --git a/src/juce_core/basics/juce_Logger.cpp b/src/juce_core/basics/juce_Logger.cpp index d3f27c22eb..5d5ef4f8cc 100644 --- a/src/juce_core/basics/juce_Logger.cpp +++ b/src/juce_core/basics/juce_Logger.cpp @@ -69,8 +69,8 @@ void Logger::writeToLog (const String& message) #if JUCE_LOG_ASSERTIONS void juce_LogAssertion (const char* filename, const int lineNum) throw() { - String m (T("JUCE Assertion failure in ")); - m << filename << T(", line ") << lineNum; + String m ("JUCE Assertion failure in "); + m << filename << ", line " << lineNum; Logger::writeToLog (m); } diff --git a/src/juce_core/basics/juce_SystemStats.cpp b/src/juce_core/basics/juce_SystemStats.cpp index 056a5bfaac..2e08c6af0d 100644 --- a/src/juce_core/basics/juce_SystemStats.cpp +++ b/src/juce_core/basics/juce_SystemStats.cpp @@ -45,7 +45,7 @@ BEGIN_JUCE_NAMESPACE //============================================================================== const String SystemStats::getJUCEVersion() throw() { - return T("JUCE v") + String (JUCE_MAJOR_VERSION) + T(".") + String (JUCE_MINOR_VERSION); + return T("JUCE v") + String (JUCE_MAJOR_VERSION) + "." + String (JUCE_MINOR_VERSION); } diff --git a/src/juce_core/basics/juce_Time.cpp b/src/juce_core/basics/juce_Time.cpp index f71dc3c569..2ccd906df6 100644 --- a/src/juce_core/basics/juce_Time.cpp +++ b/src/juce_core/basics/juce_Time.cpp @@ -447,25 +447,25 @@ const String Time::getWeekdayName (const bool threeLetterVersion) const throw() const String Time::getMonthName (int monthNumber, const bool threeLetterVersion) throw() { - const tchar* const shortMonthNames[] = { T("Jan"), T("Feb"), T("Mar"), T("Apr"), T("May"), T("Jun"), T("Jul"), T("Aug"), T("Sep"), T("Oct"), T("Nov"), T("Dec") }; - const tchar* const longMonthNames[] = { T("January"), T("February"), T("March"), T("April"), T("May"), T("June"), T("July"), T("August"), T("September"), T("October"), T("November"), T("December") }; + const char* const shortMonthNames[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + const char* const longMonthNames[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; monthNumber %= 12; - return TRANS((threeLetterVersion) ? shortMonthNames [monthNumber] - : longMonthNames [monthNumber]); + return TRANS (threeLetterVersion ? shortMonthNames [monthNumber] + : longMonthNames [monthNumber]); } const String Time::getWeekdayName (int day, const bool threeLetterVersion) throw() { - const tchar* const shortDayNames[] = { T("Sun"), T("Mon"), T("Tue"), T("Wed"), T("Thu"), T("Fri"), T("Sat") }; - const tchar* const longDayNames[] = { T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"), T("Thursday"), T("Friday"), T("Saturday") }; + const char* const shortDayNames[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + const char* const longDayNames[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; day %= 7; - return TRANS((threeLetterVersion) ? shortDayNames [day] - : longDayNames [day]); + return TRANS (threeLetterVersion ? shortDayNames [day] + : longDayNames [day]); } END_JUCE_NAMESPACE diff --git a/src/juce_core/io/files/juce_File.cpp b/src/juce_core/io/files/juce_File.cpp index 64ad1f8b73..b204cdb0ce 100644 --- a/src/juce_core/io/files/juce_File.cpp +++ b/src/juce_core/io/files/juce_File.cpp @@ -514,23 +514,23 @@ const String JUCE_CALLTYPE File::descriptionOfSizeInBytes (const int64 bytes) { if (bytes == 1) { - return T("1 byte"); + return "1 byte"; } else if (bytes < 1024) { - return String ((int) bytes) + T(" bytes"); + return String ((int) bytes) + " bytes"; } else if (bytes < 1024 * 1024) { - return String (bytes / 1024.0, 1) + T(" KB"); + return String (bytes / 1024.0, 1) + " KB"; } else if (bytes < 1024 * 1024 * 1024) { - return String (bytes / (1024.0 * 1024.0), 1) + T(" MB"); + return String (bytes / (1024.0 * 1024.0), 1) + " MB"; } else { - return String (bytes / (1024.0 * 1024.0 * 1024.0), 1) + T(" GB"); + return String (bytes / (1024.0 * 1024.0 * 1024.0), 1) + " GB"; } } diff --git a/src/juce_core/io/network/juce_Socket.cpp b/src/juce_core/io/network/juce_Socket.cpp index bb36d14045..7e7e45c7e8 100644 --- a/src/juce_core/io/network/juce_Socket.cpp +++ b/src/juce_core/io/network/juce_Socket.cpp @@ -325,7 +325,7 @@ bool Socket::createListener (int newPortNumber) if (connected) close(); - hostName = T("listener"); + hostName = "listener"; portNumber = newPortNumber; isListener = true; diff --git a/src/juce_core/misc/juce_PerformanceCounter.cpp b/src/juce_core/misc/juce_PerformanceCounter.cpp index 46e9b226a0..a16caf0793 100644 --- a/src/juce_core/misc/juce_PerformanceCounter.cpp +++ b/src/juce_core/misc/juce_PerformanceCounter.cpp @@ -50,9 +50,11 @@ PerformanceCounter::PerformanceCounter (const String& name_, { if (outputFile != File::nonexistent) { - String s (T("**** Counter for \"")); - s += name_ + T("\" started at: "); - s += Time::getCurrentTime().toString (true, true) + T("\r\n"); + String s ("**** Counter for \""); + s << name_ << "\" started at: " + << Time::getCurrentTime().toString (true, true) + << "\r\n"; + outputFile.appendText (s, false, false); } } @@ -81,22 +83,24 @@ void PerformanceCounter::printStatistics() { if (numRuns > 0) { - String s (T("Performance count for \"")); - s << name << T("\" - average over ") << numRuns << T(" run(s) = "); + String s ("Performance count for \""); + s << name << "\" - average over " << numRuns << " run(s) = "; - const int micros = (int)(totalTime * (1000.0 / numRuns)); + const int micros = (int) (totalTime * (1000.0 / numRuns)); if (micros > 10000) - s << (micros/1000) << T(" millisecs"); + s << (micros/1000) << " millisecs"; else - s << micros << T(" microsecs"); + s << micros << " microsecs"; - s << (", total = ") << String (totalTime / 1000, 5) << T(" seconds"); + s << ", total = " << String (totalTime / 1000, 5) << " seconds"; Logger::outputDebugString (s); + s << "\r\n"; + if (outputFile != File::nonexistent) - outputFile.appendText (s + T("\r\n"), false, false); + outputFile.appendText (s, false, false); numRuns = 0; totalTime = 0; diff --git a/src/juce_core/text/juce_String.cpp b/src/juce_core/text/juce_String.cpp index 4e50985f61..ff8ff2df03 100644 --- a/src/juce_core/text/juce_String.cpp +++ b/src/juce_core/text/juce_String.cpp @@ -1922,7 +1922,6 @@ const String JUCE_CALLTYPE String::toHexString (const unsigned char* data, String s (numChars, (int) 0); tchar* d = s.text->text; - static const tchar* hexDigits = T("0123456789abcdef"); for (int i = 0; i < size; ++i) { diff --git a/src/juce_core/text/juce_XmlDocument.cpp b/src/juce_core/text/juce_XmlDocument.cpp index 84eb6d72b0..c6c0c7892b 100644 --- a/src/juce_core/text/juce_XmlDocument.cpp +++ b/src/juce_core/text/juce_XmlDocument.cpp @@ -375,7 +375,7 @@ void XmlDocument::readQuotedString (String& result) throw() else if (character == 0) { outOfData = true; - setLastError (T("unmatched quotes"), false); + setLastError ("unmatched quotes", false); break; } @@ -408,7 +408,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) throw if (tagLen == 0) { - setLastError (T("tag name missing"), false); + setLastError ("tag name missing", false); return node; } } @@ -484,7 +484,7 @@ XmlElement* XmlDocument::readNextElement (const bool alsoParseSubElements) throw else { if (! outOfData) - setLastError (T("illegal characters found"), false); + setLastError ("illegal characters found", false); } break; @@ -504,7 +504,7 @@ void XmlDocument::readChildElements (XmlElement* parent) throw() if (outOfData) { - setLastError (T("unmatched tags"), false); + setLastError ("unmatched tags", false); break; } @@ -535,7 +535,7 @@ void XmlDocument::readChildElements (XmlElement* parent) throw() { if (*input == 0) { - setLastError (T("unterminated CDATA section"), false); + setLastError ("unterminated CDATA section", false); outOfData = true; break; } @@ -604,7 +604,7 @@ void XmlDocument::readChildElements (XmlElement* parent) throw() if (c == 0) { - setLastError (T("unmatched tags"), false); + setLastError ("unmatched tags", false); outOfData = true; return; } @@ -660,7 +660,7 @@ void XmlDocument::readChildElements (XmlElement* parent) throw() } else if (c == 0) { - setLastError (T("unmatched tags"), false); + setLastError ("unmatched tags", false); outOfData = true; return; } @@ -727,7 +727,7 @@ void XmlDocument::readEntity (String& result) throw() if (hexValue < 0 || ++numChars > 8) { - setLastError (T("illegal escape sequence"), true); + setLastError ("illegal escape sequence", true); break; } @@ -745,7 +745,7 @@ void XmlDocument::readEntity (String& result) throw() { if (++numChars > 12) { - setLastError (T("illegal escape sequence"), true); + setLastError ("illegal escape sequence", true); break; } @@ -757,7 +757,7 @@ void XmlDocument::readEntity (String& result) throw() } else { - setLastError (T("illegal escape sequence"), true); + setLastError ("illegal escape sequence", true); result += T("&"); return; } @@ -817,7 +817,7 @@ const String XmlDocument::expandEntity (const String& ent) return String::charToString ((tchar) ent.substring (1).getIntValue()); } - setLastError (T("illegal escape sequence"), false); + setLastError ("illegal escape sequence", false); return T("&"); } else @@ -902,7 +902,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) if (semiColon < 0) { - setLastError (T("entity without terminating semi-colon"), false); + setLastError ("entity without terminating semi-colon", false); break; } @@ -920,7 +920,7 @@ const String XmlDocument::expandExternalEntity (const String& entity) } } - setLastError (T("unknown entity"), true); + setLastError ("unknown entity", true); return entity; } diff --git a/src/juce_core/text/juce_XmlElement.cpp b/src/juce_core/text/juce_XmlElement.cpp index 4484fca89d..5da8a5faf8 100644 --- a/src/juce_core/text/juce_XmlElement.cpp +++ b/src/juce_core/text/juce_XmlElement.cpp @@ -393,21 +393,21 @@ const String XmlElement::createDocument (const String& dtd, if (includeXmlHeader) { - doc << T(" "); + doc += "\"?> "; else - doc += T("\"?>\n\n"); + doc += "\"?>\n\n"; } if (dtd.isNotEmpty()) { if (allOnOneLine) - doc << dtd << T(" "); + doc << dtd << " "; else - doc << dtd << T("\r\n"); + doc << dtd << "\r\n"; } MemoryOutputStream mem (2048, 4096); @@ -429,8 +429,8 @@ bool XmlElement::writeToFile (const File& f, if (out != 0) { - *out << T("\r\n\r\n") - << dtd << T("\r\n"); + *out << "\r\n\r\n" + << dtd << "\r\n"; writeElementAsText (*out, 0); diff --git a/src/juce_core/threads/juce_Thread.cpp b/src/juce_core/threads/juce_Thread.cpp index 3a2bcf82be..67bd1f601a 100644 --- a/src/juce_core/threads/juce_Thread.cpp +++ b/src/juce_core/threads/juce_Thread.cpp @@ -183,7 +183,7 @@ void Thread::stopThread (const int timeOutMilliseconds) // there are bound to be locks and events left in // silly states when a thread is killed by force.. jassertfalse - Logger::writeToLog (T("!! killing thread by force !!")); + Logger::writeToLog ("!! killing thread by force !!"); juce_killThread (threadHandle_); threadHandle_ = 0;