Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "bme_win.h"

#include <utility>
#include <string>

#include <cstdio>
#include <cstring>
Expand Down Expand Up @@ -83,6 +84,8 @@ unsigned timeframe = 0;
int cursorflash = 0;
int cursorcolortable[] = { CWHITE, CLGREY, CGREY, CLGREY };

std::string tooltip = "test";

void initcolorscheme(bool dark)
{
colors.CBKGND = dark ? CBLACK : CDBLUE;
Expand Down Expand Up @@ -617,6 +620,10 @@ void printstatus()

color = tables.islocked() ? colors.CTITLE : colors.CMUTE;
printtext(dpos.channelsX-5, dpos.channelsY+1, color, "Lck");

// pad with spaces
tooltip.append(35 - tooltip.length(), ' ');
printtext(dpos.octaveX+35, dpos.octaveY+1, CLBLUE, tooltip.c_str());
}


Expand Down Expand Up @@ -647,3 +654,8 @@ void incrementtime()
}
}

void settooltip(const char *msg)
{
tooltip = msg;
// TODO timeout
}
1 change: 1 addition & 0 deletions src/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ void resettime();
void incrementtime();
void flashCursor();
int getCursorColor();
void settooltip(const char *msg);

#endif
80 changes: 79 additions & 1 deletion src/loadtrk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ void calculatefreqtable();
void switchMode();
void optimizeeverything();
void findduplicatepatterns();
void tooltips();

int main(int argc, char **argv)
{
Expand Down Expand Up @@ -394,6 +395,7 @@ void waitkeymouse()
for (;;)
{
displayupdate();
tooltips();
getkey();
if ((rawkey) || (key)) break;
if (win_quitted) break;
Expand Down Expand Up @@ -483,6 +485,83 @@ void docommand()
generalcommands();
}

void tooltips()
{
settooltip("");

// Titlebar
if (!menu)
{
if (mousey == dpos.statusTopY)
{
if ((mousex >= dpos.statusTopFvX-3) && (mousex <= dpos.statusTopFvX-2) && (numsids == 2))
{
settooltip("Stereo mode");
}
if ((mousex >= dpos.statusTopFvX) && (mousex <= dpos.statusTopFvX+1))
{
settooltip("Fine vibrato");
}
if ((mousex >= dpos.statusTopFvX+3) && (mousex <= dpos.statusTopFvX+4))
{
settooltip("Optimize pulse");
}
if ((mousex >= dpos.statusTopFvX+6) && (mousex <= dpos.statusTopFvX+7))
{
settooltip("Optimize realtime");
}
if ((mousex >= dpos.statusTopFvX+9) && (mousex <= dpos.statusTopFvX+12))
{
settooltip("Video frequency");
}
if ((mousex >= dpos.statusTopFvX+14) && (mousex <= dpos.statusTopFvX+17))
{
settooltip("SID model");
}
if ((mousex >= dpos.statusTopFvX+22) &&
(mousex <= dpos.statusTopFvX+25)) settooltip("Hard restart ADSR");
if ((mousex >= dpos.statusTopFvX+27) &&
(mousex <= dpos.statusTopFvX+30)) settooltip("Speed multiplier");
if ((mousex >= dpos.statusTopFvX+31) &&
(mousex <= dpos.statusTopFvX+33)) settooltip("BPM");
if ((mousex >= dpos.statusTopEndX-8) &&
(mousex <= dpos.statusTopEndX-1)) settooltip("Online help");
}
}

// Instruments
if (mousey == dpos.instrumentsY)
{
if ((mousex >= (dpos.instrumentsX+20)) &&
(mousex <= (dpos.instrumentsX+21)))
settooltip("Attack/Decay");
if ((mousex >= (dpos.instrumentsX+23)) &&
(mousex <= (dpos.instrumentsX+24)))
settooltip("Sustain/Release");
if ((mousex >= (dpos.instrumentsX+26)) &&
(mousex <= (dpos.instrumentsX+27)))
settooltip("Wave table position");
if ((mousex >= (dpos.instrumentsX+29)) &&
(mousex <= (dpos.instrumentsX+30)))
settooltip("Pulse table position");
if ((mousex >= (dpos.instrumentsX+32)) &&
(mousex <= (dpos.instrumentsX+33)))
settooltip("Filter table position");
if ((mousex >= (dpos.instrumentsX+35)) &&
(mousex <= (dpos.instrumentsX+36)))
settooltip("Speed table position (vibrato)");
if ((mousex >= (dpos.instrumentsX+38)) &&
(mousex <= (dpos.instrumentsX+39)))
settooltip("Vibrato delay");
if ((mousex >= (dpos.instrumentsX+41)) &&
(mousex <= (dpos.instrumentsX+42)))
settooltip("Gate timer");
if ((mousex >= (dpos.instrumentsX+44)) &&
(mousex <= (dpos.instrumentsX+45)))
settooltip("First wave");
}
}

void mousecommands()
{
int maxChns = getMaxChannels();
Expand Down Expand Up @@ -652,7 +731,6 @@ void mousecommands()
(mousex >= dpos.orderlistX))
{
int newcolumn = (mousex-(dpos.orderlistX+4)) % 3;
//int newchn = mousey - 3;
int newchn = mousey - (dpos.orderlistY+1);
int newpos = esview[newchn] + (mousex-(dpos.orderlistX+4)) / 3;
if (newcolumn < 0) newcolumn = 0;
Expand Down
Loading