Browse Source

Fixed Audio Interface "wrong number of outputs/inputs" issue, add `make

dist`, change background to solid color
tags/v0.3.0
Andrew Belt 7 years ago
parent
commit
aceeade1c8
8 changed files with 263 additions and 25 deletions
  1. +208
    -0
      LICENSE-dist.txt
  2. +27
    -0
      Makefile
  3. +0
    -5
      Makefile.inc
  4. +1
    -1
      README.md
  5. +19
    -11
      src/core/AudioInterface.cpp
  6. +1
    -1
      src/core/MidiInterface.cpp
  7. +0
    -1
      src/widgets/InputPort.cpp
  8. +7
    -6
      src/widgets/RackWidget.cpp

+ 208
- 0
LICENSE-dist.txt View File

@@ -0,0 +1,208 @@
# nanovg

Copyright (c) 2013 Mikko Mononen memon@inside.org

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.


# noc

Copyright 2016 guillaumechereau

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


# Blendish

Copyright (c) 2014 Leonard Ritter <leonard.ritter@duangle.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


# GLFW

Copyright © 2002-2006 Marcus Geelnard

Copyright © 2006-2011 Camilla Berglund

This software is provided ‘as-is’, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

This notice may not be removed or altered from any source distribution.


# GLEW

The OpenGL Extension Wrangler Library
Copyright (C) 2002-2007, Milan Ikits <milan ikits[]ieee org>
Copyright (C) 2002-2007, Marcelo E. Magallon <mmagallo[]debian org>
Copyright (C) 2002, Lev Povalahev
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.


Mesa 3-D graphics library
Version: 7.0

Copyright (C) 1999-2007 Brian Paul All Rights Reserved.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Copyright (c) 2007 The Khronos Group Inc.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.

THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.


# jansson

Copyright (c) 2009-2016 Petri Lehtinen <petri@digip.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


# portaudio

PortAudio Portable Real-Time Audio Library
Copyright (c) 1999-2011 Ross Bencina and Phil Burk

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


# portmidi

Copyright (c) 1999-2000 Ross Bencina and Phil Burk
Copyright (c) 2001-2009 Roger B. Dannenberg

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 27
- 0
Makefile View File

@@ -54,5 +54,32 @@ endif

all: $(TARGET)

dist: $(TARGET)
# Rack
mkdir -p dist/Rack
cp LICENSE* dist/Rack/
ifeq ($(ARCH), linux)
cp Rack dist/Rack/
endif
ifeq ($(ARCH), apple)
./bundle.sh
cp -R Rack.app dist/Rack/
endif
ifeq ($(ARCH), windows)
cp Rack.exe dist/Rack/
./copy_dlls.sh
cp *.dll dist/Rack/
endif
cp -R res dist/Rack/
mkdir -p dist/Rack/plugins
# Fundamental
$(MAKE) -C plugins/Fundamental dist
cp -R plugins/Fundamental/dist/Fundamental dist/Rack/plugins/
# zip
cd dist && zip -5 -r Rack.zip Rack

clean:
rm -rfv build $(TARGET) dist


include Makefile.inc

+ 0
- 5
Makefile.inc View File

@@ -27,8 +27,3 @@ build/%.cc.o: %.cc
build/%.m.o: %.m
@mkdir -p $(@D)
$(CC) $(CFLAGS) -c -o $@ $<

# Utilities

clean:
rm -rf build $(TARGET)

+ 1
- 1
README.md View File

@@ -2,7 +2,7 @@

# Rack

Eurorack-style modular DAW
Open source Eurorack-style modular DAW

## Building



+ 19
- 11
src/core/AudioInterface.cpp View File

