Changeset 1304

Show
Ignore:
Timestamp:
11/07/07 22:08:56 (10 months ago)
Author:
calvin
Message:

zonajs patch: configurable "highlighting spaced points on the 'stepline' on the sequencer."
also: a remix of ld0ds paste selection patch, fix possible crash in propertyview if the selected item is deleted

Location:
trunk/src/buzelib
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/buzelib/BuzeConfiguration.cpp

    r1295 r1304  
    288288        return dw; 
    289289} 
     290 
     291void CConfiguration::setSequencerStepHigh(int sz) { 
     292        setConfigNumber("Settings", "SequencerStepHigh", sz); 
     293} 
     294 
     295void CConfiguration::setSequencerStepLow(int sz) { 
     296        setConfigNumber("Settings", "SequencerStepLow", sz); 
     297} 
     298 
     299int CConfiguration::getSequencerStepHigh() { 
     300        DWORD dw = 0; 
     301        getConfigNumber("Settings", "SequencerStepHigh", &dw); 
     302        return dw; 
     303} 
     304 
     305int CConfiguration::getSequencerStepLow() { 
     306        DWORD dw = 0; 
     307        getConfigNumber("Settings", "SequencerStepLow", &dw); 
     308        return dw; 
     309} 
  • trunk/src/buzelib/BuzeConfiguration.h

    r1295 r1304  
    5555        std::string getExternalWaveEditor(); 
    5656 
     57        void setSequencerStepHigh(int sz); 
     58        void setSequencerStepLow(int sz); 
     59        int getSequencerStepHigh(); 
     60        int getSequencerStepLow(); 
     61         
     62 
    5763}; 
  • trunk/src/buzelib/EditorActions.cpp

    r1295 r1304  
    971971        bool status = reader.readPlayer(document->player); 
    972972 
     973        document->clearSelectedMachines(); 
     974         
     975        for (size_t i = 0; i < reader.machines.size(); i++) 
     976                if ((reader.machines[i]->loader->plugin_info->flags & zzub::plugin_flag_is_root) == 0) { 
     977                        document->selectMachine(reader.machines[i]); 
     978                } 
     979 
     980 
    973981    if (!status) 
    974982                MessageBox(GetForegroundWindow(), document->player->getLoadErrors().c_str(), "Load error", MB_OK|MB_ICONERROR); 
  • trunk/src/buzelib/MachineView.cpp

    r1302 r1304  
    11071107 
    11081108metaplugin* CMachineView::getMachineAtPt(POINT pt, RECT* machineRect) { 
    1109         for (size_t i=0; i<player->getMachines(); i++) { 
     1109        for (int i = player->getMachines() - 1; i >= 0; i--) { 
    11101110                metaplugin* m = player->getMachine(i); 
    11111111                if (m->nonSongPlugin) continue; 
     
    16661666                case UpdateOpenDocument: 
    16671667                        ledStates.clear(); 
    1668                         document->clearSelectedMachines(); 
    1669                         document->selectMachine(document->player->master); 
    16701668                        break; 
    16711669                case UpdateDeleteMachine: 
     
    17171715} 
    17181716 
     1717 
  • trunk/src/buzelib/MainFrm.cpp

    r1297 r1304  
    15051505 
    15061506bool CMainFrame::openSongFromFile(std::string fileName, bool clearAll) { 
     1507        document->clearSelectedMachines(); 
     1508        document->selectMachine(document->player->master); 
    15071509 
    15081510        debug((string)"Open " + fileName); 
     
    15471549        } 
    15481550        //player->getMaster()->releaseEvent(progressEventID); 
    1549  
    1550         document->updateAllViews(0, UpdateOpenDocument); 
    15511551 
    15521552        _Module.hideWaitWindow(); 
  • trunk/src/buzelib/PropertyListView.cpp

    r1300 r1304  
    134134                        if (document->selectedPropertyProvider->isData(pHint)) { 
    135135                                clearAll(); 
     136                                delete document->selectedPropertyProvider; 
     137                                document->selectedPropertyProvider = 0; 
    136138                        } 
    137139                        break; 
  • trunk/src/buzelib/SequenceEditor.cpp

    r1285 r1304  
    353353        char pc[64]; 
    354354 
     355        size_t stepIncrement = document->configuration->getSequencerStepHigh(); 
     356        size_t miniStepIncrement = document->configuration->getSequencerStepLow(); 
     357 
     358        size_t lastStep = 0; 
     359        size_t row = scrollRows * getScale(); 
     360 
     361        // determine last step (for highlighting) 
     362        if(row && stepIncrement && miniStepIncrement) { 
     363                if (row > stepIncrement) 
     364                        while (lastStep < row - stepIncrement) 
     365                                lastStep += stepIncrement; 
     366                while (!(lastStep + miniStepIncrement >= row)) 
     367                        lastStep += miniStepIncrement; 
     368        } 
     369 
    355370        // draw row numbers 
    356371        for (size_t j=0; j<maxRows; j++) { 
    357                 sprintf(pc, "%7i ", (scrollRows+j)*getScale()); 
    358  
     372 
     373                row = (scrollRows + j) * getScale(); 
    359374                RECT mrc; 
     375 
     376                sprintf(pc, "%7i ", row); 
     377 
    360378                SetRect(&mrc, 0, y, cellWidth+1,y+17); 
    361379                dc.Rectangle(&mrc); 
    362380 
    363381                //dc.SetTextColor(0); 
     382                dc.SetBkColor(mainFrame->getThemeColor("SE BG")); 
     383 
     384                // determine highlight color 
     385                if(stepIncrement && miniStepIncrement) { 
     386                        if (!(row % stepIncrement)) { 
     387                                dc.SetBkColor(mainFrame->getThemeColor("SE BG Very Dark")); 
     388                                lastStep = row; 
     389                        } 
     390                        else if (row - lastStep == miniStepIncrement) { 
     391                                dc.SetBkColor(mainFrame->getThemeColor("SE BG Dark")); 
     392                                lastStep = row; 
     393                        } 
     394                } 
     395                dc.FillSolidRect(&mrc, dc.GetBkColor()); 
    364396 
    365397                mrc.right-=8;