-
Notifications
You must be signed in to change notification settings - Fork 0
/
PdObject.cpp
47 lines (39 loc) · 1.4 KB
/
PdObject.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "stdafx.h"
/*
* Copyright (c) 2012 Dan Wilcox <[email protected]>
*
* BSD Simplified License.
* For information on usage and redistribution, and for a DISCLAIMER OF ALL
* WARRANTIES, see the file, "LICENSE.txt," in this distribution.
*
* See https://github.com/libpd/libpd for documentation
*
* This file was adapted from the ofxPd openFrameworks addon example:
* https://github.com/danomatika/ofxPd
*
*/
#include "PdObject.hpp"
#include <iostream>
using namespace std;
using namespace pd;
//--------------------------------------------------------------
void PdObject::print(const std::string &message) {
console::print(message.c_str());
}
//--------------------------------------------------------------
void PdObject::receiveBang(const std::string &dest) {
if (dest == "stop") stop = true;
}
void PdObject::receiveFloat(const std::string &dest ,float num) {
console::printf("CPP: float %s: %g" ,dest ,num);
}
void PdObject::receiveSymbol(const std::string &dest ,const std::string &symbol) {
console::printf("CPP: symbol %s: %s" ,dest ,symbol);
}
void PdObject::receiveList(const std::string &dest ,const List &list) {
console::printf("CPP: list %s: %s%s" ,dest ,list.toString() ,list.types());
}
void PdObject::receiveMessage
(const std::string &dest ,const std::string &msg ,const List &list) {
console::printf("CPP: message %s: %s %s%s" ,dest ,msg ,list.toString() ,list.types());
}