Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ int main(int argc, char *argv[])
"Use language <lang>.", "lang", "");
parser.addOption(localeOption);

// --verbose option
QCommandLineOption verboseOption(QStringList() << "V" << "verbose",
"Enable verbose output, including OSC message logging.");
parser.addOption(verboseOption);

// --frame-rate option
QCommandLineOption frameRateOption(QStringList() << "r" << "frame-rate",
"Use a framerate of <frame-rate> per second.", "frame-rate", QString::number(MM::DEFAULT_FRAMES_PER_SECOND));
Expand Down Expand Up @@ -205,6 +210,9 @@ int main(int argc, char *argv[])
if (oscPortValue != "")
win->setOscPort(oscPortValue);

if (parser.isSet(verboseOption))
win->setVerbose(true);

bool optionOk;
qreal fps = parser.value("frame-rate").toDouble(&optionOk);
if (optionOk)
Expand Down
8 changes: 4 additions & 4 deletions src/control/OscInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ static void printCommand(QVariantList &command)

void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & command) {
Q_UNUSED(main_window);
bool VERBOSE = false;

if (VERBOSE)
if (is_verbose())
{
std::cout << "OscInterface::applyOscCommand: Receive OSC: " << std::endl;
printCommand(command);
Expand Down Expand Up @@ -211,7 +210,8 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
}
// Property setting (eg. opacity)
else if (command.size() >= 4) {
qDebug() << "Attempt to set a source property" << iterator.first << command.at(3);
if (is_verbose())
qDebug() << "Attempt to set a source property" << iterator.first << command.at(3);
pathIsValid |= setElementProperty(elem, iterator.first, command.at(3));
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ void OscInterface::applyOscCommand(MainWindow &main_window, QVariantList & comma
}
}

if (! pathIsValid)
if (! pathIsValid && is_verbose())
{
qDebug() << "Path could not be processed: " << path << Qt::endl;
printCommand(command);
Expand Down
5 changes: 4 additions & 1 deletion src/control/OscInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class OscInterface {
OscInterface(int listen_port);
~OscInterface();

void setVerbose(bool verbose) { verbose_ = verbose; }

/// Starts listening if receiving is enabled.
void start();

Expand All @@ -59,9 +61,10 @@ class OscInterface {
// FIXME use QObject signals instead of polling

private:
bool is_verbose() const { return false; }
bool is_verbose() const { return verbose_; }
void push_command(QVariantList command);

bool verbose_ = false;
bool receiving_enabled_;
OscReceiver receiver_;
ConcurrentQueue<QVariantList> messaging_queue_;
Expand Down
6 changes: 6 additions & 0 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3714,6 +3714,12 @@ int MainWindow::getOscPort() const
return oscListeningPort;
}

void MainWindow::setVerbose(bool verbose)
{
if (osc_interface)
osc_interface->setVerbose(verbose);
}

bool MainWindow::setOscPort(QString portNumber)
{
bool ok;
Expand Down
1 change: 1 addition & 0 deletions src/gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ public slots:
bool setOscPort(QString portNumber);
bool setOscPort(int portNumber);
int getOscPort() const;
void setVerbose(bool verbose);
void setOutputWindowFullScreen(bool enable);

public:
Expand Down
Loading