Skip to content

Commit c5ac473

Browse files
committed
Instrument picker.
Instrument picker allows us to assign the different instruments on field. Making toolbars more modular, layout out to the side by default. incrementing Layout configuration value so it gets refreshed Putting instrument into status. Making symbol buttons a selector.
1 parent 3ea936d commit c5ac473

36 files changed

+1083
-344
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ add_executable (
244244
${CMAKE_CURRENT_SOURCE_DIR}/src/PreferencesUtils.h
245245
${CMAKE_CURRENT_SOURCE_DIR}/src/PrintContinuityEditor.cpp
246246
${CMAKE_CURRENT_SOURCE_DIR}/src/PrintContinuityEditor.h
247+
${CMAKE_CURRENT_SOURCE_DIR}/src/SetupInstruments.cpp
248+
${CMAKE_CURRENT_SOURCE_DIR}/src/SetupInstruments.h
249+
${CMAKE_CURRENT_SOURCE_DIR}/src/SetupMarchers.cpp
250+
${CMAKE_CURRENT_SOURCE_DIR}/src/SetupMarchers.h
247251
${CMAKE_CURRENT_SOURCE_DIR}/src/TopFrame.cpp
248252
${CMAKE_CURRENT_SOURCE_DIR}/src/TopFrame.h
249253
${CMAKE_CURRENT_SOURCE_DIR}/src/TransitionSolverFrame.cpp
@@ -280,8 +284,6 @@ add_executable (
280284
${CMAKE_CURRENT_SOURCE_DIR}/src/print_ps_dialog.h
281285
${CMAKE_CURRENT_SOURCE_DIR}/src/setup_wizards.cpp
282286
${CMAKE_CURRENT_SOURCE_DIR}/src/setup_wizards.h
283-
${CMAKE_CURRENT_SOURCE_DIR}/src/show_ui.cpp
284-
${CMAKE_CURRENT_SOURCE_DIR}/src/show_ui.h
285287
${CMAKE_CURRENT_SOURCE_DIR}/src/single_instance_ipc.cpp
286288
${CMAKE_CURRENT_SOURCE_DIR}/src/single_instance_ipc.h
287289
${CMAKE_CURRENT_SOURCE_DIR}/src/ui_enums.h

src/CalChartDoc.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ CalChartDoc::GetAnimation() const
325325
return mAnimation ? mAnimation.get() : nullptr;
326326
}
327327

328-
void CalChartDoc::WizardSetupNewShow(std::vector<std::string> const& labels, int columns, ShowMode const& newmode)
328+
void CalChartDoc::WizardSetupNewShow(std::vector<std::pair<std::string, std::string>> const& labelsAndInstruments, int columns, ShowMode const& newmode)
329329
{
330-
mShow = Show::Create_CC_show(newmode, labels, columns);
330+
mShow = Show::Create_CC_show(newmode, labelsAndInstruments, columns);
331331
UpdateAllViews();
332332
}
333333

@@ -425,13 +425,19 @@ std::unique_ptr<wxCommand> CalChartDoc::Create_SetShowModeCommand(CalChart::Show
425425
return std::make_unique<CalChartDocCommand>(*this, wxT("Set Mode"), cmds);
426426
}
427427

428-
std::unique_ptr<wxCommand> CalChartDoc::Create_SetShowInfoCommand(std::vector<wxString> const& labels, int numColumns)
428+
std::unique_ptr<wxCommand> CalChartDoc::Create_SetupMarchersCommand(std::vector<std::pair<std::string, std::string>> const& labelsAndInstruments, int numColumns)
429429
{
430-
auto tlabels = std::vector<std::string>(labels.begin(), labels.end());
431-
auto show_cmds = Inject_CalChartDocArg(mShow->Create_SetShowInfoCommand(tlabels, numColumns, GetShowMode().FieldOffset()));
430+
auto tlabels = std::vector(labelsAndInstruments.begin(), labelsAndInstruments.end());
431+
auto show_cmds = Inject_CalChartDocArg(mShow->Create_SetupMarchersCommand(tlabels, numColumns, GetShowMode().FieldOffset()));
432432
return std::make_unique<CalChartDocCommand>(*this, wxT("Set show info"), show_cmds);
433433
}
434434

435+
std::unique_ptr<wxCommand> CalChartDoc::Create_SetInstrumentsCommand(std::map<int, std::string> const& dotToInstrument)
436+
{
437+
auto show_cmds = Inject_CalChartDocArg(mShow->Create_SetInstrumentsCommand(dotToInstrument));
438+
return std::make_unique<CalChartDocCommand>(*this, wxT("Set instruments"), show_cmds);
439+
}
440+
435441
std::unique_ptr<wxCommand> CalChartDoc::Create_SetSheetTitleCommand(const wxString& newname)
436442
{
437443
auto cmds = Create_SetSheetPair();

src/CalChartDoc.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class CalChartDoc : public wxDocument {
120120

121121
void FlushAllTextWindows();
122122

123-
void WizardSetupNewShow(std::vector<std::string> const& labels, int columns, CalChart::ShowMode const& newmode);
123+
void WizardSetupNewShow(std::vector<std::pair<std::string, std::string>> const& labelsAndInstruments, int columns, CalChart::ShowMode const& newmode);
124124

125125
auto GetNumSheets() const { return mShow ? mShow->GetNumSheets() : 0; }
126126

@@ -136,8 +136,11 @@ class CalChartDoc : public wxDocument {
136136
std::pair<bool, std::vector<size_t>> GetRelabelMapping(CalChart::Show::const_Sheet_iterator_t source_sheet, CalChart::Show::const_Sheet_iterator_t target_sheets, CalChart::Coord::units tolerance) const;
137137

138138
auto GetPointLabel(int i) const { return mShow->GetPointLabel(i); }
139-
140-
auto GetPointLabels() const { return mShow->GetPointLabels(); }
139+
auto GetPointsLabel() const { return mShow->GetPointsLabel(); }
140+
auto GetPointInstrument(int i) const { return mShow->GetPointInstrument(i); }
141+
auto GetPointsInstrument() const { return mShow->GetPointsInstrument(); }
142+
auto GetPointSymbol(int i) const { return mShow->GetPointSymbol(i); }
143+
auto GetPointsSymbol() const { return mShow->GetPointsSymbol(); }
141144

142145
// how to select points
143146
// Utility functions for constructing new selection lists
@@ -148,6 +151,9 @@ class CalChartDoc : public wxDocument {
148151
auto MakeRemoveFromSelection(const SelectionList& sl) const { return mShow->MakeRemoveFromSelection(sl); }
149152
auto MakeToggleSelection(const SelectionList& sl) const { return mShow->MakeToggleSelection(sl); }
150153
auto MakeSelectWithLasso(const CalChart::Lasso& lasso, int ref) const { return mShow->MakeSelectWithLasso(lasso, ref); }
154+
auto MakeSelectBySymbol(SYMBOL_TYPE symbol) const { return mShow->MakeSelectBySymbol(symbol); }
155+
auto MakeSelectByInstrument(std::string const& instrument) const { return mShow->MakeSelectByInstrument(instrument); }
156+
auto MakeSelectByLabel(std::string const& label) const { return mShow->MakeSelectByLabel(label); }
151157

152158
void SetSelection(const SelectionList& sl);
153159

@@ -167,7 +173,8 @@ class CalChartDoc : public wxDocument {
167173
std::unique_ptr<wxCommand> Create_SetSelectionCommand(const SelectionList& sl);
168174
std::unique_ptr<wxCommand> Create_SetCurrentSheetAndSelectionCommand(int n, const SelectionList& sl);
169175
std::unique_ptr<wxCommand> Create_SetShowModeCommand(CalChart::ShowMode const& newmode);
170-
std::unique_ptr<wxCommand> Create_SetShowInfoCommand(std::vector<wxString> const& labels, int numColumns);
176+
std::unique_ptr<wxCommand> Create_SetupMarchersCommand(std::vector<std::pair<std::string, std::string>> const& labels, int numColumns);
177+
std::unique_ptr<wxCommand> Create_SetInstrumentsCommand(std::map<int, std::string> const& dotToInstrument);
171178
std::unique_ptr<wxCommand> Create_SetSheetTitleCommand(const wxString& newname);
172179
std::unique_ptr<wxCommand> Create_SetSheetBeatsCommand(int beats);
173180
std::unique_ptr<wxCommand> Create_AddSheetsCommand(const CalChart::Show::Sheet_container_t& sheets, int where);

src/CalChartDocCommand.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include "CalChartDocCommand.h"
2424
#include "CalChartDoc.h"
2525

26-
// SetDescriptionCommand
27-
// Set the description of this show
2826
CalChartDocCommand::CalChartDocCommand(CalChartDoc& doc, const wxString& cmd_descr, CC_doc_command_pair const& cmds)
2927
: CalChartDocCommand(doc, cmd_descr, std::vector<CC_doc_command_pair>{ cmds })
3028
{

0 commit comments

Comments
 (0)