Skip to content

Add MIDI GUI tab and learn function #3502

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

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6f049a5
Add MIDI GUI tab and learn function
ignotus666 May 22, 2025
21d39a2
Fix clang-format issues
ignotus666 May 22, 2025
084fe9a
Delete extra line
ignotus666 May 22, 2025
6df6339
Fix GetNumericIniSet function range
ignotus666 May 23, 2025
9a2257f
Avoid repetitions in learn button handling
ignotus666 May 28, 2025
aedd894
Remove duplicate code for MIDI strings
ignotus666 May 28, 2025
6c2dc14
Clang-format errors corrected
ignotus666 May 28, 2025
a2c06db
Set autoDefault to false for Learn buttons
ignotus666 May 28, 2025
d4e1e58
SImplify learn button setup, add error handling, initialise learn but…
ignotus666 May 28, 2025
a36bc38
Add comment
ignotus666 May 29, 2025
03900bd
Add runtime MIDI in port toggle, remove pClient guards
ignotus666 Jun 2, 2025
b6d9f12
clang-format and remove android MIDI changes
ignotus666 Jun 2, 2025
d5dd70b
Add whats this for enable MIDI, correct tab order
ignotus666 Jun 2, 2025
455d062
Fix tabbing and whats this
ignotus666 Jun 2, 2025
0818f2b
Merge pull request #33 from ignotus666/midi-gui-learn2
ignotus666 Jun 2, 2025
b7faa03
Make clang-format happy
ignotus666 Jun 2, 2025
d694d14
Fix prepend user with number
ignotus666 Jun 2, 2025
280a372
Clang-format
ignotus666 Jun 2, 2025
09cd625
Fix show last opened tab
ignotus666 Jun 3, 2025
e6defec
Add curly braces
ignotus666 Jun 3, 2025
2970f5e
Fix MIDI-in port toggle misbehaving when launched enabled (macOS)
ignotus666 Jun 4, 2025
1909b62
Rename tab, improve layout and correct whats this
ignotus666 Jun 5, 2025
e35023d
Make check box text consistent
ignotus666 Jun 9, 2025
f718efa
Grey out MIDI controls when disabled
ignotus666 Jun 11, 2025
1e1759c
Correct tab order
ignotus666 Jun 11, 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
3 changes: 3 additions & 0 deletions src/audiomixerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,9 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInf
}
Mutex.unlock(); // release mutex

// Ensure MIDI state is applied to faders during the connection process
SetMIDICtrlUsed ( pSettings->bUseMIDIController );

// sort the channels according to the selected sorting type
ChangeFaderOrder ( eChSortType );

Expand Down
6 changes: 6 additions & 0 deletions src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ CClient::CClient ( const quint16 iPortNumber,

QObject::connect ( pSignalHandler, &CSignalHandler::HandledSignal, this, &CClient::OnHandledSignal );

QObject::connect ( &Sound, &CSoundBase::MidiCCReceived, this, &CClient::OnMidiCCReceived );

// start timer so that elapsed time works
PreciseTime.start();

Expand Down Expand Up @@ -1550,6 +1552,10 @@ void CClient::FreeClientChannel ( const int iServerChannelID )
*/
}

void CClient::ApplyMIDIMapping ( const QString& midiMap ) { Sound.SetMIDIMapping ( midiMap ); }

void CClient::OnMidiCCReceived ( int ccNumber ) { emit MidiCCReceived ( ccNumber ); }

// find, and optionally create, a client channel for the supplied server channel ID
// returns a client channel ID or INVALID_INDEX
int CClient::FindClientChannel ( const int iServerChannelID, const bool bCreateIfNew )
Expand Down
16 changes: 13 additions & 3 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,15 +286,21 @@ class CClient : public QObject
Channel.GetBufErrorRates ( vecErrRates, dLimit, dMaxUpLimit );
}

//### TODO: BEGIN ###//
// Refactor this to use signal/slot mechanism. https://github.com/jamulussoftware/jamulus/pull/3479/files#r1976382416
// ### TODO: BEGIN ###//
// Refactor this to use signal/slot mechanism. https://github.com/jamulussoftware/jamulus/pull/3479/files#r1976382416
CProtocol* getConnLessProtocol() { return &ConnLessProtocol; }
//### TODO: END ###//
// ### TODO: END ###//

