Added marker for where the data is edited
This commit is contained in:
parent
b936ced270
commit
6a46001a6e
@ -63,7 +63,7 @@ void Editor_update()
|
|||||||
{
|
{
|
||||||
Emgui_begin();
|
Emgui_begin();
|
||||||
|
|
||||||
TrackView_render(&s_editorData.trackViewInfo, &s_editorData.trackData.syncData);
|
TrackView_render(&s_editorData.trackViewInfo, &s_editorData.trackData);
|
||||||
|
|
||||||
Emgui_end();
|
Emgui_end();
|
||||||
}
|
}
|
||||||
@ -106,6 +106,30 @@ bool Editor_keyDown(int key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EMGUI_ARROW_LEFT:
|
||||||
|
{
|
||||||
|
if (paused)
|
||||||
|
{
|
||||||
|
--s_editorData.trackData.activeTrack;
|
||||||
|
|
||||||
|
if (s_editorData.trackData.activeTrack < 0)
|
||||||
|
s_editorData.trackData.activeTrack = 0;
|
||||||
|
|
||||||
|
Editor_update();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case EMGUI_ARROW_RIGHT:
|
||||||
|
{
|
||||||
|
if (paused)
|
||||||
|
{
|
||||||
|
++s_editorData.trackData.activeTrack;
|
||||||
|
Editor_update();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
default : handled_key = false; break;
|
default : handled_key = false; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ typedef struct TrackData
|
|||||||
struct sync_data syncData;
|
struct sync_data syncData;
|
||||||
int order[8192];
|
int order[8192];
|
||||||
int orderCount;
|
int orderCount;
|
||||||
|
int activeTrack;
|
||||||
} TrackData;
|
} TrackData;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "TrackData.h"
|
||||||
#include "../../sync/sync.h"
|
#include "../../sync/sync.h"
|
||||||
#include "../../sync/data.h"
|
#include "../../sync/data.h"
|
||||||
#include "../../sync/track.h"
|
#include "../../sync/track.h"
|
||||||
@ -125,8 +126,10 @@ int doMax(int a, int b)
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void TrackView_render(const TrackViewInfo* viewInfo, struct sync_data* syncData)
|
void TrackView_render(const TrackViewInfo* viewInfo, TrackData* trackData)
|
||||||
{
|
{
|
||||||
|
struct sync_data* syncData = &trackData->syncData;
|
||||||
|
|
||||||
// TODO: Calculate how many channels we can draw given the width
|
// TODO: Calculate how many channels we can draw given the width
|
||||||
|
|
||||||
uint i = 0; //, channel_count = 10;
|
uint i = 0; //, channel_count = 10;
|
||||||
@ -153,6 +156,9 @@ void TrackView_render(const TrackViewInfo* viewInfo, struct sync_data* syncData)
|
|||||||
renderChannel(syncData->tracks[i], 40 + (i * 128), 42,
|
renderChannel(syncData->tracks[i], 40 + (i * 128), 42,
|
||||||
(start_pos + viewInfo->rowPos),
|
(start_pos + viewInfo->rowPos),
|
||||||
(start_pos + viewInfo->rowPos + 40));
|
(start_pos + viewInfo->rowPos + 40));
|
||||||
|
|
||||||
|
if (trackData->activeTrack == i)
|
||||||
|
Emgui_fill(Emgui_color32(0xff, 0xff, 0x00, 0x80), 40 + (i * 128), 257, 128, font_size + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t color = Emgui_color32(127, 127, 127, 56);
|
uint32_t color = Emgui_color32(127, 127, 127, 56);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
struct sync_data;
|
struct TrackData* trackData;
|
||||||
|
|
||||||
typedef struct TrackViewInfo
|
typedef struct TrackViewInfo
|
||||||
{
|
{
|
||||||
@ -17,5 +17,5 @@ typedef struct TrackViewInfo
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void TrackView_init();
|
void TrackView_init();
|
||||||
void TrackView_render(const TrackViewInfo* viewInfo, struct sync_data* syncData);
|
void TrackView_render(const TrackViewInfo* viewInfo, struct TrackData* trackData);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user