Changeset 575
- Timestamp:
- 10/16/08 15:54:32 (3 months ago)
- Files:
-
- branches/midiAutosense/gui/src/main.cpp (modified) (1 diff)
- branches/midiAutosense/gui/src/widgets/midiTable.cpp (modified) (5 diffs)
- branches/midiAutosense/libs/hydrogen/include/hydrogen/action.h (modified) (2 diffs)
- branches/midiAutosense/libs/hydrogen/include/hydrogen/midiMap.h (modified) (2 diffs)
- branches/midiAutosense/libs/hydrogen/src/IO/midi_input.cpp (modified) (3 diffs)
- branches/midiAutosense/libs/hydrogen/src/action.cpp (modified) (9 diffs)
- branches/midiAutosense/libs/hydrogen/src/midiMap.cpp (modified) (6 diffs)
- branches/midiAutosense/libs/hydrogen/src/preferences.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/midiAutosense/gui/src/main.cpp
r305 r575 304 304 305 305 delete midiMap::getInstance(); 306 delete actionManager::getInstance();306 delete ActionManager::getInstance(); 307 307 308 308 _INFOLOG( "Quitting..." ); branches/midiAutosense/gui/src/widgets/midiTable.cpp
r549 r575 117 117 void midiTable::insertNewRow(QString actionString , QString eventString, int eventParameter , int actionParameter) 118 118 { 119 actionManager *aH = actionManager::getInstance();119 ActionManager *aH = ActionManager::getInstance(); 120 120 121 121 insertRow( rowCount ); … … 194 194 195 195 bool ok; 196 std::map< QString , action *> mmcMap = mM->getMMCMap();197 std::map< QString , action *>::iterator dIter(mmcMap.begin());196 std::map< QString , Action *> mmcMap = mM->getMMCMap(); 197 std::map< QString , Action *>::iterator dIter(mmcMap.begin()); 198 198 199 199 200 200 for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ) 201 201 { 202 action * pAction = dIter->second;202 Action * pAction = dIter->second; 203 203 QString actionParameter; 204 204 int actionParameterInteger = 0; … … 213 213 for( int note = 0; note < 128; note++ ) 214 214 { 215 action * pAction = mM->getNoteAction( note );215 Action * pAction = mM->getNoteAction( note ); 216 216 QString actionParameter; 217 217 int actionParameterInteger = 0; … … 227 227 for( int parameter = 0; parameter < 128; parameter++ ) 228 228 { 229 action * pAction = mM->getCCAction( parameter );229 Action * pAction = mM->getCCAction( parameter ); 230 230 QString actionParameter; 231 231 int actionParameterInteger = 0; … … 273 273 actionString = actionCombo->currentText(); 274 274 275 action * pAction = new action( actionString );275 Action * pAction = new Action( actionString ); 276 276 277 277 branches/midiAutosense/libs/hydrogen/include/hydrogen/action.h
r549 r575 29 29 30 30 31 class action : public Object {31 class Action : public Object { 32 32 public: 33 action( QString );33 Action( QString ); 34 34 35 35 QString getType(); … … 51 51 52 52 53 class actionManager : public Object53 class ActionManager : public Object 54 54 { 55 55 private: 56 static actionManager *instance;56 static ActionManager *instance; 57 57 QStringList actionList; 58 58 QStringList eventList; 59 59 60 60 public: 61 static actionManager* getInstance();61 static ActionManager* getInstance(); 62 62 63 bool handleAction( action * );63 bool handleAction( Action * ); 64 64 65 65 QStringList getActionList(); 66 66 QStringList getEventList(); 67 67 68 actionManager();69 ~ actionManager();68 ActionManager(); 69 ~ActionManager(); 70 70 }; 71 71 #endif branches/midiAutosense/libs/hydrogen/include/hydrogen/midiMap.h
r547 r575 35 35 static midiMap * getInstance(); 36 36 37 void registerMMCEvent( QString, action * );38 void registerNoteEvent( int , action * );39 void registerCCEvent( int , action * );37 void registerMMCEvent( QString,Action * ); 38 void registerNoteEvent( int , Action * ); 39 void registerCCEvent( int , Action * ); 40 40 41 map <QString , action *> getMMCMap();41 map <QString , Action *> getMMCMap(); 42 42 43 action * getMMCAction( QString );44 action * getNoteAction( int note );45 action * getCCAction( int parameter );43 Action * getMMCAction( QString ); 44 Action * getNoteAction( int note ); 45 Action * getCCAction( int parameter ); 46 46 47 47 void setupNoteArray(); … … 51 51 private: 52 52 53 action * noteArray[128];54 action * ccArray[128];53 Action * noteArray[128]; 54 Action * ccArray[128]; 55 55 56 map <QString , action *> mmcMap;56 map <QString , Action *> mmcMap; 57 57 }; 58 58 #endif branches/midiAutosense/libs/hydrogen/src/IO/midi_input.cpp
r549 r575 134 134 135 135 Hydrogen *pEngine = Hydrogen::get_instance(); 136 actionManager * aH = actionManager::getInstance();136 ActionManager * aH = ActionManager::getInstance(); 137 137 midiMap * mM = midiMap::getInstance(); 138 138 139 action * pAction;139 Action * pAction; 140 140 141 141 pAction = mM->getCCAction( msg.m_nData1 ); … … 171 171 172 172 Hydrogen *pEngine = Hydrogen::get_instance(); 173 actionManager * aH = actionManager::getInstance();173 ActionManager * aH = ActionManager::getInstance(); 174 174 midiMap * mM = midiMap::getInstance(); 175 175 … … 272 272 273 273 Hydrogen *pEngine = Hydrogen::get_instance(); 274 actionManager * aH = actionManager::getInstance();274 ActionManager * aH = ActionManager::getInstance(); 275 275 midiMap * mM = midiMap::getInstance(); 276 276 branches/midiAutosense/libs/hydrogen/src/action.cpp
r566 r575 31 31 #include <map> 32 32 33 actionManager* actionManager::instance = NULL;33 ActionManager* ActionManager::instance = NULL; 34 34 35 35 using namespace H2Core; 36 36 37 /* Class action */38 39 QString action::getType(){37 /* Class Action */ 38 39 QString Action::getType(){ 40 40 return type; 41 41 } … … 43 43 44 44 45 void action::setParameter1( QString text ){45 void Action::setParameter1( QString text ){ 46 46 parameter1 = text; 47 47 } 48 48 49 void action::setParameter2( QString text ){49 void Action::setParameter2( QString text ){ 50 50 parameter2 = text; 51 51 } 52 52 53 QString action::getParameter1(){53 QString Action::getParameter1(){ 54 54 return parameter1; 55 55 } 56 56 57 QString action::getParameter2(){57 QString Action::getParameter2(){ 58 58 return parameter2; 59 59 } 60 60 61 action::action( QString s ) : Object( "action" ) {61 Action::Action( QString s ) : Object( "Action" ) { 62 62 type = s; 63 63 QString parameter1 = "0"; … … 66 66 67 67 68 /* Class actionManager */69 70 71 actionManager::actionManager() : Object( "actionManager" ) {72 INFOLOG( " actionManager Init" );68 /* Class ActionManager */ 69 70 71 ActionManager::ActionManager() : Object( "ActionManager" ) { 72 INFOLOG( "ActionManager Init" ); 73 73 74 74 actionList <<"" … … 116 116 117 117 118 actionManager::~actionManager(){119 INFOLOG( " actionManager delete" );118 ActionManager::~ActionManager(){ 119 INFOLOG( "ActionManager delete" ); 120 120 instance = NULL; 121 121 } 122 122 123 123 124 /// Return an instance of actionManager125 actionManager* actionManager::getInstance()124 /// Return an instance of ActionManager 125 ActionManager* ActionManager::getInstance() 126 126 { 127 127 if ( instance == NULL ) { 128 instance = new actionManager();128 instance = new ActionManager(); 129 129 } 130 130 … … 132 132 } 133 133 134 QStringList actionManager::getActionList(){134 QStringList ActionManager::getActionList(){ 135 135 return actionList; 136 136 } 137 137 138 QStringList actionManager::getEventList(){138 QStringList ActionManager::getEventList(){ 139 139 return eventList; 140 140 } … … 167 167 168 168 169 bool actionManager::handleAction( action * pAction ){169 bool ActionManager::handleAction( Action * pAction ){ 170 170 171 171 Hydrogen *pEngine = Hydrogen::get_instance(); … … 173 173 /* 174 174 return false if action is null 175 (for example if no action exists for an event)175 (for example if no Action exists for an event) 176 176 */ 177 177 if( pAction == NULL ) return false; … … 203 203 204 204 default: 205 ERRORLOG( "[Hydrogen:: actionManager(PLAY): Unhandled case" );205 ERRORLOG( "[Hydrogen::ActionManager(PLAY): Unhandled case" ); 206 206 } 207 207 … … 520 520 int cc_param = 1; 521 521 522 //this action should be triggered only by CC commands522 //this Action should be triggered only by CC commands 523 523 524 524 bool ok; branches/midiAutosense/libs/hydrogen/src/midiMap.cpp
r548 r575 31 31 //constructor 32 32 for(int i = 0; i < 128; i++ ){ 33 noteArray[ i ] = new action("NOTHING");34 ccArray[ i ] = new action("NOTHING");33 noteArray[ i ] = new Action("NOTHING"); 34 ccArray[ i ] = new Action("NOTHING"); 35 35 } 36 36 } … … 38 38 midiMap::~midiMap() 39 39 { 40 std::map< QString , action *>::iterator dIter(mmcMap.begin());40 std::map< QString , Action *>::iterator dIter(mmcMap.begin()); 41 41 42 42 for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ) … … 60 60 } 61 61 62 map <QString, action *> midiMap::getMMCMap(){62 map <QString,Action *> midiMap::getMMCMap(){ 63 63 return mmcMap; 64 64 } 65 65 66 void midiMap::registerMMCEvent( QString eventString , action * pAction ){66 void midiMap::registerMMCEvent( QString eventString , Action * pAction ){ 67 67 mmcMap[ eventString ] = pAction; 68 68 } 69 69 70 void midiMap::registerNoteEvent( int note , action * pAction ){70 void midiMap::registerNoteEvent( int note , Action * pAction ){ 71 71 72 72 if( note >= 0 && note < 128 ){ … … 77 77 78 78 79 void midiMap::registerCCEvent( int parameter , action * pAction ){79 void midiMap::registerCCEvent( int parameter , Action * pAction ){ 80 80 if( parameter >= 0 and parameter < 128 ) 81 81 { … … 85 85 } 86 86 87 action * midiMap::getMMCAction( QString eventString ){87 Action * midiMap::getMMCAction( QString eventString ){ 88 88 89 std::map< QString , action *>::iterator dIter;89 std::map< QString , Action *>::iterator dIter; 90 90 dIter = mmcMap.find( eventString ); 91 91 if ( dIter == mmcMap.end() ){ … … 96 96 } 97 97 98 action * midiMap::getNoteAction( int note ){98 Action * midiMap::getNoteAction( int note ){ 99 99 return noteArray[ note ]; 100 100 } 101 101 102 action * midiMap::getCCAction( int parameter ){102 Action * midiMap::getCCAction( int parameter ){ 103 103 return ccArray[ parameter ]; 104 104 } branches/midiAutosense/libs/hydrogen/src/preferences.cpp
r549 r575 478 478 QString s_param = pMidiEventNode->FirstChild("parameter")->FirstChild()->Value(); 479 479 480 action * pAction = new action( s_action );480 Action * pAction = new Action( s_action ); 481 481 482 482 pAction->setParameter1( s_param ); … … 496 496 QString s_eventParameter = pMidiEventNode->FirstChild("eventParameter")->FirstChild()->Value(); 497 497 498 action * pAction = new action( s_action );498 Action * pAction = new Action( s_action ); 499 499 500 500 pAction->setParameter1( s_param ); … … 512 512 QString s_eventParameter = pMidiEventNode->FirstChild("eventParameter")->FirstChild()->Value(); 513 513 514 action * pAction = new action( s_action );514 Action * pAction = new Action( s_action ); 515 515 516 516 pAction->setParameter1( s_param ); … … 809 809 810 810 midiMap * mM = midiMap::getInstance(); 811 std::map< QString , action *> mmcMap = mM->getMMCMap();811 std::map< QString , Action *> mmcMap = mM->getMMCMap(); 812 812 813 813 … … 816 816 { 817 817 818 std::map< QString , action *>::iterator dIter( mmcMap.begin() );818 std::map< QString , Action *>::iterator dIter( mmcMap.begin() ); 819 819 for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ){ 820 820 821 821 QString event; 822 action * pAction;822 Action * pAction; 823 823 824 824 event = dIter->first; … … 842 842 843 843 for( int note=0; note < 128; note++ ){ 844 action * pAction = mM->getNoteAction( note );844 Action * pAction = mM->getNoteAction( note ); 845 845 if( pAction != NULL && pAction->getType() != "NOTHING") 846 846 { … … 860 860 861 861 for( int parameter=0; parameter < 128; parameter++ ){ 862 action * pAction = mM->getCCAction( parameter );862 Action * pAction = mM->getCCAction( parameter ); 863 863 if( pAction != NULL && pAction->getType() != "NOTHING") 864 864 {
