Permalink
Browse files

mapper modifications are now roughly working...

git-svn-id: https://mt.music.mcgill.ca/svn/dot/branches/v2_max5/mappers/qtmapper@2656 e7448968-c8ac-449e-ac06-376e812423d6
  • Loading branch information...
1 parent ea1d624 commit ed2f68cef4cd53f518d7a1c939568eb2a878d1f1 rudrarajuv committed Dec 10, 2010
Showing with 192 additions and 84 deletions.
  1. +15 −4 build/main.cpp
  2. +16 −1 data/mapperdata.cpp
  3. +153 −73 gui/form.cpp
  4. +2 −0 gui/form.h
  5. +6 −6 gui/form.ui
View
@@ -24,11 +24,11 @@ Form* form;
void dbDeviceCallbackFunction( mapper_db_device record,
mapper_db_action_t action,
void* user ) {
-
+/*
printf( "\nForm::db_device_callback_function( ... )\n" );
printf( "record->name %s action %d user %p \n\n",
record->name, action, user );
-
+*/
if ( action == MDB_NEW ) {
@@ -56,6 +56,7 @@ void dbSignalCallbackFunction( mapper_db_signal record,
mapper_db_action_t action,
void* user ) {
+/*
printf( "\nForm::db_signal_callback_function( ... )\n" );
printf( "device_name %s name %s type %c\n",
record->device_name, record->name, record->type );
@@ -65,6 +66,8 @@ void dbSignalCallbackFunction( mapper_db_signal record,
}
printf("is_output %d action %d user %p \n\n",
record->is_output, action, user );
+ */
+
if ( action == MDB_NEW ) {
form->addNewSignal( record );
@@ -81,18 +84,26 @@ void dbLinkCallbackFunction( mapper_db_link record,
mapper_db_action_t action,
void* user ) {
+ /*
printf( "\nForm::db_link_callback_function( ... )\n" );
printf( "record->src %s record->dest %s action %d user %p \n\n",
record->src_name, record->dest_name, action, user );
+ */
}
void dbMappingCallbackFunction( mapper_db_mapping record,
mapper_db_action_t action,
void* user ) {
- printf( "\nForm::db_mapping_callback_function( ... ) action %d\n",
- action );
+ printf( "\nForm::db_mapping_callback_function( ... )\n" );
+ if ( action == MDB_NEW ) {
+ printf( "action MDB_NEW\n");
+ } else if ( action == MDB_MODIFY ) {
+ printf( "action MDB_MODIFY\n");
+ } else if ( action == MDB_REMOVE ) {
+ printf( "action MDB_REMOVE\n");
+ }
printf( "src_name %s src_type %c dest_name %s dest_type %c\n",
record->src_name, record->src_type,
record->dest_name, record->dest_type );
View
@@ -15,8 +15,12 @@ void MapperData::modifyMappingData( mapper_db_mapping record ) {
}
+
+
void MapperData::addDeviceData( mapper_db_device record ) {
+ this->removeDeviceData( record );
+
std::list<mapper_db_device>::iterator dbit;
Utility::device_search_struct = record;
dbit = std::find_if( this->device_struct_list.begin(),
@@ -39,6 +43,8 @@ void MapperData::addDeviceData( mapper_db_device record ) {
}
void MapperData::addSignalData( mapper_db_signal record ) {
+ //this->removeSignalData( record );
+
std::list<mapper_db_device>::iterator it;
Utility::device_search_struct_name = record->device_name;
it = std::find_if( this->device_struct_list.begin(),
@@ -51,9 +57,13 @@ void MapperData::addSignalData( mapper_db_signal record ) {
}
void MapperData::addMappingData( mapper_db_mapping record ) {
+ this->removeMappingData( record );
this->mapping_struct_list.push_back( record );
}
+
+
+
void MapperData::updateAllMappings( ) {
this->mapping_struct_map.clear();
@@ -177,7 +187,12 @@ void MapperData::removeSignalData( mapper_db_signal record ) {
std::multimap<mapper_db_device, mapper_db_signal>::iterator multi_it;
multi_it = this->signal_struct_map.find( (*it) );
- this->signal_struct_map.erase( multi_it );
+
+ if ( multi_it != this->signal_struct_map.end() ) {
+
+ this->signal_struct_map.erase( multi_it );
+
+ }
}
void MapperData::removeMappingData( mapper_db_mapping record ) {
Oops, something went wrong.

0 comments on commit ed2f68c

Please sign in to comment.