@@ -91,20 +91,24 @@ void AudioInterface::step() {

// Input
// (for some reason, if you write the output stream before you read the input stream, PortAudio can segfault on Windows.)
err = Pa_ReadStream(stream, inputBuffer, numFrames);
if (err) {
// Ignore buffer underflows
if (err != paInputOverflowed) {
printf("Audio input buffer underflow\n");
if (numInputs > 0) {
err = Pa_ReadStream(stream, inputBuffer, numFrames);
if (err) {
// Ignore buffer underflows
if (err != paInputOverflowed) {
printf("Audio input buffer underflow\n");
}
}
}

// Output
err = Pa_WriteStream(stream, outputBuffer, numFrames);
if (err) {
// Ignore buffer underflows
if (err != paOutputUnderflowed) {
printf("Audio output buffer underflow\n");
if (numOutputs > 0) {
err = Pa_WriteStream(stream, outputBuffer, numFrames);
if (err) {
// Ignore buffer underflows
if (err != paOutputUnderflowed) {
printf("Audio output buffer underflow\n");
}
}
}
}
@@ -168,7 +172,11 @@ void AudioInterface::openDevice(int deviceId) {
inputParameters.suggestedLatency = info->defaultLowInputLatency;
inputParameters.hostApiSpecificStreamInfo = NULL;

err = Pa_OpenStream(&stream, &inputParameters, &outputParameters, SAMPLE_RATE, numFrames, paNoFlag, NULL, NULL);
// Don't use stream parameters if 0 input or output channels
PaStreamParameters *outputP = numOutputs == 0 ? NULL : &outputParameters;
PaStreamParameters *inputP = numInputs == 0 ? NULL : &inputParameters;

err = Pa_OpenStream(&stream, inputP, outputP, SAMPLE_RATE, numFrames, paNoFlag, NULL, NULL);
if (err) {
printf("Failed to open audio stream: %s\n", Pa_GetErrorText(err));
return;


+ 1
- 1
src/core/MidiInterface.cpp View File

@@ -33,7 +33,7 @@ struct MidiInterface : Module {
PortMidiStream *stream = NULL;
std::list<int> notes;
bool pedal = false;
int note = 60; // C4, most modules should use 261.63 Hz
int note = 60; // C4, most modules should use 261.626 Hz
int pitchWheel = 64;
bool retrigger = false;
bool retriggered = false;


+ 0
- 1
src/widgets/InputPort.cpp View File

@@ -27,7 +27,6 @@ void InputPort::onDragStart() {
}

void InputPort::onDragDrop(Widget *origin) {
printf("%p\n", origin);
if (connectedWire) return;
if (gRackWidget->activeWire) {
if (gRackWidget->activeWire->inputPort) return;


+ 7
- 6
src/widgets/RackWidget.cpp View File

@@ -262,15 +262,16 @@ void RackWidget::draw(NVGcontext *vg) {
nvgRect(vg, box.pos.x, box.pos.y, box.size.x, box.size.y);
NVGpaint paint;
{
int imageId = loadImage("res/wood.jpg");
int imageWidth, imageHeight;
nvgImageSize(vg, imageId, &imageWidth, &imageHeight);
paint = nvgImagePattern(vg, box.pos.x, box.pos.y, imageWidth, imageHeight, 0.0, imageId, 1.0);
nvgFillPaint(vg, paint);
// int imageId = loadImage("res/background.png");
// int imageWidth, imageHeight;
// nvgImageSize(vg, imageId, &imageWidth, &imageHeight);
// paint = nvgImagePattern(vg, box.pos.x, box.pos.y, imageWidth, imageHeight, 0.0, imageId, 1.0);
// nvgFillPaint(vg, paint);
nvgFillColor(vg, nvgRGBf(0.25, 0.25, 0.25));
nvgFill(vg);
}
{
int imageId = loadImage("res/rackrails.png");
int imageId = loadImage("res/rails.png");
int imageWidth, imageHeight;
nvgImageSize(vg, imageId, &imageWidth, &imageHeight);
paint = nvgImagePattern(vg, box.pos.x, box.pos.y, imageWidth, imageHeight, 0.0, imageId, 1.0);


Loading…
Cancel
Save