Browse Source

misc optimisations

tags/2021-05-28
jules 18 years ago
parent
commit
38aa8c42a9
27 changed files with 186 additions and 203 deletions
  1. +8
    -8
      build/linux/platform_specific_code/juce_linux_Audio.cpp
  2. +6
    -6
      build/linux/platform_specific_code/juce_linux_Files.cpp
  3. +2
    -2
      build/linux/platform_specific_code/juce_linux_Fonts.cpp
  4. +1
    -1
      build/linux/platform_specific_code/juce_linux_Messaging.cpp
  5. +6
    -6
      build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp
  6. +4
    -4
      build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp
  7. +5
    -5
      build/macosx/platform_specific_code/juce_mac_Files.cpp
  8. +3
    -3
      build/macosx/platform_specific_code/juce_mac_Fonts.cpp
  9. +11
    -11
      build/macosx/platform_specific_code/juce_mac_HTTPStream.h
  10. +52
    -51
      build/win32/platform_specific_code/juce_win32_ASIO.cpp
  11. +4
    -4
      build/win32/platform_specific_code/juce_win32_DirectSound.cpp
  12. +1
    -1
      build/win32/platform_specific_code/juce_win32_Files.cpp
  13. +2
    -2
      build/win32/platform_specific_code/juce_win32_Network.cpp
  14. +1
    -1
      src/juce_appframework/application/juce_Application.cpp
  15. +2
    -2
      src/juce_appframework/application/juce_PropertiesFile.cpp
  16. +3
    -3
      src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp
  17. +1
    -1
      src/juce_appframework/audio/audio_sources/juce_BufferingAudioSource.cpp
  18. +2
    -2
      src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp
  19. +3
    -3
      src/juce_appframework/documents/juce_FileBasedDocument.cpp
  20. +3
    -2
      src/juce_appframework/gui/components/controls/juce_TableListBox.cpp
  21. +2
    -2
      src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp
  22. +2
    -2
      src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp
  23. +1
    -1
      src/juce_core/basics/juce_FileLogger.cpp
  24. +5
    -5
      src/juce_core/basics/juce_Time.cpp
  25. +1
    -1
      src/juce_core/io/network/juce_Socket.cpp
  26. +10
    -20
      src/juce_core/text/juce_StringArray.cpp
  27. +45
    -54
      src/juce_core/text/juce_XmlDocument.cpp

+ 8
- 8
build/linux/platform_specific_code/juce_linux_Audio.cpp View File

