Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 44 lines (38 sloc) 1.537 kb
4b71bbe Martin Roth Add LGPL license to remaining files.
authored
1 /*
29f83db Towards an a stack-based messaging system. First commit.
Martin Roth authored
2 * Copyright 2009,2010,2011 Reality Jockey, Ltd.
4b71bbe Martin Roth Add LGPL license to remaining files.
authored
3 * info@rjdj.me
4 * http://rjdj.me/
74180d4 Added MessageAbsoluteValue, MessageArcTangent, MessageArcTangent2, Messa...
Yoonchang Han authored
5 *
4b71bbe Martin Roth Add LGPL license to remaining files.
authored
6 * This file is part of ZenGarden.
7 *
8 * ZenGarden is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ZenGarden is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
74180d4 Added MessageAbsoluteValue, MessageArcTangent, MessageArcTangent2, Messa...
Yoonchang Han authored
17 *
4b71bbe Martin Roth Add LGPL license to remaining files.
authored
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with ZenGarden. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
abb33ec First commit of current source.
Martin Roth authored
23 #include "MessageAbsoluteValue.h"
24
7329847 Martin Roth Add static factory method to all objects in order to create an object in...
authored
25 MessageObject *MessageAbsoluteValue::newObject(PdMessage *initMessage, PdGraph *graph) {
26 return new MessageAbsoluteValue(initMessage, graph);
27 }
28
74180d4 Added MessageAbsoluteValue, MessageArcTangent, MessageArcTangent2, Messa...
Yoonchang Han authored
29 MessageAbsoluteValue::MessageAbsoluteValue(PdMessage *initMessage, PdGraph *graph) : MessageObject(1, 1, graph) {
30 // nothing to do
31 }
32
abb33ec First commit of current source.
Martin Roth authored
33 MessageAbsoluteValue::~MessageAbsoluteValue() {
34 // nothing to do
35 }
36
74180d4 Added MessageAbsoluteValue, MessageArcTangent, MessageArcTangent2, Messa...
Yoonchang Han authored
37 void MessageAbsoluteValue::processMessage(int inletIndex, PdMessage *message) {
811b8c2 Martin Roth Update MessageAbsoluteValue to new message syntax.
authored
38 if (message->isFloat(0)) {
29f83db Towards an a stack-based messaging system. First commit.
Martin Roth authored
39 PdMessage *outgoingMessage = PD_MESSAGE_ON_STACK(1);
40 outgoingMessage->initWithTimestampAndFloat(message->getTimestamp(), fabsf(message->getFloat(0)));
811b8c2 Martin Roth Update MessageAbsoluteValue to new message syntax.
authored
41 sendMessage(0, outgoingMessage);
abb33ec First commit of current source.
Martin Roth authored
42 }
43 }
Something went wrong with that request. Please try again.