editor: show interpolation mode

Show the interpolation mode in the status-bar. This is a little bit
more useful for people who are new to GNU Rocket than just using some
undocumented color-code in the track.
This commit is contained in:
Erik Faye-Lund 2010-04-05 18:34:12 +02:00
parent a56dc45690
commit 51d1e706bf

View File

@ -297,7 +297,7 @@ static LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
NULL // window data
);
int statwidths[] = { 150, 150 + 32, 150 + 32 * 2, 150 + 32 * 4};
int statwidths[] = { 150, 150 + 32, 150 + 32 * 2, 150 + 32 * 4, 150 + 32 * 6};
SendMessage(statusBarWin, SB_SETPARTS, sizeof(statwidths) / sizeof(int), (LPARAM)statwidths);
SendMessage(statusBarWin, SB_SETTEXT, 0, (LPARAM)"Not connected");
SendMessage(statusBarWin, SB_SETTEXT, 1, (LPARAM)"0");
@ -457,9 +457,20 @@ static LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
{
char temp[256];
if (document.num_tracks > 0) {
sync_track *t = document.tracks[document.getTrackIndexFromPos(trackView->getEditTrack())];
float row = float(trackView->getEditRow());
const sync_track *t = document.tracks[document.getTrackIndexFromPos(trackView->getEditTrack())];
int row = trackView->getEditRow();
int idx = key_idx_floor(t, row);
snprintf(temp, 256, "%f", sync_get_val(t, row));
const char *str = "---";
if (idx >= 0) {
switch (t->keys[idx].type) {
case KEY_STEP: str = "step"; break;
case KEY_LINEAR: str = "linear"; break;
case KEY_SMOOTH: str = "smooth"; break;
case KEY_RAMP: str = "ramp"; break;
}
}
SendMessage(statusBarWin, SB_SETTEXT, 4, (LPARAM)str);
} else
snprintf(temp, 256, "---");
SendMessage(statusBarWin, SB_SETTEXT, 3, (LPARAM)temp);