Permalink
Browse files

Add MessageMultiply::toString().

  • Loading branch information...
1 parent 5818427 commit 5732804bc9152223056d7cad7f1c0e37b6a82604 @mhroth committed Mar 25, 2012
Showing with 7 additions and 1 deletion.
  1. +6 −0 src/MessageMultiply.cpp
  2. +1 −1 src/MessageMultiply.h
View
@@ -34,6 +34,12 @@ MessageMultiply::~MessageMultiply() {
// nothing to do
}
+string MessageMultiply::toString() {
+ char str[snprintf(NULL, 0, "* %g", constant)+1];
+ snprintf(str, sizeof(str), "* %g", constant);
+ return string(str);
+}
+
void MessageMultiply::processMessage(int inletIndex, PdMessage *message) {
switch (inletIndex) {
case 0: {
View
@@ -34,7 +34,7 @@ class MessageMultiply : public MessageObject {
~MessageMultiply();
static const char *getObjectLabel() { return "*"; }
- string toString() { return string(getObjectLabel()); }
+ string toString();
private:
void processMessage(int inletIndex, PdMessage *message);

0 comments on commit 5732804

Please sign in to comment.