Browse Source

fixed broken CD reader code on linux; added support for broadcasting in DatagramSockets; small fix for String::replaceSection

tags/2021-05-28
jules 16 years ago
parent
commit
ca19733aad
4 changed files with 12 additions and 11 deletions
  1. +2
    -3
      build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp
  2. +1
    -1
      build/win32/vc8/JUCE.vcproj
  3. +6
    -7
      src/juce_core/io/network/juce_Socket.cpp
  4. +3
    -0
      src/juce_core/text/juce_String.cpp

+ 2
- 3
build/linux/platform_specific_code/juce_linux_AudioCDReader.cpp View File

@@ -61,9 +61,8 @@ void AudioCDReader::refreshTrackLengths()
{
}
bool AudioCDReader::read (int** destSamples,
int64 startSampleInFile,
int numSamples)
bool AudioCDReader::readSamples (int** destSamples, int numDestChannels, int startOffsetInDestBuffer,
int64 startSampleInFile, int numSamples)
{
return false;
}


+ 1
- 1
build/win32/vc8/JUCE.vcproj View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="JUCE"
ProjectGUID="{AE232C11-D91C-4CA1-B24E-8B11A52EFF26}"
RootNamespace="JUCE"


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

@@ -90,21 +90,20 @@ static void initWin32Sockets()
//==============================================================================
static bool resetSocketOptions (const int handle, const bool isDatagram) throw()
{
if (handle <= 0)
return false;
const int sndBufSize = 65536;
const int rcvBufSize = 65536;
const int one = 1;
return setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (int)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (int)) == 0
&& (isDatagram || (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (int)) == 0));
return handle > 0
&& setsockopt (handle, SOL_SOCKET, SO_RCVBUF, (const char*) &rcvBufSize, sizeof (rcvBufSize)) == 0
&& setsockopt (handle, SOL_SOCKET, SO_SNDBUF, (const char*) &sndBufSize, sizeof (sndBufSize)) == 0
&& (isDatagram ? (setsockopt (handle, SOL_SOCKET, SO_BROADCAST, (const char*) &one, sizeof (one)) == 0)
: (setsockopt (handle, IPPROTO_TCP, TCP_NODELAY, (const char*) &one, sizeof (one)) == 0));
}
static bool bindSocketToPort (const int handle, const int port) throw()
{
if (handle == 0 || port <= 0)
if (handle <= 0 || port <= 0)
return false;
struct sockaddr_in servTmpAddr;


+ 3
- 0
src/juce_core/text/juce_String.cpp View File

@@ -1375,6 +1375,9 @@ const String String::replaceSection (int index,
const int newStringLen = (stringToInsert != 0) ? CharacterFunctions::length (stringToInsert) : 0;
const int newTotalLen = len + newStringLen - numCharsToReplace;
if (newTotalLen <= 0)
return String::empty;
String result (newTotalLen, (int) 0);


Loading…
Cancel
Save