parent
027dc6001d
commit
dbbc2c7b4a
@ -1,5 +1,6 @@
|
|||||||
#include "Commands.h"
|
#include "Commands.h"
|
||||||
#include "RemoteConnection.h"
|
#include "RemoteConnection.h"
|
||||||
|
#include "TrackData.h"
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "../../sync/sync.h"
|
#include "../../sync/sync.h"
|
||||||
#include "../../sync/track.h"
|
#include "../../sync/track.h"
|
||||||
@ -324,6 +325,41 @@ void Commands_addOrUpdateKey(int track, struct track_key* key)
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
struct BookmarkData
|
||||||
|
{
|
||||||
|
struct TrackData* trackData;
|
||||||
|
int row;
|
||||||
|
};
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
static void toggleBookmark(void* userData)
|
||||||
|
{
|
||||||
|
struct BookmarkData* data = (struct BookmarkData*)userData;
|
||||||
|
TrackData_toggleBookmark(data->trackData, data->row);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void Commands_toggleBookmark(TrackData* trackData, int row)
|
||||||
|
{
|
||||||
|
struct BookmarkData* data;
|
||||||
|
Command* command;
|
||||||
|
|
||||||
|
command = malloc(sizeof(Command));
|
||||||
|
memset(command, 0, sizeof(Command));
|
||||||
|
|
||||||
|
command->userData = data = malloc(sizeof(struct BookmarkData));
|
||||||
|
command->exec = toggleBookmark;
|
||||||
|
command->undo = toggleBookmark;
|
||||||
|
data->trackData = trackData;
|
||||||
|
data->row = row;
|
||||||
|
|
||||||
|
execCommand(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Commands_undo()
|
void Commands_undo()
|
||||||
{
|
{
|
||||||
Command* command;
|
Command* command;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ void Commands_redo();
|
|||||||
|
|
||||||
void Commands_deleteKey(int track, int row);
|
void Commands_deleteKey(int track, int row);
|
||||||
void Commands_addOrUpdateKey(int track, struct track_key* key);
|
void Commands_addOrUpdateKey(int track, struct track_key* key);
|
||||||
void Commands_toogleBookmark(int track, int row);
|
void Commands_toggleBookmark(struct TrackData* trackData, int row);
|
||||||
void Commands_updateKey(int track, struct track_key* key);
|
void Commands_updateKey(int track, struct track_key* key);
|
||||||
void Commands_beginMulti(const char* name); // Used (for example) when changing many value at the same time
|
void Commands_beginMulti(const char* name); // Used (for example) when changing many value at the same time
|
||||||
void Commands_endMulti();
|
void Commands_endMulti();
|
||||||
|
|||||||
@ -1244,7 +1244,7 @@ static void onFoldGroup(bool fold)
|
|||||||
|
|
||||||
static void onToggleBookmark()
|
static void onToggleBookmark()
|
||||||
{
|
{
|
||||||
TrackData_toogleBookmark(getTrackData(), getRowPos());
|
Commands_toggleBookmark(getTrackData(), getRowPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@ -198,7 +198,7 @@ static void sortArray(int* bookmarks, int count)
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void TrackData_toogleBookmark(TrackData* trackData, int row)
|
void TrackData_toggleBookmark(TrackData* trackData, int row)
|
||||||
{
|
{
|
||||||
int i, count = trackData->bookmarkCount;
|
int i, count = trackData->bookmarkCount;
|
||||||
int* bookmarks = trackData->bookmarks;
|
int* bookmarks = trackData->bookmarks;
|
||||||
|
|||||||
@ -79,7 +79,7 @@ typedef struct TrackData
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool TrackData_hasBookmark(TrackData* trackData, int row);
|
bool TrackData_hasBookmark(TrackData* trackData, int row);
|
||||||
void TrackData_toogleBookmark(TrackData* trackData, int row);
|
void TrackData_toggleBookmark(TrackData* trackData, int row);
|
||||||
int TrackData_getNextBookmark(TrackData* trackData, int row);
|
int TrackData_getNextBookmark(TrackData* trackData, int row);
|
||||||
int TrackData_getPrevBookmark(TrackData* trackData, int row);
|
int TrackData_getPrevBookmark(TrackData* trackData, int row);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user