forked from GrandOrgue/grandorgue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
119 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#include "GOMidiObjectContext.h" | ||
|
||
const wxString WX_PATH_SEPARATOR = "/"; | ||
|
||
GOMidiObjectContext::GOMidiObjectContext( | ||
const wxString &name, | ||
const wxString &title, | ||
const GOMidiObjectContext *pParent) | ||
: m_name(name), m_title(title), p_parent(pParent) {} | ||
|
||
wxString GOMidiObjectContext::getFullTitle( | ||
const GOMidiObjectContext *pContext) { | ||
wxString path; | ||
|
||
for (; pContext; pContext = pContext->p_parent) { | ||
if (!path.IsEmpty()) | ||
path = WX_PATH_SEPARATOR + path; | ||
path = pContext->m_title + path; | ||
} | ||
return path; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2006 Milan Digital Audio LLC | ||
* Copyright 2009-2025 GrandOrgue contributors (see AUTHORS) | ||
* License GPL-2.0 or later | ||
* (https://www.gnu.org/licenses/old-licenses/gpl-2.0.html). | ||
*/ | ||
|
||
#ifndef GOMIDIOBJECTCONTEXT_H | ||
#define GOMIDIOBJECTCONTEXT_H | ||
|
||
#include <wx/string.h> | ||
|
||
/** | ||
* This class is used for describing a place where a midi object is used. | ||
* There is a hierarhial tree of contexts. For example, setter, manuals/1/stops, | ||
* manuals/1/divisionals | ||
*/ | ||
|
||
class GOMidiObjectContext { | ||
private: | ||
// Name. Not translated. Used for exports | ||
wxString m_name; | ||
|
||
// Title. Translated. Used in UI | ||
wxString m_title; | ||
|
||
// Parent context | ||
const GOMidiObjectContext *p_parent; | ||
|
||
public: | ||
GOMidiObjectContext( | ||
const wxString &name, | ||
const wxString &title, | ||
const GOMidiObjectContext *pParent = nullptr); | ||
GOMidiObjectContext() | ||
: GOMidiObjectContext(wxEmptyString, wxEmptyString, nullptr) {} | ||
|
||
const wxString &GetName() const { return m_name; } | ||
const wxString &GetTitle() const { return m_title; } | ||
void SetTitle(const wxString title) { m_title = title; } | ||
const GOMidiObjectContext *GetParent() const { return p_parent; } | ||
|
||
static wxString getFullTitle(const GOMidiObjectContext *pContext); | ||
}; | ||
|
||
#endif /* GOMIDIOBJECTCONTEXT_H */ |