Changeset 575

Show
Ignore:
Timestamp:
10/16/08 15:54:32 (3 months ago)
Author:
smoors
Message:

renamed action-class to "Action" as a preparation for merge with trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/midiAutosense/gui/src/main.cpp

    r305 r575  
    304304 
    305305                delete midiMap::getInstance(); 
    306                 delete actionManager::getInstance(); 
     306                delete ActionManager::getInstance(); 
    307307 
    308308                _INFOLOG( "Quitting..." ); 
  • branches/midiAutosense/gui/src/widgets/midiTable.cpp

    r549 r575  
    117117void midiTable::insertNewRow(QString actionString , QString eventString, int eventParameter , int actionParameter) 
    118118{ 
    119         actionManager *aH = actionManager::getInstance(); 
     119        ActionManager *aH = ActionManager::getInstance(); 
    120120 
    121121        insertRow( rowCount ); 
     
    194194 
    195195        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()); 
    198198 
    199199         
    200200        for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ) 
    201201        { 
    202                 action * pAction = dIter->second; 
     202                Action * pAction = dIter->second; 
    203203                QString actionParameter; 
    204204                int actionParameterInteger = 0; 
     
    213213        for( int note = 0; note < 128; note++ ) 
    214214        { 
    215                 action * pAction = mM->getNoteAction( note ); 
     215                Action * pAction = mM->getNoteAction( note ); 
    216216                QString actionParameter; 
    217217                int actionParameterInteger = 0; 
     
    227227        for( int parameter = 0; parameter < 128; parameter++ ) 
    228228        { 
    229                 action * pAction = mM->getCCAction( parameter ); 
     229                Action * pAction = mM->getCCAction( parameter ); 
    230230                QString actionParameter; 
    231231                int actionParameterInteger = 0; 
     
    273273                        actionString = actionCombo->currentText(); 
    274274                 
    275                         action * pAction = new action( actionString ); 
     275                        Action * pAction = new Action( actionString ); 
    276276 
    277277 
  • branches/midiAutosense/libs/hydrogen/include/hydrogen/action.h

    r549 r575  
    2929 
    3030 
    31 class action : public Object { 
     31class Action : public Object { 
    3232        public: 
    33                 action( QString ); 
     33                Action( QString ); 
    3434                 
    3535                QString getType(); 
     
    5151 
    5252 
    53 class actionManager : public Object 
     53class ActionManager : public Object 
    5454{ 
    5555        private: 
    56                 static actionManager *instance; 
     56                static ActionManager *instance; 
    5757                QStringList actionList; 
    5858                QStringList eventList; 
    5959 
    6060        public: 
    61                 static actionManager* getInstance(); 
     61                static ActionManager* getInstance(); 
    6262 
    63                 bool handleAction( action * ); 
     63                bool handleAction( Action * ); 
    6464                 
    6565                QStringList getActionList(); 
    6666                QStringList getEventList(); 
    6767 
    68                 actionManager(); 
    69                 ~actionManager(); 
     68                ActionManager(); 
     69                ~ActionManager(); 
    7070}; 
    7171#endif 
  • branches/midiAutosense/libs/hydrogen/include/hydrogen/midiMap.h

    r547 r575  
    3535                static midiMap * getInstance(); 
    3636 
    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 * ); 
    4040 
    41                 map <QString , action *> getMMCMap(); 
     41                map <QString , Action *> getMMCMap(); 
    4242 
    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 ); 
    4646 
    4747                void setupNoteArray(); 
     
    5151        private: 
    5252 
    53                 action * noteArray[128]; 
    54                 action * ccArray[128]; 
     53                Action * noteArray[128]; 
     54                Action * ccArray[128]; 
    5555 
    56                 map <QString , action *> mmcMap; 
     56                map <QString , Action *> mmcMap; 
    5757}; 
    5858#endif 
  • branches/midiAutosense/libs/hydrogen/src/IO/midi_input.cpp

    r549 r575  
    134134         
    135135        Hydrogen *pEngine = Hydrogen::get_instance(); 
    136         actionManager * aH = actionManager::getInstance(); 
     136        ActionManager * aH = ActionManager::getInstance(); 
    137137        midiMap * mM = midiMap::getInstance(); 
    138138 
    139         action * pAction;  
     139        Action * pAction;  
    140140         
    141141        pAction = mM->getCCAction( msg.m_nData1 ); 
     
    171171 
    172172        Hydrogen *pEngine = Hydrogen::get_instance(); 
    173         actionManager * aH = actionManager::getInstance(); 
     173        ActionManager * aH = ActionManager::getInstance(); 
    174174        midiMap * mM = midiMap::getInstance(); 
    175175 
     
    272272         
    273273        Hydrogen *pEngine = Hydrogen::get_instance(); 
    274         actionManager * aH = actionManager::getInstance(); 
     274        ActionManager * aH = ActionManager::getInstance(); 
    275275        midiMap * mM = midiMap::getInstance(); 
    276276 
  • branches/midiAutosense/libs/hydrogen/src/action.cpp

    r566 r575  
    3131#include <map> 
    3232 
    33 actionManager* actionManager::instance = NULL; 
     33ActionManager* ActionManager::instance = NULL; 
    3434 
    3535using namespace H2Core; 
    3636 
    37 /* Class action */ 
    38  
    39 QString action::getType(){ 
     37/* Class Action */ 
     38 
     39QString Action::getType(){ 
    4040        return type; 
    4141} 
     
    4343 
    4444 
    45 void action::setParameter1( QString text ){ 
     45void Action::setParameter1( QString text ){ 
    4646        parameter1 = text; 
    4747} 
    4848 
    49 void action::setParameter2( QString text ){ 
     49void Action::setParameter2( QString text ){ 
    5050        parameter2 = text; 
    5151} 
    5252 
    53 QString action::getParameter1(){ 
     53QString Action::getParameter1(){ 
    5454        return parameter1; 
    5555} 
    5656 
    57 QString action::getParameter2(){ 
     57QString Action::getParameter2(){ 
    5858        return parameter2; 
    5959} 
    6060 
    61 action::action( QString s ) : Object( "action" ) { 
     61Action::Action( QString s ) : Object( "Action" ) { 
    6262        type = s; 
    6363        QString parameter1 = "0"; 
     
    6666 
    6767 
    68 /* Class actionManager */ 
    69  
    70  
    71 actionManager::actionManager() : Object( "actionManager" ) { 
    72         INFOLOG( "actionManager Init" ); 
     68/* Class ActionManager */ 
     69 
     70 
     71ActionManager::ActionManager() : Object( "ActionManager" ) { 
     72        INFOLOG( "ActionManager Init" ); 
    7373         
    7474        actionList <<"" 
     
    116116 
    117117 
    118 actionManager::~actionManager(){ 
    119         INFOLOG( "actionManager delete" ); 
     118ActionManager::~ActionManager(){ 
     119        INFOLOG( "ActionManager delete" ); 
    120120        instance = NULL; 
    121121} 
    122122 
    123123 
    124 /// Return an instance of actionManager 
    125 actionManager* actionManager::getInstance() 
     124/// Return an instance of ActionManager 
     125ActionManager* ActionManager::getInstance() 
    126126{ 
    127127        if ( instance == NULL ) { 
    128                 instance = new actionManager(); 
     128                instance = new ActionManager(); 
    129129        } 
    130130         
     
    132132} 
    133133 
    134 QStringList actionManager::getActionList(){ 
     134QStringList ActionManager::getActionList(){ 
    135135        return actionList; 
    136136} 
    137137 
    138 QStringList actionManager::getEventList(){ 
     138QStringList ActionManager::getEventList(){ 
    139139        return eventList; 
    140140} 
     
    167167 
    168168 
    169 bool actionManager::handleAction( action * pAction ){ 
     169bool ActionManager::handleAction( Action * pAction ){ 
    170170 
    171171        Hydrogen *pEngine = Hydrogen::get_instance(); 
     
    173173        /*  
    174174                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) 
    176176        */ 
    177177        if( pAction == NULL )   return false; 
     
    203203 
    204204                        default: 
    205                                 ERRORLOG( "[Hydrogen::actionManager(PLAY): Unhandled case" ); 
     205                                ERRORLOG( "[Hydrogen::ActionManager(PLAY): Unhandled case" ); 
    206206                } 
    207207 
     
    520520                int cc_param = 1; 
    521521 
    522                 //this action should be triggered only by CC commands 
     522                //this Action should be triggered only by CC commands 
    523523 
    524524                bool ok; 
  • branches/midiAutosense/libs/hydrogen/src/midiMap.cpp

    r548 r575  
    3131        //constructor 
    3232        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"); 
    3535        } 
    3636} 
     
    3838midiMap::~midiMap() 
    3939{ 
    40         std::map< QString , action *>::iterator dIter(mmcMap.begin()); 
     40        std::map< QString , Action *>::iterator dIter(mmcMap.begin()); 
    4141 
    4242        for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ) 
     
    6060} 
    6161 
    62 map <QString,action *> midiMap::getMMCMap(){ 
     62map <QString,Action *> midiMap::getMMCMap(){ 
    6363        return mmcMap; 
    6464} 
    6565 
    66 void midiMap::registerMMCEvent( QString eventString , action * pAction ){ 
     66void midiMap::registerMMCEvent( QString eventString , Action * pAction ){ 
    6767        mmcMap[ eventString ] = pAction; 
    6868} 
    6969 
    70 void midiMap::registerNoteEvent( int note , action * pAction ){ 
     70void midiMap::registerNoteEvent( int note , Action * pAction ){ 
    7171         
    7272        if( note >= 0 && note < 128 ){ 
     
    7777 
    7878 
    79 void midiMap::registerCCEvent( int parameter , action * pAction ){ 
     79void midiMap::registerCCEvent( int parameter , Action * pAction ){ 
    8080        if( parameter >= 0 and parameter < 128 ) 
    8181        { 
     
    8585} 
    8686 
    87 action * midiMap::getMMCAction( QString eventString ){ 
     87Action * midiMap::getMMCAction( QString eventString ){ 
    8888         
    89         std::map< QString , action *>::iterator dIter; 
     89        std::map< QString , Action *>::iterator dIter; 
    9090        dIter = mmcMap.find( eventString ); 
    9191        if ( dIter == mmcMap.end() ){ 
     
    9696} 
    9797 
    98 action * midiMap::getNoteAction( int note ){ 
     98Action * midiMap::getNoteAction( int note ){ 
    9999        return noteArray[ note ]; 
    100100} 
    101101 
    102 action * midiMap::getCCAction( int parameter ){ 
     102Action * midiMap::getCCAction( int parameter ){ 
    103103        return ccArray[ parameter ]; 
    104104} 
  • branches/midiAutosense/libs/hydrogen/src/preferences.cpp

    r549 r575  
    478478                                                QString s_param = pMidiEventNode->FirstChild("parameter")->FirstChild()->Value(); 
    479479         
    480                                                 action * pAction = new action( s_action ); 
     480                                                Action * pAction = new Action( s_action ); 
    481481 
    482482                                                pAction->setParameter1( s_param ); 
     
    496496                                                QString s_eventParameter = pMidiEventNode->FirstChild("eventParameter")->FirstChild()->Value(); 
    497497         
    498                                                 action * pAction = new action( s_action ); 
     498                                                Action * pAction = new Action( s_action ); 
    499499 
    500500                                                pAction->setParameter1( s_param ); 
     
    512512                                                QString s_eventParameter = pMidiEventNode->FirstChild("eventParameter")->FirstChild()->Value(); 
    513513         
    514                                                 action * pAction = new action( s_action ); 
     514                                                Action * pAction = new Action( s_action ); 
    515515 
    516516                                                pAction->setParameter1( s_param ); 
     
    809809 
    810810        midiMap * mM = midiMap::getInstance(); 
    811         std::map< QString , action *> mmcMap = mM->getMMCMap(); 
     811        std::map< QString , Action *> mmcMap = mM->getMMCMap(); 
    812812 
    813813 
     
    816816        { 
    817817                 
    818                 std::map< QString , action *>::iterator dIter( mmcMap.begin() ); 
     818                std::map< QString , Action *>::iterator dIter( mmcMap.begin() ); 
    819819                for( dIter = mmcMap.begin(); dIter != mmcMap.end(); dIter++ ){ 
    820820                         
    821821                        QString event; 
    822                         action * pAction; 
     822                        Action * pAction; 
    823823 
    824824                        event = dIter->first; 
     
    842842                 
    843843                for( int note=0; note < 128; note++ ){ 
    844                         action * pAction = mM->getNoteAction( note ); 
     844                        Action * pAction = mM->getNoteAction( note ); 
    845845                        if( pAction != NULL && pAction->getType() != "NOTHING") 
    846846                        { 
     
    860860 
    861861                for( int parameter=0; parameter < 128; parameter++ ){ 
    862                         action * pAction = mM->getCCAction( parameter ); 
     862                        Action * pAction = mM->getCCAction( parameter ); 
    863863                        if( pAction != NULL && pAction->getType() != "NOTHING") 
    864864                        {