Code Monkey home page Code Monkey logo

oscpack's People

Contributors

mariadeanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

oscpack's Issues

unable to build

I tried to build and use the lib witheout success. Im probably doing something wrong but I don't know what.
I'm on mingw (on win7).
I've tried with the makefile and the batch file...

with the makefile and get this error when launched from mingw64:

g++ -Wall -Wextra -O3 -I. -DOSC_DETECT_ENDIANESS -c -o tests/OscUnitTests.o tests/OscUnitTests.cpp tests/OscUnitTests.cpp: In function 'char* osc::AllocateAligned4(long unsigned int)': tests/OscUnitTests.cpp:109:30: error: cast from 'char*' to 'long int' loses precision [-fpermissive] return (char*)((long)(s-1) & (~0x03L)) + 4; ^ tests/OscUnitTests.cpp:109:42: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] return (char*)((long)(s-1) & (~0x03L)) + 4; ^ make: *** [<commande interne>: tests/OscUnitTests.o] Error 1

This one when run from mingw32:

g++ -Wall -Wextra -O3 -I. -DOSC_DETECT_ENDIANESS -c -o tests/OscUnitTests.o tests/OscUnitTests.cpp g++ -Wall -Wextra -O3 -I. -DOSC_DETECT_ENDIANESS -c -o osc/OscOutboundPacketStream.o osc/OscOutboundPacketStream.cpp g++ -Wall -Wextra -O3 -I. -DOSC_DETECT_ENDIANESS -c -o osc/OscReceivedElements.o osc/OscReceivedElements.cpp osc/OscReceivedElements.cpp: In function 'const char* osc::FindStr4End(const char*, const char*)': osc/OscReceivedElements.cpp:67:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if( p >= end ) ^~ osc/OscReceivedElements.cpp:70:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' if( p[0] == '\0' ) // special case for SuperCollider integer address pattern ^~ g++ -Wall -Wextra -O3 -I. -DOSC_DETECT_ENDIANESS -c -o osc/OscPrintReceivedElements.o osc/OscPrintReceivedElements.cpp g++ -o bin/OscUnitTests osc/OscTypes.o tests/OscUnitTests.o osc/OscOutboundPacketStream.o osc/OscReceivedElements.o osc/OscPrintReceivedElements.o osc/OscTypes.o: file not recognized: File format not recognized collect2.exe: error: ld returned 1 exit status make: *** [Makefile:92: bin/OscUnitTests] Error 1

I tried with the batch file too (make.MinGW32) and get an error telling me that ...\bin\oscUnitTest.exe is not a command, a command file or an executable program but the test and oscdump.exe files are created.

I tried to use the osc and ip files in my sources and to use the receive exemple code in it. Then I get ip and osc file in the same directory then my sources and try to use it for a program called "VCV rack" and my code is this.

`#include "liveControl.hpp"
#include
#include

#if defined(BORLANDC) // workaround for BCB4 release build intrinsics bug
namespace std {
using ::strcmp; // avoid error: E2316 'strcmp' is not a member of 'std'.
}
#endif

#include "osc/OscReceivedElements.h"
#include "osc/OscPacketListener.h"
#include "ip/UdpSocket.h"

#define PORT 7000

class ExamplePacketListener : public osc::OscPacketListener {
protected:

virtual void ProcessMessage( const osc::ReceivedMessage& m,
			const IpEndpointName& remoteEndpoint )
{
    (void) remoteEndpoint; // suppress unused parameter warning

    try{
        // example of parsing single messages. osc::OsckPacketListener
        // handles the bundle traversal.

        if( std::strcmp( m.AddressPattern(), "/test1" ) == 0 ){
            // example #1 -- argument stream interface
            osc::ReceivedMessageArgumentStream args = m.ArgumentStream();
            bool a1;
            osc::int32 a2;
            float a3;
            const char *a4;
            args >> a1 >> a2 >> a3 >> a4 >> osc::EndMessage;

            std::cout << "received '/test1' message with arguments: "
                << a1 << " " << a2 << " " << a3 << " " << a4 << "\n";

        }else if( std::strcmp( m.AddressPattern(), "/test2" ) == 0 ){
            // example #2 -- argument iterator interface, supports
            // reflection for overloaded messages (eg you can call
            // (*arg)->IsBool() to check if a bool was passed etc).
            osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
            bool a1 = (arg++)->AsBool();
            int a2 = (arg++)->AsInt32();
            float a3 = (arg++)->AsFloat();
            const char *a4 = (arg++)->AsString();
            if( arg != m.ArgumentsEnd() )
                throw osc::ExcessArgumentException();

            std::cout << "received '/test2' message with arguments: "
                << a1 << " " << a2 << " " << a3 << " " << a4 << "\n";
        }
    }catch( osc::Exception& e ){
        // any parsing errors such as unexpected argument types, or
        // missing arguments get thrown as exceptions.
        std::cout << "error while parsing message: "
            << m.AddressPattern() << ": " << e.what() << "\n";
    }
}

};

// The clipping function of a transistor pair is approximately tanh(x)
// TODO: Put this in a lookup table. 5th order approx doesn't seem to cut it

struct controller : Module {
enum ParamIds {

};
enum InputIds {

};
enum OutputIds {

};

controller();
//controller() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) {}
void step()override;

};

controller::controller(){
//params.resize(NUM_PARAMS);
//inputs.resize(NUM_INPUTS);
//outputs.resize(NUM_OUTPUTS);
}

void controller::step() {
ExamplePacketListener listener;
UdpListeningReceiveSocket s(
IpEndpointName( IpEndpointName::ANY_ADDRESS, PORT ),
&listener );
//std::cout << "press ctrl-c to end\n";
s.RunUntilSigInt();
}`

and it give me a list of error about undefined references (maybe because I haven't compiled the sources)

C:\msys64\rack\plugins\liveControl/src/ip/UdpSocket.h:159: undefined reference to UdpSocket::UdpSocket()'
C:\msys64\rack\plugins\liveControl/src/ip/UdpSocket.h:159: undefined reference to SocketReceiveMultiplexer::SocketReceiveMultiplexer()' C:\msys64\rack\plugins\liveControl/src/ip/UdpSocket.h:161: undefined reference to UdpSocket::Bind(IpEndpointName const&)'
C:\msys64\rack\plugins\liveControl/src/ip/UdpSocket.h:162: undefined reference to SocketReceiveMultiplexer::AttachSocketListener(UdpSocket*, PacketListener*)' build/src/Controller.cpp.o: In function UdpListeningReceiveSocket::RunUntilSigInt()':
`
Can you help?

Thanks a lot,

Raphaël

Incomplete include dir spec

If incorporating oscpack through cmake add_subdirectory compilation will fail because headers are not found.

This is because the include directory does not reference the current directory, ie CMAKE_CURRENT_SOURCE_DIR.

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})

Also consider using target_include_directories(oscpack PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) to directly export the directory to any including projects without having to care much about include paths therein.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.