Skip to content

Commit

Permalink
Updates #268 and implements "use clock" persistent setting in GRFX file
Browse files Browse the repository at this point in the history
  • Loading branch information
roman380 committed Jun 30, 2015
1 parent b1a99da commit dd30187
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/display_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,8 @@ GRAPHSTUDIO_NAMESPACE_START // cf stdafx.h for explanation

xml.BeginNode(_T("graph"));
xml.WriteValue(_T("name"), _T("Unnamed Graph"));
if(!uses_clock)
xml.WriteValue(_T("clock"), _T("none"));

for (int i=0; i<filters.GetCount(); i++) {
SaveXML_Filter(xml, filters[i], i);
Expand Down Expand Up @@ -1218,6 +1220,9 @@ GRAPHSTUDIO_NAMESPACE_START // cf stdafx.h for explanation

XML::XMLNode * const gn = *it;

const CString clock = gn->GetValue(_T("clock"));
uses_clock = clock != _T("none");

// Filter list stored in the same order as stored in XML file for fixing up Filter index references
// Only store for the duration of loading
// The IBaseFilter* are only used to find matching Filters so will not crash if pointers are invalid
Expand Down
2 changes: 1 addition & 1 deletion src/graphView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ HRESULT CGraphView::TryOpenFile(const CString& file_to_open, bool render_media_f
}

UpdateGraphState();
graph.SetClock(true, NULL);
graph.SetClock(graph.uses_clock, NULL);
graph.RefreshFilters();
graph.SmartPlacement();
Invalidate();
Expand Down

0 comments on commit dd30187

Please sign in to comment.