Changeset 1292

Show
Ignore:
Timestamp:
10/29/07 18:00:38 (10 months ago)
Author:
calvin
Message:

zoners patches: colored vu, vc8 patterneditor compile fix, preset save bug.
audio driver prefs shows only allowed recording devices for selected output device.
updated credits, updated shortcuts in the f1-docs.

Location:
trunk/src/buzelib
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/buzelib/PatternEditor/PatternEditorControl.cpp

    r1274 r1292  
    3535 
    3636        // render row numbers 
    37         for (int i = 0; i <= screenrows && i + editor.scroll.y < editor.rows; i++) { 
     37        int i; 
     38        for (i = 0; i <= screenrows && i + editor.scroll.y < editor.rows; i++) { 
    3839                int rownum = (i + editor.scroll.y) * editor.skip; 
    3940                std::stringstream str; 
     
    5152        screenDC.FillSolidRect(0, 0, rcClient.right, y, bgcolor); 
    5253 
    53         for (int i = 0; i < editor.tracks.size(); i++) { 
     54        for (i = 0; i < editor.tracks.size(); i++) { 
    5455                int track_x = editor.tracks[i].unit * editor.font_size.cx; 
    5556                int scroll_x = editor.scroll.x * editor.font_size.cx; 
  • trunk/src/buzelib/Preferences/AudioDriverPreferencesView.cpp

    r1273 r1292  
    7070        updateSampleRates(); 
    7171        updateChannels(); 
     72        updateDrivers(); 
    7273        return 0; 
    7374} 
     
    8081        } 
    8182        recordDevice = mainFrame->driver->getDeviceInfo(recordDevices[inputIndex]); 
    82 return 0; 
     83        return 0; 
    8384} 
    8485 
     
    101102void CAudioDriverPreferencesView::updateLatencies() { 
    102103 
    103         while (int i = audioLatencyDropDown.GetCount()) 
    104                 audioLatencyDropDown.DeleteString(i-1); 
     104        audioLatencyDropDown.ResetContent(); 
    105105 
    106106        unsigned int rate = 0; 
     
    134134 
    135135void CAudioDriverPreferencesView::updateChannels() { 
    136         while (int i = audioChannelDropDown.GetCount()) 
    137                 audioChannelDropDown.DeleteString(i-1); 
     136        audioChannelDropDown.ResetContent(); 
    138137 
    139138        int channels = device->out_channels / 2; 
     
    151150void CAudioDriverPreferencesView::updateSampleRates() { 
    152151 
    153         while (int i = audioRateDropDown.GetCount()) 
    154                 audioRateDropDown.DeleteString(i-1); 
     152        audioRateDropDown.ResetContent(); 
    155153 
    156154        sampleRates.clear(); 
     
    191189 
    192190void CAudioDriverPreferencesView::updateDrivers() { 
     191 
     192        audioDriverDropDown.ResetContent(); 
     193        recordDriverDropDown.ResetContent(); 
     194 
    193195        recordDriverDropDown.InsertString(-1, "<none>"); 
    194196 
    195         audiodriver* driver=mainFrame->driver; 
    196         //int ins = 0, outs = 0; 
     197        audiodriver* driver = mainFrame->driver; 
     198 
     199        int api_id = device?device->api_id:0; 
     200 
    197201        for (int i=0; i<driver->getDeviceCount(); i++) { 
    198202                audiodevice* dev = driver->getDeviceInfo(i); 
     
    201205                        outputDevices.push_back(i); 
    202206                } 
    203                 if (dev->in_channels>0) { 
     207                if (api_id == dev->api_id &&  dev->in_channels>0) { 
    204208                        recordDriverDropDown.InsertString(-1, dev->name.c_str()); 
    205209                        recordDevices.push_back(i); 
  • trunk/src/buzelib/PresetDialog.cpp

    r1280 r1292  
    4949 
    5050        zzub::pattern conv(plugin, 0); 
     51        int valueIndex = 0; 
    5152        for (size_t i = 0; i < conv.getColumns(); i++) { 
    5253                const zzub::parameter* param = conv.getColumnParameter(i); 
     
    5556                size_t pgroup=0, ptrack=0, pcolumn=0; 
    5657                conv.linearToPattern(i, pgroup, ptrack, pcolumn); 
     58                if(pgroup == 0) continue; 
    5759 
    58                 pi->values[i] = plugin->getParameter(pgroup, ptrack, pcolumn); 
     60                pi->values[valueIndex] = plugin->getParameter(pgroup, ptrack, pcolumn); 
    5961                pi->parameters++; 
     62                valueIndex++; 
    6063        } 
    6164 
  • trunk/src/buzelib/VisualVolumeSlider.cpp

    r1261 r1292  
    2020        mainFrame = mainFrm; 
    2121    maxL = maxR = 0; 
     22        rPeak = lPeak = rDrop = lDrop = 0; 
     23        rPeakColor = lPeakColor = 0; 
    2224        counter = 0; 
    2325    machine = 0; 
     
    128130                strcpy(pc, "L"); 
    129131 
     132        double f; 
     133        long pos12db; 
     134        long pos6db; 
     135        long ivPos; 
     136        long peakPos; 
     137        float *curPeak; 
     138        float *curDrop; 
     139        COLORREF *curPeakColor; 
    130140        float iV=0; 
    131         if (pc[0]=='L') 
    132                 iV=(linear_to_dB(maxL)+30) / 30; else 
     141        if (pc[0]=='L') { 
     142                iV=(linear_to_dB(maxL)+30) / 30; 
     143                curPeak = &lPeak; 
     144                curPeakColor = &lPeakColor; 
     145                curDrop = &lDrop; 
     146        } else { 
    133147                iV=(linear_to_dB(maxR)+30) / 30; 
     148                curPeak = &rPeak; 
     149                curPeakColor = &rPeakColor; 
     150                curDrop = &rDrop; 
     151        } 
    134152 
    135153        if (iV<0) iV=0; 
     
    138156        rc.bottom -= 2; 
    139157 
     158 
     159        if (*curPeak < iV) 
     160        { 
     161                (*curPeak) = iV; 
     162                (*curPeakColor) = (iV < VU_PERCENT_12DB) ? VU_COLOR_LOW : (iV < VU_PERCENT_6DB) ? VU_COLOR_12DB : VU_COLOR_6DB; 
     163                (*curDrop) = 0; //VU_PEAK_DROPRATE; 
     164        } 
     165 
     166        f = (direction == SB_VERT) ? rc.bottom : rc.right; 
     167        ivPos = (LONG)(iV * f); 
     168        pos12db = (LONG)(VU_PERCENT_12DB * f); 
     169        pos6db = (LONG)(VU_PERCENT_6DB * f); 
     170        peakPos = (LONG)((*curPeak) * f); 
     171 
     172        // Draw the VU meter 
     173 
    140174        if (direction == SB_VERT) { 
    141                 double f = rc.bottom; 
    142                 RECT rcAmp = { 0, rc.bottom - (LONG)(iV*f), rc.right, rc.bottom }; 
     175                RECT rcAmp = { 0, rc.bottom - ((iV > VU_PERCENT_12DB) ? pos12db : ivPos), rc.right, rc.bottom }; 
    143176                OffsetRect(&rcAmp, 1, 1); 
    144                 dc.FillSolidRect(&rcAmp, 0x00ff00); 
    145  
    146                 RECT rcBlank = { 0, 0, rc.right, rc.bottom - (LONG)(iV*f) + 1}; 
     177                dc.FillSolidRect(&rcAmp, VU_COLOR_LOW); 
     178                if (iV > VU_PERCENT_12DB) { 
     179                        RECT rc12db = { 0, rc.bottom - pos12db, rc.right, rc.bottom - ((iV > VU_PERCENT_6DB) ? pos6db : ivPos) }; 
     180                        OffsetRect(&rc12db, 1, 1); 
     181                        dc.FillSolidRect(&rc12db, VU_COLOR_12DB); 
     182                        if (iV > VU_PERCENT_6DB) { 
     183                                RECT rc6db = { 0, rc.bottom - pos6db, rc.right, rc.bottom - ivPos}; 
     184                                OffsetRect(&rc6db, 1, 1); 
     185                                dc.FillSolidRect(&rc6db, VU_COLOR_6DB); 
     186                        } 
     187                } 
     188        } else { 
     189                RECT rcAmp = {0, 0, (iV > VU_PERCENT_12DB) ? pos12db : ivPos, rc.bottom }; 
     190                OffsetRect(&rcAmp, 1, 1); 
     191                dc.FillSolidRect(&rcAmp, VU_COLOR_LOW); 
     192                if (iV > VU_PERCENT_12DB) { 
     193                        RECT rc12db = {pos12db, 0, (iV > VU_PERCENT_6DB) ? pos6db : ivPos, rc.bottom }; 
     194                        OffsetRect(&rc12db, 1, 1); 
     195                        dc.FillSolidRect(&rc12db, VU_COLOR_12DB); 
     196                        if (iV > VU_PERCENT_6DB) { 
     197                                RECT rc6db = {pos6db, 0, ivPos, rc.bottom }; 
     198                                OffsetRect(&rc6db, 1, 1); 
     199                                dc.FillSolidRect(&rc6db, VU_COLOR_6DB); 
     200                        } 
     201                } 
     202        } 
     203 
     204        // Draw blank part and peak line 
     205 
     206        if (direction == SB_VERT) { 
     207                RECT rcBlank = { 0, 0, rc.right, rc.bottom - ivPos + 1}; 
    147208                OffsetRect(&rcBlank, 1, 1); 
    148                 dc.FillSolidRect(&rcBlank, 0x000000); 
    149         } else { 
    150                 double f = rc.right; 
    151                 RECT rcAmp = {0, 0, (LONG)(iV*f), rc.bottom }; 
    152                 OffsetRect(&rcAmp, 1, 1); 
    153                 dc.FillSolidRect(&rcAmp, 0x00ff00); 
    154 //              DrawAmpRect(dc, &rcAmp, iV, SB_HORZ); 
    155  
    156                 RECT rcBlank={(LONG)(iV*f)+1, 0, rc.right, rc.bottom}; 
     209                dc.FillSolidRect(&rcBlank, VU_COLOR_BLANK); 
     210 
     211                if(*curPeak) { 
     212                        RECT rcPeak={0, rc.bottom - peakPos, rc.right, rc.bottom - peakPos + 2}; 
     213                        OffsetRect(&rcPeak, 1, 1); 
     214                        dc.FillSolidRect(&rcPeak, (*curPeakColor)); 
     215                        (*curPeak) -= (*curDrop); 
     216                        (*curDrop) += VU_PEAK_DROPRATE; 
     217                } 
     218        } else { 
     219                RECT rcBlank={ivPos + 1, 0, rc.right, rc.bottom}; 
    157220                OffsetRect(&rcBlank, 1, 1); 
    158                 dc.FillSolidRect(&rcBlank, 0x000000); 
    159         } 
    160  
     221                dc.FillSolidRect(&rcBlank, VU_COLOR_BLANK); 
     222 
     223                if(*curPeak) { 
     224                        RECT rcPeak={peakPos, 0, peakPos + 2, rc.bottom}; 
     225                        OffsetRect(&rcPeak, 1, 1); 
     226                        dc.FillSolidRect(&rcPeak, (*curPeakColor)); 
     227                        (*curPeak) -= (*curDrop); 
     228                        (*curDrop) += VU_PEAK_DROPRATE; 
     229                } 
     230        } 
    161231        return 0; 
    162232} 
  • trunk/src/buzelib/VisualVolumeSlider.h

    r1273 r1292  
    77// could be made to work both horizontal and vertical, and then 
    88// create a builtin master mixer-board to set vol and pan 
     9 
     10#define VU_COLOR_LOW    0x00ff00        /* Green */ 
     11#define VU_COLOR_12DB   0x99CCFF        /* Yellow */ 
     12#define VU_COLOR_6DB    0x0000FF        /* Red */ 
     13#define VU_COLOR_BLANK  0x000000        /* Black */ 
     14 
     15#define VU_PERCENT_12DB 0.91            /* Approximately -12 dB judging from jedShivaMeter */ 
     16#define VU_PERCENT_6DB  0.955           /* Approximately  -6 dB judging from jedShivaMeter */ 
     17 
     18#define VU_PEAK_DROPRATE 0.005 
    919 
    1020const int VISUAL_BUFFER_SIZE = 1024; 
     
    2939 
    3040        float maxR, maxL; 
     41        float rPeak, lPeak; 
     42        float rDrop, lDrop; 
     43        COLORREF lPeakColor; 
     44        COLORREF rPeakColor; 
    3145        int direction;  // SB_VERT or SB_HORZ 
    3246 
  • trunk/src/buzelib/buze.rc

    r1289 r1292  
    987987IDR_PARAMETERVIEW ACCELERATORS 
    988988BEGIN 
     989    VK_F1,          ID_HELP,                VIRTKEY, NOINVERT 
    989990        VK_TAB,                 ID_PARAMETERVIEW_NEXTSLIDER, VIRTKEY, NOINVERT 
    990991        VK_TAB,                 ID_PARAMETERVIEW_PREVIOUSSLIDER, VIRTKEY, SHIFT, NOINVERT 
  • trunk/src/buzelib/res/about.txt

    r1247 r1292  
    33 * Main coding by Anders Ervik 
    44 * Psycle and LADSPA wrappers by Polac 
    5  * Additional code by halfo and zeffii 
     5 * Additional code by halfo, zeffii and zoner 
    66 * Toolbar icons by Hiren Shah 
    77 * The default index.txt created by Wayfinder 
  • trunk/src/buzelib/res/help.txt

    r1232 r1292  
    2525        Delete                          Delete selection 
    2626 
     27        Shift+Enter                     Show machine parameters 
    2728        Ctrl+Backspace                  Show properties 
    2829 
  • trunk/src/buzelib/res/keyboard_parameters.txt

    r1279 r1292  
    22Parameter View keyboard shortcuts 
    33         
     4        (keyboard notes)                Play notes in selected machine 
     5        Tab                             Next parameter 
     6        Shift+Tab                       Previous parameter 
    47        Right/Left                      +/- 1  
    58        Shift+Right/Shift+Left          +/- 4  
    69        Ctrl+Right/Ctrl+Left            +/- 32  
    710        0..9                            Type a value  
    8         alt+p                           Preset Dropdown 
     11        Alt+P                           Preset Dropdown 
    912         
  • trunk/src/buzelib/res/keyboard_patterneditor.txt

    r1279 r1292  
    2626        Shift+F5                        Play current pattern   
    2727        Shift+F6                        Play current pattern from cursor 
    28         Shift+Enter                     Play row under cursor  
     28        Shift+8                         Play row under cursor  
    2929        Ctrl+Enter                      New pattern  
    3030        Ctrl+Shift+Enter                Clone pattern  
     
    6868        Space                           Paste current parameter value 
    6969        Ctrl+Space                      Paste current group values 
     70        Ctrl+T                          Toggle column editor for number columns 
    7071        (keyboard notes)                Edit notes  
  • trunk/src/buzelib/res/keyboard_wavetable.txt

    r1288 r1292  
    22Wave table keyboard shortcuts 
    33 
    4         F9                                      Show file browser 
     4        (keyboard notes)                Play notes with selected wave 
     5        F9                              Show file browser 
    56        Shift+A                         Zoom out, show all 
    67        Shift+S                         Zoom to selection