Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add midiThrough argument #4148

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/controllers/midi/portmidienumerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ bool recognizeDevice(const PmDeviceInfo& deviceInfo) {
// In developer mode we show the MIDI Through Port, otherwise ignore it
// since it routinely causes trouble.
return CmdlineArgs::Instance().getDeveloper() ||
CmdlineArgs::Instance().getMidiThrough() ||
!QLatin1String(deviceInfo.name)
.startsWith(kMidiThroughPortPrefix, Qt::CaseInsensitive);
}
Expand Down
8 changes: 8 additions & 0 deletions src/util/cmdlineargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ CmdlineArgs::CmdlineArgs()
m_debugAssertBreak(false),
m_settingsPathSet(false),
m_useColors(false),
m_midiThrough(false),
m_logLevel(mixxx::kLogLevelDefault),
m_logFlushLevel(mixxx::kLogFlushLevelDefault),
// We are not ready to switch to XDG folders under Linux, so keeping $HOME/.mixxx as preferences folder. see lp:1463273
Expand Down Expand Up @@ -172,6 +173,12 @@ bool CmdlineArgs::parse(int argc, char** argv) {
QStringLiteral("auto"));
parser.addOption(color);

const QCommandLineOption midiThrough(QStringLiteral("midiThrough"),
QCoreApplication::translate("CmdlineArgs",
"Enables MIDI Through mode. Shows MIDI through ports in "
"Preferences/Controllers."));
parser.addOption(midiThrough);

const QCommandLineOption logLevel(QStringLiteral("log-level"),
QCoreApplication::translate("CmdlineArgs",
"Sets the verbosity of command line logging.\n"
Expand Down Expand Up @@ -275,6 +282,7 @@ bool CmdlineArgs::parse(int argc, char** argv) {
m_developer = parser.isSet(developer);
m_safeMode = parser.isSet(safeMode) || parser.isSet(safeModeDeprecated);
m_debugAssertBreak = parser.isSet(debugAssertBreak) || parser.isSet(debugAssertBreakDeprecated);
m_midiThrough = parser.isSet(midiThrough);

m_musicFiles = parser.positionalArguments();

Expand Down
2 changes: 2 additions & 0 deletions src/util/cmdlineargs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class CmdlineArgs final {
}
bool getDebugAssertBreak() const { return m_debugAssertBreak; }
bool getSettingsPathSet() const { return m_settingsPathSet; }
bool getMidiThrough() const { return m_midiThrough; }
mixxx::LogLevel getLogLevel() const { return m_logLevel; }
mixxx::LogLevel getLogFlushLevel() const { return m_logFlushLevel; }
bool getTimelineEnabled() const { return !m_timelinePath.isEmpty(); }
Expand All @@ -53,6 +54,7 @@ class CmdlineArgs final {
bool m_debugAssertBreak;
bool m_settingsPathSet; // has --settingsPath been set on command line ?
bool m_useColors; // should colors be used
bool m_midiThrough;
mixxx::LogLevel m_logLevel; // Level of stderr logging message verbosity
mixxx::LogLevel m_logFlushLevel; // Level of mixx.log file flushing
QString m_locale;
Expand Down