@@ -199,7 +199,7 @@ public:
if (bitDepth == 0)
{
error = T("device doesn't support a compatible PCM format");
error = "device doesn't support a compatible PCM format";
DBG (T("ALSA error: ") + error + T("\n"));
return false;
}
@@ -353,7 +353,7 @@ class ALSAThread : public Thread
{
public:
ALSAThread (const String& deviceName_)
: Thread (T("Juce ALSA")),
: Thread ("Juce ALSA"),
sampleRate (0),
bufferSize (0),
deviceName (deviceName_),
@@ -457,7 +457,7 @@ public:
if (outputDevice == 0 && inputDevice == 0)
{
error = T("no channels");
error = "no channels";
return;
}
@@ -482,7 +482,7 @@ public:
if (--count < 0 || ! isThreadRunning())
{
error = T("device didn't start");
error = "device didn't start";
break;
}
}
@@ -528,7 +528,7 @@ public:
if (! inputDevice->read (inputChannelData, bufferSize))
{
DBG (T("ALSA: read failure"));
DBG ("ALSA: read failure");
break;
}
}
@@ -567,7 +567,7 @@ public:
jassert (numChannelsRunning >= outputDevice->numChannelsRunning);
if (! outputDevice->write (outputChannelData, bufferSize))
{
DBG (T("ALSA: write failure"));
DBG ("ALSA: write failure");
break;
}
}
@@ -858,7 +858,7 @@ public:
break;
String id, name;
id << T("hw:") << cardId << T(",") << device;
id << "hw:" << cardId << ',' << device;
if (testDevice (id))
{
@@ -868,7 +868,7 @@ public:
name = id;
if (device > 0)
name << T(" (") << (device + 1) << T(")");
name << " (" << (device + 1) << ')';
ids.add (id);
names.add (name);


+ 6
- 6
build/linux/platform_specific_code/juce_linux_Files.cpp View File

@@ -374,23 +374,23 @@ const File File::getSpecialLocation (const SpecialLocationType type)
}
case userDocumentsDirectory:
return File (T("~"));
return File ("~");
case userDesktopDirectory:
return File (T("~/Desktop"));
return File ("~/Desktop");
case userApplicationDataDirectory:
return File (T("~"));
return File ("~");
case commonApplicationDataDirectory:
return File (T("/var"));
return File ("/var");
case globalApplicationsDirectory:
return File (T("/usr"));
return File ("/usr");
case tempDirectory:
{
File tmp (T("/var/tmp"));
File tmp ("/var/tmp");
if (! tmp.isDirectory())
{


+ 2
- 2
build/linux/platform_specific_code/juce_linux_Fonts.cpp View File

@@ -130,7 +130,7 @@ public:
if (fontDirs.size() == 0)
{
XmlDocument fontsConfig (File (T("/etc/fonts/fonts.conf")));
XmlDocument fontsConfig (File ("/etc/fonts/fonts.conf"));
XmlElement* const fontsInfo = fontsConfig.getDocumentElement();
if (fontsInfo != 0)
@@ -145,7 +145,7 @@ public:
}
if (fontDirs.size() == 0)
fontDirs.add (T("/usr/X11R6/lib/X11/fonts"));
fontDirs.add ("/usr/X11R6/lib/X11/fonts");
for (int i = 0; i < fontDirs.size(); ++i)
enumerateFaces (fontDirs[i]);


+ 1
- 1
build/linux/platform_specific_code/juce_linux_Messaging.cpp View File

@@ -183,7 +183,7 @@ void MessageManager::doPlatformSpecificInitialisation()
if (! XInitThreads())
{
// This is fatal! Print error and closedown
Logger::outputDebugString (T("Failed to initialise xlib thread support."));
Logger::outputDebugString ("Failed to initialise xlib thread support.");
if (juce_isRunningAsApplication())
Process::terminate();


+ 6
- 6
build/macosx/platform_specific_code/juce_mac_CoreAudio.cpp View File

@@ -412,7 +412,7 @@ public:
int bufferSizeSamples)
{
error = String::empty;
log (T("CoreAudio reopen"));
log ("CoreAudio reopen");
callbacksAllowed = false;
stopTimer();
@@ -449,13 +449,13 @@ public:
}
if (i < 0)
error = T("Couldn't change sample rate/buffer size");
error = "Couldn't change sample rate/buffer size";
if (sampleRates.size() == 0)
error = T("Device has no available sample-rates");
error = "Device has no available sample-rates";
if (bufferSizes.size() == 0)
error = T("Device has no available buffer-sizes");
error = "Device has no available buffer-sizes";
numInputChans = jmin (numInputChans, numInputChannelInfos);
numOutputChans = jmin (numOutputChans, numOutputChannelInfos);
@@ -652,7 +652,7 @@ public:
void timerCallback()
{
stopTimer();
log (T("CoreAudio device changed callback"));
log ("CoreAudio device changed callback");
const double oldSampleRate = sampleRate;
const int oldBufferSize = bufferSize;
@@ -824,7 +824,7 @@ class CoreAudioIODevice : public AudioIODevice
public:
CoreAudioIODevice (const String& deviceName,
AudioDeviceID deviceId1)
: AudioIODevice (deviceName, T("CoreAudio")),
: AudioIODevice (deviceName, "CoreAudio"),
isOpen_ (false),
isStarted (false)
{


+ 4
- 4
build/macosx/platform_specific_code/juce_mac_CoreMidi.cpp View File

@@ -205,13 +205,13 @@ const StringArray MidiOutput::getDevices()
String name (getConnectedEndpointName (dest));
if (name.isEmpty())
name = T("<error>");
name = "<error>";
s.add (name);
}
else
{
s.add (T("<error>"));
s.add ("<error>");
}
}
@@ -351,13 +351,13 @@ const StringArray MidiInput::getDevices()
String name (getConnectedEndpointName (source));
if (name.isEmpty())
name = T("<error>");
name = "<error>";
s.add (name);
}
else
{
s.add (T("<error>"));
s.add ("<error>");
}
}


+ 5
- 5
build/macosx/platform_specific_code/juce_mac_Files.cpp View File

