Skip to content

Commit

Permalink
Correctly handle default music port for event/rate_in proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
heplesser committed Apr 10, 2024
1 parent 3b2c641 commit 771d0e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
3 changes: 3 additions & 0 deletions models/music_event_in_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ nest::music_event_in_proxy::music_event_in_proxy()
, P_()
, S_()
{
// Register port for the model so it is available as default
kernel().music_manager.register_music_in_port( P_.port_name_ );
}

nest::music_event_in_proxy::music_event_in_proxy( const music_event_in_proxy& n )
: DeviceNode( n )
, P_( n.P_ )
, S_( n.S_ )
{
// Register port for node instance because MusicManager manages ports via reference count
kernel().music_manager.register_music_in_port( P_.port_name_ );
}

Expand Down
3 changes: 3 additions & 0 deletions models/music_rate_in_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,16 @@ nest::music_rate_in_proxy::music_rate_in_proxy()
, P_()
, S_()
{
// Register port for the model so it is available as default
kernel().music_manager.register_music_in_port( P_.port_name_ );
}

nest::music_rate_in_proxy::music_rate_in_proxy( const music_rate_in_proxy& n )
: DeviceNode( n )
, P_( n.P_ )
, S_( n.S_ )
{
// Register port for node instance because MusicManager manages ports via reference count
kernel().music_manager.register_music_in_port( P_.port_name_ );
}

Expand Down
8 changes: 0 additions & 8 deletions nestkernel/music_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,6 @@ MUSICManager::register_music_in_port( std::string portname )
void
MUSICManager::unregister_music_in_port( std::string portname )
{
// Unregistering from an empty portlist is a no-op. This avoids the
// need to add a dummy entry at startup which is only there to be
// deleted on the registration of a proper port.
if ( music_in_portlist_.empty() )
{
return;
}

std::map< std::string, MusicPortData >::iterator it;
it = music_in_portlist_.find( portname );
if ( it == music_in_portlist_.end() )
Expand Down

0 comments on commit 771d0e3

Please sign in to comment.