Merge branch 'master' into fx-mixer-rework
This commit is contained in:
@@ -2034,7 +2034,8 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
|
||||
{
|
||||
return new FlpImport( static_cast<const char *>( _data ) );
|
||||
return new FlpImport( QString::fromUtf8(
|
||||
static_cast<const char *>( _data ) ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ enum parameter_flags
|
||||
PF_CTL_BUTTON = 0x0600, ///< push button
|
||||
PF_CTL_METER = 0x0700, ///< volume meter
|
||||
PF_CTL_LED = 0x0800, ///< light emitting diode
|
||||
PF_CTL_LABEL = 0x0900, ///< label
|
||||
|
||||
PF_CTLOPTIONS = 0x00F000, ///< bit mask for control (widget) options
|
||||
PF_CTLO_HORIZ = 0x001000, ///< horizontal version of the control (unused)
|
||||
|
||||
@@ -63,7 +63,7 @@ struct filterclavier_metadata: public plugin_metadata<filterclavier_metadata>
|
||||
|
||||
struct reverb_metadata: public plugin_metadata<reverb_metadata>
|
||||
{
|
||||
enum { par_decay, par_hfdamp, par_roomsize, par_diffusion, par_amount, par_dry, par_predelay, par_basscut, par_treblecut, param_count };
|
||||
enum { par_clip, par_meter_wet, par_meter_out, par_decay, par_hfdamp, par_roomsize, par_diffusion, par_amount, par_dry, par_predelay, par_basscut, par_treblecut, param_count };
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
PLUGIN_NAME_ID_LABEL("reverb", "reverb", "Reverb")
|
||||
};
|
||||
@@ -78,7 +78,7 @@ struct vintage_delay_metadata: public plugin_metadata<vintage_delay_metadata>
|
||||
struct rotary_speaker_metadata: public plugin_metadata<rotary_speaker_metadata>
|
||||
{
|
||||
public:
|
||||
enum { par_speed, par_spacing, par_shift, par_moddepth, par_treblespeed, par_bassspeed, par_micdistance, par_reflection, param_count };
|
||||
enum { par_speed, par_spacing, par_shift, par_moddepth, par_treblespeed, par_bassspeed, par_micdistance, par_reflection, par_meter_l, par_meter_h, param_count };
|
||||
enum { in_count = 2, out_count = 2, support_midi = true, require_midi = false, rt_capable = true };
|
||||
PLUGIN_NAME_ID_LABEL("rotary_speaker", "rotaryspeaker", "Rotary Speaker")
|
||||
};
|
||||
@@ -126,16 +126,27 @@ struct monosynth_metadata: public plugin_metadata<monosynth_metadata>
|
||||
};
|
||||
PLUGIN_NAME_ID_LABEL("monosynth", "monosynth", "Monosynth")
|
||||
};
|
||||
|
||||
|
||||
/// Thor's compressor - metadata
|
||||
struct compressor_metadata: public plugin_metadata<compressor_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_aweighting, param_compression, param_peak, param_clip, param_bypass, // param_freq, param_bw,
|
||||
enum { param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_aweighting, param_compression, param_peak, param_clip, param_bypass, param_input,// param_freq, param_bw,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("compressor", "compressor", "Compressor")
|
||||
};
|
||||
|
||||
/// Markus's sidechain compressor - metadata
|
||||
struct sidechaincompressor_metadata: public plugin_metadata<sidechaincompressor_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_meter_in, param_meter_out, param_clip_in, param_clip_out,
|
||||
param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_compression,
|
||||
param_sc_mode, param_f1_freq, param_f2_freq, param_f1_level, param_f2_level,
|
||||
param_sc_listen, param_f1_active, param_f2_active, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("sidechaincompressor", "sidechaincompressor", "Sidechain Compressor")
|
||||
};
|
||||
|
||||
/// Markus's multibandcompressor - metadata
|
||||
struct multibandcompressor_metadata: public plugin_metadata<multibandcompressor_metadata>
|
||||
{
|
||||
@@ -157,6 +168,71 @@ struct multibandcompressor_metadata: public plugin_metadata<multibandcompressor_
|
||||
PLUGIN_NAME_ID_LABEL("multiband_compressor", "multibandcompressor", "Multiband Compressor")
|
||||
};
|
||||
|
||||
/// Markus's deesser - metadata
|
||||
struct deesser_metadata: public plugin_metadata<deesser_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_detected, param_compression, param_detected_led, param_clip_out,
|
||||
param_detection, param_mode,
|
||||
param_threshold, param_ratio, param_laxity, param_makeup,
|
||||
param_f1_freq, param_f2_freq, param_f1_level, param_f2_level, param_f2_q,
|
||||
param_sc_listen, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("deesser", "deesser", "Deesser")
|
||||
};
|
||||
|
||||
/// Markus's 5-band EQ - metadata
|
||||
struct equalizer5band_metadata: public plugin_metadata<equalizer5band_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out, param_meter_in,
|
||||
param_meter_out, param_clip_in, param_clip_out,
|
||||
param_ls_active, param_ls_level, param_ls_freq,
|
||||
param_hs_active, param_hs_level, param_hs_freq,
|
||||
param_p1_active, param_p1_level, param_p1_freq, param_p1_q,
|
||||
param_p2_active, param_p2_level, param_p2_freq, param_p2_q,
|
||||
param_p3_active, param_p3_level, param_p3_freq, param_p3_q,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("equalizer5band", "equalizer5band", "Equalizer 5 Band")
|
||||
};
|
||||
/// Markus's 8-band EQ - metadata
|
||||
struct equalizer8band_metadata: public plugin_metadata<equalizer8band_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out, param_meter_inL, param_meter_inR,
|
||||
param_meter_outL, param_meter_outR, param_clip_inL, param_clip_inR, param_clip_outL, param_clip_outR,
|
||||
param_hp_active, param_hp_freq, param_hp_mode,
|
||||
param_lp_active, param_lp_freq, param_lp_mode,
|
||||
param_ls_active, param_ls_level, param_ls_freq,
|
||||
param_hs_active, param_hs_level, param_hs_freq,
|
||||
param_p1_active, param_p1_level, param_p1_freq, param_p1_q,
|
||||
param_p2_active, param_p2_level, param_p2_freq, param_p2_q,
|
||||
param_p3_active, param_p3_level, param_p3_freq, param_p3_q,
|
||||
param_p4_active, param_p4_level, param_p4_freq, param_p4_q,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("equalizer8band", "equalizer8band", "Equalizer 8 Band")
|
||||
};
|
||||
/// Markus's 12-band EQ - metadata
|
||||
struct equalizer12band_metadata: public plugin_metadata<equalizer12band_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out, param_meter_inL, param_meter_inR,
|
||||
param_meter_outL, param_meter_outR, param_clip_inL, param_clip_inR, param_clip_outL, param_clip_outR,
|
||||
param_hp_active, param_hp_freq, param_hp_mode,
|
||||
param_lp_active, param_lp_freq, param_lp_mode,
|
||||
param_ls_active, param_ls_level, param_ls_freq,
|
||||
param_hs_active, param_hs_level, param_hs_freq,
|
||||
param_p1_active, param_p1_level, param_p1_freq, param_p1_q,
|
||||
param_p2_active, param_p2_level, param_p2_freq, param_p2_q,
|
||||
param_p3_active, param_p3_level, param_p3_freq, param_p3_q,
|
||||
param_p4_active, param_p4_level, param_p4_freq, param_p4_q,
|
||||
param_p5_active, param_p5_level, param_p5_freq, param_p5_q,
|
||||
param_p6_active, param_p6_level, param_p6_freq, param_p6_q,
|
||||
param_p7_active, param_p7_level, param_p7_freq, param_p7_q,
|
||||
param_p8_active, param_p8_level, param_p8_freq, param_p8_q,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("equalizer12band", "equalizer12band", "Equalizer 12 Band")
|
||||
};
|
||||
|
||||
/// Organ - enums for parameter IDs etc. (this mess is caused by organ split between plugin and generic class - which was
|
||||
/// a bad design decision and should be sorted out some day) XXXKF @todo
|
||||
struct organ_enums
|
||||
|
||||
@@ -10,7 +10,12 @@
|
||||
PER_MODULE_ITEM(phaser, false, "phaser")
|
||||
PER_MODULE_ITEM(multichorus, false, "multichorus")
|
||||
PER_MODULE_ITEM(compressor, false, "compressor")
|
||||
PER_MODULE_ITEM(sidechaincompressor, false, "sidechaincompressor")
|
||||
PER_MODULE_ITEM(multibandcompressor, false, "multibandcompressor")
|
||||
PER_MODULE_ITEM(deesser, false, "deesser")
|
||||
PER_MODULE_ITEM(equalizer5band, false, "equalizer5band")
|
||||
PER_MODULE_ITEM(equalizer8band, false, "equalizer8band")
|
||||
PER_MODULE_ITEM(equalizer12band, false, "equalizer12band")
|
||||
#ifdef ENABLE_EXPERIMENTAL
|
||||
PER_MODULE_ITEM(fluidsynth, true, "fluidsynth")
|
||||
PER_MODULE_ITEM(wavetable, true, "wavetable")
|
||||
|
||||
@@ -203,6 +203,8 @@ public:
|
||||
uint32_t srate;
|
||||
gain_smoothing amount, dryamount;
|
||||
int predelay_amt;
|
||||
float meter_wet, meter_out;
|
||||
uint32_t clip;
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
@@ -223,7 +225,7 @@ public:
|
||||
}
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
|
||||
numsamples += offset;
|
||||
|
||||
clip -= std::min(clip, numsamples);
|
||||
for (uint32_t i = offset; i < numsamples; i++) {
|
||||
float dry = dryamount.get();
|
||||
float wet = amount.get();
|
||||
@@ -236,12 +238,26 @@ public:
|
||||
reverb.process(rl, rr);
|
||||
outs[0][i] = dry*s.left + wet*rl;
|
||||
outs[1][i] = dry*s.right + wet*rr;
|
||||
meter_wet = std::max(fabs(wet*rl), fabs(wet*rr));
|
||||
meter_out = std::max(fabs(outs[0][i]), fabs(outs[1][i]));
|
||||
if(outs[0][i] > 1.f or outs[1][i] > 1.f) {
|
||||
clip = srate >> 3;
|
||||
}
|
||||
}
|
||||
reverb.extra_sanitize();
|
||||
left_lo.sanitize();
|
||||
left_hi.sanitize();
|
||||
right_lo.sanitize();
|
||||
right_hi.sanitize();
|
||||
if(params[par_meter_wet] != NULL) {
|
||||
*params[par_meter_wet] = meter_wet;
|
||||
}
|
||||
if(params[par_meter_out] != NULL) {
|
||||
*params[par_meter_out] = meter_out;
|
||||
}
|
||||
if(params[par_clip] != NULL) {
|
||||
*params[par_clip] = clip;
|
||||
}
|
||||
return outputs_mask;
|
||||
}
|
||||
void activate();
|
||||
@@ -416,7 +432,9 @@ public:
|
||||
float maspeed_l;
|
||||
/// Current rotation speed for treble rotor - manual mode
|
||||
float maspeed_h;
|
||||
|
||||
|
||||
int meter_l, meter_h;
|
||||
|
||||
rotary_speaker_audio_module();
|
||||
void set_sample_rate(uint32_t sr);
|
||||
void setup();
|
||||
@@ -501,7 +519,8 @@ public:
|
||||
int xl = pseudo_sine_scl(phase_l), yl = pseudo_sine_scl(phase_l + 0x40000000);
|
||||
int xh = pseudo_sine_scl(phase_h), yh = pseudo_sine_scl(phase_h + 0x40000000);
|
||||
// printf("%d %d %d\n", shift, pdelta, shift + pdelta + 20 * xl);
|
||||
|
||||
meter_l = xl;
|
||||
meter_h = xh;
|
||||
// float out_hi_l = in_mono - delay.get_interp_1616(shift + md * xh) + delay.get_interp_1616(shift + md * 65536 + pdelta - md * yh) - delay.get_interp_1616(shift + md * 65536 + pdelta + pdelta - md * xh);
|
||||
// float out_hi_r = in_mono + delay.get_interp_1616(shift + md * 65536 - md * yh) - delay.get_interp_1616(shift + pdelta + md * xh) + delay.get_interp_1616(shift + pdelta + pdelta + md * yh);
|
||||
float out_hi_l = in_mono + delay.get_interp_1616(shift + md * xh) - mix2 * delay.get_interp_1616(shift + md * 65536 + pdelta - md * yh) + mix3 * delay.get_interp_1616(shift + md * 65536 + pdelta + pdelta - md * xh);
|
||||
@@ -541,6 +560,12 @@ public:
|
||||
if (u1 || u2)
|
||||
set_vibrato();
|
||||
}
|
||||
if(params[par_meter_l] != NULL) {
|
||||
*params[par_meter_l] = (float)meter_l / 65536.0;
|
||||
}
|
||||
if(params[par_meter_h] != NULL) {
|
||||
*params[par_meter_h] = (float)meter_h / 65536.0;
|
||||
}
|
||||
return outputs_mask;
|
||||
}
|
||||
virtual void control_change(int ctl, int val);
|
||||
@@ -901,8 +926,8 @@ class gain_reduction_audio_module {
|
||||
private:
|
||||
float linSlope, detected, kneeSqrt, kneeStart, linKneeStart, kneeStop;
|
||||
float compressedKneeStop, adjKneeStart, thres;
|
||||
float attack, release, threshold, ratio, knee, makeup, detection, bypass, mute, meter_out, meter_comp;
|
||||
float old_threshold, old_ratio, old_knee, old_makeup, old_bypass, old_mute, old_detection;
|
||||
float attack, release, threshold, ratio, knee, makeup, detection, stereo_link, bypass, mute, meter_out, meter_comp;
|
||||
float old_threshold, old_ratio, old_knee, old_makeup, old_bypass, old_mute, old_detection, old_stereo_link;
|
||||
int last_generation;
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
@@ -910,8 +935,8 @@ private:
|
||||
inline float output_gain(float linSlope, bool rms);
|
||||
public:
|
||||
gain_reduction_audio_module();
|
||||
void set_params(float att, float rel, float thr, float rat, float kn, float mak, float det, float byp, float mu);
|
||||
void process(float &left, float &right);
|
||||
void set_params(float att, float rel, float thr, float rat, float kn, float mak, float det, float stl, float byp, float mu);
|
||||
void process(float &left, float &right, float det_left = NULL, float det_right = NULL);
|
||||
void activate();
|
||||
void deactivate();
|
||||
int id;
|
||||
@@ -924,6 +949,81 @@ public:
|
||||
virtual int get_changed_offsets(int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Sidecain Compressor by Markus Schmidt (based on Thor's compressor and Krzysztof's filters)
|
||||
class sidechaincompressor_audio_module: public audio_module<sidechaincompressor_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
enum CalfScModes {
|
||||
WIDEBAND,
|
||||
DEESSER_WIDE,
|
||||
DEESSER_SPLIT,
|
||||
DERUMBLER_WIDE,
|
||||
DERUMBLER_SPLIT,
|
||||
WEIGHTED_1,
|
||||
WEIGHTED_2,
|
||||
WEIGHTED_3,
|
||||
BANDPASS_1,
|
||||
BANDPASS_2
|
||||
};
|
||||
float f1_freq_old, f2_freq_old, f1_level_old, f2_level_old;
|
||||
float f1_freq_old1, f2_freq_old1, f1_level_old1, f2_level_old1;
|
||||
CalfScModes sc_mode, sc_mode_old, sc_mode_old1;
|
||||
float f1_active, f2_active;
|
||||
uint32_t clip_in, clip_out;
|
||||
float meter_in, meter_out;
|
||||
gain_reduction_audio_module compressor;
|
||||
biquad_d2<float> f1L, f1R, f2L, f2R;
|
||||
public:
|
||||
typedef std::complex<double> cfloat;
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
volatile int last_generation, last_calculated_generation;
|
||||
sidechaincompressor_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
inline cfloat h_z(const cfloat &z) {
|
||||
switch (sc_mode) {
|
||||
default:
|
||||
case WIDEBAND:
|
||||
return false;
|
||||
break;
|
||||
case DEESSER_WIDE:
|
||||
case DERUMBLER_WIDE:
|
||||
case WEIGHTED_1:
|
||||
case WEIGHTED_2:
|
||||
case WEIGHTED_3:
|
||||
case BANDPASS_2:
|
||||
return f1L.h_z(z) * f2L.h_z(z);
|
||||
break;
|
||||
case DEESSER_SPLIT:
|
||||
return f2L.h_z(z);
|
||||
break;
|
||||
case DERUMBLER_SPLIT:
|
||||
case BANDPASS_1:
|
||||
return f1L.h_z(z);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
float freq_gain(int index, double freq, uint32_t sr)
|
||||
{
|
||||
typedef std::complex<double> cfloat;
|
||||
freq *= 2.0 * M_PI / sr;
|
||||
cfloat z = 1.0 / exp(cfloat(0.0, freq));
|
||||
|
||||
return std::abs(h_z(z));
|
||||
}
|
||||
void set_sample_rate(uint32_t sr);
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
|
||||
bool get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context);
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Multibandcompressor by Markus Schmidt
|
||||
class multibandcompressor_audio_module: public audio_module<multibandcompressor_metadata>, public line_graph_iface {
|
||||
private:
|
||||
@@ -952,6 +1052,260 @@ public:
|
||||
virtual int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Deesser by Markus Schmidt (based on Thor's compressor and Krzysztof's filters)
|
||||
class deesser_audio_module: public audio_module<deesser_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
enum CalfDeessModes {
|
||||
WIDE,
|
||||
SPLIT
|
||||
};
|
||||
float f1_freq_old, f2_freq_old, f1_level_old, f2_level_old, f2_q_old;
|
||||
float f1_freq_old1, f2_freq_old1, f1_level_old1, f2_level_old1, f2_q_old1;
|
||||
uint32_t detected_led;
|
||||
float detected, clip_out;
|
||||
uint32_t clip_led;
|
||||
gain_reduction_audio_module compressor;
|
||||
biquad_d2<float> hpL, hpR, lpL, lpR, pL, pR;
|
||||
public:
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
volatile int last_generation, last_calculated_generation;
|
||||
deesser_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
float freq_gain(int index, double freq, uint32_t sr)
|
||||
{
|
||||
return hpL.freq_gain(freq, sr) * pL.freq_gain(freq, sr);
|
||||
}
|
||||
void set_sample_rate(uint32_t sr);
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Equalizer 12 Band by Markus Schmidt (based on Krzysztof's filters)
|
||||
class equalizer12band_audio_module: public audio_module<equalizer12band_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
float hp_mode_old, hp_freq_old;
|
||||
float lp_mode_old, lp_freq_old;
|
||||
float ls_level_old, ls_freq_old;
|
||||
float hs_level_old, hs_freq_old;
|
||||
float p_level_old[8], p_freq_old[8], p_q_old[8];
|
||||
float hp_mode_old1, hp_freq_old1, hp_active_old1;
|
||||
float lp_mode_old1, lp_freq_old1, lp_active_old1;
|
||||
float ls_level_old1, ls_freq_old1, ls_active_old1;
|
||||
float hs_level_old1, hs_freq_old1, hs_active_old1;
|
||||
float p_level_old1[8], p_freq_old1[8], p_q_old1[8], p_active_old1[8];
|
||||
enum CalfEqModes {
|
||||
MODE12DB,
|
||||
MODE24DB,
|
||||
MODE36DB
|
||||
};
|
||||
CalfEqModes eq_mode, eq_mode_old1[2];
|
||||
uint32_t clip_inL, clip_outL, clip_inR, clip_outR;
|
||||
float meter_inL, meter_outL, meter_inR, meter_outR;
|
||||
biquad_d2<float> hpL[3], hpR[3], lpL[3], lpR[3];
|
||||
biquad_d2<float> lsL, lsR, hsL, hsR;
|
||||
biquad_d2<float> pL[8], pR[8];
|
||||
public:
|
||||
typedef std::complex<double> cfloat;
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
volatile int last_generation, last_calculated_generation;
|
||||
equalizer12band_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
float freq_gain(int index, double freq, uint32_t sr)
|
||||
{
|
||||
float ret = 1.f;
|
||||
if(*params[param_hp_active] > 0.f) {
|
||||
switch((int)*params[param_hp_mode]) {
|
||||
case MODE12DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE24DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE36DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(*params[param_lp_active] > 0.f) {
|
||||
switch((int)*params[param_lp_mode]) {
|
||||
case MODE12DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE24DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE36DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret *= (*params[param_ls_active] > 0.f) ? lsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_hs_active] > 0.f) ? hsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p1_active] > 0.f) ? pL[0].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p2_active] > 0.f) ? pL[1].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p3_active] > 0.f) ? pL[2].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p4_active] > 0.f) ? pL[3].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p5_active] > 0.f) ? pL[4].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p6_active] > 0.f) ? pL[5].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p7_active] > 0.f) ? pL[6].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p8_active] > 0.f) ? pL[7].freq_gain(freq, sr) : 1;
|
||||
return ret;
|
||||
}
|
||||
void set_sample_rate(uint32_t sr);
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Equalizer 8 Band by Markus Schmidt (based on Krzysztof's filters)
|
||||
class equalizer8band_audio_module: public audio_module<equalizer8band_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
float hp_mode_old, hp_freq_old;
|
||||
float lp_mode_old, lp_freq_old;
|
||||
float ls_level_old, ls_freq_old;
|
||||
float hs_level_old, hs_freq_old;
|
||||
float p_level_old[4], p_freq_old[4], p_q_old[4];
|
||||
float hp_mode_old1, hp_freq_old1, hp_active_old1;
|
||||
float lp_mode_old1, lp_freq_old1, lp_active_old1;
|
||||
float ls_level_old1, ls_freq_old1, ls_active_old1;
|
||||
float hs_level_old1, hs_freq_old1, hs_active_old1;
|
||||
float p_level_old1[4], p_freq_old1[4], p_q_old1[4], p_active_old1[4];
|
||||
enum CalfEqModes {
|
||||
MODE12DB,
|
||||
MODE24DB,
|
||||
MODE36DB
|
||||
};
|
||||
CalfEqModes eq_mode, eq_mode_old1[2];
|
||||
uint32_t clip_inL, clip_outL, clip_inR, clip_outR;
|
||||
float meter_inL, meter_outL, meter_inR, meter_outR;
|
||||
biquad_d2<float> hpL[3], hpR[3], lpL[3], lpR[3];
|
||||
biquad_d2<float> lsL, lsR, hsL, hsR;
|
||||
biquad_d2<float> pL[4], pR[4];
|
||||
public:
|
||||
typedef std::complex<double> cfloat;
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
volatile int last_generation, last_calculated_generation;
|
||||
equalizer8band_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
float freq_gain(int index, double freq, uint32_t sr)
|
||||
{
|
||||
float ret = 1.f;
|
||||
if(*params[param_hp_active] > 0.f) {
|
||||
switch((int)*params[param_hp_mode]) {
|
||||
case MODE12DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE24DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE36DB:
|
||||
ret *= hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr) * hpL[0].freq_gain(freq, sr);
|
||||
ret *= hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr) * hpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(*params[param_lp_active] > 0.f) {
|
||||
switch((int)*params[param_lp_mode]) {
|
||||
case MODE12DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE24DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
case MODE36DB:
|
||||
ret *= lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr) * lpL[0].freq_gain(freq, sr);
|
||||
ret *= lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr) * lpR[0].freq_gain(freq, sr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret *= (*params[param_ls_active] > 0.f) ? lsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_hs_active] > 0.f) ? hsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p1_active] > 0.f) ? pL[0].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p2_active] > 0.f) ? pL[1].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p3_active] > 0.f) ? pL[2].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p4_active] > 0.f) ? pL[3].freq_gain(freq, sr) : 1;
|
||||
return ret;
|
||||
}
|
||||
void set_sample_rate(uint32_t sr);
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Equalizer 5 Band by Markus Schmidt (based on Krzysztof's filters)
|
||||
class equalizer5band_audio_module: public audio_module<equalizer5band_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
float ls_level_old, ls_freq_old;
|
||||
float hs_level_old, hs_freq_old;
|
||||
float p_level_old[3], p_freq_old[3], p_q_old[3];
|
||||
float ls_level_old1, ls_freq_old1, ls_active_old1;
|
||||
float hs_level_old1, hs_freq_old1, hs_active_old1;
|
||||
float p_level_old1[3], p_freq_old1[3], p_q_old1[3], p_active_old1[3];
|
||||
uint32_t clip_in, clip_out;
|
||||
float meter_in, meter_out;
|
||||
biquad_d2<float> lsL, lsR, hsL, hsR;
|
||||
biquad_d2<float> pL[3], pR[3];
|
||||
public:
|
||||
typedef std::complex<double> cfloat;
|
||||
float *ins[in_count];
|
||||
float *outs[out_count];
|
||||
float *params[param_count];
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
volatile int last_generation, last_calculated_generation;
|
||||
equalizer5band_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
float freq_gain(int index, double freq, uint32_t sr)
|
||||
{
|
||||
float ret = 1.f;
|
||||
ret *= (*params[param_ls_active] > 0.f) ? lsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_hs_active] > 0.f) ? hsL.freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p1_active] > 0.f) ? pL[0].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p2_active] > 0.f) ? pL[1].freq_gain(freq, sr) : 1;
|
||||
ret *= (*params[param_p3_active] > 0.f) ? pL[2].freq_gain(freq, sr) : 1;
|
||||
return ret;
|
||||
}
|
||||
void set_sample_rate(uint32_t sr);
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline);
|
||||
};
|
||||
|
||||
/// Filterclavier --- MIDI controlled filter by Hans Baier
|
||||
class filterclavier_audio_module:
|
||||
public audio_module<filterclavier_metadata>,
|
||||
|
||||
37
plugins/ladspa_effect/calf/calf/waveshaping.h
Normal file
37
plugins/ladspa_effect/calf/calf/waveshaping.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* Calf DSP Library
|
||||
* Placeholder for waveshaping classes
|
||||
*
|
||||
* Copyright (C) 2001-2009 Krzysztof Foltman
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __CALF_WAVESHAPING_H
|
||||
#define __CALF_WAVESHAPING_H
|
||||
|
||||
/// This will be a waveshaper... when I'll code it (-:
|
||||
/// (or get Tom Szlagyi's permission to use his own)
|
||||
class waveshaper {
|
||||
public:
|
||||
waveshaper();
|
||||
void activate() {}
|
||||
void deactivate() {}
|
||||
void set_params(float blend, float drive) {}
|
||||
void set_sample_rate(uint32_t sr) {}
|
||||
float process(float in) { return in; }
|
||||
float get_distortion_level() { return 1; }
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -37,9 +37,9 @@ const char *calf_plugins::calf_copyright_info = "(C) 2001-2008 Krzysztof Foltman
|
||||
CALF_PORT_NAMES(flanger) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(flanger) = {
|
||||
{ 0.1, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC | PF_PROP_GRAPH, NULL, "min_delay", "Minimum delay" },
|
||||
{ 0.5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "mod_depth", "Modulation depth" },
|
||||
{ 0.25, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Modulation rate" },
|
||||
{ 0.1, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC | PF_PROP_GRAPH, NULL, "min_delay", "Min delay" },
|
||||
{ 0.5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "mod_depth", "Mod depth" },
|
||||
{ 0.25, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Mod rate" },
|
||||
{ 0.90, -0.99, 0.99, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "feedback", "Feedback" },
|
||||
{ 0, 0, 360, 9, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "stereo", "Stereo phase" },
|
||||
{ 0, 0, 1, 2, PF_BOOL | PF_CTL_BUTTON , NULL, "reset", "Reset" },
|
||||
@@ -55,8 +55,8 @@ CALF_PORT_NAMES(phaser) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(phaser) = {
|
||||
{ 1000, 20, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "base_freq", "Center Freq" },
|
||||
{ 4000, 0, 10800, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "mod_depth", "Modulation depth" },
|
||||
{ 0.25, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Modulation rate" },
|
||||
{ 4000, 0, 10800, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "mod_depth", "Mod depth" },
|
||||
{ 0.25, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Mod rate" },
|
||||
{ 0.25, -0.99, 0.99, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "feedback", "Feedback" },
|
||||
{ 6, 1, 12, 12, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "stages", "# Stages" },
|
||||
{ 180, 0, 360, 9, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "stereo", "Stereo phase" },
|
||||
@@ -74,6 +74,9 @@ CALF_PORT_NAMES(reverb) = {"In L", "In R", "Out L", "Out R"};
|
||||
const char *reverb_room_sizes[] = { "Small", "Medium", "Large", "Tunnel-like", "Large/smooth", "Experimental" };
|
||||
|
||||
CALF_PORT_PROPS(reverb) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_wet", "Wet amount" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 1.5, 0.4, 15.0, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_SEC, NULL, "decay_time", "Decay time" },
|
||||
{ 5000, 2000,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hf_damp", "High Frq Damp" },
|
||||
{ 2, 0, 5, 0, PF_ENUM | PF_CTL_COMBO , reverb_room_sizes, "room_size", "Room size", },
|
||||
@@ -151,7 +154,7 @@ const char *vintage_delay_fbmodes[] = {
|
||||
};
|
||||
|
||||
CALF_PORT_PROPS(vintage_delay) = {
|
||||
{ 120, 30, 300,2701, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_BPM, NULL, "bpm", "Tempo" },
|
||||
{ 120, 30, 300, 1, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_BPM, NULL, "bpm", "Tempo" },
|
||||
{ 4, 1, 16, 1, PF_INT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "subdiv", "Subdivide"},
|
||||
{ 3, 1, 16, 1, PF_INT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "time_l", "Time L"},
|
||||
{ 5, 1, 16, 1, PF_INT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "time_r", "Time R"},
|
||||
@@ -171,14 +174,16 @@ CALF_PORT_NAMES(rotary_speaker) = {"In L", "In R", "Out L", "Out R"};
|
||||
const char *rotary_speaker_speed_names[] = { "Off", "Chorale", "Tremolo", "HoldPedal", "ModWheel", "Manual" };
|
||||
|
||||
CALF_PORT_PROPS(rotary_speaker) = {
|
||||
{ 2, 0, 5, 1.01, PF_ENUM | PF_CTL_COMBO, rotary_speaker_speed_names, "vib_speed", "Speed Mode" },
|
||||
{ 5, 0, 5, 1.01, PF_ENUM | PF_CTL_COMBO, rotary_speaker_speed_names, "vib_speed", "Speed Mode" },
|
||||
{ 0.5, 0, 1, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_PERC, NULL, "spacing", "Tap Spacing" },
|
||||
{ 0.5, 0, 1, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_PERC, NULL, "shift", "Tap Offset" },
|
||||
{ 0.10, 0, 1, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_PERC, NULL, "mod_depth", "Mod Depth" },
|
||||
{ 390, 10, 600, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_LOG | PF_UNIT_RPM, NULL, "treble_speed", "Treble Motor" },
|
||||
{ 410, 10, 600, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_LOG | PF_UNIT_RPM, NULL, "bass_speed", "Bass Motor" },
|
||||
{ 36, 10, 600, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_LOG | PF_UNIT_RPM, NULL, "treble_speed", "Treble Motor" },
|
||||
{ 30, 10, 600, 0, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_LOG | PF_UNIT_RPM, NULL, "bass_speed", "Bass Motor" },
|
||||
{ 0.7, 0, 1, 101, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_PERC, NULL, "mic_distance", "Mic Distance" },
|
||||
{ 0.3, 0, 1, 101, PF_FLOAT | PF_CTL_KNOB | PF_SCALE_PERC, NULL, "reflection", "Reflection" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_l", "Low rotor" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_h", "High rotor" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(rotary_speaker) = { 0x8483, "RotarySpeaker", "Calf Rotary Speaker", "Krzysztof Foltman", calf_plugins::calf_copyright_info, "SimulationPlugin" };
|
||||
@@ -188,8 +193,8 @@ CALF_PLUGIN_INFO(rotary_speaker) = { 0x8483, "RotarySpeaker", "Calf Rotary Speak
|
||||
CALF_PORT_NAMES(multichorus) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(multichorus) = {
|
||||
{ 5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC | PF_PROP_GRAPH, NULL, "min_delay", "Minimum delay" },
|
||||
{ 6, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC| PF_PROP_GRAPH, NULL, "mod_depth", "Modulation depth" },
|
||||
{ 5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC | PF_PROP_GRAPH, NULL, "min_delay", "Min delay" },
|
||||
{ 6, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC| PF_PROP_GRAPH, NULL, "mod_depth", "Mod depth" },
|
||||
{ 0.5, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ| PF_PROP_GRAPH, NULL, "mod_rate", "Modulation rate" },
|
||||
{ 180, 0, 360, 91, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "stereo", "Stereo phase" },
|
||||
{ 4, 1, 8, 8, PF_INT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "voices", "Voices"},
|
||||
@@ -224,8 +229,9 @@ CALF_PORT_PROPS(compressor) = {
|
||||
{ 0, 0, 4, 0, PF_ENUM | PF_CTL_COMBO, compressor_weighting_names, "aweighting", "Weighting" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Compression" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "peak", "Peak Output" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "input", "Input" },
|
||||
// { 2000, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "deess_freq", "Frequency" },
|
||||
// { 0.707, 0.707, 32, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "deess_res", "Q" },
|
||||
};
|
||||
@@ -234,6 +240,53 @@ CALF_PLUGIN_INFO(compressor) = { 0x8502, "Compressor", "Calf Compressor", "Thor
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(sidechaincompressor) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
const char *sidechaincompressor_detection_names[] = { "RMS", "Peak" };
|
||||
const char *sidechaincompressor_stereo_link_names[] = { "Average", "Maximum" };
|
||||
const char *sidechaincompressor_mode_names[] = {"Wideband (F1:off / F2:off)",
|
||||
"Deesser wide (F1:Bell / F2:HP)",
|
||||
"Deesser split (F1:off / F2:HP)",
|
||||
"Derumbler wide (F1:LP / F2:Bell)",
|
||||
"Derumbler split (F1:LP / F2:off)",
|
||||
"Weighted #1 (F1:Shelf / F2:Shelf)",
|
||||
"Weighted #2 (F1:Shelf / F2:Bell)",
|
||||
"Weighted #3 (F1:Bell / F2:Shelf)",
|
||||
"Bandpass #1 (F1:BP / F2:off)",
|
||||
"Bandpass #2 (F1:HP / F2:LP)"};
|
||||
const char *sidechaincompressor_filter_choices[] = { "12dB", "24dB", "36dB"};
|
||||
|
||||
|
||||
CALF_PORT_PROPS(sidechaincompressor) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_in", "Input" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "0dB" },
|
||||
{ 0.125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold", "Threshold" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio", "Ratio" },
|
||||
{ 20, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Attack" },
|
||||
{ 250, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release", "Release" },
|
||||
{ 2, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup", "Makeup Gain" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee", "Knee" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_detection_names, "detection", "Detection" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_stereo_link_names, "stereo_link", "Stereo Link" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Gain Reduction" },
|
||||
{ 0, 0, 9, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_mode_names, "sc_mode", "Sidechain Mode" },
|
||||
{ 250, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "f1_freq", "Freq" },
|
||||
{ 4500, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "f2_freq", "Freq" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f1_level", "Level" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f2_level", "Level" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "sc_listen", "S/C-Listen" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f1_active", "active" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f2_active", "active" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(sidechaincompressor) = { 0x8502, "Sidechaincompressor", "Calf Sidechain Compressor", "Markus Schmidt / Thor Harald Johansen", calf_plugins::calf_copyright_info, "CompressorPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(multibandcompressor) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
const char *multibandcompressor_detection_names[] = { "RMS", "Peak" };
|
||||
@@ -246,10 +299,10 @@ CALF_PORT_PROPS(multibandcompressor) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "Input R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB" },
|
||||
|
||||
{ 100, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq0", "Split 1/2" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq1", "Split 2/3" },
|
||||
@@ -320,6 +373,197 @@ CALF_PLUGIN_INFO(multibandcompressor) = { 0x8502, "Multibandcompressor", "Calf M
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(deesser) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
const char *deesser_detection_names[] = { "RMS", "Peak" };
|
||||
const char *deesser_mode_names[] = { "Wide", "Split" };
|
||||
|
||||
|
||||
CALF_PORT_PROPS(deesser) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "detected", "Detected" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Gain Reduction" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "detected_led", "Active" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "Out" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, deesser_detection_names, "detection", "Detection" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, deesser_mode_names, "mode", "Mode" },
|
||||
{ 0.125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold", "Threshold" },
|
||||
{ 3, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio", "Ratio" },
|
||||
{ 15, 1, 100, 1, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "laxity", "Laxity" },
|
||||
{ 1, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup", "Makeup" },
|
||||
|
||||
{ 6000, 10, 18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "f1_freq", "Split" },
|
||||
{ 4500, 10, 18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "f2_freq", "Peak" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f1_level", "Gain" },
|
||||
{ 4, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f2_level", "Level" },
|
||||
{ 1, 0.1, 100,1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "f2_q", "Peak Q" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "sc_listen", "S/C-Listen" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(deesser) = { 0x8502, "Deesser", "Calf Deesser", "Markus Schmidt / Thor Harald Johansen", calf_plugins::calf_copyright_info, "CompressorPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(equalizer5band) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(equalizer5band) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_in", "Input" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "0dB" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "ls_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "ls_level", "Level" },
|
||||
{ 200, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "ls_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "hs_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "hs_level", "Level" },
|
||||
{ 4000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hs_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p1_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p1_level", "Level 1" },
|
||||
{ 250, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "p1_freq", "Freq 1" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p1_q", "Q 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p2_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p2_level", "Level 2" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p2_freq", "Freq 2" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p2_q", "Q 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p3_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p3_level", "Level 3" },
|
||||
{ 2500, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p3_freq", "Freq 3" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p3_q", "Q 3" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(equalizer5band) = { 0x8501, "Equalizer5Band", "Calf Equalizer 5 Band", "Markus Schmidt", calf_plugins::calf_copyright_info, "EqualizerPlugin" };
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(equalizer8band) = {"In L", "In R", "Out L", "Out R"};
|
||||
const char *rolloff_mode_names[] = {"12dB", "24dB", "36dB"};
|
||||
|
||||
CALF_PORT_PROPS(equalizer8band) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "hp_active", "active" },
|
||||
{ 30, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hp_freq", "Freq" },
|
||||
{ 1, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, rolloff_mode_names, "hp_mode", "Mode" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "lp_active", "active" },
|
||||
{ 18000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "lp_freq", "Freq" },
|
||||
{ 1, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, rolloff_mode_names, "lp_mode", "Mode" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "ls_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "ls_level", "Level" },
|
||||
{ 200, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "ls_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "hs_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "hs_level", "Level" },
|
||||
{ 4000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hs_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p1_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p1_level", "Level 1" },
|
||||
{ 250, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "p1_freq", "Freq 1" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p1_q", "Q 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p2_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p2_level", "Level 2" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p2_freq", "Freq 2" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p2_q", "Q 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p3_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p3_level", "Level 3" },
|
||||
{ 2500, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p3_freq", "Freq 3" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p3_q", "Q 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p4_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p4_level", "Level 4" },
|
||||
{ 5000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p4_freq", "Freq 4" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p4_q", "Q 4" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(equalizer8band) = { 0x8501, "Equalizer8Band", "Calf Equalizer 8 Band", "Markus Schmidt", calf_plugins::calf_copyright_info, "EqualizerPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(equalizer12band) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(equalizer12band) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "hp_active", "active" },
|
||||
{ 30, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hp_freq", "Freq" },
|
||||
{ 1, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, rolloff_mode_names, "hp_mode", "Mode" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "lp_active", "active" },
|
||||
{ 18000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "lp_freq", "Freq" },
|
||||
{ 1, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, rolloff_mode_names, "lp_mode", "Mode" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "ls_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "ls_level", "Level" },
|
||||
{ 200, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "ls_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "hs_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "hs_level", "Level" },
|
||||
{ 4000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hs_freq", "Freq" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p1_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p1_level", "Level 1" },
|
||||
{ 60, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "p1_freq", "Freq 1" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p1_q", "Q 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p2_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p2_level", "Level 2" },
|
||||
{ 120, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p2_freq", "Freq 2" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p2_q", "Q 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p3_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p3_level", "Level 3" },
|
||||
{ 250, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p3_freq", "Freq 3" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p3_q", "Q 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p4_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p4_level", "Level 4" },
|
||||
{ 500, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p4_freq", "Freq 4" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p4_q", "Q 4" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p5_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p5_level", "Level 5" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p5_freq", "Freq 5" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p5_q", "Q 5" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p6_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p6_level", "Level 6" },
|
||||
{ 2500, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p6_freq", "Freq 6" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p6_q", "Q 6" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p7_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p7_level", "Level 7" },
|
||||
{ 4000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p7_freq", "Freq 7" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p7_q", "Q 7" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "p8_active", "active" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p8_level", "Level 8" },
|
||||
{ 6000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p8_freq", "Freq 8" },
|
||||
{ 1, 0.1, 100, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p8_q", "Q 8" },
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(equalizer12band) = { 0x8501, "Equalizer12Band", "Calf Equalizer 12 Band", "Markus Schmidt", calf_plugins::calf_copyright_info, "EqualizerPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(monosynth) = {
|
||||
@@ -363,11 +607,11 @@ CALF_PORT_PROPS(monosynth) = {
|
||||
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "env2res", "Env->Res" },
|
||||
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "env2amp", "Env->Amp" },
|
||||
|
||||
{ 1, 1,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_a", "Attack" },
|
||||
{ 350, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_d", "Decay" },
|
||||
{ 1, 1,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_a", "Attack" },
|
||||
{ 350, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_d", "Decay" },
|
||||
{ 0.5, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr_s", "Sustain" },
|
||||
{ 0, -10000,10000, 21, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_f", "Fade" },
|
||||
{ 50, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "adsr_r", "Release" },
|
||||
{ 0, -10000,10000, 21, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_f", "Fade" },
|
||||
{ 50, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_r", "Release" },
|
||||
|
||||
{ 0, 0, 2, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "key_follow", "Key Follow" },
|
||||
{ 0, 0, 3, 0, PF_ENUM | PF_CTL_COMBO, monosynth_legato_names, "legato", "Legato Mode" },
|
||||
@@ -608,8 +852,8 @@ CALF_PORT_PROPS(fluidsynth) = {
|
||||
{ 0.5, 0, 1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_PROP_OUTPUT_GAIN, NULL, "master", "Volume" },
|
||||
{ 0, 0, 0, 0, PF_STRING | PF_PROP_MSGCONTEXT, &fluidsynth_init_soundfont, "soundfont", "Soundfont" },
|
||||
{ 2, 0, 3, 0, PF_ENUM | PF_CTL_COMBO, fluidsynth_interpolation_names, "interpolation", "Interpolation" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "reverb", "Enable Reverb" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "chorus", "Enable Chorus" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "reverb", "Reverb" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "chorus", "Chorus" },
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -572,12 +572,10 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data )
|
||||
{
|
||||
return new MidiImport( static_cast<const char *>( _data ) );
|
||||
return new MidiImport( QString::fromUtf8(
|
||||
static_cast<const char *>( _data ) ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#undef pos
|
||||
#undef setValue
|
||||
|
||||
@@ -215,7 +215,7 @@ patmanInstrument::LoadErrors patmanInstrument::loadPatch(
|
||||
{
|
||||
unloadCurrentPatch();
|
||||
|
||||
FILE * fd = fopen( _filename.toAscii().constData() , "rb" );
|
||||
FILE * fd = fopen( _filename.toUtf8().constData() , "rb" );
|
||||
if( !fd )
|
||||
{
|
||||
perror( "fopen" );
|
||||
|
||||
@@ -419,6 +419,8 @@ void VstPlugin::loadChunk( const QByteArray & _chunk )
|
||||
if( tf.open() )
|
||||
{
|
||||
tf.write( _chunk );
|
||||
tf.flush();
|
||||
|
||||
lock();
|
||||
sendMessage( message( IdLoadSettingsFromFile ).
|
||||
addString(
|
||||
|
||||
@@ -11,6 +11,8 @@ Contributors:
|
||||
Daniel Clemente (with a workaround of X11 repeated key bug)
|
||||
Emmanuel Saracco (fix for JACK output)
|
||||
Achim Settelmeier (QUERTZ keyboard layout for virtual keyboard)
|
||||
Jérémie Andréi (AZERTY keyboard layout, Array index fix)
|
||||
Jérémie Andréi (AZERTY keyboard layout, Array index fix, OSS failsafe)
|
||||
Alexis Ballier (const char* <-> string mismatch, NULLMidi prototype fix)
|
||||
Tobias Doerffel (static-instance variables fix, missing include fix)
|
||||
James Morris (Memory leaks in FLTK GUI)
|
||||
|
||||
@@ -53,7 +53,7 @@ IF(LMMS_HOST_X86 OR LMMS_HOST_X86_64)
|
||||
ENDIF(LMMS_HOST_X86 OR LMMS_HOST_X86_64)
|
||||
|
||||
# build ZynAddSubFX with full optimizations
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -Wno-write-strings -Wno-deprecated-declarations")
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations")
|
||||
|
||||
# link system-libraries when on win32
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
@@ -106,7 +106,8 @@ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}")
|
||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
ADD_EXECUTABLE(RemoteZynAddSubFx RemoteZynAddSubFx.cpp ${ZYN_SRC_GUI})
|
||||
INSTALL(TARGETS RemoteZynAddSubFx RUNTIME DESTINATION ${PLUGIN_DIR})
|
||||
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx ZynAddSubFxCore ${CMAKE_CURRENT_BINARY_DIR}/fltk/bin/libfltk.a)
|
||||
TARGET_LINK_LIBRARIES(RemoteZynAddSubFx -L${CMAKE_CURRENT_BINARY_DIR} -lZynAddSubFxCore ${CMAKE_CURRENT_BINARY_DIR}/fltk/bin/libfltk.a)
|
||||
ADD_DEPENDENCIES(RemoteZynAddSubFx ZynAddSubFxCore)
|
||||
|
||||
# link system libraries when on win32
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
6 Mar 2002 -(dupamasa - in jur de ora 4) Mi-a venit ideea exact cum sa fac cand ma plimbam pe strada Rolirudnap
|
||||
6 Mar 2002 -(dupamasa - in jur de ora 4) Mi-a venit ideea exact cum sa fac cand ma plimbam pe strada Pandurilor
|
||||
7/8 Mar 2002 - Started to do diagrams
|
||||
10 Mar 2002 - Started to write "voice"
|
||||
11 Mar 2002 - Heard first sound
|
||||
@@ -892,3 +892,68 @@
|
||||
|
||||
07 Sep 2009 (Mark McCurry)
|
||||
- Fixed glitch in XMLwrapper, which would prevent file loading
|
||||
|
||||
11 Sep 2009 (Mark McCurry)
|
||||
- Moved PADsynth_used from public struct to has/set methods in
|
||||
XMLwrapper
|
||||
- Created wrapper functions, so that XMLwrapper can be somewhat
|
||||
usable when const
|
||||
- Removed multiple addparam methods and replaced it with one
|
||||
variable argument function
|
||||
- Replaced int2str, real2str, str2int, and str2real from XMLwrapper
|
||||
with stringTo<T> and stringFrom<T> function templates in Util.
|
||||
- Moved newFFTFREQS and deleteFFTFREQS from Util to FFTwrapper
|
||||
- Removed unneeded stack from XMLwrapper
|
||||
|
||||
18 Sep 2009 (Mark McCurry)
|
||||
- Started to use versioning information in XMLwrapper
|
||||
- Remove last of stack helper functions in XMLwrapper
|
||||
- Added std::string retreval to XMLwrapper
|
||||
|
||||
20 Sep 2009 (Paul Nasca)
|
||||
- Started to implement the Unison effect for ADsynth
|
||||
|
||||
22 Sep 2009 (Paul Nasca)
|
||||
- Added vibratto and other features to Unison effect
|
||||
|
||||
22 Sep 2009 (Mark McCurry)
|
||||
- Changed temporary data for Oscilgen from static to instance
|
||||
recommended by Tobias Doerffel
|
||||
- Fixed Memory leaks in UI based upon James Morris' patch
|
||||
|
||||
23 Sep 2009 (Paul Nasca)
|
||||
- Added unison invert phase
|
||||
- Made unison frequency spread to depend on Bandwidth controllers and parameters
|
||||
- Added unison vibratto speed control and other improvements
|
||||
- bugfixes: Voice Amplitude Envelope and FM
|
||||
|
||||
24 Sep 2009 (Paul Nasca)
|
||||
- Small enhancements and bugfixes to Unison
|
||||
- Started to implement Bandwidth to the Reverb effect
|
||||
|
||||
25 Sep 2009 (Mark McCurry)
|
||||
- Allowed for XMLwrapper to retrieve strings stored in mxml TEXT
|
||||
fields
|
||||
29 Sep 2009 (Paul Nasca)
|
||||
- Remove the old (FFT based) Bandwidth effect to Reverb and started rewrite it (based on multivoice chorus/unison effect)
|
||||
|
||||
01 Oct 2009 (Paul Nasca)
|
||||
- Corrected the ADsynth unison LFO rounding function
|
||||
- Made Unison based on Bandwidth (in cents) parameter
|
||||
|
||||
02 Oct 2009 (Mark McCurry)
|
||||
- Added OSS failsafe by Jérémie Andréi
|
||||
|
||||
04 Oct 2009 (Mark McCurry)
|
||||
- fixed Ctest issues
|
||||
|
||||
06 Oct 2009 (Mark McCurry)
|
||||
- Added first simple profiling test
|
||||
|
||||
08 Oct 2009 (Mark McCurry)
|
||||
- Started to see if memset/memcpy offer performance benifits when
|
||||
widely used
|
||||
- Added basic SUBnote test
|
||||
|
||||
09 Oct 2009 (Mark McCurry)
|
||||
- Restylized codebase with uncrustify
|
||||
@@ -157,6 +157,7 @@ void ZynAddSubFxInstrument::loadSettings( const QDomElement & _this )
|
||||
QByteArray a = doc.toString( 0 ).toUtf8();
|
||||
a.prepend( "<?xml version=\"1.0\"?>\n" );
|
||||
tf.write( a );
|
||||
tf.flush();
|
||||
|
||||
const std::string fn = QSTR_TO_STDSTR(
|
||||
QDir::toNativeSeparators( tf.fileName() ) );
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
CHANGES IN FLTK 1.3.0
|
||||
|
||||
- Managing all Widget flags in a single location now (STR #2161)
|
||||
- Fixed all color related call to Fl_Color type (STR #2208)
|
||||
- File chooser preview now recognizes utf8 encoded
|
||||
text files (STR #2218)
|
||||
- Empty functions in Fluid no longer create an
|
||||
implementation (STR #2259)
|
||||
- Fixed Fluid dependency on X11 (STR #2261)
|
||||
- Updated the bundled libpng to v1.2.40 (released Sep. 10, 2009)
|
||||
- Fixed Fl_Choice contrast with light-on-dark settings (STR #2219)
|
||||
- Fixed X server "lock", if a modal dialog window is opened
|
||||
while a menu is active (STR #1986)
|
||||
- Updated mirror sites in documentation (STR #2220)
|
||||
- Setting a default font for Xft (STR #2216)
|
||||
- Temporarily limited builds to 32-bit on OX S to stay
|
||||
compatible to Snow Leopard
|
||||
- Fixed Windows compile bug with "#define USE_COLORMAP 0"
|
||||
(STR #2241)
|
||||
- Fixed glibc 2.10 compiler problems (Fedora 11 and others)
|
||||
with scandir() and strchr() (STR #2222)
|
||||
- Corrected const methods of Fl_Text_{Buffer|Display|Selection}
|
||||
@@ -27,7 +44,6 @@ CHANGES IN FLTK 1.3.0
|
||||
- Added drop box to utf8 test that will show the utf8 encoding
|
||||
for the first dropped character
|
||||
- Restructured the unittest application
|
||||
- Updated the bundled libpng to v1.2.35 (released 18 Feb. 2009)
|
||||
- Fl_Preferences.H now doesn't include windows.h any more
|
||||
(Windows only, STR #2173).
|
||||
- Fl_Window::draw() now doesn't reset its x/y-coordinates to 0
|
||||
|
||||
@@ -29,7 +29,7 @@ int main()
|
||||
{
|
||||
struct jpeg_decompress_struct cinfo;
|
||||
jpeg_create_decompress(&cinfo);
|
||||
jpeg_read_header(&cinfo, true);
|
||||
jpeg_read_header(&cinfo, TRUE);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ IF(UNIX)
|
||||
ENDIF(UNIX)
|
||||
|
||||
|
||||
# OS X with X11 is not currently supported!
|
||||
SET(FLTK_X11 1)
|
||||
SET(FLTK_APPLE 0)
|
||||
IF(APPLE)
|
||||
@@ -92,7 +93,7 @@ ENDIF(CYGWIN)
|
||||
|
||||
IF(MINGW)
|
||||
ADD_DEFINITIONS(-DWIN32)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid wsock32 gdi32 comdlg32)
|
||||
SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 gdi32 comdlg32)
|
||||
ENDIF(MINGW)
|
||||
|
||||
INCLUDE(CheckIncludeFiles)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Enumerations.H 6735 2009-04-01 22:11:57Z engelsman $"
|
||||
// "$Id: Enumerations.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Enumerations for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -330,6 +330,8 @@ enum Fl_When { // Fl_Widget::when():
|
||||
|
||||
/*@{*/
|
||||
|
||||
// FIXME: These codes collide with valid Unicode keys
|
||||
|
||||
#define FL_Button 0xfee8 ///< A mouse button; use Fl_Button + n for mouse button n.
|
||||
#define FL_BackSpace 0xff08 ///< The backspace key.
|
||||
#define FL_Tab 0xff09 ///< The tab key.
|
||||
@@ -391,6 +393,9 @@ enum Fl_When { // Fl_Widget::when():
|
||||
|
||||
/*@{*/ // group: Event States
|
||||
|
||||
// FIXME: it would be nice to have the modifiers in the upper 8 bit so that
|
||||
// a unicode ke (24bit) can be sent as an unsigned with the modifiers.
|
||||
|
||||
#define FL_SHIFT 0x00010000 ///< One of the shift keys is down
|
||||
#define FL_CAPS_LOCK 0x00020000 ///< The caps lock is on
|
||||
#define FL_CTRL 0x00040000 ///< One of the ctrl keys is down
|
||||
@@ -407,10 +412,15 @@ enum Fl_When { // Fl_Widget::when():
|
||||
#define FL_BUTTONS 0x7f000000 ///< Any mouse button is pushed
|
||||
#define FL_BUTTON(n) (0x00800000<<(n)) ///< Mouse button n (n > 0) is pushed
|
||||
|
||||
#define FL_KEY_MASK 0x0000ffff ///< All keys are 16 bit for now
|
||||
// FIXME: Unicode needs 24 bits!
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
|
||||
# define FL_COMMAND FL_META ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
|
||||
# define FL_CONTROL FL_CTRL ///< An alias for FL_META on WIN32 and X11, or FL_META on MacOS X
|
||||
#else
|
||||
# define FL_COMMAND FL_CTRL ///< An alias for FL_CTRL on WIN32 and X11, or FL_META on MacOS X
|
||||
# define FL_CONTROL FL_META ///< An alias for FL_META on WIN32 and X11, or FL_META on MacOS X
|
||||
#endif // __APPLE__
|
||||
|
||||
/*@}*/ // group: Event States
|
||||
@@ -689,7 +699,7 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
|
||||
|
||||
/** \name Colors */
|
||||
/*@{*/
|
||||
/** The Fl_Color enumeration type holds a FLTK color value.
|
||||
/** The Fl_Color type holds an FLTK color value.
|
||||
|
||||
Colors are either 8-bit indexes into a virtual colormap
|
||||
or 24-bit RGB color values.
|
||||
@@ -697,75 +707,94 @@ extern FL_EXPORT Fl_Fontsize FL_NORMAL_SIZE; ///< normal font size
|
||||
Color indices occupy the lower 8 bits of the value, while
|
||||
RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
|
||||
|
||||
\todo enum Fl_Color needs some more comments for values,
|
||||
see Fl/Enumerations.H
|
||||
<pre>
|
||||
Fl_Color => 0xrrggbbii
|
||||
| | | |
|
||||
| | | +--- index between 0 and 255
|
||||
| | +----- blue color component (8 bit)
|
||||
| +------- green component (8 bit)
|
||||
+--------- red component (8 bit)
|
||||
</pre>
|
||||
|
||||
A color can have either an index or an rgb value. Colors with rgb set
|
||||
and an index >0 are reserved for special use.
|
||||
|
||||
*/
|
||||
|
||||
enum Fl_Color { // standard colors
|
||||
// These are used as default colors in widgets and altered as necessary
|
||||
FL_FOREGROUND_COLOR = 0, ///< the default foreground color (0) used for labels and text
|
||||
FL_BACKGROUND2_COLOR = 7, ///< the default background color for text, list, and valuator widgets
|
||||
FL_INACTIVE_COLOR = 8, ///< the inactive foreground color
|
||||
FL_SELECTION_COLOR = 15, ///< the default selection/highlight color
|
||||
typedef unsigned int Fl_Color;
|
||||
|
||||
// Standard colors. These are used as default colors in widgets and altered as necessary
|
||||
const Fl_Color FL_FOREGROUND_COLOR = 0; ///< the default foreground color (0) used for labels and text
|
||||
const Fl_Color FL_BACKGROUND2_COLOR = 7; ///< the default background color for text, list, and valuator widgets
|
||||
const Fl_Color FL_INACTIVE_COLOR = 8; ///< the inactive foreground color
|
||||
const Fl_Color FL_SELECTION_COLOR = 15; ///< the default selection/highlight color
|
||||
|
||||
// boxtypes generally limit themselves to these colors so
|
||||
// the whole ramp is not allocated:
|
||||
|
||||
FL_GRAY0 = 32, // 'A'
|
||||
FL_DARK3 = 39, // 'H'
|
||||
FL_DARK2 = 45, // 'N'
|
||||
FL_DARK1 = 47, // 'P'
|
||||
FL_BACKGROUND_COLOR = 49, // 'R' default background color
|
||||
FL_LIGHT1 = 50, // 'S'
|
||||
FL_LIGHT2 = 52, // 'U'
|
||||
FL_LIGHT3 = 54, // 'W'
|
||||
const Fl_Color FL_GRAY0 = 32; // 'A'
|
||||
const Fl_Color FL_DARK3 = 39; // 'H'
|
||||
const Fl_Color FL_DARK2 = 45; // 'N'
|
||||
const Fl_Color FL_DARK1 = 47; // 'P'
|
||||
const Fl_Color FL_BACKGROUND_COLOR = 49; // 'R' default background color
|
||||
const Fl_Color FL_LIGHT1 = 50; // 'S'
|
||||
const Fl_Color FL_LIGHT2 = 52; // 'U'
|
||||
const Fl_Color FL_LIGHT3 = 54; // 'W'
|
||||
|
||||
// FLTK provides a 5x8x5 color cube that is used with colormap visuals
|
||||
|
||||
FL_BLACK = 56,
|
||||
FL_RED = 88,
|
||||
FL_GREEN = 63,
|
||||
FL_YELLOW = 95,
|
||||
FL_BLUE = 216,
|
||||
FL_MAGENTA = 248,
|
||||
FL_CYAN = 223,
|
||||
FL_DARK_RED = 72,
|
||||
const Fl_Color FL_BLACK = 56;
|
||||
const Fl_Color FL_RED = 88;
|
||||
const Fl_Color FL_GREEN = 63;
|
||||
const Fl_Color FL_YELLOW = 95;
|
||||
const Fl_Color FL_BLUE = 216;
|
||||
const Fl_Color FL_MAGENTA = 248;
|
||||
const Fl_Color FL_CYAN = 223;
|
||||
const Fl_Color FL_DARK_RED = 72;
|
||||
|
||||
FL_DARK_GREEN = 60,
|
||||
FL_DARK_YELLOW = 76,
|
||||
FL_DARK_BLUE = 136,
|
||||
FL_DARK_MAGENTA = 152,
|
||||
FL_DARK_CYAN = 140,
|
||||
const Fl_Color FL_DARK_GREEN = 60;
|
||||
const Fl_Color FL_DARK_YELLOW = 76;
|
||||
const Fl_Color FL_DARK_BLUE = 136;
|
||||
const Fl_Color FL_DARK_MAGENTA = 152;
|
||||
const Fl_Color FL_DARK_CYAN = 140;
|
||||
|
||||
FL_WHITE = 255
|
||||
};
|
||||
const Fl_Color FL_WHITE = 255;
|
||||
|
||||
#define FL_FREE_COLOR (Fl_Color)16
|
||||
#define FL_NUM_FREE_COLOR 16
|
||||
#define FL_GRAY_RAMP (Fl_Color)32
|
||||
#define FL_NUM_GRAY 24
|
||||
#define FL_GRAY FL_BACKGROUND_COLOR
|
||||
#define FL_COLOR_CUBE (Fl_Color)56
|
||||
#define FL_NUM_RED 5
|
||||
#define FL_NUM_GREEN 8
|
||||
#define FL_NUM_BLUE 5
|
||||
|
||||
#define FL_FREE_COLOR (Fl_Color)16
|
||||
#define FL_NUM_FREE_COLOR 16
|
||||
#define FL_GRAY_RAMP (Fl_Color)32
|
||||
#define FL_NUM_GRAY 24
|
||||
#define FL_GRAY FL_BACKGROUND_COLOR
|
||||
#define FL_COLOR_CUBE (Fl_Color)56
|
||||
#define FL_NUM_RED 5
|
||||
#define FL_NUM_GREEN 8
|
||||
#define FL_NUM_BLUE 5
|
||||
|
||||
FL_EXPORT Fl_Color fl_inactive(Fl_Color c);
|
||||
|
||||
FL_EXPORT Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg);
|
||||
|
||||
FL_EXPORT Fl_Color fl_color_average(Fl_Color c1, Fl_Color c2, float weight);
|
||||
|
||||
inline Fl_Color fl_lighter(Fl_Color c) { return fl_color_average(c, FL_WHITE, .67f); }
|
||||
|
||||
inline Fl_Color fl_darker(Fl_Color c) { return fl_color_average(c, FL_BLACK, .67f); }
|
||||
|
||||
/** return 24-bit color value closest to \p r, \p g, \p b. */
|
||||
inline Fl_Color fl_rgb_color(uchar r, uchar g, uchar b) {
|
||||
if (!r && !g && !b) return FL_BLACK;
|
||||
else return (Fl_Color)(((((r << 8) | g) << 8) | b) << 8);
|
||||
}
|
||||
|
||||
/** return 24-bit color value closest to \p grayscale */
|
||||
inline Fl_Color fl_rgb_color(uchar g) {
|
||||
if (!g) return FL_BLACK;
|
||||
else return (Fl_Color)(((((g << 8) | g) << 8) | g) << 8);
|
||||
}
|
||||
|
||||
inline Fl_Color fl_gray_ramp(int i) {return (Fl_Color)(i+FL_GRAY_RAMP);}
|
||||
|
||||
inline Fl_Color fl_color_cube(int r, int g, int b) {
|
||||
return (Fl_Color)((b*FL_NUM_RED + r) * FL_NUM_GREEN + g + FL_COLOR_CUBE);}
|
||||
|
||||
@@ -857,5 +886,5 @@ enum Fl_Damage {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Enumerations.H 6735 2009-04-01 22:11:57Z engelsman $".
|
||||
// End of "$Id: Enumerations.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl.H 6771 2009-04-19 12:47:36Z matt $"
|
||||
// "$Id: Fl.H 6903 2009-09-27 11:09:03Z matt $"
|
||||
//
|
||||
// Main header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -489,18 +489,25 @@ public:
|
||||
static int event_state() {return e_state;}
|
||||
/** See int event_state() */
|
||||
static int event_state(int i) {return e_state&i;}
|
||||
/** Gets which key on the keyboard was last pushed.
|
||||
\retval 0 if the last event was not a key press or release.
|
||||
\see int event_key(int) */
|
||||
/**
|
||||
Gets which key on the keyboard was last pushed.
|
||||
|
||||
The returned integer 'key code' is not necessarily a text
|
||||
equivalent for the keystroke. For instance: if someone presses '5' on the
|
||||
numeric keypad with numlock on, Fl::event_key() may return the 'key code'
|
||||
for this key, and NOT the character '5'. To always get the '5', use Fl::event_text() instead.
|
||||
|
||||
\returns an integer 'key code', or 0 if the last event was not a key press or release.
|
||||
\see int event_key(int), event_text(), compose(int&).
|
||||
*/
|
||||
static int event_key() {return e_keysym;}
|
||||
/**
|
||||
Returns the keycode of the last key event, regardless of the NumLock state.
|
||||
|
||||
|
||||
If NumLock is deactivated, FLTK translates events from the
|
||||
numeric keypad into the corresponding arrow key events.
|
||||
event_key() returns the translated key code, whereas
|
||||
event_original_key() returns the keycode before
|
||||
NumLock translation.
|
||||
event_original_key() returns the keycode before NumLock translation.
|
||||
*/
|
||||
static int event_original_key(){return e_original_keysym;}
|
||||
/**
|
||||
@@ -548,7 +555,20 @@ public:
|
||||
slower than Fl::event_key(int). \see event_key(int)
|
||||
*/
|
||||
static int get_key(int key); // platform dependent
|
||||
/** Returns the text associated with the current FL_PASTE or FL_DND_RELEASE event. */
|
||||
/**
|
||||
Returns the text associated with the current event, including FL_PASTE or FL_DND_RELEASE events.
|
||||
This can be used in response to FL_KEYUP, FL_KEYDOWN, FL_PASTE, FL_DND_RELEASE.
|
||||
|
||||
When responding to FL_KEYUP/FL_KEYDOWN, use this function instead of Fl::event_key()
|
||||
to get the text equivalent of keystrokes suitable for inserting into strings
|
||||
and text widgets.
|
||||
|
||||
The returned string is guaranteed to be be NULL terminated.
|
||||
However, see Fl::event_length() for the actual length of the string,
|
||||
in case the string itself contains NULLs that are part of the text data.
|
||||
|
||||
\returns A NULL terminated text string equivalent of the last keystroke.
|
||||
*/
|
||||
static const char* event_text() {return e_text;}
|
||||
/**
|
||||
Returns the length of the text in Fl::event_text(). There
|
||||
@@ -568,7 +588,7 @@ public:
|
||||
static void compose_reset() {compose_state = 0;}
|
||||
static int event_inside(int,int,int,int);
|
||||
static int event_inside(const Fl_Widget*);
|
||||
static int test_shortcut(int);
|
||||
static int test_shortcut(Fl_Shortcut);
|
||||
|
||||
// event destinations:
|
||||
static int handle(int, Fl_Window*);
|
||||
@@ -660,7 +680,7 @@ public:
|
||||
8-bit RGB color. The color is not allocated until fl_color(i) is used.
|
||||
*/
|
||||
static void set_color(Fl_Color, unsigned); // platform dependent
|
||||
static unsigned get_color(Fl_Color);
|
||||
static Fl_Color get_color(Fl_Color);
|
||||
static void get_color(Fl_Color, uchar&, uchar&, uchar&);
|
||||
/**
|
||||
Frees the specified color from the colormap, if applicable.
|
||||
@@ -1022,5 +1042,5 @@ public:
|
||||
#endif // !Fl_H
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.H 6771 2009-04-19 12:47:36Z matt $".
|
||||
// End of "$Id: Fl.H 6903 2009-09-27 11:09:03Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser.H 6726 2009-03-27 16:52:31Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $"
|
||||
//
|
||||
// Browser header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -36,6 +36,7 @@
|
||||
#define Fl_Browser_H
|
||||
|
||||
#include "Fl_Browser_.H"
|
||||
#include "Fl_Image.H"
|
||||
|
||||
struct FL_BLINE;
|
||||
|
||||
@@ -306,6 +307,11 @@ public:
|
||||
else Fl_Browser_::display(find_line(line));
|
||||
}
|
||||
|
||||
// icon support
|
||||
void icon(int line, Fl_Image* icon);
|
||||
Fl_Image* icon(int line) const;
|
||||
void remove_icon(int line);
|
||||
|
||||
/** For back compatibility only. */
|
||||
void replace(int a, const char* b) { text(a, b); }
|
||||
void display(int line, int val=1);
|
||||
@@ -314,5 +320,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser.H 6726 2009-03-27 16:52:31Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser.H 6850 2009-09-07 02:25:51Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser_.H 6737 2009-04-02 06:44:34Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Common browser header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -74,7 +74,7 @@ class FL_EXPORT Fl_Browser_ : public Fl_Group {
|
||||
uchar has_scrollbar_; // which scrollbars are enabled
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
void* top_; // which item scrolling position is in
|
||||
void* selection_; // which is selected (except for FL_MULTI_BROWSER)
|
||||
void *redraw1,*redraw2; // minimal update pointers
|
||||
@@ -297,11 +297,11 @@ public:
|
||||
/**
|
||||
Gets the default text color for the lines in the browser.
|
||||
*/
|
||||
Fl_Color textcolor() const { return (Fl_Color)textcolor_; }
|
||||
Fl_Color textcolor() const { return textcolor_; }
|
||||
/**
|
||||
Sets the default text color for the lines in the browser to color \p col.
|
||||
*/
|
||||
void textcolor(unsigned col) { textcolor_ = col; }
|
||||
void textcolor(Fl_Color col) { textcolor_ = col; }
|
||||
|
||||
/**
|
||||
Gets the current size of the scrollbars' troughs, in pixels.
|
||||
@@ -374,5 +374,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser_.H 6737 2009-04-02 06:44:34Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Button.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Button.H 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Button header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -45,7 +45,7 @@
|
||||
#define FL_HIDDEN_BUTTON 3 ///< for Forms compatibility
|
||||
|
||||
#ifndef FL_DOXYGEN
|
||||
extern FL_EXPORT int fl_old_shortcut(const char*);
|
||||
extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -172,5 +172,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Button.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Button.H 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Chart.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Forms chart header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -87,7 +87,7 @@ class FL_EXPORT Fl_Chart : public Fl_Widget {
|
||||
uchar autosize_;
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
protected:
|
||||
void draw();
|
||||
public:
|
||||
@@ -136,9 +136,9 @@ public:
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
|
||||
/** Gets the chart's text color */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** gets the chart's text color to \p n. */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
/**
|
||||
Get whether the chart will automatically adjust the bounds of the chart.
|
||||
@@ -156,5 +156,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Chart.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Chart.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Clock.H 6754 2009-04-12 11:32:22Z AlbrechtS $"
|
||||
// "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $"
|
||||
//
|
||||
// Clock header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -133,5 +133,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Clock.H 6754 2009-04-12 11:32:22Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Clock.H 6812 2009-07-01 07:27:25Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Counter.H 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Counter.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Counter header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -58,7 +58,7 @@ class FL_EXPORT Fl_Counter : public Fl_Valuator {
|
||||
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
double lstep_;
|
||||
uchar mouseobj;
|
||||
static void repeat_callback(void *);
|
||||
@@ -111,14 +111,14 @@ public:
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
|
||||
/** Gets the font color */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the font color to \p s */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Counter.H 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Counter.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Group.H 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Group.H 6907 2009-09-28 14:34:52Z matt $"
|
||||
//
|
||||
// Group header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -58,8 +58,6 @@ class FL_EXPORT Fl_Group : public Fl_Widget {
|
||||
Fl_Group& operator=(const Fl_Group&);
|
||||
|
||||
protected:
|
||||
enum { CLIP_CHILDREN = 2048 };
|
||||
|
||||
void draw();
|
||||
void draw_child(Fl_Widget& widget) const;
|
||||
void draw_children();
|
||||
@@ -176,7 +174,7 @@ public:
|
||||
|
||||
\see void Fl_Group::clip_children(int c)
|
||||
*/
|
||||
int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
|
||||
unsigned int clip_children() { return (flags() & CLIP_CHILDREN) != 0; }
|
||||
|
||||
// back compatibility functions:
|
||||
|
||||
@@ -224,5 +222,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Group.H 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Group.H 6907 2009-09-28 14:34:52Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.H 6777 2009-04-23 15:32:19Z matt $"
|
||||
// "$Id: Fl_Input_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Input base class header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -120,7 +120,7 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
|
||||
\p mark_, no text is selected */
|
||||
int mark_;
|
||||
|
||||
/** \internal Offset to text origin within wdget bounds */
|
||||
/** \internal Offset to text origin within widget bounds */
|
||||
int xscroll_, yscroll_;
|
||||
|
||||
/** \internal Minimal update pointer. Display requirs redraw from here to the end
|
||||
@@ -143,10 +143,10 @@ class FL_EXPORT Fl_Input_ : public Fl_Widget {
|
||||
Fl_Fontsize textsize_;
|
||||
|
||||
/** \internal color of the entire text */
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
/** \internal color of the text cursor */
|
||||
unsigned cursor_color_;
|
||||
Fl_Color cursor_color_;
|
||||
|
||||
/** \internal Horizontal cursor position in pixels while movin up or down. */
|
||||
static double up_down_pos;
|
||||
@@ -206,6 +206,7 @@ protected:
|
||||
|
||||
/** \internal Vertical offset of text to top edge of widget. */
|
||||
int yscroll() const {return yscroll_;}
|
||||
void yscroll(int y) { yscroll_ = y; damage(FL_DAMAGE_EXPOSE);}
|
||||
|
||||
/* Return the number of lines displayed on a single page. */
|
||||
int linesPerPage();
|
||||
@@ -396,23 +397,23 @@ public:
|
||||
|
||||
/** Gets the color of the text in the input field.
|
||||
\return the text color
|
||||
\see textcolor(unsigned) */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
\see textcolor(Fl_Color) */
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
|
||||
/** Sets the color of the text in the input field.
|
||||
The text color defaults to \c FL_FOREGROUND_COLOR.
|
||||
\param [in] n new text color
|
||||
\see textcolor() */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
/** Gets the color of the cursor.
|
||||
\return the current cursor color */
|
||||
Fl_Color cursor_color() const {return (Fl_Color)cursor_color_;}
|
||||
Fl_Color cursor_color() const {return cursor_color_;}
|
||||
|
||||
/** Sets the color of the cursor.
|
||||
The default color for the cursor is \c FL_BLACK.
|
||||
\param [in] n the new cursor color */
|
||||
void cursor_color(unsigned n) {cursor_color_ = n;}
|
||||
void cursor_color(Fl_Color n) {cursor_color_ = n;}
|
||||
|
||||
/** Gets the input field type.
|
||||
\return the current input type */
|
||||
@@ -450,5 +451,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.H 6777 2009-04-23 15:32:19Z matt $".
|
||||
// End of "$Id: Fl_Input_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Menu base class header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -56,7 +56,7 @@ protected:
|
||||
uchar down_box_;
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
public:
|
||||
Fl_Menu_(int,int,int,int,const char * =0);
|
||||
@@ -119,9 +119,9 @@ public:
|
||||
/** Sets the font size of menu item labels. */
|
||||
void textsize(Fl_Fontsize c) {textsize_=c;}
|
||||
/** Get the current color of menu item labels. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the current color of menu item labels. */
|
||||
void textcolor(unsigned c) {textcolor_=c;}
|
||||
void textcolor(Fl_Color c) {textcolor_=c;}
|
||||
|
||||
/**
|
||||
This box type is used to surround the currently-selected items in the
|
||||
@@ -142,5 +142,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_Item.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_Item.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Menu item header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -36,18 +36,18 @@
|
||||
# endif
|
||||
|
||||
enum { // values for flags:
|
||||
FL_MENU_INACTIVE = 1,
|
||||
FL_MENU_TOGGLE= 2,
|
||||
FL_MENU_VALUE = 4,
|
||||
FL_MENU_RADIO = 8,
|
||||
FL_MENU_INVISIBLE = 0x10,
|
||||
FL_SUBMENU_POINTER = 0x20,
|
||||
FL_SUBMENU = 0x40,
|
||||
FL_MENU_DIVIDER = 0x80,
|
||||
FL_MENU_HORIZONTAL = 0x100
|
||||
FL_MENU_INACTIVE = 1, ///< Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE= 2, ///< Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE = 4, ///< The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO = 8, ///< Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE = 0x10, ///< Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER = 0x20, ///< Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU = 0x40, ///< This item is a submenu to other items
|
||||
FL_MENU_DIVIDER = 0x80, ///< Creates divider line below this item. Also ends a group of radio buttons.
|
||||
FL_MENU_HORIZONTAL = 0x100 ///< ??? -- reserved
|
||||
};
|
||||
|
||||
extern FL_EXPORT int fl_old_shortcut(const char*);
|
||||
extern FL_EXPORT Fl_Shortcut fl_old_shortcut(const char*);
|
||||
|
||||
class Fl_Menu_;
|
||||
|
||||
@@ -68,15 +68,15 @@ class Fl_Menu_;
|
||||
};
|
||||
|
||||
enum { // values for flags:
|
||||
FL_MENU_INACTIVE = 1,
|
||||
FL_MENU_TOGGLE = 2,
|
||||
FL_MENU_VALUE = 4,
|
||||
FL_MENU_RADIO = 8,
|
||||
FL_MENU_INVISIBLE = 0x10,
|
||||
FL_SUBMENU_POINTER = 0x20,
|
||||
FL_SUBMENU = 0x40,
|
||||
FL_MENU_DIVIDER = 0x80,
|
||||
FL_MENU_HORIZONTAL = 0x100
|
||||
FL_MENU_INACTIVE = 1, // Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE = 2, // Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE = 4, // The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO = 8, // Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE = 0x10, // Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER = 0x20, // Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU = 0x40, // This item is a submenu to other items
|
||||
FL_MENU_DIVIDER = 0x80, // Creates divider line below this item. Also ends a group of radio buttons.
|
||||
FL_MENU_HORIZONTAL = 0x100 // ??? -- reserved
|
||||
};
|
||||
\endcode
|
||||
Typically menu items are statically defined; for example:
|
||||
@@ -124,7 +124,7 @@ struct FL_EXPORT Fl_Menu_Item {
|
||||
uchar labeltype_; ///< how the menu item text looks like
|
||||
Fl_Font labelfont_; ///< which font for this menu item text
|
||||
Fl_Fontsize labelsize_; ///< size of menu item text
|
||||
unsigned labelcolor_; ///< menu item text color
|
||||
Fl_Color labelcolor_; ///< menu item text color
|
||||
|
||||
// advance N items, skipping submenus:
|
||||
const Fl_Menu_Item *next(int=1) const;
|
||||
@@ -181,10 +181,10 @@ struct FL_EXPORT Fl_Menu_Item {
|
||||
color is not black fltk will <I>not</I> use overlay bitplanes to draw
|
||||
the menu - this is so that images put in the menu draw correctly.
|
||||
*/
|
||||
Fl_Color labelcolor() const {return (Fl_Color)labelcolor_;}
|
||||
Fl_Color labelcolor() const {return labelcolor_;}
|
||||
|
||||
/** See Fl_Color Fl_Menu_Item::labelcolor() const */
|
||||
void labelcolor(unsigned a) {labelcolor_ = a;}
|
||||
void labelcolor(Fl_Color a) {labelcolor_ = a;}
|
||||
/**
|
||||
Fonts are identified by small 8-bit indexes into a table. See the
|
||||
enumeration list for predefined fonts. The default value is a
|
||||
@@ -414,5 +414,5 @@ enum { // back-compatibility enum:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_Item.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_Item.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_Window.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $"
|
||||
//
|
||||
// Menu window header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -40,14 +40,13 @@
|
||||
redraw.
|
||||
*/
|
||||
class FL_EXPORT Fl_Menu_Window : public Fl_Single_Window {
|
||||
enum {NO_OVERLAY = 128};
|
||||
public:
|
||||
void show();
|
||||
void erase();
|
||||
void flush();
|
||||
void hide();
|
||||
/** Tells if hardware overlay mode is set */
|
||||
int overlay() {return !(flags()&NO_OVERLAY);}
|
||||
unsigned int overlay() {return !(flags()&NO_OVERLAY);}
|
||||
/** Tells FLTK to use hardware overlay planes if they are available. */
|
||||
void set_overlay() {clear_flag(NO_OVERLAY);}
|
||||
/** Tells FLTK to use normal drawing planes instead of overlay planes.
|
||||
@@ -65,5 +64,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_Window.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Menu_Window.H 6909 2009-09-28 14:41:43Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Multiline_Input.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
|
||||
//
|
||||
// Multiline input header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -38,11 +38,15 @@
|
||||
This input field displays '\n' characters as new lines rather than ^J,
|
||||
and accepts the Return, Tab, and up and down arrow keys. This is for
|
||||
editing multiline text.
|
||||
<P>This is far from the nirvana of text editors, and is probably only
|
||||
good for small bits of text, 10 lines at most. I think FLTK can be
|
||||
used to write a powerful text editor, but it is not going to be a
|
||||
built-in feature. Powerful text editors in a toolkit are a big source
|
||||
of bloat.
|
||||
<P>
|
||||
This is far from the nirvana of text editors, and is probably only
|
||||
good for small bits of text, 10 lines at most. Note that this widget
|
||||
does not support scrollbars or per-character color control.
|
||||
<P>
|
||||
If you are presenting large amounts of text and need scrollbars
|
||||
or full color control of characters, you probably want Fl_Text_Editor
|
||||
instead.
|
||||
<P>
|
||||
*/
|
||||
class Fl_Multiline_Input : public Fl_Input {
|
||||
public:
|
||||
@@ -58,5 +62,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Multiline_Input.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Multiline_Input.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Multiline_Output.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $"
|
||||
//
|
||||
// Multi line output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -37,6 +37,14 @@
|
||||
This widget is a subclass of Fl_Output that displays multiple
|
||||
lines of text. It also displays tab characters as whitespace to the
|
||||
next column.
|
||||
<P>
|
||||
Note that this widget does not support scrollbars, or per-character
|
||||
color control.
|
||||
<P>
|
||||
If you are presenting large amounts of read-only text
|
||||
and need scrollbars, or full color control of characters,
|
||||
then use Fl_Text_Display. If you want to display HTML text,
|
||||
use Fl_Help_View.
|
||||
*/
|
||||
class Fl_Multiline_Output : public Fl_Output {
|
||||
public:
|
||||
@@ -52,5 +60,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Multiline_Output.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Multiline_Output.H 6889 2009-09-19 22:09:00Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Output.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $"
|
||||
//
|
||||
// Output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -42,7 +42,8 @@
|
||||
\image latex text.eps "Fl_Output" width=8cm
|
||||
<P>There is a single subclass,
|
||||
Fl_Multiline_Output, which allows you to display multiple lines of
|
||||
text. </P>
|
||||
text. Fl_Multiline_Output does not provide scroll bars. If a more
|
||||
complete text editing widget is needed, use Fl_Text_Display instead.</P>
|
||||
<P>The text may contain any characters except \\0, and will correctly
|
||||
display anything, using ^X notation for unprintable control characters
|
||||
and \\nnn notation for unprintable characters with the high bit set. It
|
||||
@@ -63,5 +64,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Output.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Output.H 6898 2009-09-23 20:43:27Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Scroll.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Scroll.H 6828 2009-07-12 00:15:06Z greg.ercolano $"
|
||||
//
|
||||
// Scroll header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -193,5 +193,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Scroll.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Scroll.H 6828 2009-07-12 00:15:06Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Buffer.H 6618 2009-01-01 21:54:10Z matt $"
|
||||
// "$Id: Fl_Text_Buffer.H 6822 2009-07-04 00:24:26Z fabien $"
|
||||
//
|
||||
// Header file for Fl_Text_Buffer class.
|
||||
//
|
||||
@@ -322,5 +322,5 @@ class FL_EXPORT Fl_Text_Buffer {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Buffer.H 6618 2009-01-01 21:54:10Z matt $".
|
||||
// End of "$Id: Fl_Text_Buffer.H 6822 2009-07-04 00:24:26Z fabien $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Display.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Text_Display.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Header file for Fl_Text_Display class.
|
||||
//
|
||||
@@ -165,9 +165,9 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
/** Sets the default size of text in the widget. */
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
/** Gets the default color of text in the widget. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the default color of text in the widget. */
|
||||
void textcolor(unsigned n) {textcolor_ = n;}
|
||||
void textcolor(Fl_Color n) {textcolor_ = n;}
|
||||
|
||||
int wrapped_column(int row, int column) const;
|
||||
int wrapped_row(int row) const;
|
||||
@@ -327,7 +327,7 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
// The following are not presently used from the original NEdit code,
|
||||
// but are being put here so that future versions of Fl_Text_Display
|
||||
@@ -340,5 +340,5 @@ class FL_EXPORT Fl_Text_Display: public Fl_Group {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Display.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Text_Display.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Editor.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $"
|
||||
//
|
||||
// Header file for Fl_Text_Editor class.
|
||||
//
|
||||
@@ -103,6 +103,8 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
|
||||
static int kf_shift_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_ctrl_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_c_s_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_meta_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_m_s_move(int c, Fl_Text_Editor* e);
|
||||
static int kf_home(int, Fl_Text_Editor* e);
|
||||
static int kf_end(int c, Fl_Text_Editor* e);
|
||||
static int kf_left(int c, Fl_Text_Editor* e);
|
||||
@@ -134,6 +136,6 @@ class FL_EXPORT Fl_Text_Editor : public Fl_Text_Display {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Editor.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Text_Editor.H 6893 2009-09-20 19:24:24Z greg.ercolano $".
|
||||
//
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Tooltip.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Tooltip.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Tooltip header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -76,13 +76,13 @@ public:
|
||||
/** Sets the size of the tooltip text. */
|
||||
static void size(Fl_Fontsize s) { size_ = s; }
|
||||
/** Gets the background color for tooltips. The default background color is a pale yellow. */
|
||||
static Fl_Color color() { return (Fl_Color)color_; }
|
||||
static Fl_Color color() { return color_; }
|
||||
/** Sets the background color for tooltips. The default background color is a pale yellow. */
|
||||
static void color(unsigned c) { color_ = c; }
|
||||
static void color(Fl_Color c) { color_ = c; }
|
||||
/** Gets the color of the text in the tooltip. The default is black. */
|
||||
static Fl_Color textcolor() { return (Fl_Color)textcolor_; }
|
||||
static Fl_Color textcolor() { return textcolor_; }
|
||||
/** Sets the color of the text in the tooltip. The default is black. */
|
||||
static void textcolor(unsigned c) { textcolor_ = c; }
|
||||
static void textcolor(Fl_Color c) { textcolor_ = c; }
|
||||
|
||||
// These should not be public, but Fl_Widget::tooltip() needs them...
|
||||
// fabien: made it private with only a friend function access
|
||||
@@ -95,8 +95,8 @@ private:
|
||||
static float delay_; //!< delay before a tooltip is shown
|
||||
static float hoverdelay_; //!< delay between tooltips
|
||||
static int enabled_;
|
||||
static unsigned color_;
|
||||
static unsigned textcolor_;
|
||||
static Fl_Color color_;
|
||||
static Fl_Color textcolor_;
|
||||
static Fl_Font font_;
|
||||
static Fl_Fontsize size_;
|
||||
static Fl_Widget* widget_; //!< Keeps track of the current target widget
|
||||
@@ -105,5 +105,5 @@ private:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Tooltip.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Tooltip.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Input.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Input.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value input header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -120,16 +120,16 @@ public:
|
||||
/** Gets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return input.textcolor();}
|
||||
/** Sets the color of the text in the value box.*/
|
||||
void textcolor(unsigned n) {input.textcolor(n);}
|
||||
void textcolor(Fl_Color n) {input.textcolor(n);}
|
||||
/** Gets the color of the text cursor. The text cursor is black by default. */
|
||||
Fl_Color cursor_color() const {return input.cursor_color();}
|
||||
/** Sets the color of the text cursor. The text cursor is black by default. */
|
||||
void cursor_color(unsigned n) {input.cursor_color(n);}
|
||||
void cursor_color(Fl_Color n) {input.cursor_color(n);}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Input.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Input.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Output.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Output.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value output header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -51,7 +51,7 @@ class FL_EXPORT Fl_Value_Output : public Fl_Valuator {
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
uchar soft_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
|
||||
protected:
|
||||
void draw();
|
||||
@@ -83,13 +83,13 @@ public:
|
||||
Fl_Fontsize textsize() const {return textsize_;}
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
/** Sets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Gets the color of the text in the value box. */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Output.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Output.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Value_Slider.H 6664 2009-02-18 09:27:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Value_Slider.H 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Value slider header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -42,7 +42,7 @@
|
||||
class FL_EXPORT Fl_Value_Slider : public Fl_Slider {
|
||||
Fl_Font textfont_;
|
||||
Fl_Fontsize textsize_;
|
||||
unsigned textcolor_;
|
||||
Fl_Color textcolor_;
|
||||
protected:
|
||||
void draw();
|
||||
public:
|
||||
@@ -57,13 +57,13 @@ public:
|
||||
/** Sets the size of the text in the value box. */
|
||||
void textsize(Fl_Fontsize s) {textsize_ = s;}
|
||||
/** Gets the color of the text in the value box. */
|
||||
Fl_Color textcolor() const {return (Fl_Color)textcolor_;}
|
||||
Fl_Color textcolor() const {return textcolor_;}
|
||||
/** Sets the color of the text in the value box. */
|
||||
void textcolor(unsigned s) {textcolor_ = s;}
|
||||
void textcolor(Fl_Color s) {textcolor_ = s;}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Value_Slider.H 6664 2009-02-18 09:27:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Value_Slider.H 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Widget.H 6753 2009-04-12 09:40:59Z AlbrechtS $"
|
||||
// "$Id: Fl_Widget.H 6912 2009-10-02 19:08:55Z matt $"
|
||||
//
|
||||
// Widget header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -69,7 +69,7 @@ struct FL_EXPORT Fl_Label {
|
||||
/** size of label font */
|
||||
Fl_Fontsize size;
|
||||
/** text color */
|
||||
unsigned color;
|
||||
Fl_Color color;
|
||||
/** Draws the label aligned to the given box */
|
||||
void draw(int,int,int,int, Fl_Align) const ;
|
||||
void measure(int &w, int &h) const ;
|
||||
@@ -96,9 +96,9 @@ class FL_EXPORT Fl_Widget {
|
||||
void* user_data_;
|
||||
int x_,y_,w_,h_;
|
||||
Fl_Label label_;
|
||||
int flags_;
|
||||
unsigned color_;
|
||||
unsigned color2_;
|
||||
unsigned int flags_;
|
||||
Fl_Color color_;
|
||||
Fl_Color color2_;
|
||||
uchar type_;
|
||||
uchar damage_;
|
||||
uchar box_;
|
||||
@@ -135,23 +135,37 @@ protected:
|
||||
/** Internal use only. Use position(int,int), size(int,int) or resize(int,int,int,int) instead. */
|
||||
void h(int v) {h_ = v;}
|
||||
/** Gets the widget flags mask */
|
||||
int flags() const {return flags_;}
|
||||
unsigned int flags() const {return flags_;}
|
||||
/** Sets a flag in the flags mask */
|
||||
void set_flag(int c) {flags_ |= c;}
|
||||
void set_flag(unsigned int c) {flags_ |= c;}
|
||||
/** Clears a flag in the flags mask */
|
||||
void clear_flag(int c) {flags_ &= ~c;}
|
||||
void clear_flag(unsigned int c) {flags_ &= ~c;}
|
||||
/** flags possible values enumeration.
|
||||
See activate(), output(), visible(), changed(), set_visible_focus()
|
||||
*/
|
||||
enum {
|
||||
INACTIVE=1, ///< the widget can't receive focus, and is disabled but potentially visible
|
||||
INVISIBLE=2, ///< the widget is not drawn but can receive events
|
||||
OUTPUT=4, ///< for output only
|
||||
SHORTCUT_LABEL=64, ///< the label contains a shortcut we need to draw
|
||||
CHANGED=128, ///< the widget value changed
|
||||
VISIBLE_FOCUS=512, ///< accepts keyboard focus navigation if the widget can have the focus
|
||||
COPIED_LABEL=1024 ///< the widget label is internally copied, its destruction is handled by the widget
|
||||
};
|
||||
INACTIVE = 1<<0, ///< the widget can't receive focus, and is disabled but potentially visible
|
||||
INVISIBLE = 1<<1, ///< the widget is not drawn but can receive events
|
||||
OUTPUT = 1<<2, ///< for output only
|
||||
NOBORDER = 1<<3, ///< don't draw a decoration (Fl_Window)
|
||||
FORCE_POSITION = 1<<4, ///< don't let the window manager position the window (Fl_Window)
|
||||
NON_MODAL = 1<<5, ///< thisis a hovering toolbar window (Fl_Window)
|
||||
SHORTCUT_LABEL = 1<<6, ///< the label contains a shortcut we need to draw
|
||||
CHANGED = 1<<7, ///< the widget value changed
|
||||
OVERRIDE = 1<<8, ///< position window on top (Fl_Window)
|
||||
VISIBLE_FOCUS = 1<<9, ///< accepts keyboard focus navigation if the widget can have the focus
|
||||
COPIED_LABEL = 1<<10, ///< the widget label is internally copied, its destruction is handled by the widget
|
||||
CLIP_CHILDREN = 1<<11, ///< all drawing within this widget will be clipped (Fl_Group)
|
||||
MENU_WINDOW = 1<<12, ///< a temporary popup window, dismissed by clicking outside (Fl_Window)
|
||||
TOOLTIP_WINDOW = 1<<13, ///< a temporary popup, transparent to events, and dismissed easily (Fl_Window)
|
||||
MODAL = 1<<14, ///< a window blocking input to all other winows (Fl_Window)
|
||||
NO_OVERLAY = 1<<15, ///< window not using a hardware overlay plane (Fl_Menu_Window)
|
||||
GROUP_RELATIVE = 1<<16, ///< position this idget relative to the parent group, not to the window
|
||||
// (space for more flags)
|
||||
USERFLAG3 = 1<<29, ///< reserved for 3rd party extensions
|
||||
USERFLAG2 = 1<<30, ///< reserved for 3rd party extensions
|
||||
USERFLAG1 = 1<<31 ///< reserved for 3rd party extensions
|
||||
};
|
||||
void draw_box() const;
|
||||
void draw_box(Fl_Boxtype t, Fl_Color c) const;
|
||||
void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const;
|
||||
@@ -343,9 +357,9 @@ public:
|
||||
|
||||
/** Gets the background color of the widget.
|
||||
\return current background color
|
||||
\see color(unsigned), color(unsigned, unsigned)
|
||||
\see color(Fl_Color), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
Fl_Color color() const {return (Fl_Color)color_;}
|
||||
Fl_Color color() const {return color_;}
|
||||
|
||||
/** Sets the background color of the widget.
|
||||
The color is passed to the box routine. The color is either an index into
|
||||
@@ -355,25 +369,25 @@ public:
|
||||
The default for most widgets is FL_BACKGROUND_COLOR. Use Fl::set_color()
|
||||
to redefine colors in the color map.
|
||||
\param[in] bg background color
|
||||
\see color(), color(unsigned, unsigned), selection_color(unsigned)
|
||||
\see color(), color(Fl_Color, Fl_Color), selection_color(Fl_Color)
|
||||
*/
|
||||
void color(unsigned bg) {color_ = bg;}
|
||||
void color(Fl_Color bg) {color_ = bg;}
|
||||
|
||||
/** Gets the selection color.
|
||||
\return the current selection color
|
||||
\see selection_color(unsigned), color(unsigned, unsigned)
|
||||
\see selection_color(Fl_Color), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
Fl_Color selection_color() const {return (Fl_Color)color2_;}
|
||||
Fl_Color selection_color() const {return color2_;}
|
||||
|
||||
/** Sets the selection color.
|
||||
The selection color is defined for Forms compatibility and is usually
|
||||
used to color the widget when it is selected, although some widgets
|
||||
use this color for other purposes. You can set both colors at once
|
||||
with color(unsigned bg, unsigned sel).
|
||||
with color(Fl_Color bg, Fl_Color sel).
|
||||
\param[in] a the new selection color
|
||||
\see selection_color(), color(unsigned, unsigned)
|
||||
\see selection_color(), color(Fl_Color, Fl_Color)
|
||||
*/
|
||||
void selection_color(unsigned a) {color2_ = a;}
|
||||
void selection_color(Fl_Color a) {color2_ = a;}
|
||||
|
||||
/** Sets the background and selection color of the widget.
|
||||
|
||||
@@ -382,7 +396,7 @@ public:
|
||||
\param[in] sel selection color
|
||||
\see color(unsigned), selection_color(unsigned)
|
||||
*/
|
||||
void color(unsigned bg, unsigned sel) {color_=bg; color2_=sel;}
|
||||
void color(Fl_Color bg, Fl_Color sel) {color_=bg; color2_=sel;}
|
||||
|
||||
/** Gets the current label text.
|
||||
\return a pointer to the current label text
|
||||
@@ -439,13 +453,13 @@ public:
|
||||
The default color is FL_FOREGROUND_COLOR.
|
||||
\return the current label color
|
||||
*/
|
||||
Fl_Color labelcolor() const {return (Fl_Color)label_.color;}
|
||||
Fl_Color labelcolor() const {return label_.color;}
|
||||
|
||||
/** Sets the label color.
|
||||
The default color is FL_FOREGROUND_COLOR.
|
||||
\param[in] c the new label color
|
||||
*/
|
||||
void labelcolor(unsigned c) {label_.color=c;}
|
||||
void labelcolor(Fl_Color c) {label_.color=c;}
|
||||
|
||||
/** Gets the font to use.
|
||||
Fonts are identified by indexes into a table. The default value
|
||||
@@ -633,7 +647,7 @@ public:
|
||||
\retval 0 if the widget is not drawn and hence invisible.
|
||||
\see show(), hide(), visible_r()
|
||||
*/
|
||||
int visible() const {return !(flags_&INVISIBLE);}
|
||||
unsigned int visible() const {return !(flags_&INVISIBLE);}
|
||||
|
||||
/** Returns whether a widget and all its parents are visible.
|
||||
\retval 0 if the widget or any of its parents are invisible.
|
||||
@@ -678,7 +692,7 @@ public:
|
||||
\retval 0 if the widget is inactive
|
||||
\see active_r(), activate(), deactivate()
|
||||
*/
|
||||
int active() const {return !(flags_&INACTIVE);}
|
||||
unsigned int active() const {return !(flags_&INACTIVE);}
|
||||
|
||||
/** Returns whether the widget and all of its parents are active.
|
||||
\retval 0 if this or any of the parent widgets are inactive
|
||||
@@ -717,7 +731,7 @@ public:
|
||||
\retval 0 if the widget is used for input and output
|
||||
\see set_output(), clear_output()
|
||||
*/
|
||||
int output() const {return (flags_&OUTPUT);}
|
||||
unsigned int output() const {return (flags_&OUTPUT);}
|
||||
|
||||
/** Sets a widget to output only.
|
||||
\see output(), clear_output()
|
||||
@@ -734,7 +748,7 @@ public:
|
||||
&& visible()) but is faster.
|
||||
\retval 0 if the widget takes no events
|
||||
*/
|
||||
int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
|
||||
unsigned int takesevents() const {return !(flags_&(INACTIVE|INVISIBLE|OUTPUT));}
|
||||
|
||||
/**
|
||||
Checks if the widget value changed since the last callback.
|
||||
@@ -751,7 +765,7 @@ public:
|
||||
\retval 0 if the value did not change
|
||||
\see set_changed(), clear_changed()
|
||||
*/
|
||||
int changed() const {return flags_&CHANGED;}
|
||||
unsigned int changed() const {return flags_&CHANGED;}
|
||||
|
||||
/** Marks the value of the widget as changed.
|
||||
\see changed(), clear_changed()
|
||||
@@ -796,7 +810,7 @@ public:
|
||||
\retval 0 if this widget has no visible focus.
|
||||
\see visible_focus(int), set_visible_focus(), clear_visible_focus()
|
||||
*/
|
||||
int visible_focus() { return flags_ & VISIBLE_FOCUS; }
|
||||
unsigned int visible_focus() { return flags_ & VISIBLE_FOCUS; }
|
||||
|
||||
/** Sets the default callback for all widgets.
|
||||
Sets the default callback, which puts a pointer to the widget on the queue
|
||||
@@ -828,7 +842,7 @@ public:
|
||||
/** Internal use only. */
|
||||
int test_shortcut();
|
||||
/** Internal use only. */
|
||||
static char label_shortcut(const char *t);
|
||||
static Fl_Shortcut label_shortcut(const char *t);
|
||||
/** Internal use only. */
|
||||
static int test_shortcut(const char*);
|
||||
|
||||
@@ -866,9 +880,16 @@ public:
|
||||
*/
|
||||
uchar damage() const {return damage_;}
|
||||
|
||||
/** Clears the damage flags.
|
||||
/** Clears or sets the damage flags.
|
||||
Damage flags are cleared when parts of the widget drawing is repaired.
|
||||
\param[in] c bitmask of flags to clear
|
||||
|
||||
The optional argument \p c specifies the bits that <b>are set</b>
|
||||
after the call (default: 0) and \b not the bits that are cleared!
|
||||
|
||||
\note Therefore it is possible to set damage bits with this method, but
|
||||
this should be avoided. Use damage(uchar) instead.
|
||||
|
||||
\param[in] c new bitmask of damage flags (default: 0)
|
||||
\see damage(uchar), damage()
|
||||
*/
|
||||
void clear_damage(uchar c = 0) {damage_ = c;}
|
||||
@@ -923,5 +944,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Widget.H 6753 2009-04-12 09:40:59Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Widget.H 6912 2009-10-02 19:08:55Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window.H 6614 2009-01-01 16:11:32Z matt $"
|
||||
// "$Id: Fl_Window.H 6907 2009-09-28 14:34:52Z matt $"
|
||||
//
|
||||
// Window header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -69,16 +69,6 @@ class FL_EXPORT Fl_Window : public Fl_Group {
|
||||
Fl_Cursor cursor_default;
|
||||
Fl_Color cursor_fg, cursor_bg;
|
||||
void size_range_();
|
||||
// values for flags():
|
||||
enum {
|
||||
FL_MODAL = 64,
|
||||
FL_NOBORDER = 8,
|
||||
FL_FORCE_POSITION = 16,
|
||||
FL_NON_MODAL = 32,
|
||||
FL_OVERRIDE = 256,
|
||||
FL_MENU_WINDOW = 4096,
|
||||
FL_TOOLTIP_WINDOW = 8192
|
||||
};
|
||||
void _Fl_Window(); // constructor innards
|
||||
|
||||
// unimplemented copy ctor and assignment operator
|
||||
@@ -167,13 +157,13 @@ public:
|
||||
Fast inline function to turn the border
|
||||
off. It only works before show() is called.
|
||||
*/
|
||||
void clear_border() {set_flag(FL_NOBORDER);}
|
||||
void clear_border() {set_flag(NOBORDER);}
|
||||
/** See int Fl_Window::border(int) */
|
||||
int border() const {return !(flags() & FL_NOBORDER);}
|
||||
/** Activate the flags FL_NOBORDER|FL_OVERRIDE */
|
||||
void set_override() {set_flag(FL_NOBORDER|FL_OVERRIDE);}
|
||||
unsigned int border() const {return !(flags() & NOBORDER);}
|
||||
/** Activate the flags NOBORDER|FL_OVERRIDE */
|
||||
void set_override() {set_flag(NOBORDER|OVERRIDE);}
|
||||
/** Returns non zero if FL_OVERRIDE flag is set, 0 otherwise. */
|
||||
int override() const { return flags()&FL_OVERRIDE; }
|
||||
unsigned int override() const { return flags()&OVERRIDE; }
|
||||
/**
|
||||
A "modal" window, when shown(), will prevent any events from
|
||||
being delivered to other windows in the same program, and will also
|
||||
@@ -183,18 +173,18 @@ public:
|
||||
which window (if any) is modal by calling
|
||||
Fl::modal().
|
||||
*/
|
||||
void set_modal() {set_flag(FL_MODAL);}
|
||||
void set_modal() {set_flag(MODAL);}
|
||||
/** Returns true if this window is modal. */
|
||||
int modal() const {return flags() & FL_MODAL;}
|
||||
unsigned int modal() const {return flags() & MODAL;}
|
||||
/**
|
||||
A "non-modal" window (terminology borrowed from Microsoft Windows)
|
||||
acts like a modal() one in that it remains on top, but it has
|
||||
no effect on event delivery. There are <I>three</I> states for a
|
||||
window: modal, non-modal, and normal.
|
||||
*/
|
||||
void set_non_modal() {set_flag(FL_NON_MODAL);}
|
||||
void set_non_modal() {set_flag(NON_MODAL);}
|
||||
/** Returns true if this window is modal or non-modal. */
|
||||
int non_modal() const {return flags() & (FL_NON_MODAL|FL_MODAL);}
|
||||
unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);}
|
||||
|
||||
/**
|
||||
Marks the window as a menu window.
|
||||
@@ -209,10 +199,10 @@ public:
|
||||
This must be called before the window is shown and cannot be changed
|
||||
later.
|
||||
*/
|
||||
void set_menu_window() {set_flag(FL_MENU_WINDOW);}
|
||||
void set_menu_window() {set_flag(MENU_WINDOW);}
|
||||
|
||||
/** Returns true if this window is a menu window. */
|
||||
int menu_window() const {return flags() & FL_MENU_WINDOW;}
|
||||
unsigned int menu_window() const {return flags() & MENU_WINDOW;}
|
||||
|
||||
/**
|
||||
Marks the window as a tooltip window.
|
||||
@@ -230,10 +220,10 @@ public:
|
||||
\note Since Fl_Tooltip_Window is derived from Fl_Menu_Window, this
|
||||
also \b clears the menu_window() state.
|
||||
*/
|
||||
void set_tooltip_window() { set_flag(FL_TOOLTIP_WINDOW);
|
||||
clear_flag(FL_MENU_WINDOW); }
|
||||
void set_tooltip_window() { set_flag(TOOLTIP_WINDOW);
|
||||
clear_flag(MENU_WINDOW); }
|
||||
/** Returns true if this window is a tooltip window. */
|
||||
int tooltip_window() const {return flags() & FL_TOOLTIP_WINDOW;}
|
||||
unsigned int tooltip_window() const {return flags() & TOOLTIP_WINDOW;}
|
||||
|
||||
/**
|
||||
Position the window so that the mouse is pointing at the
|
||||
@@ -252,7 +242,7 @@ public:
|
||||
so that the next time show() is called the window manager is
|
||||
free to position the window.
|
||||
*/
|
||||
void free_position() {clear_flag(FL_FORCE_POSITION);}
|
||||
void free_position() {clear_flag(FORCE_POSITION);}
|
||||
/**
|
||||
Set the allowable range the user can resize this window to. This only
|
||||
works for top-level windows.
|
||||
@@ -410,5 +400,5 @@ public:
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window.H 6614 2009-01-01 16:11:32Z matt $".
|
||||
// End of "$Id: Fl_Window.H 6907 2009-09-28 14:34:52Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw.H 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// "$Id: fl_draw.H 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Portable drawing function header file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -203,14 +203,7 @@ inline Fl_Fontsize fl_size() {return fl_size_;}
|
||||
You can also use the value of \p size passed to fl_font()
|
||||
*/
|
||||
FL_EXPORT int fl_height(); // using "size" should work ok
|
||||
/**
|
||||
Dummy passthru function called only in Fl_Text_Display that simply returns
|
||||
the font height as given by the \p size parameter in the same call!
|
||||
|
||||
\todo Is fl_height(int, int size) required for Fl_Text_Dispay?
|
||||
Why not use \p size parameter directly?
|
||||
*/
|
||||
inline int fl_height(int, int size) {return size;}
|
||||
FL_EXPORT int fl_height(int font, int size);
|
||||
/**
|
||||
Returns the recommended distance above the bottom of a fl_height() tall box to
|
||||
draw the text at so it looks centered vertically in that box.
|
||||
@@ -448,8 +441,8 @@ FL_EXPORT int fl_measure_pixmap(const char* const* cdata, int &w, int &h);
|
||||
// other:
|
||||
FL_EXPORT void fl_scroll(int X, int Y, int W, int H, int dx, int dy,
|
||||
void (*draw_area)(void*, int,int,int,int), void* data);
|
||||
FL_EXPORT const char* fl_shortcut_label(int shortcut);
|
||||
FL_EXPORT const char* fl_shortcut_label(int shortcuti, const char **eom);
|
||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut);
|
||||
FL_EXPORT const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom);
|
||||
FL_EXPORT void fl_overlay_rect(int x,int y,int w,int h);
|
||||
FL_EXPORT void fl_overlay_clear();
|
||||
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color fg=FL_BLACK, Fl_Color bg=FL_WHITE);
|
||||
@@ -475,5 +468,5 @@ FL_EXPORT int fl_add_symbol(const char* name, void (*drawit)(Fl_Color), int scal
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw.H 6779 2009-04-24 09:28:30Z yuri $".
|
||||
// End of "$Id: fl_draw.H 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -52,6 +52,9 @@ typedef char *Fl_String;
|
||||
typedef const char *Fl_CString;
|
||||
|
||||
/** 24-bit Unicode character + 8-bit indicator for keyboard flags */
|
||||
typedef unsigned int Fl_Shortcut;
|
||||
|
||||
/** 24-bit Unicode character - upper 8-bits are unused */
|
||||
typedef unsigned int Fl_Char;
|
||||
|
||||
/*@}*/ /* group: Miscellaneous */
|
||||
|
||||
686
plugins/zynaddsubfx/fltk/README.123
Normal file
686
plugins/zynaddsubfx/fltk/README.123
Normal file
@@ -0,0 +1,686 @@
|
||||
|
||||
R E A D M E . 1 2 3
|
||||
=====================
|
||||
|
||||
This file listst the differences between FLTK 1 and FLTK 2 with annotations
|
||||
for a possible implementation of FLTK 3. The all new and improved FLTK 3
|
||||
needs to be compatible with 1 and 2. It must have a moder API, plenty of
|
||||
widgets, lots of options, customization at run-time, but still be easily
|
||||
portable, fast, and of course light.
|
||||
|
||||
FLTK 1 has become a nice starting point for the first steps in GUI
|
||||
programming. It runs on al major platform (and on many minor ones
|
||||
as well), is small, compact, and easy to use. FLTK 2 was the
|
||||
attempt to continue the success of FLTK 1 with a much cleaber API
|
||||
and many important details improved. Unfortunately many users never
|
||||
made the jump to FLTK 2 and so it not only ended in a crawling slow
|
||||
branch, it also became instable and at last unmaintainable.
|
||||
|
||||
FLTK 3 sets out to surprise FLTK 1 users and satisfy FLTK 2 junkies.
|
||||
It will basically be the improved FLTK 2 API combined with the quite
|
||||
stable innards of FLTK 1. As an extra bonus, FLTK 3 will be compatible
|
||||
to 1 and 2. Just prepend your code with the "coding_style" instruction
|
||||
and FLTK 3 will do the rest. It is even possible to intermix F1 and
|
||||
F2 coding styles at any place.
|
||||
|
||||
Nice challange, eh? So let's get going:
|
||||
|
||||
|
||||
The Big Differences
|
||||
---------------------
|
||||
|
||||
FLTK 2 is based on FLTK 1 in many ways, and while the FLTK 1 API was based
|
||||
on the Forms Library, FLTK 2 is Bill's take on how FLTK 1 should have been.
|
||||
This chapter outlines the biggest differences between version.
|
||||
|
||||
(1) Coordinate System: FLTK 1 child coordinates are always relative to the
|
||||
window, not as most would expect to the parent. FLTK 2 does the logical
|
||||
thing and uses group-relative origins. This is somewhat difficult to port
|
||||
if we want to stay downward compatible. Fl_Widget will need an additional
|
||||
flag indicating absolute or relative coordinates.
|
||||
|
||||
(2) Pulldown Menus: The developers of the Forms Library did not implement
|
||||
the idea of hierarchies all the way through. Pulldown menus, which are
|
||||
hierarchical by nature, were instead implemented as a list with lots of
|
||||
tricks and cludges to make them usable. FLTK 2 went half way by using the
|
||||
existing Windget/Group relation to create menus, however, menu items are
|
||||
still specialized widgets. For FLTK 3, I would like to allow any widget
|
||||
inside a pulldown menu.
|
||||
|
||||
(3) Browsers and Tree Views: Browsers in FLTK1 are implemented even worse
|
||||
than Pulldown Menus. FLTK 2 solved the issues in a similar way, and here
|
||||
again, I prefer the FLTK 2 way very mch, but also would like to extend
|
||||
functionality to allow arbitrary widgets as list items. A Tree-like
|
||||
widget comes free with the FLTK 2 concept. FLTK 1 has no such thing and
|
||||
even Fluid had to hack the library badly to generate a tree view.
|
||||
|
||||
(4) Namespaces: this is a minr issue that I include for completeness. FLTK 2
|
||||
introduces the ftk namespace, renaming all widgets. FLTK 3 will use the
|
||||
FLTK 2 naming scheme and map FLTK 1 class names using typedefs. This is, as
|
||||
most things in programming are, a compromise. The "coding_style" function
|
||||
must be used to switch between FLTK 1 and FLTK 2 code. No worries though,
|
||||
it's easy and straight forward.
|
||||
|
||||
(5) Layout: FLTK 1 uses a top-down approach for widget layout in which the
|
||||
parent widget decides about the childs size "resize(x, y, w, h)". In FLTK 2
|
||||
any widget can call "layout()" which will query children for their preffered
|
||||
size and propagate the information up. This is a great concept that FLTK 3
|
||||
should adapt, plus it is compatible.
|
||||
|
||||
(6) Ractangle: FLTK 2's base class is fltk::Rectangle. This is nice and
|
||||
easy to implement. The API is pretty much the same in both versions.
|
||||
|
||||
(7) Styles: FLTK 2 uses a minimal number of styles to define the basic
|
||||
(and often repeated) parameters of every widget. API's are similar though,
|
||||
so this is luckily another pretty straight-forward upgrade.
|
||||
|
||||
|
||||
Comparison Chart by Class
|
||||
---------------------------
|
||||
|
||||
This chart contains a list of all classes in FLTK 1 and 2, how they
|
||||
correspond, and how they could be implemented in FLTK 3.
|
||||
|
||||
1: class Fl
|
||||
2: namespace fltk
|
||||
*: this is a pretty straight-forward mapping of functions. The actual work
|
||||
lies in finding and listing all global functions and adapting those.
|
||||
|
||||
1: class Fl_Adjuster
|
||||
2: class Adjuster
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class AlignGroup
|
||||
*: undocumented in FLTK 2. Minimal code. Can be transfered easily.
|
||||
|
||||
1:
|
||||
2: class AnsiWidget
|
||||
*: There is no equvalet in FLTK 1, but the widget may be easily ported.
|
||||
|
||||
1:
|
||||
2: class AssociationFunctor
|
||||
*: Associations are a new and rarly used concept in FLTK 2. We need to
|
||||
decide if these should be moved into FLTK 3
|
||||
|
||||
1:
|
||||
2: class AssociationType
|
||||
*: Associations are a new and rarly used concept in FLTK 2. We need to
|
||||
decide if these should be moved into FLTK 3
|
||||
|
||||
1:
|
||||
2: class BarGroup
|
||||
*: undocumented in FLTK 2. Minimal code. Can be transfered easily.
|
||||
|
||||
1: class Fl_BMP_Image
|
||||
2: class bmpImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Bitmap
|
||||
2:
|
||||
|
||||
1: class Fl_Box
|
||||
2: class Widget
|
||||
*: This actually maps pretty much exactly to fltk::Widget. FLTK 2 provides
|
||||
a bunch of other box-like classes which have some predefined properties,
|
||||
however this is the best match for FLTK 1. fltk::InvisibleBox can be used
|
||||
as well.
|
||||
|
||||
1: class Fl_Browser
|
||||
2: class Browser
|
||||
|
||||
1: class Fl_Browser_
|
||||
2:
|
||||
|
||||
1: class Fl_Button
|
||||
2: class Button
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Cairo_State
|
||||
2:
|
||||
|
||||
1: class Fl_Cairo_Window
|
||||
2:
|
||||
|
||||
1: class Fl_Chart
|
||||
2:
|
||||
|
||||
1: class Fl_Check_Browser
|
||||
2:
|
||||
|
||||
1: class Fl_Check_Button
|
||||
2: class CheckButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Choice
|
||||
2: class Choice
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Clock
|
||||
2: class Clock
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Clock_Output
|
||||
2: class ClockOutput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Color_Chooser
|
||||
2: class ColorChooser
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ComboBrowser
|
||||
|
||||
1:
|
||||
2: class ComboWindow
|
||||
|
||||
1:
|
||||
2: class CycleButton
|
||||
|
||||
1: class Fl_Counter
|
||||
2:
|
||||
|
||||
1: class Fl_Dial
|
||||
2: class Dial
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class Divider
|
||||
|
||||
1: class Fl_Double_Window
|
||||
2: class DoubleBufferWindow
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_End
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class EngravedLabel
|
||||
|
||||
1: class Fl_File_Browser
|
||||
2: class FileBrowser
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Chooser
|
||||
2: class FileChooser
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Icon
|
||||
2: class FileIcon
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_File_Input
|
||||
2: class FileInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Fill_Dial
|
||||
2: class FillDial
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Fill_Slider
|
||||
2: class FillSlider
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class FlatBox
|
||||
|
||||
1: class Fl_Float_Input
|
||||
2: class FloatInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_FormsBitmap
|
||||
2:
|
||||
|
||||
1: class Fl_FormsPixmap
|
||||
2:
|
||||
|
||||
1: class Fl_FormsText
|
||||
2: class Fl_FormsText
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class FrameBox
|
||||
|
||||
1: class Fl_Free
|
||||
2:
|
||||
|
||||
1: class Fl_GIF_Image
|
||||
2: class gifImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Gl_Choice
|
||||
2: class GlChoice
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Gl_Window
|
||||
2: class GlWindow
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class GlOverlay
|
||||
|
||||
1: class Fl_Glut_Window
|
||||
2: class GlutWindow
|
||||
|
||||
1: class Fl_Group
|
||||
2: class Group
|
||||
*: should map easily, must manage coordinate systems
|
||||
|
||||
1:
|
||||
2: class GSave
|
||||
|
||||
1:
|
||||
2: class Guard
|
||||
|
||||
1: class Fl_Help_Dialog
|
||||
2: class HelpDialog
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Help_View
|
||||
2: class HelpView
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class HighlightBox
|
||||
|
||||
1:
|
||||
2: class HighlightButton
|
||||
|
||||
1: class Fl_Hold_Browser
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Fill_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Nice_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Hor_Value_Slider
|
||||
2:
|
||||
|
||||
1: class Fl_Image
|
||||
2: class Image
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Input
|
||||
2: class Input
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Input_
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class InputBrowser
|
||||
|
||||
1: class Fl_Input_Choice
|
||||
2: class ComboBox
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Int_Input
|
||||
2: class IntInput
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class InvisibleBox
|
||||
|
||||
1:
|
||||
2: class Item
|
||||
|
||||
1:
|
||||
2: class ItemGroup
|
||||
|
||||
1: class Fl_JPEG_Image
|
||||
2: class jpegImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class LabelType
|
||||
|
||||
1: class Fl_Light_Button
|
||||
2: class LightButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Line_Dial
|
||||
2: class LineDial
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class List
|
||||
|
||||
1: class Fl_Menu_
|
||||
2: class Menu
|
||||
|
||||
1: class Fl_Menu_Bar
|
||||
2: class MenuBar
|
||||
|
||||
1: class Fl_Menu_Button
|
||||
2: class PopupMenu
|
||||
|
||||
1:
|
||||
2: class MenuSection
|
||||
|
||||
1: class Fl_Menu_Window
|
||||
2: class MenuWindow
|
||||
|
||||
1:
|
||||
2: class Monitor
|
||||
|
||||
1: class Fl_Multi_Browser
|
||||
2: class MultiBrowser
|
||||
|
||||
1:
|
||||
2: class MultiImage
|
||||
|
||||
1: class Fl_Multiline_Input
|
||||
2: class MultiLineInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Multiline_Output
|
||||
2: class MultiLineOutput
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class Mutex
|
||||
|
||||
1: class Fl_Nice_Slider
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class NumericInput
|
||||
|
||||
1: class Fl_Output
|
||||
2: class Output
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Overlay_Window
|
||||
2:
|
||||
|
||||
1: class Fl_PNG_Image
|
||||
2: class pngImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_PNM_Image
|
||||
2: class pnmImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Pack
|
||||
2: class PackedGroup
|
||||
*: should map easily, FLTK 2 has soem additional functionaity
|
||||
|
||||
1: class Fl_Pixmap
|
||||
2:
|
||||
|
||||
1: class Fl_Positioner
|
||||
2:
|
||||
|
||||
1: class Fl_Preferences
|
||||
2: class Preferences
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Progress
|
||||
2: class ProgressBar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_RGB_Image
|
||||
2: class rgbImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Radio_Button
|
||||
2: class RadioButton
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class RadioItem
|
||||
|
||||
1: class Fl_Radio_Light_Button
|
||||
2: class RadioLightButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Radio_Round_Button
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class Rectangle
|
||||
|
||||
1:
|
||||
2: class RecursiveMutex
|
||||
|
||||
1: class Fl_Repeat_Button
|
||||
2: class RepeatButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Return_Button
|
||||
2: class ReturnButton
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Roller
|
||||
2: class ThumbWheel
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Round_Button
|
||||
2:
|
||||
|
||||
1: class Fl_Round_Clock
|
||||
2:
|
||||
|
||||
1: class Fl_Scroll
|
||||
2: class ScrollGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Scrollbar
|
||||
2: class Scrollbar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Secret_Input
|
||||
2: class SecretInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Select_Browser
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class ShapedWindow
|
||||
|
||||
1: class Fl_Shared_Image
|
||||
2: class SharedImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ShortcutFunctor
|
||||
|
||||
1: class Fl_Simple_Counter
|
||||
2:
|
||||
|
||||
1: class Fl_Single_Window
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class SignalMutex
|
||||
|
||||
1: class Fl_Slider
|
||||
2: class Slider
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Spinner
|
||||
2:
|
||||
|
||||
1:
|
||||
2: class StatusBarGroup
|
||||
|
||||
1:
|
||||
2: class StringArray
|
||||
|
||||
1:
|
||||
2: class StringHierarchy
|
||||
|
||||
1:
|
||||
2: class StringList
|
||||
|
||||
1:
|
||||
2: class Style
|
||||
|
||||
1:
|
||||
2: class StyleSet
|
||||
|
||||
1:
|
||||
2: class Symbol
|
||||
|
||||
1: class Fl_Sys_Menu_Bar
|
||||
2: class SystemMenuBar
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tabs
|
||||
2: class TabGroup
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class TabGroupPager
|
||||
|
||||
1: class Fl_Text_Buffer
|
||||
2: class TextBuffer
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Display
|
||||
2: class TextDisplay
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Editor
|
||||
2: class TextEditor
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Text_Selection
|
||||
2: class TextSelection
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tile
|
||||
2: class TiledGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Tiled_Image
|
||||
2: class TiledImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Timer
|
||||
2:
|
||||
|
||||
1: class Fl_Toggle_Button
|
||||
2: class ToggleButton
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class ToggleItem
|
||||
|
||||
1: class Fl_Tooltip
|
||||
2: class Tooltip
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class WordwrapInput
|
||||
|
||||
1:
|
||||
2: class WordwrapOutput
|
||||
|
||||
1: class Fl_Valuator
|
||||
2: class Valuator
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Input
|
||||
2: class ValueInput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Output
|
||||
2: class ValueOutput
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Value_Slider
|
||||
2: class ValueSlider
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Widget
|
||||
2: class Widget
|
||||
*: should map easily for the most part
|
||||
|
||||
1: class Fl_Widget_Tracker
|
||||
2:
|
||||
|
||||
1: class Fl_Window
|
||||
2: class Window
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_Wizard
|
||||
2: class WizardGroup
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_X
|
||||
2: class CreatedWindow
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_XBM_Image
|
||||
2: class xbmImage
|
||||
*: should map easily
|
||||
|
||||
1: class Fl_XPM_Image
|
||||
2: class xpmImage
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: class xpmFileImage
|
||||
|
||||
1:
|
||||
2: struct Cursor
|
||||
|
||||
1:
|
||||
2: struct Font
|
||||
|
||||
1: struct Fl_Glut_Bitmap_Font
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeChar
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeFont
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeStrip
|
||||
2:
|
||||
|
||||
1: struct Fl_Glut_StrokeVertex
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Block
|
||||
2: struct HelpBlock
|
||||
*: should map easily
|
||||
|
||||
1: struct Fl_Help_Font_Stack
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Font_Style
|
||||
2:
|
||||
|
||||
1: struct Fl_Help_Link
|
||||
2: struct HelpLink
|
||||
*: should map easily
|
||||
|
||||
1: struct Fl_Help_Target
|
||||
2: struct HelpTarget
|
||||
*: should map easily
|
||||
|
||||
1:
|
||||
2: struct ImageType
|
||||
|
||||
1: struct Fl_Label
|
||||
2:
|
||||
|
||||
1: struct Fl_Menu_Item
|
||||
2:
|
||||
|
||||
1: struct Fl_Multi_Label
|
||||
2:
|
||||
|
||||
1:
|
||||
2: struct NamedStyle
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ SET(CPPFILES
|
||||
Fl_Menu.cxx
|
||||
Fl_Menu_.cxx
|
||||
Fl_Menu_Bar.cxx
|
||||
Fl_Sys_Menu_Bar.cxx
|
||||
Fl_Sys_Menu_Bar.cxx
|
||||
Fl_Menu_Button.cxx
|
||||
Fl_Menu_Window.cxx
|
||||
Fl_Menu_add.cxx
|
||||
@@ -130,6 +130,8 @@ SET(CPPFILES
|
||||
fl_vertex.cxx
|
||||
screen_xywh.cxx
|
||||
fl_utf8.cxx
|
||||
fl_encoding_latin1.cxx
|
||||
fl_encoding_mac_roman.cxx
|
||||
)
|
||||
SET(FLCPPFILES
|
||||
forms_compatability.cxx
|
||||
@@ -165,18 +167,18 @@ SET(IMGCPPFILES
|
||||
|
||||
SET(CFILES
|
||||
fl_call_main.c
|
||||
fl_utf.c
|
||||
flstring.c
|
||||
scandir.c
|
||||
numericsort.c
|
||||
vsnprintf.c
|
||||
xutf8/case.c
|
||||
xutf8/is_right2left.c
|
||||
xutf8/is_spacing.c
|
||||
xutf8/keysym2Ucs.c
|
||||
xutf8/case.c
|
||||
xutf8/utf8Input.c
|
||||
xutf8/utf8Utils.c
|
||||
xutf8/utf8Wrap.c
|
||||
xutf8/keysym2Ucs.c
|
||||
fl_utf.c
|
||||
)
|
||||
|
||||
ADD_LIBRARY(fltk ${CPPFILES} ${CFILES})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl.cxx 6787 2009-05-14 20:16:09Z engelsman $"
|
||||
// "$Id: Fl.cxx 6836 2009-07-25 12:56:16Z AlbrechtS $"
|
||||
//
|
||||
// Main event handling code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1699,5 +1699,5 @@ Fl_Widget_Tracker::~Fl_Widget_Tracker() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl.cxx 6787 2009-05-14 20:16:09Z engelsman $".
|
||||
// End of "$Id: Fl.cxx 6836 2009-07-25 12:56:16Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Browser.cxx 6726 2009-03-27 16:52:31Z greg.ercolano $"
|
||||
// "$Id: Fl_Browser.cxx 6895 2009-09-21 06:35:08Z greg.ercolano $"
|
||||
//
|
||||
// Browser widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -44,10 +44,16 @@
|
||||
#define SELECTED 1
|
||||
#define NOTDISPLAYED 2
|
||||
|
||||
// WARNING:
|
||||
// Fl_File_Chooser.cxx also has a definition of this structure (FL_BLINE).
|
||||
// Changes to FL_BLINE *must* be reflected in Fl_File_Chooser.cxx as well.
|
||||
// This hack in Fl_File_Chooser should be solved.
|
||||
//
|
||||
struct FL_BLINE { // data is in a linked list of these
|
||||
FL_BLINE* prev;
|
||||
FL_BLINE* next;
|
||||
void* data;
|
||||
Fl_Image* icon;
|
||||
short length; // sizeof(txt)-1, may be longer than string
|
||||
char flags; // selected, displayed
|
||||
char txt[1]; // start of allocated array
|
||||
@@ -138,7 +144,8 @@ const char *Fl_Browser::item_text(void *item) const {
|
||||
item_next(), etc. to access the internal linked list more efficiently.
|
||||
|
||||
\param[in] line The line number of the item to return. (1 based)
|
||||
\returns The returned item.
|
||||
\retval item that was found.
|
||||
\retval NULL if line is out of range.
|
||||
\see item_at(), find_line(), lineno()
|
||||
*/
|
||||
FL_BLINE* Fl_Browser::find_line(int line) const {
|
||||
@@ -287,6 +294,7 @@ void Fl_Browser::insert(int line, const char* newtext, void* d) {
|
||||
t->flags = 0;
|
||||
strcpy(t->txt, newtext);
|
||||
t->data = d;
|
||||
t->icon = 0;
|
||||
insert(line, t);
|
||||
}
|
||||
|
||||
@@ -321,6 +329,7 @@ void Fl_Browser::text(int line, const char* newtext) {
|
||||
replacing(t, n);
|
||||
cache = n;
|
||||
n->data = t->data;
|
||||
n->icon = t->icon;
|
||||
n->length = (short)l;
|
||||
n->flags = t->flags;
|
||||
n->prev = t->prev;
|
||||
@@ -364,8 +373,7 @@ int Fl_Browser::item_height(void *item) const {
|
||||
fl_font(textfont(), textsize());
|
||||
int hh = fl_height();
|
||||
if (hh > hmax) hmax = hh;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const int* i = column_widths();
|
||||
// do each column separately as they may all set different fonts:
|
||||
for (char* str = l->txt; str && *str; str++) {
|
||||
@@ -400,6 +408,9 @@ int Fl_Browser::item_height(void *item) const {
|
||||
}
|
||||
}
|
||||
|
||||
if (l->icon && (l->icon->h()+2)>hmax) {
|
||||
hmax = l->icon->h() + 2; // leave 2px above/below
|
||||
}
|
||||
return hmax; // previous version returned hmax+2!
|
||||
}
|
||||
|
||||
@@ -412,7 +423,8 @@ int Fl_Browser::item_height(void *item) const {
|
||||
incr_height(), full_height()
|
||||
*/
|
||||
int Fl_Browser::item_width(void *item) const {
|
||||
char* str = ((FL_BLINE*)item)->txt;
|
||||
FL_BLINE* l=(FL_BLINE*)item;
|
||||
char* str = l->txt;
|
||||
const int* i = column_widths();
|
||||
int ww = 0;
|
||||
|
||||
@@ -457,6 +469,8 @@ int Fl_Browser::item_width(void *item) const {
|
||||
if (*str == format_char_ && str[1])
|
||||
str ++;
|
||||
|
||||
if (ww==0 && l->icon) ww = l->icon->w();
|
||||
|
||||
fl_font(font, tsize);
|
||||
return ww + int(fl_width(str)) + 6;
|
||||
}
|
||||
@@ -492,9 +506,11 @@ int Fl_Browser::incr_height() const {
|
||||
\param[in] X,Y,W,H position and size.
|
||||
*/
|
||||
void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
char* str = ((FL_BLINE*)item)->txt;
|
||||
FL_BLINE* l = (FL_BLINE*)item;
|
||||
char* str = l->txt;
|
||||
const int* i = column_widths();
|
||||
|
||||
bool first = true; // for icon
|
||||
while (W > 6) { // do each tab-separated field
|
||||
int w1 = W; // width for this field
|
||||
char* e = 0; // pointer to end of field or null if none
|
||||
@@ -502,6 +518,15 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
e = strchr(str, column_char());
|
||||
if (e) {*e = 0; w1 = *i++;}
|
||||
}
|
||||
// Icon drawing code
|
||||
if (first) {
|
||||
first = false;
|
||||
if (l->icon) {
|
||||
l->icon->draw(X+2,Y+1); // leave 2px left, 1px above
|
||||
int iconw = l->icon->w()+2;
|
||||
X += iconw; W -= iconw; w1 -= iconw;
|
||||
}
|
||||
}
|
||||
int tsize = textsize();
|
||||
Fl_Font font = textfont();
|
||||
Fl_Color lcol = textcolor();
|
||||
@@ -521,7 +546,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
case 'c': talign = FL_ALIGN_CENTER; break;
|
||||
case 'r': talign = FL_ALIGN_RIGHT; break;
|
||||
case 'B':
|
||||
if (!(((FL_BLINE*)item)->flags & SELECTED)) {
|
||||
if (!(l->flags & SELECTED)) {
|
||||
fl_color((Fl_Color)strtol(str, &str, 10));
|
||||
fl_rectf(X, Y, w1, H);
|
||||
} else strtol(str, &str, 10);
|
||||
@@ -557,7 +582,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
|
||||
}
|
||||
BREAK:
|
||||
fl_font(font, tsize);
|
||||
if (((FL_BLINE*)item)->flags & SELECTED)
|
||||
if (l->flags & SELECTED)
|
||||
lcol = fl_contrast(lcol, selection_color());
|
||||
if (!active_r()) lcol = fl_inactive(lcol);
|
||||
fl_color(lcol);
|
||||
@@ -592,8 +617,7 @@ Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char *L)
|
||||
Updates the browser so that \p line is shown at position \p pos.
|
||||
\param[in] line line number. (1 based)
|
||||
\param[in] pos position.
|
||||
\see topline(), middleline(), bottomline(), \n
|
||||
+: Command not found.
|
||||
\see topline(), middleline(), bottomline()
|
||||
*/
|
||||
void Fl_Browser::lineposition(int line, Fl_Line_Position pos) {
|
||||
if (line<1) line = 1;
|
||||
@@ -835,6 +859,58 @@ void Fl_Browser::swap(int a, int b) {
|
||||
swap(ai,bi);
|
||||
}
|
||||
|
||||
/**
|
||||
Set the image icon for \p line to the value \p icon.
|
||||
Caller is responsible for keeping the icon allocated.
|
||||
The \p line is automatically redrawn.
|
||||
\param[in] line The line to be modified. If out of range, nothing is done.
|
||||
\param[in] icon The image icon to be assigned to the \p line.
|
||||
If NULL, any previous icon is removed.
|
||||
*/
|
||||
void Fl_Browser::icon(int line, Fl_Image* icon) {
|
||||
|
||||
if (line<1 || line > lines) return;
|
||||
|
||||
FL_BLINE* bl = find_line(line);
|
||||
|
||||
int old_h = bl->icon ? bl->icon->h()+2 : 0; // init with *old* icon height
|
||||
bl->icon = 0; // remove icon, if any
|
||||
int th = item_height(bl); // height of text only
|
||||
int new_h = icon ? icon->h()+2 : 0; // init with *new* icon height
|
||||
if (th > old_h) old_h = th;
|
||||
if (th > new_h) new_h = th;
|
||||
int dh = new_h - old_h;
|
||||
full_height_ += dh; // do this *always*
|
||||
|
||||
bl->icon = icon; // set new icon
|
||||
if (dh>0) {
|
||||
redraw(); // icon larger than item? must redraw widget
|
||||
} else {
|
||||
redraw_line(bl); // icon same or smaller? can redraw just this line
|
||||
}
|
||||
replacing(bl,bl); // recalc Fl_Browser_::max_width et al
|
||||
}
|
||||
|
||||
/**
|
||||
Returns the icon currently defined for \p line.
|
||||
If no icon is defined, NULL is returned.
|
||||
\param[in] line The line whose icon is returned.
|
||||
\returns The icon defined, or NULL if none.
|
||||
*/
|
||||
Fl_Image* Fl_Browser::icon(int line) const {
|
||||
FL_BLINE* l = find_line(line);
|
||||
return(l ? l->icon : NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
Removes the icon for \p line.
|
||||
It's ok to remove an icon if none has been defined.
|
||||
\param[in] line The line whose icon is to be removed.
|
||||
*/
|
||||
void Fl_Browser::remove_icon(int line) {
|
||||
icon(line,0);
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Browser.cxx 6726 2009-03-27 16:52:31Z greg.ercolano $".
|
||||
// End of "$Id: Fl_Browser.cxx 6895 2009-09-21 06:35:08Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Choice.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_Choice.cxx 6873 2009-09-16 07:06:41Z AlbrechtS $"
|
||||
//
|
||||
// Choice widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -209,5 +209,5 @@ int Fl_Choice::handle(int e) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Choice.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_Choice.cxx 6873 2009-09-16 07:06:41Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -128,7 +128,7 @@ HDC fl_makeDC(HBITMAP bitmap) {
|
||||
SetTextAlign(new_gc, TA_BASELINE|TA_LEFT);
|
||||
SetBkMode(new_gc, TRANSPARENT);
|
||||
#if USE_COLORMAP
|
||||
if (fl_palette) SelectPalette(new_gc, fl_palette, false);
|
||||
if (fl_palette) SelectPalette(new_gc, fl_palette, FALSE);
|
||||
#endif
|
||||
SelectObject(new_gc, bitmap);
|
||||
return new_gc;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Browser.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_File_Browser.cxx 6853 2009-09-09 05:16:41Z greg.ercolano $"
|
||||
//
|
||||
// Fl_File_Browser routines.
|
||||
//
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <FL/Fl_File_Browser.H>
|
||||
#include <FL/fl_draw.H>
|
||||
#include <FL/filename.H>
|
||||
#include <FL/Fl_Image.H> // icon
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "flstring.h"
|
||||
@@ -80,11 +81,17 @@
|
||||
#define SELECTED 1
|
||||
#define NOTDISPLAYED 2
|
||||
|
||||
// TODO -- Warning: The definition of FL_BLINE here is a hack.
|
||||
// Fl_File_Browser should not do this. PLEASE FIX.
|
||||
// FL_BLINE should be private to Fl_Browser, and not re-defined here.
|
||||
// For now, make sure this struct is precisely consistent with Fl_Browser.cxx.
|
||||
//
|
||||
struct FL_BLINE // data is in a linked list of these
|
||||
{
|
||||
FL_BLINE *prev; // Previous item in list
|
||||
FL_BLINE *next; // Next item in list
|
||||
void *data; // Pointer to data (function)
|
||||
Fl_Image *icon; // Pointer to optional icon
|
||||
short length; // sizeof(txt)-1, may be longer than string
|
||||
char flags; // selected, displayed
|
||||
char txt[1]; // start of allocated array
|
||||
@@ -635,5 +642,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Browser.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_File_Browser.cxx 6853 2009-09-09 05:16:41Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_File_Chooser2.cxx 6678 2009-03-13 23:36:09Z AlbrechtS $"
|
||||
// "$Id: Fl_File_Chooser2.cxx 6899 2009-09-23 21:32:23Z matt $"
|
||||
//
|
||||
// More Fl_File_Chooser routines.
|
||||
//
|
||||
@@ -858,7 +858,7 @@ Fl_File_Chooser::fileNameCB()
|
||||
}
|
||||
} else {
|
||||
// File doesn't exist, so beep at and alert the user...
|
||||
fl_alert("%s", existing_file_label);
|
||||
fl_alert(existing_file_label);
|
||||
}
|
||||
}
|
||||
else if (Fl::event_key() != FL_Delete &&
|
||||
@@ -1046,7 +1046,7 @@ Fl_File_Chooser::newdir()
|
||||
|
||||
|
||||
// Get a directory name from the user
|
||||
if ((dir = fl_input("%s", new_directory_label, (char *)NULL)) == NULL)
|
||||
if ((dir = fl_input(new_directory_label, NULL)) == NULL)
|
||||
return;
|
||||
|
||||
// Make it relative to the current directory as needed...
|
||||
@@ -1213,7 +1213,7 @@ Fl_File_Chooser::showChoiceCB()
|
||||
item = showChoice->text(showChoice->value());
|
||||
|
||||
if (strcmp(item, custom_filter_label) == 0) {
|
||||
if ((item = fl_input("%s",custom_filter_label, pattern_)) != NULL) {
|
||||
if ((item = fl_input(custom_filter_label, pattern_)) != NULL) {
|
||||
strlcpy(pattern_, item, sizeof(pattern_));
|
||||
|
||||
quote_pathname(temp, item, sizeof(temp));
|
||||
@@ -1332,10 +1332,37 @@ Fl_File_Chooser::update_preview()
|
||||
window->cursor(FL_CURSOR_DEFAULT);
|
||||
Fl::check();
|
||||
|
||||
// Scan the buffer for printable chars...
|
||||
for (ptr = preview_text_;
|
||||
// Scan the buffer for printable UTF8 chars...
|
||||
for (ptr = preview_text_; *ptr; ptr++) {
|
||||
uchar c = uchar(*ptr);
|
||||
if ( (c&0x80)==0 ) {
|
||||
if (!isprint(c&255) && !isspace(c&255)) break;
|
||||
} else if ( (c&0xe0)==0xc0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
} else if ( (c&0xf0)==0xe0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
} else if ( (c&0xf8)==0xf0 ) {
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
if (ptr[1] && (ptr[1]&0xc0)!=0x80) break;
|
||||
ptr++;
|
||||
}
|
||||
}
|
||||
// *ptr && (isprint(*ptr & 255) || isspace(*ptr & 255));
|
||||
// ptr ++);
|
||||
|
||||
// Scan the buffer for printable characters in 8 bit
|
||||
if (*ptr || ptr == preview_text_) {
|
||||
for (ptr = preview_text_;
|
||||
*ptr && (isprint(*ptr & 255) || isspace(*ptr & 255));
|
||||
ptr ++);
|
||||
}
|
||||
|
||||
if (*ptr || ptr == preview_text_) {
|
||||
// Non-printable file, just show a big ?...
|
||||
@@ -1589,5 +1616,5 @@ unquote_pathname(char *dst, // O - Destination string
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_File_Chooser2.cxx 6678 2009-03-13 23:36:09Z AlbrechtS $".
|
||||
// End of "$Id: Fl_File_Chooser2.cxx 6899 2009-09-23 21:32:23Z matt $".
|
||||
//
|
||||
|
||||
@@ -144,7 +144,7 @@ void Fl_File_Input::update_buttons() {
|
||||
\param[in] str new string value
|
||||
\param[in] len lengh of value
|
||||
*/
|
||||
int // O - true on success
|
||||
int // O - TRUE on success
|
||||
Fl_File_Input::value(const char *str, // I - New string value
|
||||
int len) { // I - Length of value
|
||||
damage(FL_DAMAGE_BAR);
|
||||
@@ -157,7 +157,7 @@ Fl_File_Input::value(const char *str, // I - New string value
|
||||
Returns non 0 on success.
|
||||
\param[in] str new string value
|
||||
*/
|
||||
int // O - true on success
|
||||
int // O - TRUE on success
|
||||
Fl_File_Input::value(const char *str) { // I - New string value
|
||||
damage(FL_DAMAGE_BAR);
|
||||
return Fl_Input::value(str);
|
||||
@@ -187,7 +187,7 @@ void Fl_File_Input::draw() {
|
||||
Return non zero if event is handled.
|
||||
\param[in] event
|
||||
*/
|
||||
int // O - true if we handled event
|
||||
int // O - TRUE if we handled event
|
||||
Fl_File_Input::handle(int event) // I - Event
|
||||
{
|
||||
// printf("handle(event = %d)\n", event);
|
||||
@@ -230,7 +230,7 @@ Fl_File_Input::handle(int event) // I - Event
|
||||
Return non zero if event is handled.
|
||||
\param[in] event
|
||||
*/
|
||||
int // O - true if we handled event
|
||||
int // O - TRUE if we handled event
|
||||
Fl_File_Input::handle_button(int event) // I - Event
|
||||
{
|
||||
int i, // Looping var
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Image.cxx 6773 2009-04-21 09:25:22Z AlbrechtS $"
|
||||
// "$Id: Fl_Image.cxx 6804 2009-06-29 07:44:25Z AlbrechtS $"
|
||||
//
|
||||
// Image drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -551,5 +551,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Image.cxx 6773 2009-04-21 09:25:22Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Image.cxx 6804 2009-06-29 07:44:25Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Input.cxx 6888 2009-09-19 21:16:21Z matt $"
|
||||
//
|
||||
// Input widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -621,6 +621,18 @@ int Fl_Input::handle(int event) {
|
||||
take_focus();
|
||||
return 1;
|
||||
|
||||
/* TODO: this will scroll the area, but stop if the cursor would become invisible.
|
||||
That clipping happens in drawtext(). Do we change the clipping or should
|
||||
we move the cursor (ouch)?
|
||||
case FL_MOUSEWHEEL:
|
||||
if (Fl::e_dy > 0) {
|
||||
yscroll( yscroll() - Fl::e_dy*15 );
|
||||
} else if (Fl::e_dy < 0) {
|
||||
yscroll( yscroll() - Fl::e_dy*15 );
|
||||
}
|
||||
return 1;
|
||||
*/
|
||||
|
||||
}
|
||||
Fl_Boxtype b = box();
|
||||
return Fl_Input_::handletext(event,
|
||||
@@ -637,5 +649,5 @@ Fl_Input::Fl_Input(int X, int Y, int W, int H, const char *l)
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Input.cxx 6888 2009-09-19 21:16:21Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Input_.cxx 6777 2009-04-23 15:32:19Z matt $"
|
||||
// "$Id: Fl_Input_.cxx 6887 2009-09-19 20:57:48Z matt $"
|
||||
//
|
||||
// Common input widget routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -134,7 +134,7 @@ double Fl_Input_::expandpos(
|
||||
if (c < ' ' || c == 127) {
|
||||
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) {
|
||||
n += 8-(chr%8);
|
||||
chr += 8-(chr%8);
|
||||
chr += 7-(chr%8);
|
||||
} else n += 2;
|
||||
} else {
|
||||
n++;
|
||||
@@ -239,6 +239,7 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
|
||||
// count how many lines and put the last one into the buffer:
|
||||
// And figure out where the cursor is:
|
||||
int height = fl_height();
|
||||
int threshold = height/2;
|
||||
int lines;
|
||||
int curx, cury;
|
||||
for (p=value(), curx=cury=lines=0; ;) {
|
||||
@@ -248,15 +249,15 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
|
||||
if (Fl::focus()==this && !was_up_down) up_down_pos = curx;
|
||||
cury = lines*height;
|
||||
int newscroll = xscroll_;
|
||||
if (curx > newscroll+W-20) {
|
||||
if (curx > newscroll+W-threshold) {
|
||||
// figure out scrolling so there is space after the cursor:
|
||||
newscroll = curx+20-W;
|
||||
newscroll = curx+threshold-W;
|
||||
// figure out the furthest left we ever want to scroll:
|
||||
int ex = int(expandpos(p, e, buf, 0))+2-W;
|
||||
// use minimum of both amounts:
|
||||
if (ex < newscroll) newscroll = ex;
|
||||
} else if (curx < newscroll+20) {
|
||||
newscroll = curx-20;
|
||||
} else if (curx < newscroll+threshold) {
|
||||
newscroll = curx-threshold;
|
||||
}
|
||||
if (newscroll < 0) newscroll = 0;
|
||||
if (newscroll != xscroll_) {
|
||||
@@ -1253,5 +1254,5 @@ Fl_Char Fl_Input_::index(int i) const
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Input_.cxx 6777 2009-04-23 15:32:19Z matt $".
|
||||
// End of "$Id: Fl_Input_.cxx 6887 2009-09-19 20:57:48Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu.cxx 6757 2009-04-12 20:00:45Z matt $"
|
||||
// "$Id: Fl_Menu.cxx 6841 2009-08-03 06:26:32Z AlbrechtS $"
|
||||
//
|
||||
// Menu code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1014,5 +1014,5 @@ const Fl_Menu_Item* Fl_Menu_Item::test_shortcut() const {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu.cxx 6757 2009-04-12 20:00:45Z matt $".
|
||||
// End of "$Id: Fl_Menu.cxx 6841 2009-08-03 06:26:32Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $"
|
||||
// "$Id: Fl_Menu_.cxx 6904 2009-09-27 11:39:02Z matt $"
|
||||
//
|
||||
// Common menu code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -172,11 +172,11 @@ void Fl_Menu_Item::setonly() {
|
||||
}
|
||||
}
|
||||
|
||||
Fl_Menu_::Fl_Menu_(int X,int Y,int W,int H,const char* l)
|
||||
/**
|
||||
Creates a new Fl_Menu_ widget using the given position, size,
|
||||
and label string. menu() is initialized to null.
|
||||
*/
|
||||
Creates a new Fl_Menu_ widget using the given position, size,
|
||||
and label string. menu() is initialized to null.
|
||||
*/
|
||||
Fl_Menu_::Fl_Menu_(int X,int Y,int W,int H,const char* l)
|
||||
: Fl_Widget(X,Y,W,H,l) {
|
||||
set_flag(SHORTCUT_LABEL);
|
||||
box(FL_UP_BOX);
|
||||
@@ -262,5 +262,5 @@ void Fl_Menu_::clear() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Menu_.cxx 6904 2009-09-27 11:39:02Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Menu_add.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: Fl_Menu_add.cxx 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Menu utilities for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -177,56 +177,95 @@ int Fl_Menu_Item::add(
|
||||
}
|
||||
|
||||
/**
|
||||
Adds a new menu item, with a title string, shortcut int (or string),
|
||||
callback, argument to the callback, and flags.
|
||||
Adds a new menu item.
|
||||
|
||||
\param[in] label The text label for the menu item.
|
||||
\param[in] shortcut Optional keyboard shortcut that can be an int or string; (FL_CTRL+'a') or "^a". Default 0 if none.
|
||||
\param[in] callback Optional callback invoked when user clicks the item. Default 0 if none.
|
||||
\param[in] userdata Optional user data passed as an argument to the callback. Default 0 if none.
|
||||
\param[in] flags Optional flags that control the type of menu item; see below. Default is 0 for none.
|
||||
\returns The index into the menu() array, where the entry was added.
|
||||
|
||||
\par Description
|
||||
If the menu array was directly set with menu(x), then copy() is done
|
||||
to make a private array.
|
||||
|
||||
The characters "&", "/", "\", and "_" are treated as
|
||||
special characters in the label string. The "&" character
|
||||
specifies that the following character is an accelerator and
|
||||
will be underlined. The "\" character is used to escape the next
|
||||
character in the string. Labels starting with the "_" character
|
||||
cause a divider to be placed after that menu item.
|
||||
|
||||
A label of the form "foo/bar/baz" will create submenus called
|
||||
"foo" and "bar" with an entry called "baz". The "/" character is
|
||||
ignored if it appears as the first character of the label string, e.g.
|
||||
"/foo/bar/baz".
|
||||
|
||||
\par
|
||||
A menu item's callback must not add() items to its parent menu during the callback.
|
||||
|
||||
<B>Detailed Description of Parameters</B>
|
||||
\par label
|
||||
The menu item's label. This option is required.
|
||||
\par
|
||||
The characters "&", "/", "\", and "_" are treated as special characters in the label string.
|
||||
The "&" character specifies that the following character is an accelerator and will be underlined.
|
||||
The "\" character is used to escape the next character in the string.
|
||||
Labels starting with the "_" character cause a divider to be placed after that menu item.
|
||||
\par
|
||||
A label of the form "File/Quit" will create the submenu "File"
|
||||
with a menu item called "Quit". The "/" character is ignored if it appears
|
||||
as the first character of the label string, e.g. "/File/Quit".
|
||||
\par
|
||||
The label string is copied to new memory and can be freed.
|
||||
The other arguments (including the shortcut) are copied into the
|
||||
menu item unchanged.
|
||||
|
||||
\par
|
||||
If an item exists already with that name then it is replaced with
|
||||
this new one. Otherwise this new one is added to the end of the
|
||||
correct menu or submenu. The return value is the offset into the array
|
||||
that the new entry was placed at.
|
||||
|
||||
\par shortcut
|
||||
The keyboard shortcut for this menu item.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 to indicate no shortcut.
|
||||
\par
|
||||
Shortcut can be 0L, or either a modifier/key combination (for example
|
||||
FL_CTRL+'A') or a string describing the shortcut in one of two ways:
|
||||
|
||||
\code
|
||||
\verbatim
|
||||
[#+^]<ascii_value> e.g. "97", "^97", "+97", "#97"
|
||||
[#+^]<ascii_char> e.g. "a", "^a", "+a", "#a"
|
||||
\endcode
|
||||
\endverbatim
|
||||
..where \<ascii_value\> is a decimal value representing an
|
||||
ascii character (eg. 97 is the ascii for 'a'), and the optional
|
||||
prefixes enhance the value that follows. Multiple prefixes must
|
||||
appear in the above order.
|
||||
\code
|
||||
\verbatim
|
||||
# - Alt
|
||||
+ - Shift
|
||||
^ - Control
|
||||
\endcode
|
||||
\endverbatim
|
||||
Text shortcuts are converted to integer shortcut by calling
|
||||
int fl_old_shortcut(const char*).
|
||||
|
||||
The return value is the index into the array that the entry was put.
|
||||
|
||||
No items must be added to a menu during a callback to the same menu.
|
||||
Fl_Shortcut fl_old_shortcut(const char*).
|
||||
|
||||
\par callback
|
||||
The callback to invoke when this menu item is selected.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 for no callback.
|
||||
|
||||
\par userdata
|
||||
The callback's 'user data' that is passed to the callback.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0.
|
||||
|
||||
\par flags
|
||||
These are bit flags to define what kind of menu item this is.
|
||||
\par
|
||||
This parameter is optional, and defaults to 0 to define a 'regular' menu item.
|
||||
\par
|
||||
These flags can be 'OR'ed together:
|
||||
\code
|
||||
FL_MENU_INACTIVE // Deactivate menu item (gray out)
|
||||
FL_MENU_TOGGLE // Item is a checkbox toggle (shows checkbox for on/off state)
|
||||
FL_MENU_VALUE // The on/off state for checkbox/radio buttons (if set, state is 'on')
|
||||
FL_MENU_RADIO // Item is a radio button (one checkbox of many can be on)
|
||||
FL_MENU_INVISIBLE // Item will not show up (shortcut will work)
|
||||
FL_SUBMENU_POINTER // Indicates user_data() is a pointer to another menu array
|
||||
FL_SUBMENU // This item is a submenu to other items
|
||||
FL_MENU_DIVIDER // Creates divider line below this item. Also ends a group of radio buttons.
|
||||
\endcode
|
||||
|
||||
*/
|
||||
int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
|
||||
int Fl_Menu_::add(const char *label,int shortcut,Fl_Callback *callback,void *userdata,int flags) {
|
||||
// make this widget own the local array:
|
||||
if (this != fl_menu_array_owner) {
|
||||
if (fl_menu_array_owner) {
|
||||
@@ -260,7 +299,7 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
|
||||
}
|
||||
fl_menu_array_owner = this;
|
||||
}
|
||||
int r = menu_->add(t,s,c,v,f);
|
||||
int r = menu_->add(label,shortcut,callback,userdata,flags);
|
||||
// if it rellocated array we must fix the pointer:
|
||||
int value_offset = value_-menu_;
|
||||
menu_ = local_array; // in case it reallocated it
|
||||
@@ -335,5 +374,5 @@ void Fl_Menu_::remove(int i) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Menu_add.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: Fl_Menu_add.cxx 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Progress.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: Fl_Progress.cxx 6794 2009-06-27 09:29:36Z AlbrechtS $"
|
||||
//
|
||||
// Progress bar widget routines.
|
||||
//
|
||||
@@ -119,5 +119,5 @@ Fl_Progress::Fl_Progress(int X, int Y, int W, int H, const char* L)
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Progress.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: Fl_Progress.cxx 6794 2009-06-27 09:29:36Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Scroll.cxx 6654 2009-02-08 18:47:37Z AlbrechtS $"
|
||||
// "$Id: Fl_Scroll.cxx 6828 2009-07-12 00:15:06Z greg.ercolano $"
|
||||
//
|
||||
// Scroll widget for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -413,5 +413,5 @@ int Fl_Scroll::handle(int event) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Scroll.cxx 6654 2009-02-08 18:47:37Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Scroll.cxx 6828 2009-07-12 00:15:06Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Buffer.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Buffer.cxx 6825 2009-07-04 05:18:29Z fabien $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -2502,5 +2502,5 @@ Fl_Text_Buffer::outputfile(const char *file, int start, int end, int buflen) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Buffer.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Buffer.cxx 6825 2009-07-04 05:18:29Z fabien $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Display.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Display.cxx 6909 2009-09-28 14:41:43Z matt $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -387,8 +387,8 @@ void Fl_Text_Display::resize(int X, int Y, int W, int H) {
|
||||
mMaxsize = max(mMaxsize, fl_height(mStyleTable[i].font, mStyleTable[i].size));
|
||||
|
||||
// did we have scrollbars initially?
|
||||
int hscrollbarvisible = mHScrollBar->visible();
|
||||
int vscrollbarvisible = mVScrollBar->visible();
|
||||
unsigned int hscrollbarvisible = mHScrollBar->visible();
|
||||
unsigned int vscrollbarvisible = mVScrollBar->visible();
|
||||
|
||||
// try without scrollbars first
|
||||
mVScrollBar->clear_visible();
|
||||
@@ -3439,5 +3439,5 @@ int Fl_Text_Display::handle(int event) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Display.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Display.cxx 6909 2009-09-28 14:41:43Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Text_Editor.cxx 6765 2009-04-15 08:35:28Z matt $"
|
||||
// "$Id: Fl_Text_Editor.cxx 6894 2009-09-20 21:55:21Z greg.ercolano $"
|
||||
//
|
||||
// Copyright 2001-2009 by Bill Spitzak and others.
|
||||
// Original code Copyright Mark Edel. Permission to distribute under
|
||||
@@ -156,6 +156,14 @@ static struct {
|
||||
{ 'c', FL_COMMAND, Fl_Text_Editor::kf_copy },
|
||||
{ 'v', FL_COMMAND, Fl_Text_Editor::kf_paste },
|
||||
{ 'a', FL_COMMAND, Fl_Text_Editor::kf_select_all },
|
||||
{ FL_Left, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Right, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Up, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Down, FL_COMMAND, Fl_Text_Editor::kf_meta_move },
|
||||
{ FL_Left, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Right, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Up, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
{ FL_Down, FL_COMMAND|FL_SHIFT, Fl_Text_Editor::kf_m_s_move },
|
||||
#endif // __APPLE__
|
||||
|
||||
{ 0, 0, 0 }
|
||||
@@ -352,6 +360,40 @@ int Fl_Text_Editor::kf_ctrl_move(int c, Fl_Text_Editor* e) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Moves the current text cursor in the direction indicated by meta key */
|
||||
int Fl_Text_Editor::kf_meta_move(int c, Fl_Text_Editor* e) {
|
||||
if (!e->buffer()->selected())
|
||||
e->dragPos = e->insert_position();
|
||||
if (c != FL_Up && c != FL_Down) {
|
||||
e->buffer()->unselect();
|
||||
e->show_insert_position();
|
||||
}
|
||||
switch (c) {
|
||||
case FL_Up: // top of buffer
|
||||
e->insert_position(0);
|
||||
e->scroll(0, 0);
|
||||
break;
|
||||
case FL_Down: // end of buffer
|
||||
e->insert_position(e->buffer()->length());
|
||||
e->scroll(e->count_lines(0, e->buffer()->length(), 1), 0);
|
||||
break;
|
||||
case FL_Left: // beginning of line
|
||||
kf_move(FL_Home, e);
|
||||
break;
|
||||
case FL_Right: // end of line
|
||||
kf_move(FL_End, e);
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Extends the current selection in the direction indicated by meta key c. */
|
||||
int Fl_Text_Editor::kf_m_s_move(int c, Fl_Text_Editor* e) {
|
||||
kf_meta_move(c, e);
|
||||
fl_text_drag_me(e->insert_position(), e);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** Extends the current selection in the direction indicated by control key c. */
|
||||
int Fl_Text_Editor::kf_c_s_move(int c, Fl_Text_Editor* e) {
|
||||
kf_ctrl_move(c, e);
|
||||
@@ -572,5 +614,5 @@ int Fl_Text_Editor::handle(int event) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Text_Editor.cxx 6765 2009-04-15 08:35:28Z matt $".
|
||||
// End of "$Id: Fl_Text_Editor.cxx 6894 2009-09-20 21:55:21Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Tooltip.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $"
|
||||
// "$Id: Fl_Tooltip.cxx 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Tooltip source file for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -34,10 +34,10 @@
|
||||
float Fl_Tooltip::delay_ = 1.0f;
|
||||
float Fl_Tooltip::hoverdelay_ = 0.2f;
|
||||
int Fl_Tooltip::enabled_ = 1;
|
||||
unsigned Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
|
||||
Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
|
||||
FL_NUM_GREEN - 1,
|
||||
FL_NUM_BLUE - 2);
|
||||
unsigned Fl_Tooltip::textcolor_ = FL_BLACK;
|
||||
Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
|
||||
Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
|
||||
Fl_Fontsize Fl_Tooltip::size_ = FL_NORMAL_SIZE;
|
||||
|
||||
@@ -278,5 +278,5 @@ void Fl_Widget::tooltip(const char *tt) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Tooltip.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Tooltip.cxx 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window.cxx 6669 2009-02-25 08:44:54Z AlbrechtS $"
|
||||
// "$Id: Fl_Window.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// Window widget class for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -66,7 +66,7 @@ Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l)
|
||||
cursor_bg = FL_WHITE;
|
||||
|
||||
_Fl_Window();
|
||||
set_flag(FL_FORCE_POSITION);
|
||||
set_flag(FORCE_POSITION);
|
||||
}
|
||||
|
||||
Fl_Window::Fl_Window(int W, int H, const char *l)
|
||||
@@ -151,8 +151,7 @@ void Fl_Window::copy_label(const char *a) {
|
||||
|
||||
|
||||
void Fl_Window::iconlabel(const char *iname) {
|
||||
// FIXME: 'flags' is 32 bit large!
|
||||
uchar saveflags = flags();
|
||||
unsigned saveflags = flags();
|
||||
label(label(), iname);
|
||||
set_flag(saveflags);
|
||||
}
|
||||
@@ -179,5 +178,5 @@ Fl_Window *Fl_Window::current() {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window.cxx 6669 2009-02-25 08:44:54Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Window.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_Window_fullscreen.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $"
|
||||
// "$Id: Fl_Window_fullscreen.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// Fullscreen window support for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -43,10 +43,10 @@
|
||||
void Fl_Window::border(int b) {
|
||||
if (b) {
|
||||
if (border()) return;
|
||||
clear_flag(FL_NOBORDER);
|
||||
clear_flag(NOBORDER);
|
||||
} else {
|
||||
if (!border()) return;
|
||||
set_flag(FL_NOBORDER);
|
||||
set_flag(NOBORDER);
|
||||
}
|
||||
#if defined(USE_X11)
|
||||
if (shown()) Fl_X::i(this)->sendxjunk();
|
||||
@@ -91,5 +91,5 @@ void Fl_Window::fullscreen_off(int X,int Y,int W,int H) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx 6660 2009-02-15 18:58:03Z AlbrechtS $".
|
||||
// End of "$Id: Fl_Window_fullscreen.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_arg.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $"
|
||||
// "$Id: Fl_arg.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $"
|
||||
//
|
||||
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -538,5 +538,5 @@ int XParseGeometry(const char* string, int* x, int* y,
|
||||
#endif // ifdef WIN32
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_arg.cxx 6712 2009-03-22 19:21:34Z AlbrechtS $".
|
||||
// End of "$Id: Fl_arg.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_mac.cxx 6758 2009-04-13 07:32:01Z matt $"
|
||||
// "$Id: Fl_mac.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// MacOS specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1496,10 +1496,10 @@ void fl_open_display() {
|
||||
beenHereDoneThat = 1;
|
||||
|
||||
FlushEvents(everyEvent,0);
|
||||
|
||||
|
||||
MoreMasters(); // \todo Carbon suggests MoreMasterPointers()
|
||||
AEInstallEventHandler( kCoreEventClass, kAEQuitApplication, NewAEEventHandlerUPP((AEEventHandlerProcPtr)QuitAppleEventHandler), 0, false );
|
||||
|
||||
|
||||
// create the Mac Handle for the default cursor (a pointer to a pointer)
|
||||
GetQDGlobalsArrow(&default_cursor);
|
||||
default_cursor_ptr = &default_cursor;
|
||||
@@ -1508,12 +1508,12 @@ void fl_open_display() {
|
||||
ClearMenuBar();
|
||||
AppendResMenu( GetMenuHandle( 1 ), 'DRVR' );
|
||||
DrawMenuBar();
|
||||
|
||||
|
||||
// bring the application into foreground without a 'CARB' resource
|
||||
Boolean same_psn;
|
||||
ProcessSerialNumber cur_psn, front_psn;
|
||||
if( !GetCurrentProcess( &cur_psn ) && !GetFrontProcess( &front_psn ) &&
|
||||
!SameProcess( &front_psn, &cur_psn, &same_psn ) && !same_psn )
|
||||
!SameProcess( &front_psn, &cur_psn, &same_psn ) && !same_psn )
|
||||
{
|
||||
// only transform the application type for unbundled apps
|
||||
CFBundleRef bundle = CFBundleGetMainBundle();
|
||||
@@ -1522,35 +1522,16 @@ void fl_open_display() {
|
||||
FSRef execFs;
|
||||
CFURLRef execUrl = CFBundleCopyExecutableURL( bundle );
|
||||
CFURLGetFSRef( execUrl, &execFs );
|
||||
|
||||
|
||||
FSRef bundleFs;
|
||||
GetProcessBundleLocation( &cur_psn, &bundleFs );
|
||||
|
||||
|
||||
if( !FSCompareFSRefs( &execFs, &bundleFs ) )
|
||||
bundle = NULL;
|
||||
|
||||
|
||||
CFRelease(execUrl);
|
||||
}
|
||||
|
||||
// imm: keycode handler stub setting - use Gestalt to determine the running system version,
|
||||
// then set the keycode_function pointer accordingly
|
||||
SInt32 MacVersion;
|
||||
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
|
||||
{
|
||||
// SInt32 maj, min, fix;
|
||||
// Gestalt(gestaltSystemVersionMajor, &maj); // e.g. 10
|
||||
// Gestalt(gestaltSystemVersionMinor, &min); // e.g. 4
|
||||
// Gestalt(gestaltSystemVersionBugFix, &fix); // e.g. 11
|
||||
if(MacVersion >= 0x1050) { // 10.5.0 or later
|
||||
keycode_function = keycodeToUnicode;
|
||||
}
|
||||
else {
|
||||
keycode_function = keycode_wrap_old; // pre-10.5 mechanism
|
||||
}
|
||||
}
|
||||
// else our default handler will be used (keycode_wrap_old)
|
||||
|
||||
|
||||
|
||||
if( !bundle )
|
||||
{
|
||||
// Earlier versions of this code tried to use weak linking, however it
|
||||
@@ -1558,19 +1539,30 @@ void fl_open_display() {
|
||||
// both TransformProcessType and CPSEnableForegroundOperation, the following
|
||||
// conditional code compiled on 10.2 will still work on newer releases...
|
||||
OSErr err;
|
||||
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||
if (TransformProcessType != NULL) {
|
||||
err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
|
||||
} else
|
||||
err = TransformProcessType(&cur_psn, kProcessTransformToForegroundApplication);
|
||||
} else
|
||||
#endif // MAC_OS_X_VERSION_MAX_ALLOWED > MAC_OS_X_VERSION_10_2
|
||||
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
|
||||
|
||||
err = CPSEnableForegroundOperation(&cur_psn, 0x03, 0x3C, 0x2C, 0x1103);
|
||||
|
||||
if (err == noErr) {
|
||||
SetFrontProcess( &cur_psn );
|
||||
SetFrontProcess( &cur_psn );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// imm: keycode handler stub setting - use Gestalt to determine the running system version,
|
||||
// then set the keycode_function pointer accordingly
|
||||
keycode_function = keycode_wrap_old; // default to pre-10.5 mechanism
|
||||
SInt32 MacVersion;
|
||||
if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)
|
||||
{
|
||||
if(MacVersion >= 0x1050) { // 10.5.0 or later
|
||||
keycode_function = keycodeToUnicode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2185,7 +2177,7 @@ void Fl_X::make(Fl_Window* w)
|
||||
wp += 2*bx;
|
||||
hp += 2*by+bt;
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
// use the Carbon functions below for default window positioning
|
||||
w->x(xyPos+Fl::x());
|
||||
w->y(xyPos+Fl::y());
|
||||
@@ -2232,7 +2224,7 @@ void Fl_X::make(Fl_Window* w)
|
||||
SetWindowClass(x->xid, kFloatingWindowClass);
|
||||
SetWindowActivationScope(x->xid, kWindowActivationScopeAll);
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION))
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION))
|
||||
{
|
||||
WindowRef pw = Fl_X::first ? Fl_X::first->xid : 0 ;
|
||||
if (w->modal()) {
|
||||
@@ -2412,7 +2404,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
// printf("Fl_Winodw::resize(X=%d, Y=%d, W=%d, H=%d), is_a_resize=%d, resize_from_system=%p, this=%p\n",
|
||||
// X, Y, W, H, is_a_resize, resize_from_system, this);
|
||||
if (X != x() || Y != y()) set_flag(FL_FORCE_POSITION);
|
||||
if (X != x() || Y != y()) set_flag(FORCE_POSITION);
|
||||
else if (!is_a_resize) return;
|
||||
if ( (resize_from_system!=this) && (!parent()) && shown()) {
|
||||
if (is_a_resize) {
|
||||
@@ -2881,5 +2873,5 @@ void MacUnmapWindow(Fl_Window *w, WindowPtr p) {
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_mac.cxx 6758 2009-04-13 07:32:01Z matt $".
|
||||
// End of "$Id: Fl_mac.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_win32.cxx 6668 2009-02-21 10:18:47Z AlbrechtS $"
|
||||
// "$Id: Fl_win32.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// WIN32-specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -398,7 +398,7 @@ int fl_wait(double time_to_wait) {
|
||||
|
||||
time_to_wait = (time_to_wait > 10000 ? 10000 : time_to_wait);
|
||||
int t_msec = (int) (time_to_wait * 1000.0 + 0.5);
|
||||
MsgWaitForMultipleObjects(0, NULL, false, t_msec, QS_ALLINPUT);
|
||||
MsgWaitForMultipleObjects(0, NULL, FALSE, t_msec, QS_ALLINPUT);
|
||||
|
||||
fl_lock_function();
|
||||
|
||||
@@ -1127,7 +1127,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||
#if USE_COLORMAP
|
||||
case WM_QUERYNEWPALETTE :
|
||||
fl_GetDC(hWnd);
|
||||
if (fl_select_palette()) InvalidateRect(hWnd, NULL, false);
|
||||
if (fl_select_palette()) InvalidateRect(hWnd, NULL, FALSE);
|
||||
break;
|
||||
|
||||
case WM_PALETTECHANGED:
|
||||
@@ -1215,7 +1215,7 @@ int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int &by)
|
||||
r.right = w->x()+w->w();
|
||||
r.bottom = w->y()+w->h();
|
||||
// get the decoration rectangle for the desired client rectangle
|
||||
BOOL ok = AdjustWindowRectEx(&r, style, false, exstyle);
|
||||
BOOL ok = AdjustWindowRectEx(&r, style, FALSE, exstyle);
|
||||
if (ok) {
|
||||
X = r.left;
|
||||
Y = r.top;
|
||||
@@ -1292,7 +1292,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (X != x() || Y != y()) {
|
||||
set_flag(FL_FORCE_POSITION);
|
||||
set_flag(FORCE_POSITION);
|
||||
} else {
|
||||
if (!is_a_resize) return;
|
||||
flags |= SWP_NOMOVE;
|
||||
@@ -1474,7 +1474,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
wp += 2*bx;
|
||||
hp += 2*by+bt;
|
||||
}
|
||||
if (!(w->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(w->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
xp = yp = CW_USEDEFAULT;
|
||||
} else {
|
||||
if (!Fl::grab()) {
|
||||
@@ -1557,7 +1557,7 @@ Fl_X* Fl_X::make(Fl_Window* w) {
|
||||
CoCreateInstance(CLSID_CActiveIMM, NULL, CLSCTX_INPROC_SERVER,
|
||||
IID_IActiveIMMApp, (void**) &fl_aimm);
|
||||
if (fl_aimm) {
|
||||
fl_aimm->Activate(true);
|
||||
fl_aimm->Activate(TRUE);
|
||||
}
|
||||
}
|
||||
#endif // !__GNUC__ || __GNUC__ >= 3
|
||||
@@ -1916,5 +1916,5 @@ void fl_cleanup_dc_list(void) { // clean up the list
|
||||
#endif // FL_DOXYGEN
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_win32.cxx 6668 2009-02-21 10:18:47Z AlbrechtS $".
|
||||
// End of "$Id: Fl_win32.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: Fl_x.cxx 6767 2009-04-16 22:23:36Z AlbrechtS $"
|
||||
// "$Id: Fl_x.cxx 6905 2009-09-27 12:06:35Z matt $"
|
||||
//
|
||||
// X specific code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -1352,7 +1352,7 @@ void Fl_Window::resize(int X,int Y,int W,int H) {
|
||||
int is_a_resize = (W != w() || H != h());
|
||||
int resize_from_program = (this != resize_bug_fix);
|
||||
if (!resize_from_program) resize_bug_fix = 0;
|
||||
if (is_a_move && resize_from_program) set_flag(FL_FORCE_POSITION);
|
||||
if (is_a_move && resize_from_program) set_flag(FORCE_POSITION);
|
||||
else if (!is_a_resize && !is_a_move) return;
|
||||
if (is_a_resize) {
|
||||
Fl_Group::resize(X,Y,W,H);
|
||||
@@ -1430,7 +1430,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap)
|
||||
if (!win->parent() && !Fl::grab()) {
|
||||
// center windows in case window manager does not do anything:
|
||||
#ifdef FL_CENTER_WINDOWS
|
||||
if (!(win->flags() & Fl_Window::FL_FORCE_POSITION)) {
|
||||
if (!(win->flags() & Fl_Widget::FORCE_POSITION)) {
|
||||
win->x(X = scr_x+(scr_w-W)/2);
|
||||
win->y(Y = scr_y+(scr_h-H)/2);
|
||||
}
|
||||
@@ -1636,7 +1636,7 @@ void Fl_X::sendxjunk() {
|
||||
prop[1] = 1|2|16; // MWM_FUNC_ALL | MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE
|
||||
}
|
||||
|
||||
if (w->flags() & Fl_Window::FL_FORCE_POSITION) {
|
||||
if (w->flags() & Fl_Widget::FORCE_POSITION) {
|
||||
hints->flags |= USPosition;
|
||||
hints->x = w->x();
|
||||
hints->y = w->y();
|
||||
@@ -1741,5 +1741,5 @@ void Fl_Window::make_current() {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: Fl_x.cxx 6767 2009-04-16 22:23:36Z AlbrechtS $".
|
||||
// End of "$Id: Fl_x.cxx 6905 2009-09-27 12:06:35Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_ask.cxx 6763 2009-04-13 22:47:21Z AlbrechtS $"
|
||||
// "$Id: fl_ask.cxx 6869 2009-09-13 21:57:46Z AlbrechtS $"
|
||||
//
|
||||
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -215,8 +215,7 @@ static int innards(const char* fmt, va_list ap,
|
||||
message_form->show();
|
||||
// deactivate Fl::grab(), because it is incompatible with Fl::readqueue()
|
||||
Fl_Window* g = Fl::grab();
|
||||
if (g) // do an alternative grab to avoid floating menus, if possible
|
||||
Fl::grab(message_form);
|
||||
if (g) Fl::grab(0);
|
||||
int r = 0;
|
||||
for (;;) {
|
||||
Fl_Widget *o = Fl::readqueue();
|
||||
@@ -461,5 +460,5 @@ const char *fl_password(const char *fmt, const char *defstr, ...) {
|
||||
/** @} */
|
||||
|
||||
//
|
||||
// End of "$Id: fl_ask.cxx 6763 2009-04-13 22:47:21Z AlbrechtS $".
|
||||
// End of "$Id: fl_ask.cxx 6869 2009-09-13 21:57:46Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_boxtype.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: fl_boxtype.cxx 6902 2009-09-27 11:06:56Z matt $"
|
||||
//
|
||||
// Box drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -406,7 +406,7 @@ void Fl_Widget::draw_box() const {
|
||||
// if (t == FL_FLAT_BOX) return;
|
||||
// t += 2; // convert box to frame
|
||||
// }
|
||||
draw_box((Fl_Boxtype)t, x_, y_, w_, h_, (Fl_Color)color_);
|
||||
draw_box((Fl_Boxtype)t, x_, y_, w_, h_, color_);
|
||||
}
|
||||
/** Draws a box of type t, of color c at the widget's position and size. */
|
||||
void Fl_Widget::draw_box(Fl_Boxtype t, Fl_Color c) const {
|
||||
@@ -420,5 +420,5 @@ void Fl_Widget::draw_box(Fl_Boxtype t, int X, int Y, int W, int H, Fl_Color c) c
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_boxtype.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: fl_boxtype.cxx 6902 2009-09-27 11:06:56Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_color.cxx 6716 2009-03-24 01:40:44Z fabien $"
|
||||
// "$Id: fl_color.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $"
|
||||
//
|
||||
// Color functions for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -484,5 +484,5 @@ Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg) {
|
||||
@}
|
||||
*/
|
||||
//
|
||||
// End of "$Id: fl_color.cxx 6716 2009-03-24 01:40:44Z fabien $".
|
||||
// End of "$Id: fl_color.cxx 6813 2009-07-01 07:32:14Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -241,7 +241,7 @@ fl_select_palette(void)
|
||||
fl_palette = CreatePalette(pPal);
|
||||
}
|
||||
if (fl_palette) {
|
||||
SelectPalette(fl_gc, fl_palette, false);
|
||||
SelectPalette(fl_gc, fl_palette, FALSE);
|
||||
RealizePalette(fl_gc);
|
||||
}
|
||||
return fl_palette;
|
||||
|
||||
@@ -434,14 +434,14 @@ public:
|
||||
// df->pFiles = sizeof(DROPFILES);
|
||||
// df->pt.x = 0;
|
||||
// df->pt.y = 0;
|
||||
// df->fNC = false;
|
||||
// df->fNC = FALSE;
|
||||
// for (int i = 0; i < fl_selection_length[0]; i++) {
|
||||
// if (fl_selection_buffer[0][i] == '\n') {
|
||||
// fl_selection_buffer[0][i] = '\0';
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// df->fWide = true;
|
||||
// df->fWide = TRUE;
|
||||
// l = fl_utf2unicode((unsigned char*)fl_selection_buffer[0],
|
||||
// fl_selection_length[0], (xchar*)(((char*)pMem)
|
||||
// + sizeof(DROPFILES)));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw.cxx 6735 2009-04-01 22:11:57Z engelsman $"
|
||||
// "$Id: fl_draw.cxx 6845 2009-08-28 20:14:41Z greg.ercolano $"
|
||||
//
|
||||
// Label drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -422,6 +422,31 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
|
||||
h = lines*h;
|
||||
}
|
||||
|
||||
/**
|
||||
This function returns the actual height of the specified \p font
|
||||
and \p size. Normally the font height should always be 'size',
|
||||
but with the advent of XFT, there are (currently) complexities
|
||||
that seem to only be solved by asking the font what its actual
|
||||
font height is. (See STR#2115)
|
||||
|
||||
This function was originally undocumented in 1.1.x, and was used
|
||||
only by Fl_Text_Display. We're now documenting it in 1.3.x so that
|
||||
apps that need precise height info can get it with this function.
|
||||
|
||||
\returns the height of the font in pixels.
|
||||
|
||||
\todo In the future, when the XFT issues are resolved, this function
|
||||
should simply return the 'size' value.
|
||||
*/
|
||||
int fl_height(int font, int size) {
|
||||
if ( font == fl_font() && size == fl_size() ) return(fl_height());
|
||||
int tf = fl_font(), ts = fl_size(); // save
|
||||
fl_font(font,size);
|
||||
int height = fl_height();
|
||||
fl_font(tf,ts); // restore
|
||||
return(height);
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw.cxx 6735 2009-04-01 22:11:57Z engelsman $".
|
||||
// End of "$Id: fl_draw.cxx 6845 2009-08-28 20:14:41Z greg.ercolano $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_draw_image_win32.cxx 6616 2009-01-01 21:28:26Z matt $"
|
||||
// "$Id: fl_draw_image_win32.cxx 6844 2009-08-24 19:55:29Z AlbrechtS $"
|
||||
//
|
||||
// WIN32 image drawing code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -115,8 +115,10 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
|
||||
int delta, int linedelta, int depth,
|
||||
Fl_Draw_Image_Cb cb, void* userdata)
|
||||
{
|
||||
char indexed = 0;
|
||||
|
||||
#if USE_COLORMAP
|
||||
char indexed = (fl_palette != 0);
|
||||
indexed = (fl_palette != 0);
|
||||
#endif
|
||||
|
||||
if (depth==0) depth = 3;
|
||||
@@ -319,5 +321,5 @@ void fl_rectf(int x, int y, int w, int h, uchar r, uchar g, uchar b) {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_draw_image_win32.cxx 6616 2009-01-01 21:28:26Z matt $".
|
||||
// End of "$Id: fl_draw_image_win32.cxx 6844 2009-08-24 19:55:29Z AlbrechtS $".
|
||||
//
|
||||
|
||||
@@ -44,8 +44,8 @@ Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name, Fl_Fontsize size) {
|
||||
fl_angle_*10, // base-line orientation angle
|
||||
weight,
|
||||
italic,
|
||||
false, // underline attribute flag
|
||||
false, // strikeout attribute flag
|
||||
FALSE, // underline attribute flag
|
||||
FALSE, // strikeout attribute flag
|
||||
DEFAULT_CHARSET, // character set identifier
|
||||
OUT_DEFAULT_PRECIS, // output precision
|
||||
CLIP_DEFAULT_PRECIS,// clipping precision
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_font_xft.cxx 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// "$Id: fl_font_xft.cxx 6862 2009-09-13 10:15:42Z matt $"
|
||||
//
|
||||
// Xft font code for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -635,5 +635,5 @@ void fl_rtl_draw(const char* c, int n, int x, int y) {
|
||||
#endif
|
||||
|
||||
//
|
||||
// End of "$Id: fl_font_xft.cxx 6779 2009-04-24 09:28:30Z yuri $"
|
||||
// End of "$Id: fl_font_xft.cxx 6862 2009-09-13 10:15:42Z matt $"
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_open_uri.cxx 6641 2009-01-20 11:10:29Z fabien $"
|
||||
// "$Id: fl_open_uri.cxx 6901 2009-09-26 13:56:04Z matt $"
|
||||
//
|
||||
// fl_open_uri() code for FLTK.
|
||||
//
|
||||
@@ -117,9 +117,9 @@ fl_open_uri(const char *uri, char *msg, int msglen) {
|
||||
#elif defined(__APPLE__)
|
||||
char *argv[3]; // Command-line arguments
|
||||
|
||||
argv[0] = "open";
|
||||
argv[1] = (char *)uri;
|
||||
argv[2] = 0;
|
||||
argv[0] = (char*)"open";
|
||||
argv[1] = (char*)uri;
|
||||
argv[2] = (char*)0;
|
||||
|
||||
if (msg) snprintf(msg, msglen, "open %s", uri);
|
||||
|
||||
@@ -364,5 +364,5 @@ int main(int argc, char **argv) {
|
||||
|
||||
|
||||
//
|
||||
// End of "$Id: fl_open_uri.cxx 6641 2009-01-20 11:10:29Z fabien $".
|
||||
// End of "$Id: fl_open_uri.cxx 6901 2009-09-26 13:56:04Z matt $".
|
||||
//
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// "$Id: fl_shortcut.cxx 6760 2009-04-13 11:32:58Z matt $"
|
||||
// "$Id: fl_shortcut.cxx 6878 2009-09-17 22:12:24Z matt $"
|
||||
//
|
||||
// Shortcut support routines for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
@@ -39,7 +39,7 @@
|
||||
// It also checks against the first character of Fl::event_text(),
|
||||
// and zero for FL_SHIFT means "don't care".
|
||||
// This allows punctuation shortcuts like "#" to work (rather than
|
||||
// calling it "shift+3")
|
||||
// calling it "shift+3" on a US keyboard)
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Widget.H>
|
||||
@@ -58,19 +58,12 @@
|
||||
be confused with
|
||||
Fl_Widget::test_shortcut().
|
||||
*/
|
||||
int Fl::test_shortcut(int shortcut) {
|
||||
int Fl::test_shortcut(Fl_Shortcut shortcut) {
|
||||
if (!shortcut) return 0;
|
||||
|
||||
int v = shortcut & 0xffff;
|
||||
#ifdef __APPLE__
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#else
|
||||
// most X11 use MSWindows Latin-1 if set to Western encoding, so 0x80 to 0xa0 are defined
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#endif
|
||||
if (isupper(v)) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
||||
if (fl_tolower(v)!=v) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
|
||||
int shift = Fl::event_state();
|
||||
@@ -81,17 +74,18 @@ int Fl::test_shortcut(int shortcut) {
|
||||
// these three must always be correct:
|
||||
if (mismatch&(FL_META|FL_ALT|FL_CTRL)) return 0;
|
||||
|
||||
int key = shortcut & 0xffff;
|
||||
Fl_Char key = shortcut & FL_KEY_MASK;
|
||||
|
||||
// if shift is also correct, check for exactly equal keysyms:
|
||||
if (!(mismatch&(FL_SHIFT)) && key == Fl::event_key()) return 1;
|
||||
|
||||
// try matching ascii, ignore shift:
|
||||
if (key == event_text()[0]) return 1;
|
||||
// try matching utf8, ignore shift:
|
||||
Fl_Char firstChar = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0);
|
||||
if (key==firstChar) return 1;
|
||||
|
||||
// kludge so that Ctrl+'_' works (as opposed to Ctrl+'^_'):
|
||||
if ((shift&FL_CTRL) && key >= 0x3f && key <= 0x5F
|
||||
&& event_text()[0]==(key^0x40)) return 1;
|
||||
&& firstChar==(key^0x40)) return 1; // firstChar should be within a-z
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -180,7 +174,7 @@ static Keyname table[] = {
|
||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||
*/
|
||||
const char* fl_shortcut_label(int shortcut) {
|
||||
const char* fl_shortcut_label(Fl_Shortcut shortcut) {
|
||||
return fl_shortcut_label(shortcut, 0L);
|
||||
}
|
||||
|
||||
@@ -190,23 +184,17 @@ const char* fl_shortcut_label(int shortcut) {
|
||||
\param [in] shortcut the integer value containing the ascii charcter or extended keystroke plus modifiers
|
||||
\param [in] eom if this pointer is set, it will receive a pointer to the end of the modifier text
|
||||
\return a pointer to a static buffer containing human readable text for the shortcut
|
||||
\see fl_shortcut_label(int shortcut)
|
||||
\see fl_shortcut_label(Fl_Shortcut shortcut)
|
||||
*/
|
||||
const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
const char* fl_shortcut_label(Fl_Shortcut shortcut, const char **eom) {
|
||||
static char buf[20];
|
||||
char *p = buf;
|
||||
if (eom) *eom = p;
|
||||
if (!shortcut) {*p = 0; return buf;}
|
||||
// fix upper case shortcuts
|
||||
int v = shortcut & 0xffff;
|
||||
#ifdef __APPLE__
|
||||
if (v > 32 && v < 0x7f || v >= 0x80 && v <= 0xff) {
|
||||
#else
|
||||
if (v > 32 && v < 0x7f || v >= 0xa0 && v <= 0xff) {
|
||||
#endif
|
||||
if (isupper(v)) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
Fl_Char v = shortcut & FL_KEY_MASK;
|
||||
if (fl_tolower(v)!=v) {
|
||||
shortcut |= FL_SHIFT;
|
||||
}
|
||||
#ifdef __APPLE__
|
||||
// this column contains utf8 characters - v
|
||||
@@ -221,7 +209,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
if (shortcut & FL_CTRL) {strcpy(p,"Ctrl+"); p += 5;}
|
||||
#endif // __APPLE__
|
||||
if (eom) *eom = p;
|
||||
int key = shortcut & 0xFFFF;
|
||||
Fl_Char key = shortcut & FL_KEY_MASK;
|
||||
#if defined(WIN32) || defined(__APPLE__) // if not X
|
||||
if (key >= FL_F && key <= FL_F_Last) {
|
||||
*p++ = 'F';
|
||||
@@ -234,7 +222,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
while (a < b) {
|
||||
int c = (a+b)/2;
|
||||
if (table[c].key == key) {
|
||||
if (p > buf) {
|
||||
if (p > buf) {
|
||||
strcpy(p,table[c].name);
|
||||
return buf;
|
||||
} else {
|
||||
@@ -252,7 +240,7 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
*p++ = uchar(key & 127);
|
||||
} else {
|
||||
// if none found, use the keystroke as a match:
|
||||
*p++ = uchar(toupper(key & 255));
|
||||
p += fl_utf8encode(fl_toupper(key), p);
|
||||
}
|
||||
}
|
||||
*p = 0;
|
||||
@@ -262,7 +250,11 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
if (key == FL_Enter || key == '\r') q="Enter"; // don't use Xlib's "Return":
|
||||
else if (key > 32 && key < 0x100) q = 0;
|
||||
else q = XKeysymToString(key);
|
||||
if (!q) {*p++ = uchar(toupper(key & 255)); *p = 0; return buf;}
|
||||
if (!q) {
|
||||
p += fl_utf8encode(fl_toupper(key), p);
|
||||
*p = 0;
|
||||
return buf;
|
||||
}
|
||||
if (p > buf) {
|
||||
strcpy(p,q);
|
||||
return buf;
|
||||
@@ -278,9 +270,9 @@ const char* fl_shortcut_label(int shortcut, const char **eom) {
|
||||
/**
|
||||
Emulation of XForms named shortcuts.
|
||||
*/
|
||||
int fl_old_shortcut(const char* s) {
|
||||
Fl_Shortcut fl_old_shortcut(const char* s) {
|
||||
if (!s || !*s) return 0;
|
||||
int n = 0;
|
||||
Fl_Shortcut n = 0;
|
||||
if (*s == '#') {n |= FL_ALT; s++;}
|
||||
if (*s == '+') {n |= FL_SHIFT; s++;}
|
||||
if (*s == '^') {n |= FL_CTRL; s++;}
|
||||
@@ -290,14 +282,14 @@ int fl_old_shortcut(const char* s) {
|
||||
|
||||
// Tests for &x shortcuts in button labels:
|
||||
|
||||
char Fl_Widget::label_shortcut(const char *t) {
|
||||
Fl_Shortcut Fl_Widget::label_shortcut(const char *t) {
|
||||
if (!t) return 0;
|
||||
for (;;) {
|
||||
if (*t==0) return 0;
|
||||
if (*t=='&') {
|
||||
char s = t[1];
|
||||
Fl_Shortcut s = fl_utf8decode(t+1, 0, 0);
|
||||
if (s==0) return 0;
|
||||
else if (s=='&') t++;
|
||||
else if (s==(Fl_Char)'&') t++;
|
||||
else return s;
|
||||
}
|
||||
t++;
|
||||
@@ -309,8 +301,9 @@ int Fl_Widget::test_shortcut(const char *t) {
|
||||
// on MSWindows, users expect shortcuts to work only when the Alt modifier is pressed
|
||||
if (Fl::event_state(FL_ALT)==0) return 0;
|
||||
#endif
|
||||
char c = Fl::event_text()[0];
|
||||
if (!c || !t) return 0;
|
||||
if (!t) return 0;
|
||||
Fl_Shortcut c = fl_utf8decode(Fl::event_text(), Fl::event_text()+Fl::event_length(), 0);
|
||||
if (!c) return 0;
|
||||
if (c == label_shortcut(t))
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -322,5 +315,5 @@ int Fl_Widget::test_shortcut() {
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: fl_shortcut.cxx 6760 2009-04-13 11:32:58Z matt $".
|
||||
// End of "$Id: fl_shortcut.cxx 6878 2009-09-17 22:12:24Z matt $".
|
||||
//
|
||||
|
||||
@@ -138,11 +138,11 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
{
|
||||
unsigned char c = *(unsigned char*)p;
|
||||
if (c < 0x80) {
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
return c;
|
||||
#if ERRORS_TO_CP1252
|
||||
} else if (c < 0xa0) {
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
return cp1252[c-0x80];
|
||||
#endif
|
||||
} else if (c < 0xc2) {
|
||||
@@ -150,7 +150,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
}
|
||||
if (p+1 >= end || (p[1]&0xc0) != 0x80) goto FAIL;
|
||||
if (c < 0xe0) {
|
||||
*len = 2;
|
||||
if (len) *len = 2;
|
||||
return
|
||||
((p[0] & 0x1f) << 6) +
|
||||
((p[1] & 0x3f));
|
||||
@@ -171,7 +171,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
} else if (c < 0xf0) {
|
||||
UTF8_3:
|
||||
if (p+2 >= end || (p[2]&0xc0) != 0x80) goto FAIL;
|
||||
*len = 3;
|
||||
if (len) *len = 3;
|
||||
return
|
||||
((p[0] & 0x0f) << 12) +
|
||||
((p[1] & 0x3f) << 6) +
|
||||
@@ -182,7 +182,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
} else if (c < 0xf4) {
|
||||
UTF8_4:
|
||||
if (p+3 >= end || (p[2]&0xc0) != 0x80 || (p[3]&0xc0) != 0x80) goto FAIL;
|
||||
*len = 4;
|
||||
if (len) *len = 4;
|
||||
#if STRICT_RFC3629
|
||||
/* RFC 3629 says all codes ending in fffe or ffff are illegal: */
|
||||
if ((p[1]&0xf)==0xf &&
|
||||
@@ -199,7 +199,7 @@ unsigned fl_utf8decode(const char* p, const char* end, int* len)
|
||||
goto UTF8_4;
|
||||
} else {
|
||||
FAIL:
|
||||
*len = 1;
|
||||
if (len) *len = 1;
|
||||
#if ERRORS_TO_ISO8859_1
|
||||
return c;
|
||||
#else
|
||||
|
||||
@@ -58,7 +58,7 @@ static fl_gmi_func fl_gmi = NULL; // used to get a proc pointer for GetMonitorIn
|
||||
static RECT screens[16];
|
||||
|
||||
static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) {
|
||||
if (num_screens >= 16) return true;
|
||||
if (num_screens >= 16) return TRUE;
|
||||
|
||||
MONITORINFO mi;
|
||||
mi.cbSize = sizeof(mi);
|
||||
@@ -69,7 +69,7 @@ static BOOL CALLBACK screen_cb(HMONITOR mon, HDC, LPRECT r, LPARAM) {
|
||||
screens[num_screens] = mi.rcWork;
|
||||
num_screens ++;
|
||||
}
|
||||
return true;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void screen_init() {
|
||||
|
||||
@@ -22,19 +22,19 @@
|
||||
#include "Control.h"
|
||||
|
||||
Control::Control(char ndefaultval)
|
||||
:defaultval(ndefaultval),lockqueue(-1),locked(false)
|
||||
:defaultval(ndefaultval), lockqueue(-1), locked(false)
|
||||
{}
|
||||
|
||||
void Control::lock()
|
||||
{
|
||||
locked=true;
|
||||
lockqueue=-1;
|
||||
locked = true;
|
||||
lockqueue = -1;
|
||||
}
|
||||
|
||||
void Control::ulock()
|
||||
{
|
||||
if (locked&&lockqueue>=0)
|
||||
if(locked && (lockqueue >= 0))
|
||||
setmVal(lockqueue);
|
||||
locked=false;
|
||||
locked = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,33 +25,33 @@
|
||||
/**A control for a parameter within the program*/
|
||||
class Control
|
||||
{
|
||||
public:
|
||||
Control(char ndefaultval);/**\todo create proper initialization list*/
|
||||
~Control() {};
|
||||
/**Return the string, which represents the internal value
|
||||
* @return a string representation of the current value*/
|
||||
virtual std::string getString()const=0;
|
||||
/**Set the Control to the given value
|
||||
* @param nval A number 0-127*/
|
||||
virtual void setmVal(char nval)=0;
|
||||
/**Return the midi value (aka the char)
|
||||
* @return the current value*/
|
||||
virtual char getmVal()const=0;
|
||||
/** Will lock the Control until it is ulocked
|
||||
*
|
||||
* Locking a Control will Stop it from having
|
||||
* its internal data altered*/
|
||||
void lock();
|
||||
/** Will unlock the Control
|
||||
*
|
||||
* This will also update the Control
|
||||
* if something attempted to update it while it was locked*/
|
||||
void ulock();
|
||||
private:
|
||||
char defaultval;/**<Default value of the Control*/
|
||||
char lockqueue; /**<The value is that is stored, while the Control is locked
|
||||
public:
|
||||
Control(char ndefaultval); /**\todo create proper initialization list*/
|
||||
~Control() {}
|
||||
/**Return the string, which represents the internal value
|
||||
* @return a string representation of the current value*/
|
||||
virtual std::string getString() const = 0;
|
||||
/**Set the Control to the given value
|
||||
* @param nval A number 0-127*/
|
||||
virtual void setmVal(char nval) = 0;
|
||||
/**Return the midi value (aka the char)
|
||||
* @return the current value*/
|
||||
virtual char getmVal() const = 0;
|
||||
/** Will lock the Control until it is ulocked
|
||||
*
|
||||
* Locking a Control will Stop it from having
|
||||
* its internal data altered*/
|
||||
void lock();
|
||||
/** Will unlock the Control
|
||||
*
|
||||
* This will also update the Control
|
||||
* if something attempted to update it while it was locked*/
|
||||
void ulock();
|
||||
private:
|
||||
char defaultval; /**<Default value of the Control*/
|
||||
char lockqueue; /**<The value is that is stored, while the Control is locked
|
||||
* and something attempts to update it*/
|
||||
bool locked;//upgrade this to a integer lock level if problems occur
|
||||
bool locked; //upgrade this to a integer lock level if problems occur
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,28 +23,29 @@
|
||||
#include <sstream>
|
||||
|
||||
DelayCtl::DelayCtl()
|
||||
:Control(64),value(64/127.0*1.5) {} /**\todo finishme*/
|
||||
:Control(64), value(64 / 127.0 * 1.5) {} /**\todo finishme*/
|
||||
|
||||
std::string DelayCtl::getString() const
|
||||
{
|
||||
std::ostringstream buf;
|
||||
buf<<value;
|
||||
return (buf.str() + " Seconds");
|
||||
buf << value;
|
||||
return buf.str() + " Seconds";
|
||||
}
|
||||
|
||||
void DelayCtl::setmVal(char nval)
|
||||
{
|
||||
/**\todo add locking code*/
|
||||
//value=1+(int)(nval/127.0*SAMPLE_RATE*1.5);//0 .. 1.5 sec
|
||||
value=(nval/127.0*1.5);//0 .. 1.5 sec
|
||||
value = (nval / 127.0 * 1.5); //0 .. 1.5 sec
|
||||
}
|
||||
|
||||
char DelayCtl::getmVal() const
|
||||
{
|
||||
return((char)(value/1.5*127.0));
|
||||
return (char)(value / 1.5 * 127.0);
|
||||
}
|
||||
|
||||
float DelayCtl::getiVal() const
|
||||
{
|
||||
return(value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,15 +28,15 @@
|
||||
* Will vary from 0 seconds to 1.5 seconds*/
|
||||
class DelayCtl:public Control
|
||||
{
|
||||
public:
|
||||
DelayCtl();
|
||||
~DelayCtl() {};
|
||||
std::string getString() const;
|
||||
void setmVal(char nval);
|
||||
char getmVal() const;
|
||||
float getiVal() const;
|
||||
private:
|
||||
float value;
|
||||
public:
|
||||
DelayCtl();
|
||||
~DelayCtl() {}
|
||||
std::string getString() const;
|
||||
void setmVal(char nval);
|
||||
char getmVal() const;
|
||||
float getiVal() const;
|
||||
private:
|
||||
float value;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,384 +24,427 @@
|
||||
#include <stdio.h>
|
||||
#include "AnalogFilter.h"
|
||||
|
||||
AnalogFilter::AnalogFilter(unsigned char Ftype,REALTYPE Ffreq, REALTYPE Fq,unsigned char Fstages)
|
||||
AnalogFilter::AnalogFilter(unsigned char Ftype,
|
||||
REALTYPE Ffreq,
|
||||
REALTYPE Fq,
|
||||
unsigned char Fstages)
|
||||
{
|
||||
stages=Fstages;
|
||||
for (int i=0;i<3;i++) {
|
||||
oldc[i]=0.0;
|
||||
oldd[i]=0.0;
|
||||
c[i]=0.0;
|
||||
d[i]=0.0;
|
||||
};
|
||||
type=Ftype;
|
||||
freq=Ffreq;
|
||||
q=Fq;
|
||||
gain=1.0;
|
||||
if (stages>=MAX_FILTER_STAGES) stages=MAX_FILTER_STAGES;
|
||||
stages = Fstages;
|
||||
for(int i = 0; i < 3; i++) {
|
||||
oldc[i] = 0.0;
|
||||
oldd[i] = 0.0;
|
||||
c[i] = 0.0;
|
||||
d[i] = 0.0;
|
||||
}
|
||||
type = Ftype;
|
||||
freq = Ffreq;
|
||||
q = Fq;
|
||||
gain = 1.0;
|
||||
if(stages >= MAX_FILTER_STAGES)
|
||||
stages = MAX_FILTER_STAGES;
|
||||
cleanup();
|
||||
firsttime=0;
|
||||
abovenq=0;
|
||||
oldabovenq=0;
|
||||
setfreq_and_q(Ffreq,Fq);
|
||||
firsttime=1;
|
||||
d[0]=0;//this is not used
|
||||
outgain=1.0;
|
||||
};
|
||||
firsttime = 0;
|
||||
abovenq = 0;
|
||||
oldabovenq = 0;
|
||||
setfreq_and_q(Ffreq, Fq);
|
||||
firsttime = 1;
|
||||
d[0] = 0; //this is not used
|
||||
outgain = 1.0;
|
||||
}
|
||||
|
||||
AnalogFilter::~AnalogFilter()
|
||||
{
|
||||
};
|
||||
{}
|
||||
|
||||
void AnalogFilter::cleanup()
|
||||
{
|
||||
for (int i=0;i<MAX_FILTER_STAGES+1;i++) {
|
||||
x[i].c1=0.0;
|
||||
x[i].c2=0.0;
|
||||
y[i].c1=0.0;
|
||||
y[i].c2=0.0;
|
||||
oldx[i]=x[i];
|
||||
oldy[i]=y[i];
|
||||
};
|
||||
needsinterpolation=0;
|
||||
};
|
||||
for(int i = 0; i < MAX_FILTER_STAGES + 1; i++) {
|
||||
x[i].c1 = 0.0;
|
||||
x[i].c2 = 0.0;
|
||||
y[i].c1 = 0.0;
|
||||
y[i].c2 = 0.0;
|
||||
oldx[i] = x[i];
|
||||
oldy[i] = y[i];
|
||||
}
|
||||
needsinterpolation = 0;
|
||||
}
|
||||
|
||||
void AnalogFilter::computefiltercoefs()
|
||||
{
|
||||
REALTYPE tmp;
|
||||
REALTYPE omega,sn,cs,alpha,beta;
|
||||
int zerocoefs=0;//this is used if the freq is too high
|
||||
REALTYPE omega, sn, cs, alpha, beta;
|
||||
int zerocoefs = 0; //this is used if the freq is too high
|
||||
|
||||
//do not allow frequencies bigger than samplerate/2
|
||||
REALTYPE freq=this->freq;
|
||||
if (freq>(SAMPLE_RATE/2-500.0)) {
|
||||
freq=SAMPLE_RATE/2-500.0;
|
||||
zerocoefs=1;
|
||||
};
|
||||
if (freq<0.1) freq=0.1;
|
||||
REALTYPE freq = this->freq;
|
||||
if(freq > (SAMPLE_RATE / 2 - 500.0)) {
|
||||
freq = SAMPLE_RATE / 2 - 500.0;
|
||||
zerocoefs = 1;
|
||||
}
|
||||
if(freq < 0.1)
|
||||
freq = 0.1;
|
||||
//do not allow bogus Q
|
||||
if (q<0.0) q=0.0;
|
||||
REALTYPE tmpq,tmpgain;
|
||||
if (stages==0) {
|
||||
tmpq=q;
|
||||
tmpgain=gain;
|
||||
} else {
|
||||
tmpq=(q>1.0 ? pow(q,1.0/(stages+1)) : q);
|
||||
tmpgain=pow(gain,1.0/(stages+1));
|
||||
};
|
||||
if(q < 0.0)
|
||||
q = 0.0;
|
||||
REALTYPE tmpq, tmpgain;
|
||||
if(stages == 0) {
|
||||
tmpq = q;
|
||||
tmpgain = gain;
|
||||
}
|
||||
else {
|
||||
tmpq = (q > 1.0 ? pow(q, 1.0 / (stages + 1)) : q);
|
||||
tmpgain = pow(gain, 1.0 / (stages + 1));
|
||||
}
|
||||
|
||||
//most of theese are implementations of
|
||||
//the "Cookbook formulae for audio EQ" by Robert Bristow-Johnson
|
||||
//The original location of the Cookbook is:
|
||||
//http://www.harmony-central.com/Computer/Programming/Audio-EQ-Cookbook.txt
|
||||
switch (type) {
|
||||
case 0://LPF 1 pole
|
||||
if (zerocoefs==0) tmp=exp(-2.0*PI*freq/SAMPLE_RATE);
|
||||
else tmp=0.0;
|
||||
c[0]=1.0-tmp;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=tmp;
|
||||
d[2]=0.0;
|
||||
order=1;
|
||||
switch(type) {
|
||||
case 0: //LPF 1 pole
|
||||
if(zerocoefs == 0)
|
||||
tmp = exp(-2.0 * PI * freq / SAMPLE_RATE);
|
||||
else
|
||||
tmp = 0.0;
|
||||
c[0] = 1.0 - tmp;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = tmp;
|
||||
d[2] = 0.0;
|
||||
order = 1;
|
||||
break;
|
||||
case 1://HPF 1 pole
|
||||
if (zerocoefs==0) tmp=exp(-2.0*PI*freq/SAMPLE_RATE);
|
||||
else tmp=0.0;
|
||||
c[0]=(1.0+tmp)/2.0;
|
||||
c[1]=-(1.0+tmp)/2.0;
|
||||
c[2]=0.0;
|
||||
d[1]=tmp;
|
||||
d[2]=0.0;
|
||||
order=1;
|
||||
case 1: //HPF 1 pole
|
||||
if(zerocoefs == 0)
|
||||
tmp = exp(-2.0 * PI * freq / SAMPLE_RATE);
|
||||
else
|
||||
tmp = 0.0;
|
||||
c[0] = (1.0 + tmp) / 2.0;
|
||||
c[1] = -(1.0 + tmp) / 2.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = tmp;
|
||||
d[2] = 0.0;
|
||||
order = 1;
|
||||
break;
|
||||
case 2://LPF 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
alpha=sn/(2*tmpq);
|
||||
tmp=1+alpha;
|
||||
c[0]=(1.0-cs)/2.0/tmp;
|
||||
c[1]=(1.0-cs)/tmp;
|
||||
c[2]=(1.0-cs)/2.0/tmp;
|
||||
d[1]=-2*cs/tmp*(-1);
|
||||
d[2]=(1-alpha)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=1.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
case 2: //LPF 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
alpha = sn / (2 * tmpq);
|
||||
tmp = 1 + alpha;
|
||||
c[0] = (1.0 - cs) / 2.0 / tmp;
|
||||
c[1] = (1.0 - cs) / tmp;
|
||||
c[2] = (1.0 - cs) / 2.0 / tmp;
|
||||
d[1] = -2 * cs / tmp * (-1);
|
||||
d[2] = (1 - alpha) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 3://HPF 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
alpha=sn/(2*tmpq);
|
||||
tmp=1+alpha;
|
||||
c[0]=(1.0+cs)/2.0/tmp;
|
||||
c[1]=-(1.0+cs)/tmp;
|
||||
c[2]=(1.0+cs)/2.0/tmp;
|
||||
d[1]=-2*cs/tmp*(-1);
|
||||
d[2]=(1-alpha)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=0.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
case 3: //HPF 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
alpha = sn / (2 * tmpq);
|
||||
tmp = 1 + alpha;
|
||||
c[0] = (1.0 + cs) / 2.0 / tmp;
|
||||
c[1] = -(1.0 + cs) / tmp;
|
||||
c[2] = (1.0 + cs) / 2.0 / tmp;
|
||||
d[1] = -2 * cs / tmp * (-1);
|
||||
d[2] = (1 - alpha) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 0.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 4://BPF 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
alpha=sn/(2*tmpq);
|
||||
tmp=1+alpha;
|
||||
c[0]=alpha/tmp*sqrt(tmpq+1);
|
||||
c[1]=0;
|
||||
c[2]=-alpha/tmp*sqrt(tmpq+1);
|
||||
d[1]=-2*cs/tmp*(-1);
|
||||
d[2]=(1-alpha)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=0.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
case 4: //BPF 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
alpha = sn / (2 * tmpq);
|
||||
tmp = 1 + alpha;
|
||||
c[0] = alpha / tmp *sqrt(tmpq + 1);
|
||||
c[1] = 0;
|
||||
c[2] = -alpha / tmp *sqrt(tmpq + 1);
|
||||
d[1] = -2 * cs / tmp * (-1);
|
||||
d[2] = (1 - alpha) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 0.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 5://NOTCH 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
alpha=sn/(2*sqrt(tmpq));
|
||||
tmp=1+alpha;
|
||||
c[0]=1/tmp;
|
||||
c[1]=-2*cs/tmp;
|
||||
c[2]=1/tmp;
|
||||
d[1]=-2*cs/tmp*(-1);
|
||||
d[2]=(1-alpha)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=1.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
case 5: //NOTCH 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
alpha = sn / (2 * sqrt(tmpq));
|
||||
tmp = 1 + alpha;
|
||||
c[0] = 1 / tmp;
|
||||
c[1] = -2 * cs / tmp;
|
||||
c[2] = 1 / tmp;
|
||||
d[1] = -2 * cs / tmp * (-1);
|
||||
d[2] = (1 - alpha) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 6://PEAK (2 poles)
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
tmpq*=3.0;
|
||||
alpha=sn/(2*tmpq);
|
||||
tmp=1+alpha/tmpgain;
|
||||
c[0]=(1.0+alpha*tmpgain)/tmp;
|
||||
c[1]=(-2.0*cs)/tmp;
|
||||
c[2]=(1.0-alpha*tmpgain)/tmp;
|
||||
d[1]=-2*cs/tmp*(-1);
|
||||
d[2]=(1-alpha/tmpgain)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=1.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
case 6: //PEAK (2 poles)
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
tmpq *= 3.0;
|
||||
alpha = sn / (2 * tmpq);
|
||||
tmp = 1 + alpha / tmpgain;
|
||||
c[0] = (1.0 + alpha * tmpgain) / tmp;
|
||||
c[1] = (-2.0 * cs) / tmp;
|
||||
c[2] = (1.0 - alpha * tmpgain) / tmp;
|
||||
d[1] = -2 * cs / tmp * (-1);
|
||||
d[2] = (1 - alpha / tmpgain) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 7://Low Shelf - 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
tmpq=sqrt(tmpq);
|
||||
alpha=sn/(2*tmpq);
|
||||
beta=sqrt(tmpgain)/tmpq;
|
||||
tmp=(tmpgain+1.0)+(tmpgain-1.0)*cs+beta*sn;
|
||||
case 7: //Low Shelf - 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
tmpq = sqrt(tmpq);
|
||||
alpha = sn / (2 * tmpq);
|
||||
beta = sqrt(tmpgain) / tmpq;
|
||||
tmp = (tmpgain + 1.0) + (tmpgain - 1.0) * cs + beta * sn;
|
||||
|
||||
c[0]=tmpgain*((tmpgain+1.0)-(tmpgain-1.0)*cs+beta*sn)/tmp;
|
||||
c[1]=2.0*tmpgain*((tmpgain-1.0)-(tmpgain+1.0)*cs)/tmp;
|
||||
c[2]=tmpgain*((tmpgain+1.0)-(tmpgain-1.0)*cs-beta*sn)/tmp;
|
||||
d[1]=-2.0*((tmpgain-1.0)+(tmpgain+1.0)*cs)/tmp*(-1);
|
||||
d[2]=((tmpgain+1.0)+(tmpgain-1.0)*cs-beta*sn)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=tmpgain;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
c[0] = tmpgain
|
||||
* ((tmpgain
|
||||
+ 1.0) - (tmpgain - 1.0) * cs + beta * sn) / tmp;
|
||||
c[1] = 2.0 * tmpgain
|
||||
* ((tmpgain - 1.0) - (tmpgain + 1.0) * cs) / tmp;
|
||||
c[2] = tmpgain
|
||||
* ((tmpgain
|
||||
+ 1.0) - (tmpgain - 1.0) * cs - beta * sn) / tmp;
|
||||
d[1] = -2.0 * ((tmpgain - 1.0) + (tmpgain + 1.0) * cs) / tmp * (-1);
|
||||
d[2] =
|
||||
((tmpgain
|
||||
+ 1.0) + (tmpgain - 1.0) * cs - beta * sn) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = tmpgain;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
case 8://High Shelf - 2 poles
|
||||
if (zerocoefs==0) {
|
||||
omega=2*PI*freq/SAMPLE_RATE;
|
||||
sn=sin(omega);
|
||||
cs=cos(omega);
|
||||
tmpq=sqrt(tmpq);
|
||||
alpha=sn/(2*tmpq);
|
||||
beta=sqrt(tmpgain)/tmpq;
|
||||
tmp=(tmpgain+1.0)-(tmpgain-1.0)*cs+beta*sn;
|
||||
case 8: //High Shelf - 2 poles
|
||||
if(zerocoefs == 0) {
|
||||
omega = 2 * PI * freq / SAMPLE_RATE;
|
||||
sn = sin(omega);
|
||||
cs = cos(omega);
|
||||
tmpq = sqrt(tmpq);
|
||||
alpha = sn / (2 * tmpq);
|
||||
beta = sqrt(tmpgain) / tmpq;
|
||||
tmp = (tmpgain + 1.0) - (tmpgain - 1.0) * cs + beta * sn;
|
||||
|
||||
c[0]=tmpgain*((tmpgain+1.0)+(tmpgain-1.0)*cs+beta*sn)/tmp;
|
||||
c[1]=-2.0*tmpgain*((tmpgain-1.0)+(tmpgain+1.0)*cs)/tmp;
|
||||
c[2]=tmpgain*((tmpgain+1.0)+(tmpgain-1.0)*cs-beta*sn)/tmp;
|
||||
d[1]=2.0*((tmpgain-1.0)-(tmpgain+1.0)*cs)/tmp*(-1);
|
||||
d[2]=((tmpgain+1.0)-(tmpgain-1.0)*cs-beta*sn)/tmp*(-1);
|
||||
} else {
|
||||
c[0]=1.0;
|
||||
c[1]=0.0;
|
||||
c[2]=0.0;
|
||||
d[1]=0.0;
|
||||
d[2]=0.0;
|
||||
};
|
||||
order=2;
|
||||
c[0] = tmpgain
|
||||
* ((tmpgain
|
||||
+ 1.0) + (tmpgain - 1.0) * cs + beta * sn) / tmp;
|
||||
c[1] = -2.0 * tmpgain
|
||||
* ((tmpgain - 1.0) + (tmpgain + 1.0) * cs) / tmp;
|
||||
c[2] = tmpgain
|
||||
* ((tmpgain
|
||||
+ 1.0) + (tmpgain - 1.0) * cs - beta * sn) / tmp;
|
||||
d[1] = 2.0 * ((tmpgain - 1.0) - (tmpgain + 1.0) * cs) / tmp * (-1);
|
||||
d[2] =
|
||||
((tmpgain
|
||||
+ 1.0) - (tmpgain - 1.0) * cs - beta * sn) / tmp * (-1);
|
||||
}
|
||||
else {
|
||||
c[0] = 1.0;
|
||||
c[1] = 0.0;
|
||||
c[2] = 0.0;
|
||||
d[1] = 0.0;
|
||||
d[2] = 0.0;
|
||||
}
|
||||
order = 2;
|
||||
break;
|
||||
default://wrong type
|
||||
type=0;
|
||||
default: //wrong type
|
||||
type = 0;
|
||||
computefiltercoefs();
|
||||
break;
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AnalogFilter::setfreq(REALTYPE frequency)
|
||||
{
|
||||
if (frequency<0.1) frequency=0.1;
|
||||
REALTYPE rap=freq/frequency;
|
||||
if (rap<1.0) rap=1.0/rap;
|
||||
if(frequency < 0.1)
|
||||
frequency = 0.1;
|
||||
REALTYPE rap = freq / frequency;
|
||||
if(rap < 1.0)
|
||||
rap = 1.0 / rap;
|
||||
|
||||
oldabovenq=abovenq;
|
||||
abovenq=frequency>(SAMPLE_RATE/2-500.0);
|
||||
oldabovenq = abovenq;
|
||||
abovenq = frequency > (SAMPLE_RATE / 2 - 500.0);
|
||||
|
||||
int nyquistthresh=(abovenq^oldabovenq);
|
||||
int nyquistthresh = (abovenq ^ oldabovenq);
|
||||
|
||||
|
||||
if ((rap>3.0)||(nyquistthresh!=0)) {//if the frequency is changed fast, it needs interpolation (now, filter and coeficients backup)
|
||||
for (int i=0;i<3;i++) {
|
||||
oldc[i]=c[i];
|
||||
oldd[i]=d[i];
|
||||
};
|
||||
for (int i=0;i<MAX_FILTER_STAGES+1;i++) {
|
||||
oldx[i]=x[i];
|
||||
oldy[i]=y[i];
|
||||
};
|
||||
if (firsttime==0) needsinterpolation=1;
|
||||
};
|
||||
freq=frequency;
|
||||
if((rap > 3.0) || (nyquistthresh != 0)) { //if the frequency is changed fast, it needs interpolation (now, filter and coeficients backup)
|
||||
for(int i = 0; i < 3; i++) {
|
||||
oldc[i] = c[i];
|
||||
oldd[i] = d[i];
|
||||
}
|
||||
for(int i = 0; i < MAX_FILTER_STAGES + 1; i++) {
|
||||
oldx[i] = x[i];
|
||||
oldy[i] = y[i];
|
||||
}
|
||||
if(firsttime == 0)
|
||||
needsinterpolation = 1;
|
||||
}
|
||||
freq = frequency;
|
||||
computefiltercoefs();
|
||||
firsttime=0;
|
||||
firsttime = 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
void AnalogFilter::setfreq_and_q(REALTYPE frequency,REALTYPE q_)
|
||||
void AnalogFilter::setfreq_and_q(REALTYPE frequency, REALTYPE q_)
|
||||
{
|
||||
q=q_;
|
||||
q = q_;
|
||||
setfreq(frequency);
|
||||
};
|
||||
}
|
||||
|
||||
void AnalogFilter::setq(REALTYPE q_)
|
||||
{
|
||||
q=q_;
|
||||
q = q_;
|
||||
computefiltercoefs();
|
||||
};
|
||||
}
|
||||
|
||||
void AnalogFilter::settype(int type_)
|
||||
{
|
||||
type=type_;
|
||||
type = type_;
|
||||
computefiltercoefs();
|
||||
};
|
||||
}
|
||||
|
||||
void AnalogFilter::setgain(REALTYPE dBgain)
|
||||
{
|
||||
gain=dB2rap(dBgain);
|
||||
gain = dB2rap(dBgain);
|
||||
computefiltercoefs();
|
||||
};
|
||||
}
|
||||
|
||||
void AnalogFilter::setstages(int stages_)
|
||||
{
|
||||
if (stages_>=MAX_FILTER_STAGES) stages_=MAX_FILTER_STAGES-1;
|
||||
stages=stages_;
|
||||
if(stages_ >= MAX_FILTER_STAGES)
|
||||
stages_ = MAX_FILTER_STAGES - 1;
|
||||
stages = stages_;
|
||||
cleanup();
|
||||
computefiltercoefs();
|
||||
};
|
||||
}
|
||||
|
||||
void AnalogFilter::singlefilterout(REALTYPE *smp,fstage &x,fstage &y,REALTYPE *c,REALTYPE *d)
|
||||
void AnalogFilter::singlefilterout(REALTYPE *smp,
|
||||
fstage &x,
|
||||
fstage &y,
|
||||
REALTYPE *c,
|
||||
REALTYPE *d)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
REALTYPE y0;
|
||||
if (order==1) {//First order filter
|
||||
for (i=0;i<SOUND_BUFFER_SIZE;i++) {
|
||||
y0=smp[i]*c[0]+x.c1*c[1]+y.c1*d[1];
|
||||
y.c1=y0;
|
||||
x.c1=smp[i];
|
||||
if(order == 1) { //First order filter
|
||||
for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
|
||||
y0 = smp[i] * c[0] + x.c1 * c[1] + y.c1 * d[1];
|
||||
y.c1 = y0;
|
||||
x.c1 = smp[i];
|
||||
//output
|
||||
smp[i]=y0;
|
||||
};
|
||||
};
|
||||
if (order==2) {//Second order filter
|
||||
for (i=0;i<SOUND_BUFFER_SIZE;i++) {
|
||||
y0=smp[i]*c[0]+x.c1*c[1]+x.c2*c[2]+y.c1*d[1]+y.c2*d[2];
|
||||
y.c2=y.c1;
|
||||
y.c1=y0;
|
||||
x.c2=x.c1;
|
||||
x.c1=smp[i];
|
||||
smp[i] = y0;
|
||||
}
|
||||
}
|
||||
if(order == 2) { //Second order filter
|
||||
for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
|
||||
y0 = smp[i] * c[0] + x.c1 * c[1] + x.c2 * c[2] + y.c1 * d[1]
|
||||
+ y.c2 * d[2];
|
||||
y.c2 = y.c1;
|
||||
y.c1 = y0;
|
||||
x.c2 = x.c1;
|
||||
x.c1 = smp[i];
|
||||
//output
|
||||
smp[i]=y0;
|
||||
};
|
||||
};
|
||||
};
|
||||
smp[i] = y0;
|
||||
}
|
||||
}
|
||||
}
|
||||
void AnalogFilter::filterout(REALTYPE *smp)
|
||||
{
|
||||
REALTYPE *ismp=NULL;//used if it needs interpolation
|
||||
REALTYPE *ismp = NULL; //used if it needs interpolation
|
||||
int i;
|
||||
if (needsinterpolation!=0) {
|
||||
ismp=new REALTYPE[SOUND_BUFFER_SIZE];
|
||||
for (i=0;i<SOUND_BUFFER_SIZE;i++) ismp[i]=smp[i];
|
||||
for (i=0;i<stages+1;i++) singlefilterout(ismp,oldx[i],oldy[i],oldc,oldd);
|
||||
};
|
||||
if(needsinterpolation != 0) {
|
||||
ismp = new REALTYPE[SOUND_BUFFER_SIZE];
|
||||
for(i = 0; i < SOUND_BUFFER_SIZE; i++)
|
||||
ismp[i] = smp[i];
|
||||
for(i = 0; i < stages + 1; i++)
|
||||
singlefilterout(ismp, oldx[i], oldy[i], oldc, oldd);
|
||||
}
|
||||
|
||||
for (i=0;i<stages+1;i++) singlefilterout(smp,x[i],y[i],c,d);
|
||||
for(i = 0; i < stages + 1; i++)
|
||||
singlefilterout(smp, x[i], y[i], c, d);
|
||||
|
||||
if (needsinterpolation!=0) {
|
||||
for (i=0;i<SOUND_BUFFER_SIZE;i++) {
|
||||
REALTYPE x=i/(REALTYPE) SOUND_BUFFER_SIZE;
|
||||
smp[i]=ismp[i]*(1.0-x)+smp[i]*x;
|
||||
};
|
||||
if(needsinterpolation != 0) {
|
||||
for(i = 0; i < SOUND_BUFFER_SIZE; i++) {
|
||||
REALTYPE x = i / (REALTYPE) SOUND_BUFFER_SIZE;
|
||||
smp[i] = ismp[i] * (1.0 - x) + smp[i] * x;
|
||||
}
|
||||
delete [] ismp;
|
||||
needsinterpolation=0;
|
||||
};
|
||||
needsinterpolation = 0;
|
||||
}
|
||||
|
||||
for (i=0;i<SOUND_BUFFER_SIZE;i++) smp[i]*=outgain;
|
||||
};
|
||||
for(i = 0; i < SOUND_BUFFER_SIZE; i++)
|
||||
smp[i] *= outgain;
|
||||
}
|
||||
|
||||
REALTYPE AnalogFilter::H(REALTYPE freq)
|
||||
{
|
||||
REALTYPE fr=freq/SAMPLE_RATE*PI*2.0;
|
||||
REALTYPE x=c[0],y=0.0;
|
||||
for (int n=1;n<3;n++) {
|
||||
x+=cos(n*fr)*c[n];
|
||||
y-=sin(n*fr)*c[n];
|
||||
};
|
||||
REALTYPE h=x*x+y*y;
|
||||
x=1.0;
|
||||
y=0.0;
|
||||
for (int n=1;n<3;n++) {
|
||||
x-=cos(n*fr)*d[n];
|
||||
y+=sin(n*fr)*d[n];
|
||||
};
|
||||
h=h/(x*x+y*y);
|
||||
return(pow(h,(stages+1.0)/2.0));
|
||||
};
|
||||
REALTYPE fr = freq / SAMPLE_RATE * PI * 2.0;
|
||||
REALTYPE x = c[0], y = 0.0;
|
||||
for(int n = 1; n < 3; n++) {
|
||||
x += cos(n * fr) * c[n];
|
||||
y -= sin(n * fr) * c[n];
|
||||
}
|
||||
REALTYPE h = x * x + y * y;
|
||||
x = 1.0;
|
||||
y = 0.0;
|
||||
for(int n = 1; n < 3; n++) {
|
||||
x -= cos(n * fr) * d[n];
|
||||
y += sin(n * fr) * d[n];
|
||||
}
|
||||
h = h / (x * x + y * y);
|
||||
return pow(h, (stages + 1.0) / 2.0);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,45 +29,52 @@
|
||||
/**Implementation of Several analog filters (lowpass, highpass...)*/
|
||||
class AnalogFilter:public Filter_
|
||||
{
|
||||
public:
|
||||
AnalogFilter(unsigned char Ftype,REALTYPE Ffreq, REALTYPE Fq,unsigned char Fstages);
|
||||
~AnalogFilter();
|
||||
void filterout(REALTYPE *smp);
|
||||
void setfreq(REALTYPE frequency);
|
||||
void setfreq_and_q(REALTYPE frequency,REALTYPE q_);
|
||||
void setq(REALTYPE q_);
|
||||
public:
|
||||
AnalogFilter(unsigned char Ftype,
|
||||
REALTYPE Ffreq,
|
||||
REALTYPE Fq,
|
||||
unsigned char Fstages);
|
||||
~AnalogFilter();
|
||||
void filterout(REALTYPE *smp);
|
||||
void setfreq(REALTYPE frequency);
|
||||
void setfreq_and_q(REALTYPE frequency, REALTYPE q_);
|
||||
void setq(REALTYPE q_);
|
||||
|
||||
void settype(int type_);
|
||||
void setgain(REALTYPE dBgain);
|
||||
void setstages(int stages_);
|
||||
void cleanup();
|
||||
void settype(int type_);
|
||||
void setgain(REALTYPE dBgain);
|
||||
void setstages(int stages_);
|
||||
void cleanup();
|
||||
|
||||
REALTYPE H(REALTYPE freq);//Obtains the response for a given frequency
|
||||
REALTYPE H(REALTYPE freq); //Obtains the response for a given frequency
|
||||
|
||||
private:
|
||||
struct fstage {
|
||||
REALTYPE c1,c2;
|
||||
} x[MAX_FILTER_STAGES+1],y[MAX_FILTER_STAGES+1],
|
||||
oldx[MAX_FILTER_STAGES+1],oldy[MAX_FILTER_STAGES+1];
|
||||
private:
|
||||
struct fstage {
|
||||
REALTYPE c1, c2;
|
||||
} x[MAX_FILTER_STAGES + 1], y[MAX_FILTER_STAGES + 1],
|
||||
oldx[MAX_FILTER_STAGES + 1], oldy[MAX_FILTER_STAGES + 1];
|
||||
|
||||
void singlefilterout(REALTYPE *smp,fstage &x,fstage &y,REALTYPE *c,REALTYPE *d);
|
||||
void computefiltercoefs();
|
||||
int type;//The type of the filter (LPF1,HPF1,LPF2,HPF2...)
|
||||
int stages;//how many times the filter is applied (0->1,1->2,etc.)
|
||||
REALTYPE freq;//Frequency given in Hz
|
||||
REALTYPE q; //Q factor (resonance or Q factor)
|
||||
REALTYPE gain;//the gain of the filter (if are shelf/peak) filters
|
||||
void singlefilterout(REALTYPE *smp,
|
||||
fstage &x,
|
||||
fstage &y,
|
||||
REALTYPE *c,
|
||||
REALTYPE *d);
|
||||
void computefiltercoefs();
|
||||
int type; //The type of the filter (LPF1,HPF1,LPF2,HPF2...)
|
||||
int stages; //how many times the filter is applied (0->1,1->2,etc.)
|
||||
REALTYPE freq; //Frequency given in Hz
|
||||
REALTYPE q; //Q factor (resonance or Q factor)
|
||||
REALTYPE gain; //the gain of the filter (if are shelf/peak) filters
|
||||
|
||||
int order;//the order of the filter (number of poles)
|
||||
int order; //the order of the filter (number of poles)
|
||||
|
||||
REALTYPE c[3],d[3];//coefficients
|
||||
REALTYPE c[3], d[3]; //coefficients
|
||||
|
||||
REALTYPE oldc[3],oldd[3];//old coefficients(used only if some filter paremeters changes very fast, and it needs interpolation)
|
||||
REALTYPE oldc[3], oldd[3]; //old coefficients(used only if some filter paremeters changes very fast, and it needs interpolation)
|
||||
|
||||
REALTYPE xd[3],yd[3];//used if the filter is applied more times
|
||||
int needsinterpolation,firsttime;/**\todo see if bool works for these*/
|
||||
int abovenq;//this is 1 if the frequency is above the nyquist
|
||||
int oldabovenq;//if the last time was above nyquist (used to see if it needs interpolation)
|
||||
REALTYPE xd[3], yd[3]; //used if the filter is applied more times
|
||||
int needsinterpolation, firsttime; /**\todo see if bool works for these*/
|
||||
int abovenq; //this is 1 if the frequency is above the nyquist
|
||||
int oldabovenq; //if the last time was above nyquist (used to see if it needs interpolation)
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ set(zynaddsubfx_dsp_SRCS
|
||||
Filter.cpp
|
||||
FormantFilter.cpp
|
||||
SVFilter.cpp
|
||||
Unison.cpp
|
||||
)
|
||||
|
||||
add_library(zynaddsubfx_dsp STATIC
|
||||
|
||||
@@ -25,17 +25,29 @@
|
||||
|
||||
FFTwrapper::FFTwrapper(int fftsize_)
|
||||
{
|
||||
fftsize=fftsize_;
|
||||
tmpfftdata1=new fftw_real[fftsize];
|
||||
tmpfftdata2=new fftw_real[fftsize];
|
||||
fftsize = fftsize_;
|
||||
tmpfftdata1 = new fftw_real[fftsize];
|
||||
tmpfftdata2 = new fftw_real[fftsize];
|
||||
#ifdef FFTW_VERSION_2
|
||||
planfftw=rfftw_create_plan(fftsize,FFTW_REAL_TO_COMPLEX,FFTW_ESTIMATE|FFTW_IN_PLACE);
|
||||
planfftw_inv=rfftw_create_plan(fftsize,FFTW_COMPLEX_TO_REAL,FFTW_ESTIMATE|FFTW_IN_PLACE);
|
||||
planfftw = rfftw_create_plan(fftsize,
|
||||
FFTW_REAL_TO_COMPLEX,
|
||||
FFTW_ESTIMATE | FFTW_IN_PLACE);
|
||||
planfftw_inv = rfftw_create_plan(fftsize,
|
||||
FFTW_COMPLEX_TO_REAL,
|
||||
FFTW_ESTIMATE | FFTW_IN_PLACE);
|
||||
#else
|
||||
planfftw=fftwf_plan_r2r_1d(fftsize,tmpfftdata1,tmpfftdata1,FFTW_R2HC,FFTW_ESTIMATE);
|
||||
planfftw_inv=fftwf_plan_r2r_1d(fftsize,tmpfftdata2,tmpfftdata2,FFTW_HC2R,FFTW_ESTIMATE);
|
||||
planfftw = fftwf_plan_r2r_1d(fftsize,
|
||||
tmpfftdata1,
|
||||
tmpfftdata1,
|
||||
FFTW_R2HC,
|
||||
FFTW_ESTIMATE);
|
||||
planfftw_inv = fftwf_plan_r2r_1d(fftsize,
|
||||
tmpfftdata2,
|
||||
tmpfftdata2,
|
||||
FFTW_HC2R,
|
||||
FFTW_ESTIMATE);
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
FFTwrapper::~FFTwrapper()
|
||||
{
|
||||
@@ -49,52 +61,76 @@ FFTwrapper::~FFTwrapper()
|
||||
|
||||
delete [] tmpfftdata1;
|
||||
delete [] tmpfftdata2;
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
* do the Fast Fourier Transform
|
||||
*/
|
||||
void FFTwrapper::smps2freqs(REALTYPE *smps,FFTFREQS freqs)
|
||||
void FFTwrapper::smps2freqs(REALTYPE *smps, FFTFREQS freqs)
|
||||
{
|
||||
#ifdef FFTW_VERSION_2
|
||||
for (int i=0;i<fftsize;i++) tmpfftdata1[i]=smps[i];
|
||||
rfftw_one(planfftw,tmpfftdata1,tmpfftdata2);
|
||||
for (int i=0;i<fftsize/2;i++) {
|
||||
freqs.c[i]=tmpfftdata2[i];
|
||||
if (i!=0) freqs.s[i]=tmpfftdata2[fftsize-i];
|
||||
};
|
||||
for(int i = 0; i < fftsize; i++)
|
||||
tmpfftdata1[i] = smps[i];
|
||||
rfftw_one(planfftw, tmpfftdata1, tmpfftdata2);
|
||||
for(int i = 0; i < fftsize / 2; i++) {
|
||||
freqs.c[i] = tmpfftdata2[i];
|
||||
if(i != 0)
|
||||
freqs.s[i] = tmpfftdata2[fftsize - i];
|
||||
}
|
||||
#else
|
||||
for (int i=0;i<fftsize;i++) tmpfftdata1[i]=smps[i];
|
||||
for(int i = 0; i < fftsize; i++)
|
||||
tmpfftdata1[i] = smps[i];
|
||||
fftwf_execute(planfftw);
|
||||
for (int i=0;i<fftsize/2;i++) {
|
||||
freqs.c[i]=tmpfftdata1[i];
|
||||
if (i!=0) freqs.s[i]=tmpfftdata1[fftsize-i];
|
||||
};
|
||||
for(int i = 0; i < fftsize / 2; i++) {
|
||||
freqs.c[i] = tmpfftdata1[i];
|
||||
if(i != 0)
|
||||
freqs.s[i] = tmpfftdata1[fftsize - i];
|
||||
}
|
||||
#endif
|
||||
tmpfftdata2[fftsize/2]=0.0;
|
||||
};
|
||||
tmpfftdata2[fftsize / 2] = 0.0;
|
||||
}
|
||||
|
||||
/*
|
||||
* do the Inverse Fast Fourier Transform
|
||||
*/
|
||||
void FFTwrapper::freqs2smps(FFTFREQS freqs,REALTYPE *smps)
|
||||
void FFTwrapper::freqs2smps(FFTFREQS freqs, REALTYPE *smps)
|
||||
{
|
||||
tmpfftdata2[fftsize/2]=0.0;
|
||||
tmpfftdata2[fftsize / 2] = 0.0;
|
||||
#ifdef FFTW_VERSION_2
|
||||
for (int i=0;i<fftsize/2;i++) {
|
||||
tmpfftdata1[i]=freqs.c[i];
|
||||
if (i!=0) tmpfftdata1[fftsize-i]=freqs.s[i];
|
||||
};
|
||||
rfftw_one(planfftw_inv,tmpfftdata1,tmpfftdata2);
|
||||
for (int i=0;i<fftsize;i++) smps[i]=tmpfftdata2[i];
|
||||
for(int i = 0; i < fftsize / 2; i++) {
|
||||
tmpfftdata1[i] = freqs.c[i];
|
||||
if(i != 0)
|
||||
tmpfftdata1[fftsize - i] = freqs.s[i];
|
||||
}
|
||||
rfftw_one(planfftw_inv, tmpfftdata1, tmpfftdata2);
|
||||
for(int i = 0; i < fftsize; i++)
|
||||
smps[i] = tmpfftdata2[i];
|
||||
#else
|
||||
for (int i=0;i<fftsize/2;i++) {
|
||||
tmpfftdata2[i]=freqs.c[i];
|
||||
if (i!=0) tmpfftdata2[fftsize-i]=freqs.s[i];
|
||||
};
|
||||
for(int i = 0; i < fftsize / 2; i++) {
|
||||
tmpfftdata2[i] = freqs.c[i];
|
||||
if(i != 0)
|
||||
tmpfftdata2[fftsize - i] = freqs.s[i];
|
||||
}
|
||||
fftwf_execute(planfftw_inv);
|
||||
for (int i=0;i<fftsize;i++) smps[i]=tmpfftdata2[i];
|
||||
for(int i = 0; i < fftsize; i++)
|
||||
smps[i] = tmpfftdata2[i];
|
||||
#endif
|
||||
}
|
||||
|
||||
};
|
||||
void newFFTFREQS(FFTFREQS *f, int size)
|
||||
{
|
||||
f->c = new REALTYPE[size];
|
||||
f->s = new REALTYPE[size];
|
||||
for(int i = 0; i < size; i++) {
|
||||
f->c[i] = 0.0;
|
||||
f->s[i] = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void deleteFFTFREQS(FFTFREQS *f)
|
||||
{
|
||||
delete[] f->c;
|
||||
delete[] f->s;
|
||||
f->c = f->s = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,21 +47,24 @@ Hope all goes right." */
|
||||
/**A wrapper for the FFTW library (Fast Fourier Transforms)*/
|
||||
class FFTwrapper
|
||||
{
|
||||
public:
|
||||
/**Constructor
|
||||
* @param fftsize The size of samples to be fed to fftw*/
|
||||
FFTwrapper(int fftsize_);
|
||||
/**Destructor*/
|
||||
~FFTwrapper();
|
||||
/**Convert Samples to Frequencies using Fourier Transform
|
||||
* @param smps Pointer to Samples to be converted; has length fftsize_
|
||||
* @param freqs Structure FFTFREQS which stores the frequencies*/
|
||||
void smps2freqs(REALTYPE *smps,FFTFREQS freqs);
|
||||
void freqs2smps(FFTFREQS freqs,REALTYPE *smps);
|
||||
private:
|
||||
int fftsize;
|
||||
fftw_real *tmpfftdata1,*tmpfftdata2;
|
||||
rfftw_plan planfftw,planfftw_inv;
|
||||
public:
|
||||
/**Constructor
|
||||
* @param fftsize The size of samples to be fed to fftw*/
|
||||
FFTwrapper(int fftsize_);
|
||||
/**Destructor*/
|
||||
~FFTwrapper();
|
||||
/**Convert Samples to Frequencies using Fourier Transform
|
||||
* @param smps Pointer to Samples to be converted; has length fftsize_
|
||||
* @param freqs Structure FFTFREQS which stores the frequencies*/
|
||||
void smps2freqs(REALTYPE *smps, FFTFREQS freqs);
|
||||
void freqs2smps(FFTFREQS freqs, REALTYPE *smps);
|
||||
private:
|
||||
int fftsize;
|
||||
fftw_real *tmpfftdata1, *tmpfftdata2;
|
||||
rfftw_plan planfftw, planfftw_inv;
|
||||
};
|
||||
|
||||
void newFFTFREQS(FFTFREQS *f, int size);
|
||||
void deleteFFTFREQS(FFTFREQS *f);
|
||||
#endif
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user