1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Sorted out a few pedantic warnings thrown up in the audio host demo

This commit is contained in:
jules 2015-12-11 16:24:35 +00:00
parent 9510c16665
commit 0eac373893
5 changed files with 15 additions and 22 deletions

View file

@ -120,28 +120,22 @@ void FilterGraph::removeIllegalConnections()
changed();
}
void FilterGraph::setNodePosition (const int nodeId, double x, double y)
void FilterGraph::setNodePosition (const uint32 nodeId, double x, double y)
{
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
if (n != nullptr)
if (AudioProcessorGraph::Node::Ptr n = graph.getNodeForId (nodeId))
{
n->properties.set ("x", jlimit (0.0, 1.0, x));
n->properties.set ("y", jlimit (0.0, 1.0, y));
}
}
void FilterGraph::getNodePosition (const int nodeId, double& x, double& y) const
Point<double> FilterGraph::getNodePosition (const uint32 nodeId) const
{
x = y = 0;
if (AudioProcessorGraph::Node::Ptr n = graph.getNodeForId (nodeId))
return Point<double> (static_cast<double> (n->properties ["x"]),
static_cast<double> (n->properties ["y"]));
const AudioProcessorGraph::Node::Ptr n (graph.getNodeForId (nodeId));
if (n != nullptr)
{
x = (double) n->properties ["x"];
y = (double) n->properties ["y"];
}
return Point<double>();
}
//==============================================================================

View file

@ -56,8 +56,8 @@ public:
void removeIllegalConnections();
void setNodePosition (const int nodeId, double x, double y);
void getNodePosition (const int nodeId, double& x, double& y) const;
void setNodePosition (uint32 nodeId, double x, double y);
Point<double> getNodePosition (uint32 nodeId) const;
//==============================================================================
int getNumConnections() const noexcept;

View file

@ -508,9 +508,8 @@ public:
setName (f->getProcessor()->getName());
{
double x, y;
graph.getNodePosition (filterID, x, y);
setCentreRelative ((float) x, (float) y);
Point<double> p = graph.getNodePosition (filterID);
setCentreRelative ((float) p.x, (float) p.y);
}
if (numIns != numInputs || numOuts != numOutputs)

View file

@ -209,7 +209,7 @@ namespace AudioUnitFormatHelpers
if (manuString != 0 && CFGetTypeID (manuString) == CFStringGetTypeID())
manufacturer = String::fromCFString ((CFStringRef) manuString);
const short resFileId = CFBundleOpenBundleResourceMap (bundleRef);
const ResFileRefNum resFileId = CFBundleOpenBundleResourceMap (bundleRef);
UseResFile (resFileId);
const OSType thngType = stringToOSType ("thng");
@ -540,7 +540,7 @@ public:
for (AudioUnitElement j = 0; j < numOutputBusChannels; ++j)
{
abl->mBuffers[j].mNumberChannels = 1;
abl->mBuffers[j].mDataByteSize = sizeof (float) * (size_t) numSamples;
abl->mBuffers[j].mDataByteSize = (UInt32) (sizeof (float) * (size_t) numSamples);
abl->mBuffers[j].mData = buffer.getWritePointer ((int) (i * numOutputBusChannels + j));
}
}
@ -855,7 +855,7 @@ public:
AudioUnitGetProperty (audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global,
0, ids, &paramListSize);
for (int i = 0; i < numParams; ++i)
for (size_t i = 0; i < numParams; ++i)
{
AudioUnitParameterInfo info;
UInt32 sz = sizeof (info);

View file

@ -479,7 +479,7 @@ public:
Handle resHandle;
CFBundleRef bundleRef;
FSSpec parentDirFSSpec;
short resFileId;
ResFileRefNum resFileId;
bool open()
{