Skip to content

Commit f8b60f8

Browse files
Added source of v0.0.2.1.0.9
1 parent d7a2240 commit f8b60f8

25 files changed

+253
-33
lines changed

doc/Sound2Light_Tool_Anleitung.pdf

46.4 KB
Binary file not shown.

doc/Sound2Light_Tool_Manual_en.pdf

47 KB
Binary file not shown.

doc/s2l_changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11

22
# Sound2Light Change Log
33

4+
### Version 0.0.2.1.0.9 - 1 Mar 2017
5+
6+
- Supports Muting the OSC output of individual channels
7+
48
### Version 0.0.2.1.0.8 - 1 Mar 2017
59

610
- Fixed BPM OSC Messages with a one digit value being interpreted falsely on EOS

doc/screenshot_main_window.png

43 KB
Loading

src/BPMOscControler.cpp

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,25 @@
2121
#include "BPMOscControler.h"
2222

2323
BPMOscControler::BPMOscControler(OSCNetworkManager &osc) :
24-
m_osc(osc)
24+
m_bpmMute(false)
25+
, m_osc(osc)
2526
, m_oscCommands()
2627
{
2728
}
2829

30+
void BPMOscControler::setBPMMute(bool mute)
31+
{
32+
m_bpmMute = mute;
33+
34+
m_osc.sendMessage("/s2l/out/bpm/mute", (m_bpmMute ? "1" : "0"), true);
35+
}
36+
37+
void BPMOscControler::toggleBPMMute()
38+
{
39+
m_bpmMute = !m_bpmMute;
40+
m_osc.sendMessage("/s2l/out/bpm/mute", (m_bpmMute ? "1" : "0"), true);
41+
}
42+
2943
// Restore the commands from e.g. a preset or whatever else
3044
void BPMOscControler::restore(QSettings& settings)
3145
{
@@ -55,6 +69,9 @@ inline int round(float value) { return (fmod(value,1.0) < 0.5) ? value : value +
5569
// Called by the bpm detector to make the controller send the new bpm to the clients
5670
void BPMOscControler::transmitBPM(float bpm)
5771
{
72+
// Don't transmit if mute is engaged
73+
if (m_bpmMute) return;
74+
5875
// Send user specified commands
5976

6077
for (QString& command : m_oscCommands) {

src/BPMOscControler.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ class BPMOscControler
2929
public:
3030
BPMOscControler(OSCNetworkManager& osc);
3131

32+
// Getter/Setter for mute
33+
bool getBPMMute() { return m_bpmMute; }
34+
void setBPMMute(bool mute);
35+
void toggleBPMMute();
36+
3237
// Called by the bpm detector to make the controller send the new bpm to the clients
3338
void transmitBPM(float bpm);
3439

@@ -49,6 +54,7 @@ class BPMOscControler
4954

5055

5156
protected:
57+
bool m_bpmMute; // If the bpm osc is muted
5258
OSCNetworkManager& m_osc; // The network manager to send network signals thorugh
5359
QStringList m_oscCommands; // The osc messages to be sent on a tempo changed. Delivered as finished strings with the <BPM> (<BPM1-2>, <BPM4> etc. for fractions from 1/4 to 4) qualifier to be changed. The message is generated in the qml because thats the way tim did it with the other osc messages
5460
};

src/LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) 2016 Electronic Theatre Controls, Inc., http://www.etcconnect.com
2+
//
3+
// Permission is hereby granted, free of charge, to any person obtaining a copy
4+
// of this software and associated documentation files (the "Software"), to deal
5+
// in the Software without restriction, including without limitation the rights
6+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
// copies of the Software, and to permit persons to whom the Software is
8+
// furnished to do so, subject to the following conditions:
9+
//
10+
// The above copyright notice and this permission notice shall be included in
11+
// all copies or substantial portions of the Software.
12+
//
13+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
// THE SOFTWARE.

src/MainController.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,8 @@ void MainController::loadPreset(const QString &constFileName, bool createIfNotEx
474474
// Restore the manual BPM
475475
m_bpmTap.setBpm(settings.value("bpm/tapvalue", 60).toInt());
476476

477+
m_bpmOSC.setBPMMute(settings.value("bpm/mute", false).toBool());
478+
477479

478480
// this is now the loaded preset, update the preset name:
479481
m_currentPresetFilename = fileName; emit presetNameChanged();
@@ -491,6 +493,7 @@ void MainController::loadPreset(const QString &constFileName, bool createIfNotEx
491493
emit bpmActiveChanged();
492494
emit bpmRangeChanged();
493495
emit waveformVisibleChanged();
496+
emit bpmMuteChanged();
494497

495498
emit m_bassController->parameterChanged();
496499
emit m_loMidController->parameterChanged();
@@ -505,6 +508,13 @@ void MainController::loadPreset(const QString &constFileName, bool createIfNotEx
505508
emit m_highController->oscLabelTextChanged();
506509
emit m_envelopeController->oscLabelTextChanged();
507510
emit m_silenceController->oscLabelTextChanged();
511+
512+
emit m_bassController->muteChanged();
513+
emit m_loMidController->muteChanged();
514+
emit m_hiMidController->muteChanged();
515+
emit m_highController->muteChanged();
516+
emit m_envelopeController->muteChanged();
517+
emit m_silenceController->muteChanged();
508518
}
509519

510520
void MainController::savePresetAs(const QString &constFileName, bool isAutosave)
@@ -547,9 +557,12 @@ void MainController::savePresetAs(const QString &constFileName, bool isAutosave)
547557
// save the settings in the BPMOscController
548558
m_bpmOSC.save(settings);
549559

550-
// Restore the manual BPM
560+
// save the manual BPM
551561
settings.setValue("bpm/tapvalue", m_bpmTap.getBpm());
552562

563+
// save bpm mute
564+
settings.setValue("bpm/mute", m_bpmOSC.getBPMMute());
565+
553566
if (!isAutosave) {
554567
// this is now the loaded preset, update the preset name:
555568
m_currentPresetFilename = fileName; emit presetNameChanged();

src/MainController.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ class MainController : public QObject
130130
// emitted if the waveform visiblity changed
131131
void waveformVisibleChanged();
132132

133+
// emitted if the bpm mute changed
134+
void bpmMuteChanged();
135+
133136
// forwarded from OSCNetworkManager:
134137
void messageReceived(OSCMessage msg);
135138
void packetSent();
@@ -246,6 +249,10 @@ public slots:
246249
// gets the minium bpm of the range
247250
int getMinBPM() { return m_bpm.getMinBPM(); }
248251

252+
// set/get bpm mute
253+
bool getBPMMute() { return m_bpmOSC.getBPMMute(); }
254+
void toggleBPMMute() { m_bpmOSC.toggleBPMMute(); emit bpmMuteChanged(); }
255+
249256
// set/get the waveform visibility
250257
bool getWaveformVisible() { return m_waveformVisible & m_bpmActive; }
251258
void setWaveformVisible(bool value) { m_waveformVisible = value; emit waveformVisibleChanged();}

src/OSCMapping.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,20 @@ void OSCMapping::handleMessage(OSCMessage msg)
8282
if (msg.arguments().size() == 0 || msg.arguments().at(0).toBool()) {
8383
m_controller->triggerBeat();
8484
}
85+
} else if (msg.pathStartsWith("/s2l/bpm/mute")) {
86+
m_controller->toggleBPMMute();
87+
} else if (msg.pathStartsWith("/s2l/bass/mute")) {
88+
m_controller->m_bassController->toggleMute();
89+
} else if (msg.pathStartsWith("/s2l/lo_mid/mute")) {
90+
m_controller->m_loMidController->toggleMute();
91+
} else if (msg.pathStartsWith("/s2l/hi_mid/mute")) {
92+
m_controller->m_hiMidController->toggleMute();
93+
} else if (msg.pathStartsWith("/s2l/high/mute")) {
94+
m_controller->m_highController->toggleMute();
95+
} else if (msg.pathStartsWith("/s2l/level/mute")) {
96+
m_controller->m_envelopeController->toggleMute();
97+
} else if (msg.pathStartsWith("/s2l/silence/mute")) {
98+
m_controller->m_silenceController->toggleMute();
8599
}
86100
}
87101

0 commit comments

Comments
 (0)