Skip to content

Commit

Permalink
Rename mapper_db_create/destroy_mapping and sort out the API for netw…
Browse files Browse the repository at this point in the history
…ork control.

These functions are not db functions, but they do need the monitor
pointer in order to get an admin for sending admin messages.

Technically a device could do this too, but we assume the use case is
for monitors.  Add functions to link/unlink, connect/disconnect.

Connection properties can be specified by passing a
mapper_db_mapping_t structure, along with a bitflag indicating which
properties are valid.

git-svn-id: https://mt.music.mcgill.ca/svn/dot/branches/v2_max5/mappers/qtmapper@2554 e7448968-c8ac-449e-ac06-376e812423d6
  • Loading branch information
sinclairs committed Nov 30, 2010
1 parent 27fe998 commit b3107ae
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions gui/form.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,15 @@ void Form::finishDrawingMapping( const QModelIndex& index ) {
void Form::sendNewMappingRequest( const char* source_signal_path,
const char* dest_signal_path ) {

mapper_db_create_mapping( source_signal_path, dest_signal_path );
std::string src_dev = std::string(source_signal_path)
.substr(0,std::string(source_signal_path).find('/', 1));

std::string dest_dev = std::string(dest_signal_path)
.substr(0,std::string(dest_signal_path).find('/', 1));

mapper_monitor_link( mon, src_dev.c_str(), dest_dev.c_str() );
mapper_monitor_connect( mon, source_signal_path,
dest_signal_path, 0, 0 );

}

Expand Down Expand Up @@ -834,7 +842,8 @@ void Form::updatePressedLink( Link *reference ) {
printf("updatePressedLink source %s dest %s\n",
reference->source_signal_name,
reference->dest_signal_name );
mapper_db_destroy_mapping( reference->source_signal_name,
mapper_monitor_disconnect( mon,
reference->source_signal_name,
reference->dest_signal_name );

}
Expand Down

0 comments on commit b3107ae

Please sign in to comment.