@@ -629,19 +629,19 @@ const File File::getSpecialLocation (const SpecialLocationType type)
}
case userDocumentsDirectory:
return File (T("~/Documents"));
return File ("~/Documents");
case userDesktopDirectory:
return File (T("~/Desktop"));
return File ("~/Desktop");
case userApplicationDataDirectory:
return File (T("~/Library"));
return File ("~/Library");
case commonApplicationDataDirectory:
return File (T("/Library"));
return File ("/Library");
case globalApplicationsDirectory:
return File (T("/Applications"));
return File ("/Applications");
case tempDirectory:
{


+ 3
- 3
build/macosx/platform_specific_code/juce_mac_Fonts.cpp View File

@@ -520,9 +520,9 @@ const StringArray Font::findAllTypefaceNames()
void Font::getDefaultFontNames (String& defaultSans, String& defaultSerif, String& defaultFixed)
{
defaultSans = T("Lucida Grande");
defaultSerif = T("Times New Roman");
defaultFixed = T("Monaco");
defaultSans = "Lucida Grande";
defaultSerif = "Times New Roman";
defaultFixed = "Monaco";
}


+ 11
- 11
build/macosx/platform_specific_code/juce_mac_HTTPStream.h View File

@@ -198,12 +198,12 @@ private:
const String& optionalPostText,
const bool isPost)
{
String header (isPost ? T("POST ") : T("GET "));
String header (isPost ? "POST " : "GET ");
if (proxyURL.isEmpty())
{
header << hostPath << T(" HTTP/1.1\r\nHost: ")
<< hostName << ":" << hostPort;
header << hostPath << " HTTP/1.1\r\nHost: "
<< hostName << ':' << hostPort;
}
else
{
@@ -213,8 +213,8 @@ private:
if (! decomposeURL (proxyURL, proxyName, proxyPath, proxyPort))
return String::empty;
header << originalURL << T(" HTTP/1.1\r\nHost: ")
<< proxyName << T(":") << proxyPort;
header << originalURL << " HTTP/1.1\r\nHost: "
<< proxyName << ':' << proxyPort;
/* xxx needs finishing
const char* proxyAuth = getenv ("http_proxy_auth");
@@ -223,20 +223,20 @@ private:
*/
}
header << T("\r\nUser-Agent: JUCE/")
<< JUCE_MAJOR_VERSION << T('.') << JUCE_MINOR_VERSION
<< T("\r\nConnection: Close\r\n");
header << "\r\nUser-Agent: JUCE/"
<< JUCE_MAJOR_VERSION << '.' << JUCE_MINOR_VERSION
<< "\r\nConnection: Close\r\n";
if (isPost && optionalPostText.isNotEmpty())
{
const char* const postTextUTF8 = (const char*) optionalPostText.toUTF8();
header << T("Content-type: application/x-www-form-urlencoded\r\nContent-length: ")
<< (int) strlen (postTextUTF8) << T("\r\n\r\n")
header << "Content-type: application/x-www-form-urlencoded\r\nContent-length: "
<< (int) strlen (postTextUTF8) << "\r\n\r\n"
<< optionalPostText;
}
header << T("\r\n");
header << "\r\n";
//DBG (header);
return header;
}


+ 52
- 51
build/win32/platform_specific_code/juce_win32_ASIO.cpp View File