// MIDI control
void EnableMIDI ( bool bEnable ) { Sound.EnableMIDI ( bEnable ); }
bool IsMIDIEnabled() const { return Sound.IsMIDIEnabled(); }

// settings
CChannelCoreInfo ChannelInfo;
QString strClientName;

void ApplyMIDIMapping ( const QString& midiMap );

protected:
// callback function must be static, otherwise it does not work
static void AudioCallback ( CVector<short>& psData, void* arg );
Expand Down Expand Up @@ -471,4 +477,8 @@ protected slots:
void ControllerInFaderIsSolo ( int iChannelIdx, bool bIsSolo );
void ControllerInFaderIsMute ( int iChannelIdx, bool bIsMute );
void ControllerInMuteMyself ( bool bMute );
void MidiCCReceived ( int ccNumber );

private slots:
void OnMidiCCReceived ( int ccNumber );
};
26 changes: 20 additions & 6 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP,

pSettingsMenu->addAction ( tr ( "A&dvanced Settings..." ), this, SLOT ( OnOpenAdvancedSettings() ), QKeySequence ( Qt::CTRL + Qt::Key_D ) );

pSettingsMenu->addAction ( tr ( "&MIDI Control Settings..." ), this, SLOT ( OnOpenMidiSettings() ), QKeySequence ( Qt::CTRL + Qt::Key_M ) );

// Main menu bar -----------------------------------------------------------
QMenuBar* pMenu = new QMenuBar ( this );

Expand Down Expand Up @@ -535,6 +537,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP,

QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::NumMixerPanelRowsChanged, this, &CClientDlg::OnNumMixerPanelRowsChanged );

QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::MIDIControllerUsageChanged, this, &CClientDlg::OnMIDIControllerUsageChanged );

QObject::connect ( this, &CClientDlg::SendTabChange, &ClientSettingsDlg, &CClientSettingsDlg::OnMakeTabChange );

QObject::connect ( MainMixerBoard, &CAudioMixerBoard::ChangeChanGain, this, &CClientDlg::OnChangeChanGain );
Expand Down Expand Up @@ -987,9 +991,8 @@ void CClientDlg::ShowGeneralSettings ( int iTab )
// open general settings dialog
emit SendTabChange ( iTab );
ClientSettingsDlg.show();
ClientSettingsDlg.setWindowTitle ( MakeClientNameTitle ( tr ( "Settings" ), pClient->strClientName ) );

// make sure dialog is upfront and has focus
ClientSettingsDlg.setWindowTitle ( MakeClientNameTitle ( tr ( "Settings" ), pClient->strClientName ) );
ClientSettingsDlg.raise();
ClientSettingsDlg.activateWindow();
}
Expand Down Expand Up @@ -1286,11 +1289,11 @@ void CClientDlg::Disconnect()
TimerDetectFeedback.stop();
bDetectFeedback = false;

//### TODO: BEGIN ###//
// is this still required???
// immediately update status bar
// ### TODO: BEGIN ###//
// is this still required???
// immediately update status bar
OnTimerStatus();
//### TODO: END ###//
// ### TODO: END ###//

// reset LEDs
ledBuffers->Reset();
Expand Down Expand Up @@ -1516,3 +1519,14 @@ void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, c
// set current LED status
ledDelay->SetLight ( eOverallDelayLEDColor );
}

void CClientDlg::OnOpenMidiSettings() { ShowGeneralSettings ( SETTING_TAB_MIDI ); }

void CClientDlg::OnMIDIControllerUsageChanged ( bool bEnabled )
{
// Update the mixer board's MIDI flag to trigger proper user numbering display
MainMixerBoard->SetMIDICtrlUsed ( bEnabled );

// Enable/disable runtime MIDI via the sound interface through the public CClient interface
pClient->EnableMIDI ( bEnabled );
}
3 changes: 3 additions & 0 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ public slots:

void accept() { close(); } // introduced by pljones

void OnOpenMidiSettings();
void OnMIDIControllerUsageChanged ( bool bEnabled );

signals:
void SendTabChange ( int iTabIdx );
};
Loading