From 51d1e706bf67c6636f4c144d4a6b905a4f0eb7a1 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 5 Apr 2010 18:34:12 +0200 Subject: [PATCH] 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. --- editor/editor.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/editor/editor.cpp b/editor/editor.cpp index af56477..9b8a430 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -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);