@@ -87,22 +87,22 @@ BEGIN_JUCE_NAMESPACE
#ifdef ASIO_DEBUGGING
static void logError (const String& context, long error)
{
String err (T("unknown error"));
String err ("unknown error");
if (error == ASE_NotPresent)
err = T("Not Present");
err = "Not Present";
else if (error == ASE_HWMalfunction)
err = T("Hardware Malfunction");
err = "Hardware Malfunction";
else if (error == ASE_InvalidParameter)
err = T("Invalid Parameter");
err = "Invalid Parameter";
else if (error == ASE_InvalidMode)
err = T("Invalid Mode");
err = "Invalid Mode";
else if (error == ASE_SPNotAdvancing)
err = T("Sample position not advancing");
err = "Sample position not advancing";
else if (error == ASE_NoClock)
err = T("No Clock");
err = "No Clock";
else if (error == ASE_NoMemory)
err = T("Out of memory");
err = "Out of memory";
log (T("!!error: ") + context + T(" - ") + err);
}
@@ -163,7 +163,7 @@ public:
currentASIODev = 0;
close();
log (T("ASIO - exiting"));
log ("ASIO - exiting");
removeCurrentDriver();
juce_free (tempBuffer);
@@ -259,7 +259,7 @@ public:
if (asioObject == 0 || ! isASIOOpen)
{
log (T("Warning: device not open"));
log ("Warning: device not open");
const String err (openDevice());
if (asioObject == 0 || ! isASIOOpen)
@@ -293,7 +293,7 @@ public:
if (shouldUsePreferredSize)
{
log (T("Using preferred size for buffer.."));
log ("Using preferred size for buffer..");
if ((err = asioObject->getBufferSize (&minSize, &maxSize, &preferredSize, &granularity)) == 0)
{
@@ -302,7 +302,7 @@ public:
else
{
bufferSizeSamples = 1024;
logError (T("GetBufferSize1"), err);
logError ("GetBufferSize1", err);
}
shouldUsePreferredSize = false;
@@ -333,13 +333,13 @@ public:
int i;
for (i = 0; i < numSources; ++i)
{
String s (T("clock: "));
String s ("clock: ");
s += clocks[i].name;
if (clocks[i].isCurrentSource)
{
isSourceSet = true;
s += T(" (cur)");
s << " (cur)";
}
log (s);
@@ -347,7 +347,7 @@ public:
if (numSources > 1 && ! isSourceSet)
{
log (T("setting clock source"));
log ("setting clock source");
asioObject->setClockSource (clocks[0].index);
Thread::sleep (20);
}
@@ -355,7 +355,7 @@ public:
{
if (numSources == 0)
{
log (T("ASIO - no clock sources!"));
log ("ASIO - no clock sources!");
}
}
@@ -367,7 +367,7 @@ public:
}
else
{
logError (T("GetSampleRate"), err);
logError ("GetSampleRate", err);
currentSampleRate = 0;
}
@@ -384,12 +384,12 @@ public:
if (err == ASE_NoClock && numSources > 0)
{
log (T("trying to set a clock source.."));
log ("trying to set a clock source..");
Thread::sleep (10);
err = asioObject->setClockSource (clocks[0].index);
if (err != 0)
{
logError (T("SetClock"), err);
logError ("SetClock", err);
}
Thread::sleep (10);
@@ -405,10 +405,10 @@ public:
{
if (isReSync)
{
log (T("Resync request"));
log ("Resync request");
}
log (T("! Resetting ASIO after sample rate change"));
log ("! Resetting ASIO after sample rate change");
removeCurrentDriver();
loadDriver();
@@ -459,7 +459,7 @@ public:
callbacks.asioMessage = &asioMessagesCallback;
callbacks.bufferSwitchTimeInfo = &bufferSwitchTimeInfoCallback;
log (T("disposing buffers"));
log ("disposing buffers");
err = asioObject->disposeBuffers();
log (T("creating buffers: ") + String (totalBuffers) + T(", ") + String (currentBlockSizeSamples));
@@ -471,7 +471,7 @@ public:
if (err != 0)
{
currentBlockSizeSamples = preferredSize;
logError (T("create buffers 2"), err);
logError ("create buffers 2", err);
asioObject->disposeBuffers();
err = asioObject->createBuffers (bufferInfos,
@@ -567,7 +567,7 @@ public:
if (bufferInfos[n].buffers[0] == 0
|| bufferInfos[n].buffers[1] == 0)
{
log (T("!! Null buffers"));
log ("!! Null buffers");
}
else
{
@@ -585,7 +585,7 @@ public:
if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0)
{
log (T("ASIO - no latencies"));
log ("ASIO - no latencies");
}
else
{
@@ -610,11 +610,11 @@ public:
if (isUsingThread && ! isThreadRunning())
{
error = T("Can't start thread!");
error = "Can't start thread!";
}
else
{
log (T("starting ASIO"));
log ("starting ASIO");
calledback = false;
err = asioObject->start();
@@ -628,10 +628,10 @@ public:
}
isOpen_ = false;
log (T("ASIO - stop on failure"));
log ("ASIO - stop on failure");
Thread::sleep (10);
asioObject->stop();
error = T("Can't start device");
error = "Can't start device";
Thread::sleep (10);
}
else
@@ -644,8 +644,8 @@ public:
if (! calledback)
{
error = T("Device didn't start correctly");
log (T("ASIO didn't callback - stopping.."));
error = "Device didn't start correctly";
log ("ASIO didn't callback - stopping..");
asioObject->stop();
}
}
@@ -653,12 +653,12 @@ public:
}
else
{
error = T("Can't create i/o buffers");
error = "Can't create i/o buffers";
}
}
else
{
error = T("Can't set sample rate: ");
error = "Can't set sample rate: ";
error << sampleRate;
}
@@ -703,7 +703,7 @@ public:
needToReset = false;
isReSync = false;
log (T("ASIO - stopping"));
log ("ASIO - stopping");
if (asioObject != 0)
{
@@ -795,7 +795,7 @@ public:
bool showControlPanel()
{
log (T("ASIO - showing control panel"));
log ("ASIO - showing control panel");
Component modalWindow (String::empty);
modalWindow.setOpaque (true);
@@ -847,7 +847,7 @@ public:
if (bufferIndex < 0)
{
log (T("! ASIO callback never called"));
log ("! ASIO callback never called");
}
}
@@ -869,7 +869,7 @@ public:
stopTimer();
// used to cause a reset
log (T("! ASIO restart request!"));
log ("! ASIO restart request!");
if (isOpen_)
{
@@ -982,7 +982,7 @@ private:
return String::empty;
}
return T("No Driver");
return "No Driver";
}
const String openDevice()
@@ -1062,11 +1062,11 @@ private:
if (currentRate <= 0.0 || currentRate > 192001.0)
{
log (T("setting sample rate"));
log ("setting sample rate");
err = asioObject->setSampleRate (44100.0);
if (err != 0)
{
logError (T("setting sample rate"), err);
logError ("setting sample rate", err);
}
asioObject->getSampleRate (&currentRate);
@@ -1077,7 +1077,7 @@ private:
postOutput = (asioObject->outputReady() == 0);
if (postOutput)
{
log (T("ASIO outputReady = ok"));
log ("ASIO outputReady = ok");
}
updateSampleRates();
@@ -1086,11 +1086,12 @@ private:
inputLatency = outputLatency = 0;
if (asioObject->getLatencies (&inputLatency, &outputLatency) != 0)
{
log (T("ASIO - no latencies"));
log ("ASIO - no latencies");
}
log (String (T("latencies: "))
+ String ((int)inputLatency) + T(", ") + String ((int)outputLatency));
log (String ("latencies: ")
+ String ((int) inputLatency)
+ T(", ") + String ((int) outputLatency));
// create some dummy buffers now.. because cubase does..
numActiveInputChans = 0;
@@ -1131,7 +1132,7 @@ private:
err = asioObject->createBuffers (bufferInfos, numChans, preferredSize, &callbacks);
if (err != 0)
{
logError (T("dummy buffers"), err);
logError ("dummy buffers", err);
}
}
@@ -1197,7 +1198,7 @@ private:
if ((err = asioObject->start()) != 0)
{
// ignore an error here, as it might start later after setting other stuff up
logError (T("ASIO start"), err);
logError ("ASIO start", err);
}
Thread::sleep (100);
@@ -1205,18 +1206,18 @@ private:
}
else
{
error = T("Can't detect buffer sizes");
error = "Can't detect buffer sizes";
}
}
else
{
error = T("Can't detect asio channels");
error = "Can't detect asio channels";
}
}
}
else
{
error = T("No such device");
error = "No such device";
}
if (error.isNotEmpty())
@@ -1232,7 +1233,7 @@ private:
else
{
isASIOOpen = true;
log (T("ASIO device open"));
log ("ASIO device open");
}
isOpen_ = false;
@@ -1283,7 +1284,7 @@ private:
if (isReSync)
{
log (T("! ASIO resync"));
log ("! ASIO resync");
isReSync = false;
}
else


