void CVT_D_L() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = *((long long*)reg_cop1_double[cffs]); PC++; }
void CVT_S_D() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_simple[cffd] = *reg_cop1_double[cffs]; PC++; }
void MOV_D(void) { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = *reg_cop1_double[cffs]; PC++; }
void ABS_D() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = fabs(*reg_cop1_double[cffs]); PC++; }
void CVT_W_D(void) { if (check_cop1_unusable()) return; set_rounding(); *((int*)reg_cop1_simple[cffd]) = *reg_cop1_double[cffs]; PC++; }
void CVT_D_W(void) { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = *((int*)reg_cop1_simple[cffs]); PC++; }
void NEG_D(void) { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = -(*reg_cop1_double[cffs]); PC++; }
void CVT_L_S() { if (check_cop1_unusable()) return; set_rounding(); *((long long*)(reg_cop1_double[cffd])) = *reg_cop1_simple[cffs]; PC++; }
void MOV_S() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_simple[cffd] = *reg_cop1_simple[cffs]; PC++; }
void SQRT_D() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = sqrt(*reg_cop1_double[cffs]); PC++; }
void NEG_S() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_simple[cffd] = -(*reg_cop1_simple[cffs]); PC++; }
void DIV_D() { if (check_cop1_unusable()) return; set_rounding(); *reg_cop1_double[cffd] = *reg_cop1_double[cffs] / *reg_cop1_double[cfft]; PC++; }
void linear_pcm32_be_1ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int32_t *dst = (int32_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2be32(s2i(*src[0])); src[0]++; dst += 1; } restore_rounding(r); }
void linear_pcmdouble_1ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; double *dst = (double *)rawdata; int r = set_rounding(); while (size--) { dst[0] = double(*src[0]); src[0]++; dst += 1; } restore_rounding(r); }
void linear_pcmfloat_1ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; float *dst = (float *)rawdata; int r = set_rounding(); while (size--) { dst[0] = float(*src[0]); src[0]++; dst += 1; } restore_rounding(r); }
void linear_pcm24_be_2ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int24_t *dst = (int24_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2be24(s2i(*src[0])); src[0]++; dst[1] = int2be24(s2i(*src[1])); src[1]++; dst += 2; } restore_rounding(r); }
void linear_pcm16_be_3ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int16_t *dst = (int16_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2be16(s2i(*src[0])); src[0]++; dst[1] = int2be16(s2i(*src[1])); src[1]++; dst[2] = int2be16(s2i(*src[2])); src[2]++; dst += 3; } restore_rounding(r); }
void linear_pcm32_4ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int32_t *dst = (int32_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2le32(s2i(*src[0])); src[0]++; dst[1] = int2le32(s2i(*src[1])); src[1]++; dst[2] = int2le32(s2i(*src[2])); src[2]++; dst[3] = int2le32(s2i(*src[3])); src[3]++; dst += 4; } restore_rounding(r); }
void linear_pcm24_6ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int24_t *dst = (int24_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2le24(s2i(*src[0])); src[0]++; dst[1] = int2le24(s2i(*src[1])); src[1]++; dst[2] = int2le24(s2i(*src[2])); src[2]++; dst[3] = int2le24(s2i(*src[3])); src[3]++; dst[4] = int2le24(s2i(*src[4])); src[4]++; dst[5] = int2le24(s2i(*src[5])); src[5]++; dst += 6; } restore_rounding(r); }
void linear_pcmdouble_6ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; double *dst = (double *)rawdata; int r = set_rounding(); while (size--) { dst[0] = double(*src[0]); src[0]++; dst[1] = double(*src[1]); src[1]++; dst[2] = double(*src[2]); src[2]++; dst[3] = double(*src[3]); src[3]++; dst[4] = double(*src[4]); src[4]++; dst[5] = double(*src[5]); src[5]++; dst += 6; } restore_rounding(r); }
void linear_pcmfloat_7ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; float *dst = (float *)rawdata; int r = set_rounding(); while (size--) { dst[0] = float(*src[0]); src[0]++; dst[1] = float(*src[1]); src[1]++; dst[2] = float(*src[2]); src[2]++; dst[3] = float(*src[3]); src[3]++; dst[4] = float(*src[4]); src[4]++; dst[5] = float(*src[5]); src[5]++; dst[6] = float(*src[6]); src[6]++; dst += 7; } restore_rounding(r); }
void linear_pcm32_be_8ch(uint8_t *rawdata, samples_t samples, size_t size) { samples_t src = samples; int32_t *dst = (int32_t *)rawdata; int r = set_rounding(); while (size--) { dst[0] = int2be32(s2i(*src[0])); src[0]++; dst[1] = int2be32(s2i(*src[1])); src[1]++; dst[2] = int2be32(s2i(*src[2])); src[2]++; dst[3] = int2be32(s2i(*src[3])); src[3]++; dst[4] = int2be32(s2i(*src[4])); src[4]++; dst[5] = int2be32(s2i(*src[5])); src[5]++; dst[6] = int2be32(s2i(*src[6])); src[6]++; dst[7] = int2be32(s2i(*src[7])); src[7]++; dst += 8; } restore_rounding(r); }
int WidgetPDial::handle(int event) { double dragsize, min = minimum(), max = maximum(), result; int dy; if (event == FL_RELEASE && Fl::event_clicks() == 1) { Fl::event_clicks(0); value(reset_value); tipwin->hide(); value_damage(); if (this->when() != 0) do_callback(); return 1; } int old_mod_state; switch(event) { case FL_PUSH: mod_state = Fl::event_state() & MOD_MASK; if (!use_rounding) { if (integer_step) set_rounding(0); else if (mod_state == MOD_MASK) set_rounding(5); else if (mod_state == FL_SHIFT) set_rounding(4); else set_rounding((Fl::event_button3() || mod_state & FL_CTRL) ? 3 : 2); } oldvalue = value(); old_y = Fl::event_y(); case FL_DRAG: getPos(); old_mod_state = mod_state; mod_state = Fl::event_state() & MOD_MASK; if (old_mod_state != mod_state) { oldvalue = value(); old_y = Fl::event_y(); if (!use_rounding) { if (integer_step) set_rounding(0); else if (mod_state == MOD_MASK) set_rounding(5); else if (mod_state == FL_SHIFT) set_rounding(4); else set_rounding((Fl::event_button3() || mod_state & FL_CTRL) ? 3 : 2); } break; } dy = old_y - Fl::event_y(); if (dy < -1 || dy > 1) Fl::event_clicks(0); if (!integer_step && mod_state == MOD_MASK) dragsize = 200000.0f; else if (!integer_step && mod_state == FL_SHIFT) dragsize = 20000.0f; else dragsize = (Fl::event_button3() || mod_state & MOD_MASK) ? 1000.0f : 200.0f; value(clamp(oldvalue + dy / dragsize * (max - min))); tipwin->showValue(transform(value())); value_damage(); if(this->when() != 0) do_callback(); return 1; case FL_MOUSEWHEEL: if (Fl::event_buttons() || Fl::belowmouse() != this) return 1; mod_state = Fl::event_state() & MOD_MASK; dy = - Fl::event_dy(); if (integer_step) { if (!use_rounding) set_rounding(0); result = (int)(value() + dy * ((Fl::event_ctrl() || Fl::event_shift()) ? 1 : 8)); } else { float dragsize; if (mod_state == MOD_MASK) { dragsize = 100000.0; if (!use_rounding) set_rounding(5); } else if (mod_state == FL_SHIFT) { dragsize = 10000.0; if (!use_rounding) set_rounding(4); } else if (mod_state == FL_CTRL) { dragsize = 1000.0; if (!use_rounding) set_rounding(3); } else { dragsize = 100.0; if (!use_rounding) set_rounding(2); } result = value() + dy / dragsize * (max - min); } value(clamp(result)); tipwin->showValue(transform(value())); value_damage(); if(this->when() != 0) do_callback(); return 1; case FL_ENTER: getPos(); tipwin->showText(); return 1; case FL_HIDE: case FL_LEAVE: tipwin->hide(); resetPos(); break; case FL_RELEASE: if (integer_step) { float rounded = floorf(value() + 0.5); value(clamp(rounded)); } tipwin->hide(); resetPos(); if(this->when() == 0) do_callback(); return 1; } return 0; //#endif }