예제 #1
0
// ------------------------------------------------------
// Move the lists up & down
void Files_List_Move(int Amount)
{
    switch(Scopish)
    {
        case SCOPE_ZONE_INSTR_LIST:
        case SCOPE_ZONE_SYNTH_LIST:

            if(zcheckMouse(MAX_PATT_SCREEN_X + 1, 42, 16, 14))
            {
                Instrs_index -= Amount;
                gui_action = GUI_CMD_INSTR_SYNTH_SCROLL;
            }

            if(zcheckMouse(MAX_PATT_SCREEN_X + 1, 164, 16, 14))
            {
                Instrs_index += Amount;
                gui_action = GUI_CMD_INSTR_SYNTH_SCROLL;
            }
            break;

        default:

            // Files list up
            if(zcheckMouse(MAX_PATT_SCREEN_X + 1, 42, 16, 14))
            {
                if(abs(Amount) > 1)
                {
                    Prev_Prefix();
                }
                else
                {
                    lt_index[Scopish] -= Amount;
                }
                gui_action = GUI_CMD_FILELIST_SCROLL;
            }

            // Files list down
            if(zcheckMouse(MAX_PATT_SCREEN_X + 1, 164, 16, 14))
            {
                if(abs(Amount) > 1)
                {
                    Next_Prefix();
                }
                else
                {
                    lt_index[Scopish] += Amount;
                }
                gui_action = GUI_CMD_FILELIST_SCROLL;
            }
            break;
    }
}
예제 #2
0
// ------------------------------------------------------
// Modify a cc value or relative automation one
void Mod_Midi_Automation_Value(int Amount)
{
    int i;

    for(i = 0; i < NBR_MIDI_DISPATCH_MSG; i++)
    {
        if(zcheckMouse(Pos_Midi_Automation[i].x,
                       (Cur_Height - Pos_Midi_Automation[i].y),
                       16, 16) && snamesel == INPUT_NONE)
        {
            Midi_Dispatch_Table[i].CC -= Amount;
            if(Midi_Dispatch_Table[i].CC < 0) Midi_Dispatch_Table[i].CC = 0;
            teac = UPDATE_MIDI_ED_CC0 + i;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            break;
        }

        if(zcheckMouse(Pos_Midi_Automation[i].x + 44,
                       (Cur_Height - Pos_Midi_Automation[i].y),
                       16, 16) && snamesel == INPUT_NONE)
        {
            Midi_Dispatch_Table[i].CC += Amount;
            if(Midi_Dispatch_Table[i].CC > 255) Midi_Dispatch_Table[i].CC = 255;
            teac = UPDATE_MIDI_ED_CC0 + i;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            break;
        }

        if(zcheckMouse(Pos_Midi_Automation[i].x + GAP_X_MIDI,
                       (Cur_Height - Pos_Midi_Automation[i].y),
                       16, 16) && snamesel == INPUT_NONE)
        {
            Midi_Dispatch_Table[i].Automation = (MIDI_AUTOMATION) (Midi_Dispatch_Table[i].Automation - Amount);
            if(Midi_Dispatch_Table[i].Automation < (MIDI_AUTOMATION) 0) Midi_Dispatch_Table[i].Automation = (MIDI_AUTOMATION) 0;
            teac = UPDATE_MIDI_ED_CC0 + i;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            break;
        }

        if(zcheckMouse(Pos_Midi_Automation[i].x + GAP_X_MIDI + (18 + 110),
                       (Cur_Height - Pos_Midi_Automation[i].y),
                       16, 16) && snamesel == INPUT_NONE)
        {
            Midi_Dispatch_Table[i].Automation = (MIDI_AUTOMATION) (Midi_Dispatch_Table[i].Automation + Amount);
            if(Midi_Dispatch_Table[i].Automation > (MIDI_AUTOMATION) (NBR_MIDI_AUTOMATION - 1)) Midi_Dispatch_Table[i].Automation = (MIDI_AUTOMATION) (NBR_MIDI_AUTOMATION - 1);
            teac = UPDATE_MIDI_ED_CC0 + i;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            break;
        }
    }
}
예제 #3
0
// ------------------------------------------------------
// Check if a track can be solo'ed
void Check_Tracks_To_Render_To_Solo(void)
{
    int i;
    int j;

    for(i = 0; i < Songtracks; i++)
    {
        if(zcheckMouse(Tracks_Position[i].x, (Cur_Height - 112) + Tracks_Position[i].y, 17, 16))
        {
            if(Is_Track_To_Render_Solo(i))
            {
                for(j = 0; j < Songtracks; j++)
                {
                    Tracks_To_Render[j] = FALSE;
                }
            }
            else
            {
                for(j = 0; j < Songtracks; j++)
                {
                    Tracks_To_Render[j] = TRUE;
                }
                Tracks_To_Render[i] = FALSE;
            }
        }
    }
    Display_Tracks_To_Render();
}
예제 #4
0
// ------------------------------------------------------
// Handle the mouse buttons
void Mouse_Handler_Requester(void)
{
    int i;

    // If no buttons then the whole surface is used
    if(!Nbr_Buttons)
    {
        if(Mouse.button_oneshot & MOUSE_LEFT_BUTTON ||
                Mouse.button_oneshot & MOUSE_MIDDLE_BUTTON ||
                Mouse.button_oneshot & MOUSE_RIGHT_BUTTON)
        {
            Req_Pressed_Button = 1;
        }
    }
    else
    {
        if(Mouse.button_oneshot & MOUSE_LEFT_BUTTON)
        {
            for(i = 0; i < Nbr_Buttons; i++)
            {
                if(zcheckMouse(Pos_X + Buttons_Pos[i],
                               Pos_Y + (Size_Y - Font_Height) - 16, Buttons_Size[i], 16))
                {
                    Req_Pressed_Button = i + 1;
                }
            }
        }
    }
}
예제 #5
0
// ------------------------------------------------------
// Handle right mouse button
void Mouse_Right_DiskIO_Ed(void)
{
    if(userscreen == USER_SCREEN_DISKIO_EDIT)
    {
        Check_Tracks_To_Render_To_Solo();

        if(rawrender_range)
        {
            // From position
            if(zcheckMouse(572, (Cur_Height - 86), 16, 16) == 1)
            {
                rawrender_from -= 10;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 3;
            }

            // From position
            if(zcheckMouse(572 + 44, (Cur_Height - 86), 16, 16) == 1)
            {
                rawrender_from += 10;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 3;
            }

            // To position
            if(zcheckMouse(572, (Cur_Height - 66), 16, 16) == 1)
            {
                rawrender_to -= 10;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 4;
            }

            // To position
            if(zcheckMouse(572 + 44, (Cur_Height - 66), 16, 16) == 1)
            {
                rawrender_to += 10;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 4;
            }
        }
    }
}
예제 #6
0
// ------------------------------------------------------
// Handle clicks on the tracks gadgets
void Check_Tracks_To_Render(void)
{
    int i;

    for(i = 0; i < MAX_TRACKS; i++)
    {
        if(i < Songtracks)
        {
            if(zcheckMouse(Tracks_Position[i].x, (Cur_Height - 112) + Tracks_Position[i].y, 17, 16))
            {
                Tracks_To_Render[i] ^= TRUE;
                Display_1_Track_To_Render(i);
            }
        }
    }
}
예제 #7
0
void Mouse_Left_Track_Fx_Ed(void)
{
    if(userscreen == USER_SCREEN_TRACK_FX_EDIT)
    {
        if(zcheckMouse(74, (Cur_Height - 128), 20, 16) && LFO_ON[Track_Under_Caret] == FALSE)
        {
            LFO_ON[Track_Under_Caret] = TRUE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }
        if(zcheckMouse(96, (Cur_Height - 128), 20, 16) && LFO_ON[Track_Under_Caret] == TRUE)
        {
            LFO_ON[Track_Under_Caret] = FALSE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }
        if(zcheckMouse(184, (Cur_Height - 128), 20, 16) && FLANGER_ON[Track_Under_Caret] == FALSE)
        {
            FLANGER_ON[Track_Under_Caret] = TRUE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }
        if(zcheckMouse(206, (Cur_Height - 128), 20, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_ON[Track_Under_Caret] = FALSE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }

        if(zcheckMouse(602, (Cur_Height - 121), 20, 16) && Compress_Track[Track_Under_Caret] == FALSE)
        {
            Compress_Track[Track_Under_Caret] = TRUE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }
        if(zcheckMouse(624, (Cur_Height - 121), 20, 16) && Compress_Track[Track_Under_Caret])
        {
            Compress_Track[Track_Under_Caret] = FALSE;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 0;
        }

    }
}
예제 #8
0
void Mouse_Left_Midi_Ed(void)
{
    if(userscreen == USER_SCREEN_SETUP_MIDI)
    {
        // Save the data
        if(zcheckMouse(749, (Cur_Height - 142), 34, 16))
        {
            if(File_Exist_Req("%s"SLASH"%s.pmi", Dir_MidiCfg, Midi_Name))
            {
                Display_Requester(&Overwrite_Requester, GUI_CMD_SAVE_MIDI_CFG);
            }
            else
            {
                gui_action = GUI_CMD_SAVE_MIDI_CFG;
            }
        }

        // Start midi name input
        if(zcheckMouse(583, (Cur_Height - 142), 164, 16) && snamesel == INPUT_NONE)
        {
            snamesel = INPUT_MIDI_NAME;
            strcpy(cur_input_name, Midi_Name);
            namesize = 0;
            sprintf(Midi_Name, "");
            teac = UPDATE_MIDI_ED_CHANGE_NAME;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
        }

#if !defined(__NO_MIDI__)
        // Previous midi in device
        if(zcheckMouse(70, (Cur_Height - 134), 16, 16))
        {
            c_midiin--;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            midiin_changed = 1;
            teac = UPDATE_MIDI_ED_SEL_IN;
        }
        // Next midi in device
        if(zcheckMouse(114, (Cur_Height - 134), 16, 16))
        {
            c_midiin++;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            midiin_changed = 1;
            teac = UPDATE_MIDI_ED_SEL_IN;
        }

        // Previous midi out device
        if(zcheckMouse(70, (Cur_Height - 117), 16, 16))
        {
            c_midiout--;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            midiout_changed = TRUE;
            teac = UPDATE_MIDI_ED_SEL_OUT;
        }
        // Next midi out device
        if(zcheckMouse(114, (Cur_Height - 117), 16, 16))
        {
            c_midiout++;
            gui_action = GUI_CMD_UPDATE_MIDI_ED;
            midiout_changed = TRUE;
            teac = UPDATE_MIDI_ED_SEL_OUT;
        }
#endif

        // Midi track notes off
#if !defined(__NO_MIDI__)
        if(zcheckMouse(12, (Cur_Height - 99), 82, 16) == 1 && c_midiout != -1)
        {
            Midi_NoteOff(Track_Under_Caret, -1);
            int i;
            for(i = 0; i < MAX_POLYPHONY; i++)
            {
                Midi_Current_Notes[CHAN_MIDI_PRG[Track_Under_Caret]][i] = 0;
            }
            gui_action = GUI_CMD_MIDI_NOTE_OFF_1_TRACK;
        }
#endif

        // All Midi notes off
#if !defined(__NO_MIDI__)
        if(zcheckMouse(12, (Cur_Height - 81), 82, 16) == 1 && c_midiout != -1)
        {
            Midi_AllNotesOff();
            gui_action = GUI_CMD_MIDI_NOTE_OFF_ALL_TRACKS;
        }
#endif

        Mod_Midi_Automation_Value(1);
    }
}
예제 #9
0
void Mouse_Left_303_Ed(void)
{
    if(userscreen == USER_SCREEN_TB303_EDIT)
    {
        // Step Forward
        if(zcheckMouse(479, (Cur_Height - 50), 25, 16))
        {
            editsteps[sl3][tb303[sl3].selectedpattern]++;
            if(editsteps[sl3][tb303[sl3].selectedpattern] > tb303[sl3].patternlength[tb303[sl3].selectedpattern] - 1)
            {
                editsteps[sl3][tb303[sl3].selectedpattern] = 0;
            }
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // Step Back
        if(zcheckMouse(484, (Cur_Height - 78), 15, 10))
        {
            if(editsteps[sl3][tb303[sl3].selectedpattern] == 0) editsteps[sl3][tb303[sl3].selectedpattern] = tb303[sl3].patternlength[tb303[sl3].selectedpattern] - 1;
            else editsteps[sl3][tb303[sl3].selectedpattern]--;
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Pattern Steps +1
        if(zcheckMouse(135, (Cur_Height - 45), 11, 9) &&
           tb303[sl3].patternlength[tb303[sl3].selectedpattern] < 16)
        {
            tb303[sl3].patternlength[tb303[sl3].selectedpattern]++;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // Pattern Steps -1
        if(zcheckMouse(135, (Cur_Height - 36), 11, 9) &&
           tb303[sl3].patternlength[tb303[sl3].selectedpattern] > 1)
        {
            tb303[sl3].patternlength[tb303[sl3].selectedpattern]--;
            if(editsteps[sl3][tb303[sl3].selectedpattern] > tb303[sl3].patternlength[tb303[sl3].selectedpattern] - 1)
            {
                editsteps[sl3][tb303[sl3].selectedpattern] = tb303[sl3].patternlength[tb303[sl3].selectedpattern] - 1;
            }
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // Pause/Note button
        if(zcheckMouse(450, (Cur_Height - 82), 15, 10))
        {
            if(tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].pause)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].pause = 0;
            }
            else
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].pause = 1;
            }
            teac = 10;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Glide button
        if(zcheckMouse(454, (Cur_Height - 50), 10, 15))
        {
            if(tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].slide_flag)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].slide_flag = 0;
            }
            else
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].slide_flag = 1;
            }
            teac = 11;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Accent button
        if(zcheckMouse(428, (Cur_Height - 50), 10, 15))
        {
            if(tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].accent_flag)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].accent_flag = 0;
            }
            else
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].accent_flag = 1;
            }
            teac = 12;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Transpose up button
        if(zcheckMouse(403, (Cur_Height - 50), 10, 15))
        {
            if(tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposeup_flag)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposeup_flag = 0;
            }
            else
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposeup_flag = 1;
            }
            teac = 13;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Transpose down button
        if(zcheckMouse(378, (Cur_Height - 50), 10, 15))
        {
            if(tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposedown_flag)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposedown_flag = 0;
            }
            else
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]].transposedown_flag = 1;
            }
            teac = 14;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Sawtooth/Square switching
        if(zcheckMouse(177, (Cur_Height - 129), 19, 10))
        {
            tb303[sl3].waveform ^= 1;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 2;
        }

        // NoteOn/Off buttons
        if(zcheckMouse(87 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(100 + 80, (Cur_Height - 76), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 1;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(113 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 2;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(126 + 80, (Cur_Height - 76), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 3;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(139 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 4;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(165 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 5;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(178 + 80, (Cur_Height - 76), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 6;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(190 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 7;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(203 + 80, (Cur_Height - 76), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 8;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(216 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 9;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }

        if(zcheckMouse(229 + 80, (Cur_Height - 76), 87, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 10;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(242 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 11;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }
        if(zcheckMouse(268 + 80, (Cur_Height - 50), 17, 15))
        {
            tb303[sl3].tone[tb303[sl3].selectedpattern][editsteps[sl3][tb303[sl3].selectedpattern]] = 12;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 9;
        }

        // Pattern selection buttons
        if(zcheckMouse(86, (Cur_Height - 117), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(100, (Cur_Height - 117), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 1;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(114, (Cur_Height - 117), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 2;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(130, (Cur_Height - 117), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 3;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(86, (Cur_Height - 102), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 4;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(100, (Cur_Height - 102), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 5;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(114, (Cur_Height - 102), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 6;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(130, (Cur_Height - 102), 16, 16))
        {
            char gcp = (tb303[sl3].selectedpattern / 8) * 8;
            tb303[sl3].selectedpattern = gcp + 7;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // Bank selection buttons
        if(zcheckMouse(86, (Cur_Height - 75), 16, 16))
        {
            tb303[sl3].selectedpattern = (tb303[sl3].selectedpattern - (tb303[sl3].selectedpattern / 8) * 8);
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(100, (Cur_Height - 75), 16, 16))
        {
            tb303[sl3].selectedpattern = ((tb303[sl3].selectedpattern - (tb303[sl3].selectedpattern / 8) * 8)) + 8;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(114, (Cur_Height - 75), 16, 16))
        {
            tb303[sl3].selectedpattern = ((tb303[sl3].selectedpattern - (tb303[sl3].selectedpattern / 8) * 8)) + 16;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        if(zcheckMouse(130, (Cur_Height - 75), 16, 16))
        {
            tb303[sl3].selectedpattern = ((tb303[sl3].selectedpattern - (tb303[sl3].selectedpattern / 8) * 8)) + 24;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // 303 #1
        if(zcheckMouse(553, (Cur_Height - 71), 15, 12))
        {
            sl3 = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }
        // 303 #2
        if(zcheckMouse(573, (Cur_Height - 71), 15, 12))
        {
            sl3 = 1;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 0;
        }

        // Rand tones
        if(zcheckMouse(8, (Cur_Height - 80), 64, 16))
        {
            for(char alter = 0; alter < 16; alter++)
            {
                tb303[sl3].tone[tb303[sl3].selectedpattern][alter] = (rand() % 13);
            }
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // rand flags
        if(zcheckMouse(8, (Cur_Height - 62), 64, 16))
        {
            for(char alter = 0; alter < 16; alter++)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].slide_flag = rand() % 2;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposeup_flag = rand() % 2;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposedown_flag = rand() % 2;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].accent_flag = rand() % 2;
            }
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Rand noteon
        if(zcheckMouse(8, (Cur_Height - 98), 64, 16))
        {
            for(char alter = 0; alter < 16; alter++)
            {
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].pause = rand() % 2;
            }
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Clear pattern
        if(zcheckMouse(8, (Cur_Height - 116), 64, 16))
        {
            for(char alter = 0; alter < 16; alter++)
            {
                tb303[sl3].tone[tb303[sl3].selectedpattern][alter] = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].pause = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].slide_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposeup_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposedown_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].accent_flag = 0;
            }
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Reset pattern
        if(zcheckMouse(8, (Cur_Height - 134), 64, 16))
        {
            for(char alter = 0; alter < 16; alter++)
            {
                tb303[sl3].tone[tb303[sl3].selectedpattern][alter] = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].pause = 1;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].slide_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposeup_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].transposedown_flag = 0;
                tb303[sl3].flag[tb303[sl3].selectedpattern][alter].accent_flag = 0;
            }
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // All notes up
        if(zcheckMouse(600, (Cur_Height - 98), 64, 16))
        {
            tb303_notes_up();
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // All notes down
        if(zcheckMouse(668, (Cur_Height - 98), 64, 16))
        {
            tb303_notes_down();
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Copy pattern
        if(zcheckMouse(600, (Cur_Height - 78), 64, 16))
        {
            tb303_copy_pattern();
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Paste pattern
        if(zcheckMouse(600, (Cur_Height - 60), 64, 16))
        {
            tb303_paste_pattern();
            teac = 0;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Select the copy buffers
        if(zcheckMouse(600, (Cur_Height - 42), 15, 16))
        {
            Current_copy_buffer = 0;
            teac = 17;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }
        if(zcheckMouse(616, (Cur_Height - 42), 15, 16))
        {
            Current_copy_buffer = 1;
            teac = 17;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }
        if(zcheckMouse(633, (Cur_Height - 42), 15, 16))
        {
            Current_copy_buffer = 2;
            teac = 17;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }
        if(zcheckMouse(649, (Cur_Height - 42), 15, 16))
        {
            Current_copy_buffer = 3;
            teac = 17;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
        }

        // Start name input
        if(zcheckMouse(600, (Cur_Height - 120), 164, 16) && snamesel == INPUT_NONE)
        {
            snamesel = INPUT_303_PATTERN;
            strcpy(cur_input_name, tb303[sl3].pattern_name[tb303[sl3].selectedpattern]);
            namesize = 0;
            sprintf(tb303[sl3].pattern_name[tb303[sl3].selectedpattern], "");
            teac = 18;
            gui_action = GUI_CMD_UPDATE_MIDI_303_ED;
        }

        // Save the data
        if(zcheckMouse(658, (Cur_Height - 138), 34, 16))
        {
            if(File_Exist_Req("%s"SLASH"%s.303", Dir_Patterns, tb303[sl3].pattern_name[tb303[sl3].selectedpattern]))
            {
                Display_Requester(&Overwrite_Requester, GUI_CMD_SAVE_303_PATTERN);
            }
            else
            {
                gui_action = GUI_CMD_SAVE_303_PATTERN;
            }
        }

        // Tune to the other unit
        if(zcheckMouse(668, (Cur_Height - 78), 64, 16))
        {
            if(sl3)
            {
                tb303[1].tune = tb303[0].tune;
            }
            else
            {
                tb303[0].tune = tb303[1].tune;
            }
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 3;
        }

        // Scale
        if(zcheckMouse(670, (Cur_Height - 42), 16, 16))
        {
            tb303[sl3].scale--;
            if(tb303[sl3].scale < 1) tb303[sl3].scale = 1;
            tb303engine[sl3].tbCurMultiple = tb303[sl3].scale;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 19;
        }

        // Scale
        if(zcheckMouse(670 + 44, (Cur_Height - 42), 16, 16))
        {
            tb303[sl3].scale++;
            if(tb303[sl3].scale > 16) tb303[sl3].scale = 16;
            tb303engine[sl3].tbCurMultiple = tb303[sl3].scale;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 19;
        }

    }
}
예제 #10
0
void Mouse_Wheel_303_Ed(int roll_amount)
{
    if(userscreen == USER_SCREEN_TB303_EDIT)
    {
        // Volume Knob
        if(zcheckMouse(529, (Cur_Height - 115), 19, 88))
        {
            float froll = roll_amount / 86.0f;
            float breakvol = tb303engine[sl3].tbVolume + froll;
            if(breakvol < 0.0f) breakvol = 0.0f;
            if(breakvol > 1.0f) breakvol = 1.0f;
            tb303engine[sl3].tbVolume = breakvol;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            liveparam = LIVE_PARAM_303_1_VOLUME + sl3;
            livevalue = (int) (breakvol * 255.0f);
            teac = 15;
        }

        // Tune Knob
        if(zcheckMouse(229, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].tune + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].tune = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 3;
            liveparam = LIVE_PARAM_303_1_TUNE + sl3;
            livevalue = tempz << 1;
        }

        // CutOff Knob
        if(zcheckMouse(262, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].cutoff + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].cutoff = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 4;
            liveparam = LIVE_PARAM_303_1_CUTOFF + sl3;
            livevalue = tempz << 1;
        }

        // Reso knob
        if(zcheckMouse(295, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].resonance + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].resonance = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 5;
            liveparam = LIVE_PARAM_303_1_RESONANCE + sl3;
            livevalue = tempz << 1;
        }

        // Envmod knob
        if(zcheckMouse(328, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].envmod + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].envmod = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 6;
            liveparam = LIVE_PARAM_303_1_ENVMOD + sl3;
            livevalue = tempz << 1;
        }

        // Decay knob
        if(zcheckMouse(361, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].decay + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].decay = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 7;
            liveparam = LIVE_PARAM_303_1_DECAY + sl3;
            livevalue = tempz << 1;
        }

        // Accent knob
        if(zcheckMouse(394, (Cur_Height - 124), 24, 24))
        {
            int tempz = tb303[sl3].accent + roll_amount;
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].accent = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 8;
            liveparam = LIVE_PARAM_303_1_ACCENT + sl3;
            livevalue = tempz << 1;
        }
    }
}
예제 #11
0
void Mouse_Right_303_Ed(void )
{
    if(userscreen == USER_SCREEN_TB303_EDIT)
    {
        // Volume Slider
        if(zcheckMouse(529, (Cur_Height - 115), 19, 88))
        {
            tb303engine[sl3].tbVolume = 0.5f;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 15;
            liveparam = LIVE_PARAM_303_1_VOLUME + sl3;
            livevalue = (int) (tb303engine[sl3].tbVolume * 255.0f);
        }

        // Tune Knob
        if(zcheckMouse(229, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].tune = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 3;
            liveparam = LIVE_PARAM_303_1_TUNE + sl3;
            livevalue = tempz << 1;
        }

        // CutOff Knob
        if(zcheckMouse(262, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].cutoff = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 4;
            liveparam = LIVE_PARAM_303_1_CUTOFF + sl3;
            livevalue = tempz << 1;
        }

        // Reso knob
        if(zcheckMouse(295, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].resonance = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 5;
            liveparam = LIVE_PARAM_303_1_RESONANCE + sl3;
            livevalue = tempz << 1;
        }

        // Envmod knob
        if(zcheckMouse(328, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].envmod = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 6;
            liveparam = LIVE_PARAM_303_1_ENVMOD + sl3;
            livevalue = tempz << 1;
        }

        // Decay knob
        if(zcheckMouse(361, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].decay = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 7;
            liveparam = LIVE_PARAM_303_1_DECAY + sl3;
            livevalue = tempz << 1;
        }

        // Accent knob
        if(zcheckMouse(394, (Cur_Height - 124), 24, 24))
        {
            int tempz = 64;
            tb303[sl3].accent = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 8;
            liveparam = LIVE_PARAM_303_1_ACCENT + sl3;
            livevalue = tempz << 1;
        }

        // Scale
        if(zcheckMouse(670, (Cur_Height - 42), 16, 16))
        {
            int value = tb303[sl3].scale;
            value -= 4;
            if(value < 1) value = 1;
            tb303[sl3].scale = value;
            tb303engine[sl3].tbCurMultiple = tb303[sl3].scale;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 19;
        }

        // Scale
        if(zcheckMouse(670 + 44, (Cur_Height - 42), 16, 16))
        {
            tb303[sl3].scale += 4;
            if(tb303[sl3].scale > 16) tb303[sl3].scale = 16;
            tb303engine[sl3].tbCurMultiple = tb303[sl3].scale;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 19;
        }
    }
}
예제 #12
0
void Mouse_Sliders_303_Ed(void)
{
    if(userscreen == USER_SCREEN_TB303_EDIT)
    {
        // Volume Knob
        if(zcheckMouse(529, (Cur_Height - 115), 19, 88))
        {
            float breakvol = (float) (80 - (Mouse.y - (Cur_Height - 115)));
            breakvol /= 72.0f;
            if(breakvol < 0.0f) breakvol = 0.0f;
            if(breakvol > 1.0f) breakvol = 1.0f;
            tb303engine[sl3].tbVolume = breakvol;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 15;
            liveparam = LIVE_PARAM_303_1_VOLUME + sl3;
            livevalue = (int) (breakvol * 255.0f);
        }

        // Tune Knob
        if(zcheckMouse(229, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].tune;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].tune = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 3;
            liveparam = LIVE_PARAM_303_1_TUNE + sl3;
            livevalue = tempz << 1;
        }

        // CutOff Knob
        if(zcheckMouse(262, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].cutoff;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].cutoff = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 4;
            liveparam = LIVE_PARAM_303_1_CUTOFF + sl3;
            livevalue = tempz << 1;
        }

        // Reso knob
        if(zcheckMouse(295, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].resonance;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].resonance = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 5;
            liveparam = LIVE_PARAM_303_1_RESONANCE + sl3;
            livevalue = tempz << 1;
        }

        // Envmod knob
        if(zcheckMouse(328, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].envmod;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].envmod = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 6;
            liveparam = LIVE_PARAM_303_1_ENVMOD + sl3;
            livevalue = tempz << 1;
        }

        // Decay knob
        if(zcheckMouse(361, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].decay;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].decay = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 7;
            liveparam = LIVE_PARAM_303_1_DECAY + sl3;
            livevalue = tempz << 1;
        }

        // Accent knob
        if(zcheckMouse(394, (Cur_Height - 124), 24, 24))
        {
            if(fluzy == -1) fluzy = (Mouse.y * 3) + tb303[sl3].accent;

            int tempz = fluzy - (Mouse.y * 3);
            if(tempz < 0) tempz = 0;
            if(tempz > 127) tempz = 127;
            tb303[sl3].accent = tempz;
            gui_action = GUI_CMD_REFRESH_TB303_PARAMS;
            teac = 8;
            liveparam = LIVE_PARAM_303_1_ACCENT + sl3;
            livevalue = tempz << 1;
        }
    }
}
예제 #13
0
// ------------------------------------------------------
// Handle left mouse button
void Mouse_Left_DiskIO_Ed(void)
{
    int i;
    char WavFileName[MAX_PATH];

    if(userscreen == USER_SCREEN_DISKIO_EDIT)
    {
        // Save song
        if(zcheckMouse(8, (Cur_Height - 112), 80, 16))
        {
#ifndef __LITE__
            if(File_Exist_Req("%s"SLASH"%s.ptk", Dir_Mods, name))
#else
            if(File_Exist_Req("%s"SLASH"%s.ptl", Dir_Mods, name))
#endif
            {
                Display_Requester(&Overwrite_Requester, GUI_CMD_SAVE_MODULE);
            }
            else
            {
                gui_action = GUI_CMD_SAVE_MODULE;
            }
        }
        // Save final
        if(zcheckMouse(254, (Cur_Height - 130), 80, 16))
        {
            if(File_Exist_Req("%s"SLASH"%s.ptp", Dir_Mods, name))
            {
                Display_Requester(&Overwrite_Requester, GUI_CMD_SAVE_FINAL);
            }
            else
            {
                gui_action = GUI_CMD_SAVE_FINAL;
            }
        }
        // Calc final
        if(zcheckMouse(254, (Cur_Height - 112), 80, 16))
        {
            gui_action = GUI_CMD_CALC_FINAL;
        }
        // Calc length
        if(zcheckMouse(254, (Cur_Height - 76), 80, 16))
        {
            Calc_Length();
        }

        if(zcheckMouse(90, (Cur_Height - 130), 80, 16))
        {
            gui_action = GUI_CMD_MODULE_INFOS;
        }

        // Start module name input
        if(zcheckMouse(90, (Cur_Height - 94), 162, 16) && snamesel == INPUT_NONE)
        {
            strcpy(cur_input_name, name);
            sprintf(name, "");
            namesize = 0;
            snamesel = INPUT_MODULE_NAME;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Start artist name input
        if(zcheckMouse(90, (Cur_Height - 76), 162, 16) && snamesel == INPUT_NONE)
        {
            strcpy(cur_input_name, artist);
            sprintf(artist, "");
            namesize = 0;
            snamesel = INPUT_MODULE_ARTIST;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Start module style input
        if(zcheckMouse(90, (Cur_Height - 58), 162, 16) && snamesel == INPUT_NONE)
        {
            strcpy(cur_input_name, style);
            sprintf(style, "");
            namesize = 0;
            snamesel = INPUT_MODULE_STYLE;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Zzaapp
        if(zcheckMouse(8, (Cur_Height - 130), 80, 16))
        {
            Display_Requester(&Zzaapp_Requester, GUI_CMD_NEW_MODULE);
        }

        if(zcheckMouse(90, (Cur_Height - 112), 80, 16))
        {
            if(rawrender_target == RENDER_TO_FILE)
            {
                if(rawrender_multi &&
                   rawrender_target == RENDER_TO_FILE)
                {
                    int any_file = FALSE;
                    for(i = 0; i < Songtracks; i++)
                    {
                        sprintf(WavFileName, "%%s"SLASH"%%s_%x.wav", i);
                        if(File_Exist(WavFileName, Dir_Mods, name))
                        {
                            any_file = TRUE;
                            break;
                        }
                    }
                    if(any_file)
                    {
                        Overwrite_Requester.Text = "Some .wav files are about to be overwritten, is that ok ?";
                        Display_Requester(&Overwrite_Requester, GUI_CMD_RENDER_WAV);
                    }
                    else
                    {
                        gui_action = GUI_CMD_RENDER_WAV;
                    }
                }
                else
                {
                    if(File_Exist_Req("%s"SLASH"%s.wav", Dir_Mods, name))
                    {
                        Display_Requester(&Overwrite_Requester, GUI_CMD_RENDER_WAV);
                    }
                    else
                    {
                        gui_action = GUI_CMD_RENDER_WAV;
                    }
                }
            }
            else
            {
                gui_action = GUI_CMD_RENDER_WAV;
            }
        }

        // Render as 32 bit on
        if(zcheckMouse(458, (Cur_Height - 68), 29, 16) && !Allow_32bit)
        {
            rawrender_32float = TRUE;
            teac = 1;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render as 32 bit off
        if(zcheckMouse(458 + 31, (Cur_Height - 68), 29, 16) && !Allow_32bit)
        {
            rawrender_32float = FALSE;
            teac = 1;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render entire song
        if(zcheckMouse(534, (Cur_Height - 112), 40, 16))
        {
            rawrender_range = FALSE;
            teac = 0;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render a range
        if(zcheckMouse(534 + 42, (Cur_Height - 112), 40, 16))
        {
            rawrender_range = TRUE;
            teac = 0;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        if(rawrender_range)
        {
            // From position
            if(zcheckMouse(572, (Cur_Height - 86), 16, 16) == 1)
            {
                rawrender_from--;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 3;
            }

            // From position
            if(zcheckMouse(572 + 44, (Cur_Height - 86), 16, 16) == 1)
            {
                rawrender_from++;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 3;
            }

            // To position
            if(zcheckMouse(572, (Cur_Height - 66), 16, 16) == 1)
            {
                rawrender_to--;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 4;
            }

            // To position
            if(zcheckMouse(572 + 44, (Cur_Height - 66), 16, 16) == 1)
            {
                rawrender_to++;
                gui_action = GUI_CMD_UPDATE_DISKIO_ED;
                teac = 4;
            }
        }

        // Render to wav file
        if(zcheckMouse(654, (Cur_Height - 106), 80, 16))
        {
            rawrender_target = RENDER_TO_FILE;
            teac = 0;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render to mono sample
        if(zcheckMouse(654, (Cur_Height - 88), 80, 16))
        {
            rawrender_target = RENDER_TO_MONO;
            teac = 0;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render to stereo sample
        if(zcheckMouse(654, (Cur_Height - 70), 80, 16))
        {
            rawrender_target = RENDER_TO_STEREO;
            teac = 0;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render as multiple file
        if(zcheckMouse(458, (Cur_Height - 49), 29, 16) && !Allow_Single_Render)
        {
            rawrender_multi = TRUE;
            teac = 5;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }

        // Render as single files
        if(zcheckMouse(458 + 31, (Cur_Height - 49), 29, 16) && !Allow_Single_Render)
        {
            rawrender_multi = FALSE;
            teac = 5;
            gui_action = GUI_CMD_UPDATE_DISKIO_ED;
        }


        Check_Tracks_To_Render();
    }
}
예제 #14
0
void Mouse_Sliders_Track_Fx_Ed(void)
{
    if(userscreen == USER_SCREEN_TRACK_FX_EDIT)
    {
        if(zcheckMouse(74, (Cur_Height - 110), 148, 16) && LFO_ON[Track_Under_Caret])
        {
            LFO_RATE[Track_Under_Caret] = (Mouse.x - 84) / 16384.0f;
            teac = 2;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
        }
        if(zcheckMouse(74, (Cur_Height - 92), 148, 16) && LFO_ON[Track_Under_Caret])
        {
            LFO_AMPL[Track_Under_Caret] = float(Mouse.x - 84);
            teac = 3;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
        }
        if(zcheckMouse(74, (Cur_Height - 49), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_DEPHASE[Track_Under_Caret] = (Mouse.x - 84) * 0.0490873f;
            teac = 4;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 4;
        }

        if(zcheckMouse(308, (Cur_Height - 121), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            teac = 1;
            FLANGER_AMOUNT[Track_Under_Caret] = ((Mouse.x - 318.0f) / 64.0f) - 1.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
        }
        if(zcheckMouse(308, (Cur_Height - 103), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_RATE[Track_Under_Caret] = (Mouse.x - 318.0f) / 939104.92f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 5;
        }
        if(zcheckMouse(308, (Cur_Height - 85), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_AMPL[Track_Under_Caret] = (Mouse.x - 318.0f) / 12800.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 6;
        }
        if(zcheckMouse(308, (Cur_Height - 67), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_FEEDBACK[Track_Under_Caret] = ((Mouse.x - 318) / 64.0f) - 1.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 7;
        }
        if(zcheckMouse(308, (Cur_Height - 49), 148, 16) && FLANGER_ON[Track_Under_Caret])
        {
            FLANGER_DELAY[Track_Under_Caret] = (Mouse.x - 318) * 32;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            fld_chan = TRUE;
            teac = 8;
        }

        // Compressor threshold
        if(zcheckMouse(602, (Cur_Height - 103), 67, 18) &&
           Compress_Track[Track_Under_Caret])
        {
            Mas_Compressor_Set_Variables_Track(Track_Under_Caret,
                                               (Mouse.x - 612.0f) * 2.0f,
                                                mas_comp_ratio_Track[Track_Under_Caret]);
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 12;
        }

        // Compressor ratio
        if(zcheckMouse(602, (Cur_Height - 85), 67, 18) &&
           Compress_Track[Track_Under_Caret])
        {
            Mas_Compressor_Set_Variables_Track(Track_Under_Caret,
                                               mas_comp_threshold_Track[Track_Under_Caret],
                                               (Mouse.x - 612.0f) * 2.0f);
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 12;
        }

        // Volume
        if(zcheckMouse(602, (Cur_Height - 53), 67, 18))
        {
            Track_Volume[Track_Under_Caret] = (Mouse.x - 612.0f) / 50.0f;
            if(Track_Volume[Track_Under_Caret] > 1.0f) Track_Volume[Track_Under_Caret] = 1.0f;
            if(Track_Volume[Track_Under_Caret] < 0.0f) Track_Volume[Track_Under_Caret] = 0.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 13;
        }

        // Lo Eq
        if(zcheckMouse(710, (Cur_Height - 120), 16, 64))
        {
            float Pos_Mouse;
            int Center = Slider_Get_Center(16, 100, 65);
            Pos_Mouse = ((float) ((Mouse.y - (Cur_Height - 120)) - (Center / 2)));
            Pos_Mouse /= 54.0f;
            if(Pos_Mouse > 1.0f) Pos_Mouse = 1.0f;
            Pos_Mouse *= 2.0f;
            EqDat[Track_Under_Caret].lg = 2.0f - Pos_Mouse;
            if(EqDat[Track_Under_Caret].lg < 0.0f) EqDat[Track_Under_Caret].lg = 0.0f;
            if(EqDat[Track_Under_Caret].lg > 2.0f) EqDat[Track_Under_Caret].lg = 2.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

        // Med Eq
        if(zcheckMouse(710 + (22 * 1), (Cur_Height - 120), 16, 64))
        {
            float Pos_Mouse;
            int Center = Slider_Get_Center(16, 100, 65);
            Pos_Mouse = ((float) ((Mouse.y - (Cur_Height - 120)) - (Center / 2)));
            Pos_Mouse /= 54.0f;
            if(Pos_Mouse > 1.0f) Pos_Mouse = 1.0f;
            Pos_Mouse *= 2.0f;
            EqDat[Track_Under_Caret].mg = 2.0f - Pos_Mouse;
            if(EqDat[Track_Under_Caret].mg < 0.0f) EqDat[Track_Under_Caret].mg = 0.0f;
            if(EqDat[Track_Under_Caret].mg > 2.0f) EqDat[Track_Under_Caret].mg = 2.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

        // Hi Eq
        if(zcheckMouse(710 + (22 * 2), (Cur_Height - 120), 16, 64))
        {
            float Pos_Mouse;
            int Center = Slider_Get_Center(16, 100, 65);
            Pos_Mouse = ((float) ((Mouse.y - (Cur_Height - 120)) - (Center / 2)));
            Pos_Mouse /= 54.0f;
            if(Pos_Mouse > 1.0f) Pos_Mouse = 1.0f;
            Pos_Mouse *= 2.0f;
            EqDat[Track_Under_Caret].hg = 2.0f - Pos_Mouse;
            if(EqDat[Track_Under_Caret].hg < 0.0f) EqDat[Track_Under_Caret].hg = 0.0f;
            if(EqDat[Track_Under_Caret].hg > 2.0f) EqDat[Track_Under_Caret].hg = 2.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

        // Clear lo band
        if(zcheckMouse(710, (Cur_Height - 55), 16, 16))
        {
            EqDat[Track_Under_Caret].lg = 1.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

        // Clear med band
        if(zcheckMouse(710 + (22 * 1), (Cur_Height - 55), 16, 16))
        {
            EqDat[Track_Under_Caret].mg = 1.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

        // Clear hi band
        if(zcheckMouse(710 + (22 * 2), (Cur_Height - 55), 16, 16))
        {
            EqDat[Track_Under_Caret].hg = 1.0f;
            gui_action = GUI_CMD_UPDATE_TRACK_FX_ED;
            teac = 14;
        }

    }
}