Skip to content

Commit

Permalink
Merge pull request #1723 from richardeakin/unused_param_audio
Browse files Browse the repository at this point in the history
[warnings] Comment unused parameters in cinder/audio v2
  • Loading branch information
richardeakin committed Jan 20, 2017
2 parents 6fe03ba + 096e082 commit fb5b57b
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 13 deletions.
1 change: 1 addition & 0 deletions include/cinder/audio/Buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ std::unique_ptr<T, FreeDeleter<T> > makeAlignedArray( size_t size, size_t alignm
// unnecessary at the moment anyway, so it is commented out until fixed
//ptr = std::align( alignment, size, ptr, size );
//CI_ASSERT( ptr );
(void)alignment;

return std::unique_ptr<T, FreeDeleter<T> >( static_cast<T *>( ptr ) );
}
Expand Down
4 changes: 2 additions & 2 deletions include/cinder/audio/Context.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class Context : public std::enable_shared_from_this<Context> {
//! Returns whether or not this \a Context is current enabled and processing audio.
bool isEnabled() const { return mEnabled; }

//! Called by \a node when it's connections have changed, default implementation is empty.
virtual void connectionsDidChange( const NodeRef &node ) {}
//! Called by \a node when it's connections have changed. Default implementation is empty.
virtual void connectionsDidChange( const NodeRef &node );

//! Returns the samplerate of this Context, which is governed by the current OutputNode.
size_t getSampleRate() { return getOutput()->getOutputSampleRate(); }
Expand Down
15 changes: 8 additions & 7 deletions include/cinder/audio/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,18 @@ class Node : public std::enable_shared_from_this<Node>, private Noncopyable {

protected:

//! Called before audio buffers need to be used. There is always a valid Context at this point.
//! Called before audio buffers need to be used. There is always a valid Context at this point. Default implementation is empty.
virtual void initialize() {}
//! Called once the contents of initialize are no longer relevant, i.e. connections have changed. \note Not guaranteed to be called at Node destruction.
//! Called once the contents of initialize are no longer relevant, i.e. connections have changed. Default implementation is empty.
//! \note Not guaranteed to be called at Node destruction.
virtual void uninitialize() {}
//! Callled when this Node should enable processing. Initiated from Node::enable().
//! Callled when this Node should enable processing. Initiated from Node::enable(). Default implementation is empty.
virtual void enableProcessing() {}
//! Callled when this Node should disable processing. Initiated from Node::disable().
//! Callled when this Node should disable processing. Initiated from Node::disable(). Default implementation is empty.
virtual void disableProcessing() {}
//! Override to perform audio processing on \t buffer.
virtual void process( Buffer *buffer ) {}

//! Override to perform audio processing on \t buffer. Default implementation is empty.
virtual void process( Buffer *buffer );
//! Override to customize how input Nodes are summed into the internal summing buffer. You usually don't need to do this.
virtual void sumInputs();

//! Default implementation returns true if numChannels matches our format.
Expand Down
2 changes: 1 addition & 1 deletion src/cinder/audio/ChannelRouterNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const ChannelRouterNodeRef& operator>>( const NodeRef &input, const ChannelRoute
return route.getOutputRouter();
}

bool ChannelRouterNode::supportsInputNumChannels( size_t numChannels ) const
bool ChannelRouterNode::supportsInputNumChannels( size_t /*numChannels*/ ) const
{
return true;
}
Expand Down
4 changes: 4 additions & 0 deletions src/cinder/audio/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ void Context::setEnabled( bool b )
disable();
}

void Context::connectionsDidChange( const NodeRef & /*node*/ )
{
}

void Context::initializeAllNodes()
{
set<NodeRef> traversedNodes;
Expand Down
2 changes: 1 addition & 1 deletion src/cinder/audio/FileOggVorbis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ int SourceFileOggVorbis::seekFn( void *datasource, ogg_int64_t offset, int whenc
}

// static
int SourceFileOggVorbis::closeFn( void *datasource )
int SourceFileOggVorbis::closeFn( void * /*datasource*/ )
{
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cinder/audio/InputNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ InputNode::~InputNode()
{
}

void InputNode::connectInput( const NodeRef &input )
void InputNode::connectInput( const NodeRef & /*input*/ )
{
CI_ASSERT_MSG( 0, "InputNode does not support inputs" );
}
Expand Down
4 changes: 4 additions & 0 deletions src/cinder/audio/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ void Node::pullInputs( Buffer *inPlaceBuffer )
}
}

void Node::process( Buffer * /*buffer*/ )
{
}

void Node::sumInputs()
{
// Pull all inputs, summing the results from the buffer that input used for processing.
Expand Down
2 changes: 1 addition & 1 deletion src/cinder/audio/OutputNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ OutputNode::OutputNode( const Format &format )
setAutoEnabled( false );
}

void OutputNode::connect( const NodeRef &output )
void OutputNode::connect( const NodeRef & /*output*/ )
{
CI_ASSERT_MSG( 0, "OutputNode does not support connecting to other outputs" );
}
Expand Down

0 comments on commit fb5b57b

Please sign in to comment.