+ 4
- 4
build/win32/platform_specific_code/juce_win32_DirectSound.cpp View File

@@ -228,7 +228,7 @@ static const String getDSErrorMessage (HRESULT hr)
{
if (hr != S_OK)
{
String error (T("DS error at line "));
String error ("DS error at line ");
error << lineNum << T(" - ") << getDSErrorMessage (hr);
log (error);
}
@@ -392,7 +392,7 @@ public:
primaryDesc.dwBufferBytes = 0;
primaryDesc.lpwfxFormat = 0;
log (T("opening dsound out step 2"));
log ("opening dsound out step 2");
hr = pDirectSound->CreateSoundBuffer (&primaryDesc, &pPrimaryBuffer, 0);
logError (hr);
@@ -426,7 +426,7 @@ public:
if (hr == S_OK)
{
log (T("opening dsound out step 3"));
log ("opening dsound out step 3");
DWORD dwDataLen;
unsigned char* pDSBuffData;
@@ -981,7 +981,7 @@ public:
DSoundAudioIODevice (const String& deviceName,
const int index,
const int inputIndex_)
: AudioIODevice (deviceName, T("DirectSound")),
: AudioIODevice (deviceName, "DirectSound"),
Thread ("Juce DSound"),
isOpen_ (false),
isStarted (false),


+ 1
- 1
build/win32/platform_specific_code/juce_win32_Files.cpp View File

@@ -812,7 +812,7 @@ bool NamedPipe::openInternal (const String& pipeName, const bool createPipe)
NamedPipeInternal* const intern = new NamedPipeInternal();
String file (T("\\\\.\\pipe\\"));
String file ("\\\\.\\pipe\\");
file += pipeName;
intern->createdPipe = createPipe;


+ 2
- 2
build/win32/platform_specific_code/juce_win32_Network.cpp View File

@@ -136,11 +136,11 @@ void* juce_openInternetFile (const String& url,
if (request != 0)
{
// (this header is needed to make webservers process a POST request correctly)
const String hdr (T("Content-Type: application/x-www-form-urlencoded"));
const String hdr ("Content-Type: application/x-www-form-urlencoded");
if (HttpSendRequest (request,
hdr, hdr.length(),
(void*)(const char*) postText,
(void*) (const char*) postText,
postText.length()))
{
ConnectionAndRequestStruct* const result = new ConnectionAndRequestStruct();


+ 1
- 1
src/juce_appframework/application/juce_Application.cpp View File

@@ -192,7 +192,7 @@ int JUCEApplication::main (String& commandLine, JUCEApplication* const app)
appInstance = 0;
commandLine = String::empty;
DBG (T("Another instance is running - quitting..."));
DBG ("Another instance is running - quitting...");
return 0;
}
}


+ 2
- 2
src/juce_appframework/application/juce_PropertiesFile.cpp View File

@@ -251,8 +251,8 @@ const File PropertiesFile::getDefaultAppSettingsFile (const String& applicationN
jassert (applicationName == File::createLegalFileName (applicationName));
#ifdef JUCE_MAC
File dir (commonToAllUsers ? T("/Library/Preferences")
: T("~/Library/Preferences"));
File dir (commonToAllUsers ? "/Library/Preferences"
: "~/Library/Preferences");
if (folderName.isNotEmpty())
dir = dir.getChildFile (folderName);


+ 3
- 3
src/juce_appframework/audio/audio_file_formats/juce_AudioCDReader.cpp View File

@@ -47,11 +47,11 @@ BEGIN_JUCE_NAMESPACE
static void findCDs (OwnedArray<File>& cds)
{
File volumes (T("/Volumes"));
File volumes ("/Volumes");
volumes.findChildFiles (cds, File::findDirectories, false);
for (int i = cds.size(); --i >= 0;)
if (! cds[i]->getChildFile (T(".TOC.plist")).exists())
if (! cds[i]->getChildFile (".TOC.plist").exists())
cds.remove (i);
}
@@ -80,7 +80,7 @@ AudioCDReader* AudioCDReader::createReaderForCD (const int index)
}
AudioCDReader::AudioCDReader (const File& volume)
: AudioFormatReader (0, T("CD Audio")),
: AudioFormatReader (0, "CD Audio"),
volumeDir (volume),
currentReaderTrack (-1),
reader (0)


+ 1
- 1
src/juce_appframework/audio/audio_sources/juce_BufferingAudioSource.cpp View File

@@ -48,7 +48,7 @@ class SharedBufferingAudioSourceThread : public DeletedAtShutdown,
{
public:
SharedBufferingAudioSourceThread()
: Thread (T("Audio Buffer")),
: Thread ("Audio Buffer"),
sources (8)
{
}


+ 2
- 2
src/juce_appframework/audio/devices/juce_AudioDeviceManager.cpp View File

@@ -170,7 +170,7 @@ void AudioDeviceManager::addDeviceNamesToComboBox (ComboBox& combo) const
combo.addSeparator();
}
combo.addItem (T("<< no audio device >>"), -1);
combo.addItem ("<< no audio device >>", -1);
}
const String AudioDeviceManager::getCurrentAudioDeviceName() const
@@ -256,7 +256,7 @@ const String AudioDeviceManager::setAudioDevice (const String& deviceNameToUse,
else
{
deleteAndZero (currentAudioDevice);
error << T("No such device: ") << deviceNameToUse;
error << "No such device: " << deviceNameToUse;
}
}
else


+ 3
- 3
src/juce_appframework/documents/juce_FileBasedDocument.cpp View File

@@ -171,7 +171,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAs (const File& newFile,
TRANS("File already exists"),
TRANS("There's already a file called:\n\n")
+ newFile.getFullPathName()
+ T("\n\nAre you sure you want to overwrite it?"),
+ TRANS("\n\nAre you sure you want to overwrite it?"),
TRANS("overwrite"),
TRANS("cancel")))
{
@@ -203,7 +203,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAs (const File& newFile,
TRANS("Error writing to file..."),
TRANS("An error occurred while trying to save \"")
+ getDocumentTitle()
+ T("\" to the file:\n\n")
+ TRANS("\" to the file:\n\n")
+ newFile.getFullPathName()
+ T("\n\n")
+ error);
@@ -251,7 +251,7 @@ FileBasedDocument::SaveResult FileBasedDocument::saveAsInteractive (const bool w
String legalFilename (File::createLegalFileName (getDocumentTitle()));
if (legalFilename.isEmpty())
legalFilename = T("unnamed");
legalFilename = "unnamed";
if (f.existsAsFile() || f.getParentDirectory().isDirectory())
f = f.getSiblingFile (legalFilename);


+ 3
- 2
src/juce_appframework/gui/components/controls/juce_TableListBox.cpp View File

@@ -38,6 +38,7 @@ BEGIN_JUCE_NAMESPACE
#include "../../../../juce_core/basics/juce_Random.h"
#include "../mouse/juce_DragAndDropContainer.h"
#include "../../graphics/imaging/juce_Image.h"
#include "../../../../juce_core/text/juce_LocalisedStrings.h"
//==============================================================================
@@ -290,8 +291,8 @@ public:
{
if (owner.isAutoSizeMenuOptionShown())
{
menu.addItem (0xf836743, T("Auto-size this column"), columnIdClicked != 0);
menu.addItem (0xf836744, T("Auto-size all columns"), owner.getHeader()->getNumColumns (true) > 0);
menu.addItem (0xf836743, TRANS("Auto-size this column"), columnIdClicked != 0);
menu.addItem (0xf836744, TRANS("Auto-size all columns"), owner.getHeader()->getNumColumns (true) > 0);
menu.addSeparator();
}


+ 2
- 2
src/juce_appframework/gui/components/filebrowser/juce_FileBrowserComponent.cpp View File

@@ -60,7 +60,7 @@ FileBrowserComponent::FileBrowserComponent (FileChooserMode mode_,
mode (mode_),
listeners (2),
previewComp (previewComp_),
thread (T("Juce FileBrowser"))
thread ("Juce FileBrowser")
{
String filename;
@@ -479,7 +479,7 @@ const BitArray FileBrowserComponent::getRoots (StringArray& rootNames, StringArr
separators.setBit (rootPaths.size());
OwnedArray <File> volumes;
File vol (T("/Volumes"));
File vol ("/Volumes");
vol.findChildFiles (volumes, File::findDirectories, false);
for (int i = 0; i < volumes.size(); ++i)


+ 2
- 2
src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp View File

@@ -497,8 +497,8 @@ void AudioDeviceSelectorComponent::changeListenerCallback (void*)
if (currentDevice->hasControlPanel())
{
addAndMakeVisible (launchUIButton = new TextButton (T("show this device's control panel"),
T("opens the device's own control panel")));
addAndMakeVisible (launchUIButton = new TextButton (TRANS ("show this device's control panel"),
TRANS ("opens the device's own control panel")));
launchUIButton->addButtonListener (this);
}


+ 1
- 1
src/juce_core/basics/juce_FileLogger.cpp View File

@@ -120,7 +120,7 @@ FileLogger* FileLogger::createDefaultAppLogger (const String& logFileSubDirector
const int maxInitialFileSizeBytes)
{
#ifdef JUCE_MAC
File logFile (T("~/Library/Logs"));
File logFile ("~/Library/Logs");
logFile = logFile.getChildFile (logFileName);
#else


+ 5
- 5
src/juce_core/basics/juce_Time.cpp View File

@@ -256,12 +256,12 @@ const String Time::toString (const bool includeDate,
if (includeDate)
{
result << getDayOfMonth() << T(' ')
<< getMonthName (true) << T(' ')
result << getDayOfMonth() << ' '
<< getMonthName (true) << ' '
<< getYear();
if (includeTime)
result << T(' ');
result << ' ';
}
if (includeTime)
@@ -283,7 +283,7 @@ const String Time::toString (const bool includeDate,
}
if (! use24HourClock)
result << (isAfternoon() ? T("pm") : T("am"));
result << (isAfternoon() ? "pm" : "am");
}
return result.trimEnd();
@@ -428,7 +428,7 @@ const String Time::getTimeZone() const throw()
if (zone[0].length() > 3
&& zone[0].containsIgnoreCase (T("daylight"))
&& zone[0].contains (T("GMT")))
zone[0] = T("BST");
zone[0] = "BST";
}
return zone[0].substring (0, 3);


+ 1
- 1
src/juce_core/io/network/juce_Socket.cpp View File

@@ -305,7 +305,7 @@ void Socket::close()
{
// need to do this to interrupt the accept() function..
Socket temp;
temp.connect (T("localhost"), portNumber, 1000);
temp.connect ("localhost", portNumber, 1000);
}
}


+ 10
- 20
src/juce_core/text/juce_StringArray.cpp View File

@@ -65,26 +65,16 @@ StringArray::StringArray (const juce_wchar** const strings) throw()
{
int i = 0;
for (;;)
{
if (strings[i] != 0)
add (strings [i++]);
else
break;
}
while (strings[i] != 0)
add (strings [i++]);
}
StringArray::StringArray (const char** const strings) throw()
{
int i = 0;
for (;;)
{
if (strings[i] != 0)
add (strings [i++]);
else
break;
}
while (strings[i] != 0)
add (strings [i++]);
}
const StringArray& StringArray::operator= (const StringArray& other) throw()
@@ -249,7 +239,7 @@ int StringArray::indexOf (const String& stringToLookFor,
//==============================================================================
void StringArray::remove (const int index) throw()
{
String* const s = (String*) strings[index];
String* const s = (String*) strings [index];
if (s != 0)
{
@@ -305,7 +295,7 @@ void StringArray::trim() throw()
class InternalStringArrayComparator
{
public:
static int compareElements (void* const first, void* const second) throw()
static int JUCE_CALLTYPE compareElements (void* const first, void* const second) throw()
{
return ((const String*) first)->compare (*(const String*) second);
}
@@ -314,7 +304,7 @@ public:
class InsensitiveInternalStringArrayComparator
{
public:
static int compareElements (void* const first, void* const second) throw()
static int JUCE_CALLTYPE compareElements (void* const first, void* const second) throw()
{
return ((const String*) first)->compareIgnoreCase (*(const String*) second);
}
@@ -324,12 +314,12 @@ void StringArray::sort (const bool ignoreCase) throw()
{
if (ignoreCase)
{
InsensitiveInternalStringArrayComparator comp;
const InsensitiveInternalStringArrayComparator comp;
strings.sort (comp);
}
else
{
InternalStringArrayComparator comp;
const InternalStringArrayComparator comp;
strings.sort (comp);
}
}
@@ -366,7 +356,7 @@ const String StringArray::joinIntoString (const String& separator,
String result;
result.preallocateStorage (charsNeeded);
tchar* dest = (tchar*)(const tchar*) result;
tchar* dest = (tchar*) (const tchar*) result;
while (start < last)
{


+ 45
- 54
src/juce_core/text/juce_XmlDocument.cpp View File

@@ -64,7 +64,7 @@ static bool isXmlIdentifierChar_Slow (const tchar c)
class FileInputSource : public XmlInputSource
{
public:
FileInputSource (const File& file_)
FileInputSource (const File& file_) throw()
: file (file_)
{
}
@@ -117,75 +117,66 @@ void XmlDocument::setInputSource (XmlInputSource* const newSource) throw()
XmlElement* XmlDocument::getDocumentElement (const bool onlyReadOuterDocumentElement)
{
JUCE_TRY
String textToParse (originalText);
if (textToParse.isEmpty() && inputSource != 0)
{
String textToParse (originalText);
InputStream* const in = inputSource->createInputStreamFor (String::empty);
if (textToParse.isEmpty() && inputSource != 0)
if (in != 0)
{
InputStream* const in = inputSource->createInputStreamFor (String::empty);
if (in != 0)
{
MemoryBlock data;
in->readIntoMemoryBlock (data, onlyReadOuterDocumentElement ? 8192 : -1);
delete in;
MemoryBlock data;
if (data.getSize() >= 2
&& ((data[0] == (char)-2 && data[1] == (char)-1)
|| (data[0] == (char)-1 && data[1] == (char)-2)))
{
textToParse = String::createStringFromData ((const char*) data.getData(), data.getSize());
}
else
{
textToParse = String::fromUTF8 ((const uint8*) data.getData(), data.getSize());
}
in->readIntoMemoryBlock (data, onlyReadOuterDocumentElement ? 8192 : -1);
delete in;
if (! onlyReadOuterDocumentElement)
originalText = textToParse;
if (data.getSize() >= 2
&& ((data[0] == (char)-2 && data[1] == (char)-1)
|| (data[0] == (char)-1 && data[1] == (char)-2)))
{
textToParse = String::createStringFromData ((const char*) data.getData(), data.getSize());
}
else
{
textToParse = String::fromUTF8 ((const uint8*) data.getData(), data.getSize());
}
if (! onlyReadOuterDocumentElement)
originalText = textToParse;
}
}
input = textToParse;
lastError = String::empty;
errorOccurred = false;
outOfData = false;
needToLoadDTD = true;
input = textToParse;
lastError = String::empty;
errorOccurred = false;
outOfData = false;
needToLoadDTD = true;
for (int i = 0; i < 128; ++i)
identifierLookupTable[i] = isXmlIdentifierChar_Slow ((tchar) i);
for (int i = 0; i < 128; ++i)
identifierLookupTable[i] = isXmlIdentifierChar_Slow ((tchar) i);
if (textToParse.isEmpty())
if (textToParse.isEmpty())
{
lastError = "not enough input";
}
else
{
skipHeader();
if (input != 0)
{
lastError = T("not enough input");
XmlElement* const result = readNextElement (! onlyReadOuterDocumentElement);
if (errorOccurred)
delete result;
else
return result;
}
else
{
skipHeader();
if (input != 0)
{
XmlElement* const result = readNextElement (! onlyReadOuterDocumentElement);
if (errorOccurred && (result != 0))
delete result;
else
return result;
}
else
{
lastError = T("incorrect xml header");
}
lastError = "incorrect xml header";
}
}
#if JUCE_CATCH_UNHANDLED_EXCEPTIONS
catch (...)
{
lastError = T("internal error");
}
#endif
return 0;
}


Loading…
Cancel
Save