mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
fixed broken CD reader code on linux; added support for broadcasting in DatagramSockets; small fix for String::replaceSection
This commit is contained in:
parent
fc2181aa22
commit
ca19733aad
4 changed files with 12 additions and 11 deletions
|
|
@ -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,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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue