Supprimer les parametres d'éxample

This commit is contained in:
yaw-man 2022-08-09 13:20:33 -03:00
parent ca10986e54
commit 2a2202c1fd
3 changed files with 38 additions and 36 deletions

View File

@ -20,20 +20,7 @@
#endif
enum Parameters {
kParameterBufferSize = 0,
kParameterCanRequestParameterValueChanges,
kParameterTimePlaying,
kParameterTimeFrame,
kParameterTimeValidBBT,
kParameterTimeBar,
kParameterTimeBeat,
kParameterTimeTick,
kParameterTimeBarStartTick,
kParameterTimeBeatsPerBar,
kParameterTimeBeatType,
kParameterTimeTicksPerBeat,
kParameterTimeBeatsPerMinute,
kParameterTabletX,
kParameterTabletX = 0,
kParameterTabletY,
kParameterTabletZ,
kParameterTabletPressure,

View File

@ -11,9 +11,10 @@ public:
// clear all parameters
std::memset(fParameters, 0, sizeof(float) * kParameterCount);
// we can know some things right at the start
/* we can know some things right at the start
fParameters[kParameterBufferSize] = getBufferSize();
fParameters[kParameterCanRequestParameterValueChanges] = canRequestParameterValueChanges();
*/
}
protected:
@ -94,7 +95,7 @@ protected:
parameter.ranges.max = 16777216.0f;
switch (index)
{
{/*
case kParameterBufferSize:
parameter.name = "BufferSize";
parameter.symbol = "buffer_size";
@ -152,28 +153,28 @@ protected:
case kParameterTimeBeatsPerMinute:
parameter.name = "TimeBeatsPerMinute";
parameter.symbol = "time_beatsperminute";
break;
break;*/
case kParameterTabletX:
parameter.name = "TabletX";
parameter.symbol = "tablet_x";
parameter.name = "x";
parameter.symbol = "x";
parameter.ranges.min = 0;
parameter.ranges.max = 1024;
break;
case kParameterTabletY:
parameter.name = "TabletY";
parameter.symbol = "tablet_y";
parameter.name = "y";
parameter.symbol = "y";
parameter.ranges.min = 0;
parameter.ranges.max = 1024;
break;
case kParameterTabletZ:
parameter.name = "TabletZ";
parameter.symbol = "tablet_z";
parameter.name = "z";
parameter.symbol = "z";
parameter.ranges.min = 0;
parameter.ranges.max = 1024;
break;
case kParameterTabletPressure:
parameter.name = "TabletPressure";
parameter.symbol = "tablet_p";
parameter.name = "p";
parameter.symbol = "p";
parameter.ranges.min = 0;
parameter.ranges.max = 1024;
break;
@ -228,6 +229,7 @@ protected:
const TimePosition& timePos(getTimePosition());
// set basic values
/*
fParameters[kParameterTimePlaying] = timePos.playing ? 1.0f : 0.0f;
fParameters[kParameterTimeFrame] = timePos.frame;
fParameters[kParameterTimeValidBBT] = timePos.bbt.valid ? 1.0f : 0.0f;
@ -255,9 +257,10 @@ protected:
fParameters[kParameterTimeTicksPerBeat] = 0.0f;
fParameters[kParameterTimeBeatsPerMinute] = 0.0f;
}
*/
//il faut seulment changer un des parametres pour mettre à jour les donnés de la tablet
fParameters[kParameterTabletPressure] = 0;
fParameters[kParameterTabletPressure] = timePos.bbt.tick;
}
/* --------------------------------------------------------------------------------------------------------
@ -271,7 +274,7 @@ protected:
*/
void bufferSizeChanged(uint32_t newBufferSize) override
{
fParameters[kParameterBufferSize] = newBufferSize;
//fParameters[kParameterBufferSize] = newBufferSize;
}
// -------------------------------------------------------------------------------------------------------

View File

@ -41,17 +41,17 @@ protected:
{
// some hosts send parameter change events for output parameters even when nothing changed
// we catch that here in order to prevent excessive repaints
if (d_isEqual(fParameters[index], value))
return;
//if (d_isEqual(fParameters[index], value))
// return;
fParameters[index] = value;
//Lire donnés de la tablet
tab.NewPacket();
fParameters[kParameterTabletX] = tab.pkt.pkX;
fParameters[kParameterTabletY] = tab.pkt.pkY;
fParameters[kParameterTabletZ] = tab.pkt.pkZ;
fParameters[kParameterTabletPressure] = tab.pkt.pkNormalPressure;
fParameters[kParameterTabletX] = static_cast<float>(tab.pkt.pkX);
fParameters[kParameterTabletY] = static_cast<float>(tab.pkt.pkY);
fParameters[kParameterTabletZ] = static_cast<float>(tab.pkt.pkZ);
fParameters[kParameterTabletPressure] = static_cast<float>(tab.pkt.pkNormalPressure);
repaint();
@ -84,7 +84,7 @@ protected:
float x = 0.0f * fScale;
float y = 15.0f * fScale;
/*
// buffer size
drawLeft(x, y, "Buffer Size:");
drawRight(x, y, getTextBufInt(fParameters[kParameterBufferSize]));
@ -172,10 +172,22 @@ protected:
drawLeft(x, y, "BPM:");
drawRight(x, y, getTextBufFloat(fParameters[kParameterTimeBeatsPerMinute]));
y += lineHeight;
*/
drawLeft(x, y, "x:");
drawRight(x, y, getTextBufFloat(fParameters[kParameterTabletX]));
y += lineHeight;
drawLeft(x, y, "y:");
drawRight(x, y, getTextBufFloat(fParameters[kParameterTabletY]));
y += lineHeight;
drawLeft(x, y, "z:");
drawRight(x, y, getTextBufFloat(fParameters[kParameterTabletZ]));
y += lineHeight;
drawLeft(x, y, "p:");
drawRight(x, y, getTextBufFloat(fParameters[kParameterTabletPressure]));
y += lineHeight;
}
void onResize(const ResizeEvent& ev) override