Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
e9e1528
Add basic search and color select for markers
ThomasWilshaw Mar 4, 2025
2f1c0fb
Add 'Filter By' selction and cleanup
ThomasWilshaw Mar 5, 2025
2021d55
Add Effect filtering
ThomasWilshaw Mar 5, 2025
d053029
Add state information to the marker filter to improve performance
ThomasWilshaw Mar 5, 2025
ae92002
Merge branch 'main' into marker_search
ThomasWilshaw Mar 14, 2025
0c3ce05
Fix merge
ThomasWilshaw Mar 14, 2025
2b5c3e3
Redraw list when marker colour selection is cleared
ThomasWilshaw Mar 14, 2025
cf6a058
Improve comemnting
ThomasWilshaw Mar 14, 2025
769e07d
Merge branch 'main' into marker_search
ThomasWilshaw Sep 25, 2025
ae00360
Move marker filter state to tab data structure
ThomasWilshaw Sep 25, 2025
2cdd4ff
Add usage box and tooltip to the marker filter UI
ThomasWilshaw Sep 25, 2025
6d191ca
Add place holder text when no file is loaded
ThomasWilshaw Sep 26, 2025
4a990f8
Move effect state to tab data and fix marker checkboxes
ThomasWilshaw Sep 26, 2025
edc97cf
Remove Usage box and move text to help icon
ThomasWilshaw Sep 27, 2025
02a6234
Tidy up code
ThomasWilshaw Sep 27, 2025
1a7bd5a
Fix marker and effect filter logic
ThomasWilshaw Sep 30, 2025
e5a9c6f
Add a state change variable to TabData that can be used to check if w…
ThomasWilshaw Sep 30, 2025
922f1a8
Move state change code to AppUpdate function and piggy back existing …
ThomasWilshaw Sep 30, 2025
ec24ae3
Fix crash that may be unrelated. Empty strings for labels are not all…
ThomasWilshaw Sep 30, 2025
4b05d51
Fix typos
ThomasWilshaw Sep 30, 2025
12d618b
Fix crash when deleting object with marker
ThomasWilshaw Dec 3, 2025
41f302a
Ensure JSON edits trigger a Marker/Filter redraw
ThomasWilshaw Dec 3, 2025
48e6ca8
Ensure adding a marker causes a redraw
ThomasWilshaw Dec 3, 2025
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
15 changes: 14 additions & 1 deletion app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@ void LoadFile(std::string path) {
return;
}

// Force inspector to reload marker and effect lists
appState.active_tab->marker_filter_state.reload = true;
appState.active_tab->effect_filter_state.reload = true;

appState.active_tab->file_path = path;

auto end = std::chrono::high_resolution_clock::now();
Expand Down Expand Up @@ -622,7 +626,16 @@ bool IconButton(const char* label, const ImVec2 size = ImVec2(0, 0)) {
return result;
}

void AppUpdate() { }
void AppUpdate() {
// If something has happend that changed the active tabs state
// then handle any redraw/recalculation flags here
if (appState.active_tab && appState.active_tab->state_change) {
appState.active_tab->marker_filter_state.reload = true;
appState.active_tab->effect_filter_state.reload = true;

appState.active_tab->state_change = false;
}
}

void DrawRoot(otio::SerializableObjectWithMetadata* root) {
if (!root){
Expand Down
42 changes: 42 additions & 0 deletions app.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "imgui.h"
#include "imgui_internal.h"

#include <opentimelineio/marker.h>
#include <opentimelineio/timeline.h>
#include <opentimelineio/serializableObjectWithMetadata.h>
namespace otio = opentimelineio::OPENTIMELINEIO_VERSION;
Expand Down Expand Up @@ -77,6 +78,36 @@ struct AppTheme {
ImU32 colors[AppThemeCol_COUNT];
};


typedef std::pair<otio::SerializableObject::Retainer<otio::Marker>,
otio::SerializableObject::Retainer<otio::Item>> marker_parent_pair;

// Store the state of the marker filter to save regenerating the list every frame
// if the filter options haven't changed
struct MarkerFilterState {
bool color_change; // Has the color combo box changed?
std::string filter_text = ""; // Text in filter box
bool name_check = true; // State of filter by Name checkbox
bool item_check = false; // State of filter by Item checkbox
std::vector<marker_parent_pair> pairs; // List of Markers the passed filtering
bool reload = false; // Trigger from loading a new file or state change
std::string filter_marker_color; // Stores the selected color in the combo box
};

typedef std::pair<otio::SerializableObject::Retainer<otio::Effect>,
otio::SerializableObject::Retainer<otio::Item>> effect_parent_pair;

// Store the state of the effect filter to save regenerating the list every frame
// if the filter options haven't changed
struct EffectFilterState {
std::string filter_text = ""; // Text in filter box
bool reload = false; // Trigger from loading a new file or state change
bool name_check = true; // State of filter by Name checkbox
bool item_check = false; // State of filter by Item checkbox
bool effect_check = true; // State of filter by Effect checkbox
std::vector<effect_parent_pair> pairs; //List of Effects that passed filtering
};

// Struct that holds data specific to individual tabs.
struct TabData {
// This holds the main Schema object. Pretty much everything drills into
Expand All @@ -93,6 +124,17 @@ struct TabData {

bool first_frame = true; // The timeline drawing code has to be drawn across
// two frames so we keep track of that here

// Filter state
MarkerFilterState marker_filter_state; // Persistant state of Marker filtering
EffectFilterState effect_filter_state; // Persistant state of Effect filtering

// This should be set to true whenever something happens that changes to state
// of the tab. Then on the next draw loop we can check this and update things
// as required. See the Effects Inspector for an example. If set to true
// things are handled in AppUpdate() in app.c
// TODO: Could use to add a "file changed" indicator to the tab headers
bool state_change = false;
};

// Struct that holds the application's state
Expand Down
12 changes: 12 additions & 0 deletions editing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ void DeleteSelectedObject() {
return;
}

// Flag general state change
appState.active_tab->state_change = true;

// This function is called from DrawMenu() which is called before
// DrawInspector() in the main loop. THerefore we have to force update
// Marker and Filter redrawing here
appState.active_tab->marker_filter_state.reload = true;
appState.active_tab->effect_filter_state.reload = true;

if (appState.selected_object == GetActiveRoot()) {
CloseTab(appState.active_tab);
return;
Expand Down Expand Up @@ -179,6 +188,9 @@ void AddMarkerAtPlayhead(otio::Item* item, std::string name, std::string color)
otio::SerializableObject::Retainer<otio::Marker> marker = new otio::Marker(name, marked_range, color);

item->markers().push_back(marker);

// Force Marker inpsector to redraw
appState.active_tab->marker_filter_state.reload = true;
}

void AddTrack(std::string kind) {
Expand Down
Loading
Loading