Changeset 1277

Show
Ignore:
Timestamp:
10/08/07 01:34:07 (12 months ago)
Author:
calvin
Message:

machine view context menu entry for solo was broken, showing pattern length in pattern editor status bar

Location:
trunk/src/buzelib
Files:
2 modified

Legend:

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

    r1276 r1277  
    744744        bool isMaster = (machine->getFlags() & PLUGIN_FLAGS_MASK) == ROOT_PLUGIN_FLAGS; 
    745745        bool isEffect = (machine->getFlags() & PLUGIN_FLAGS_MASK) == EFFECT_PLUGIN_FLAGS; 
    746  
    747         menu.InsertMenu(-1, (machine->isMuted()?MF_CHECKED:MF_UNCHECKED)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_MUTE, "Mute"); 
     746        bool isGenerator = (machine->getFlags() & PLUGIN_FLAGS_MASK) == GENERATOR_PLUGIN_FLAGS; 
     747 
     748        menu.InsertMenu(-1, (isMaster?MF_GRAYED:0)|(machine->isMuted()?MF_CHECKED:MF_UNCHECKED)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_MUTE, "Mute"); 
    748749        //if (mac->type==1) 
    749750        bool soloCheck=player->getSoloMachine() && player->getSoloMachine()==machine; 
    750         menu.InsertMenu(-1, soloCheck?MF_CHECKED:0|((!isEffect||!singleSelect)?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_SOLO, "Solo"); 
     751        menu.InsertMenu(-1, soloCheck?MF_CHECKED:0|((!isGenerator||!singleSelect)?MF_GRAYED:0)|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_SOLO, "Solo"); 
    751752        menu.InsertMenu(-1, bypassCheck?MF_CHECKED:0|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_BYPASS, "Bypass"); 
    752753        menu.InsertMenu(-1, minimizeCheck?MF_CHECKED:0|MF_BYPOSITION|MF_STRING, (UINT_PTR)ID_MACHINE_MINIMIZE, "M&inimize"); 
  • trunk/src/buzelib/PatternView.cpp

    r1276 r1277  
    11861186        pattern_position pos = document->getPatternPosition(machine, pattern); 
    11871187 
    1188         string row = "Row " + stringFromInt(pos.row); 
     1188        std::stringstream rowStrm; 
     1189        rowStrm << "Row " << pos.row << " / " << pattern->getRows(); 
    11891190        if (patternEditor.HasSelection()) { 
    11901191                RECT rcSel; 
    11911192                patternEditor.GetSelectionRect(&rcSel); 
    1192                 row += " (" + stringFromInt(rcSel.right-rcSel.left+1) + "x" + stringFromInt(rcSel.bottom-rcSel.top+patternEditor.GetSkip()) + ")"; 
     1193                rowStrm << " (" << (rcSel.right-rcSel.left+1) << "x" << (rcSel.bottom-rcSel.top+patternEditor.GetSkip()) << ")"; 
    11931194        } 
    11941195 
     
    12021203        int value = track->getValue(pos.row, pos.column); 
    12031204         
    1204         string valueDesc = ""; 
     1205        std::stringstream valueStrm; 
    12051206        if (value != getNoValue(param)) { 
    12061207                if (param->type == parameter_type_note) { 
    1207                         valueDesc = noteFromInt(value); 
     1208                        valueStrm << noteFromInt(value); 
    12081209                } else { 
    1209                         valueDesc = machine->describeValue(pos.group, pos.column, value); 
    1210                         char pcStatus[256]; 
    1211                         sprintf(pcStatus, "%04x (%i) %s", value, value, valueDesc.c_str()); 
    1212                         valueDesc = pcStatus; 
     1210                        std::string desc = machine->describeValue(pos.group, pos.column, value); 
     1211                        valueStrm << std::setw(4) << std::setfill('0') << std::hex << value << " (" << std::dec << value << ") " << desc; 
    12131212                } 
    12141213        } 
     
    12171216        if (param->description != 0) paramDesc = (string)param->description; 
    12181217 
    1219         statusBar.SetText(0, row.c_str()); 
    1220         statusBar.SetText(1, valueDesc.c_str()); 
     1218        statusBar.SetText(0, rowStrm.str().c_str()); 
     1219        statusBar.SetText(1, valueStrm.str().c_str()); 
    12211220        statusBar.SetText(2, paramDesc.c_str()); 
    12221221} 
     
    12331232                const PATTERNCOLUMN& col = patternEditor.GetColumn(rcSelection.left); 
    12341233                pastePatternTrack(selection, rcSelection.top, col.group, col.track, col.column); 
    1235                 //document->placeRangeTrack(machine, pattern, rc.top, rc.left, track); 
    12361234                delete selection; 
    12371235        }