merge resolution with master

This commit is contained in:
Paul Davis
2013-05-02 20:21:54 -04:00
66 changed files with 255 additions and 4024 deletions

View File

@@ -73,7 +73,6 @@ public:
AEffect * plugin () const { return _plugin; }
VSTState * state () const { return _state; }
void set_state (VSTState* s) { _state = s; }
int set_state (XMLNode const &, int);

View File

@@ -1299,8 +1299,8 @@ AUPlugin::render_callback(AudioUnitRenderActionFlags*,
{
/* not much to do with audio - the data is already in the buffers given to us in connect_and_run() */
DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1: render callback, frames %2 bufs %3\n",
name(), inNumberFrames, ioData->mNumberBuffers));
// DEBUG_TRACE (DEBUG::AudioUnits, string_compose ("%1: render callback, frames %2 bufs %3\n",
// name(), inNumberFrames, ioData->mNumberBuffers));
if (input_maxbuf == 0) {
error << _("AUPlugin: render callback called illegally!") << endmsg;

View File

@@ -34,8 +34,6 @@
#include <glibmm/fileutils.h>
#include "ardour/linux_vst_support.h"
#include "ardour/vst_plugin.h"
#include "pbd/basename.h"
#include "pbd/error.h"
@@ -295,43 +293,36 @@ vstfx_unload (VSTHandle* fhandle)
return 0;
}
/**
Instantiates a VST plugin and also set _state of its plugin argument
*/
/*This instantiates a plugin*/
VSTState*
vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void *ptr)
VSTState *
vstfx_instantiate (VSTHandle* fhandle, audioMasterCallback amc, void* userptr)
{
VSTState* vstfx = vstfx_new ();
ARDOUR::VSTPlugin* plugin = reinterpret_cast<ARDOUR::VSTPlugin*> (ptr);
if (fhandle == 0) {
if(fhandle == 0)
{
vstfx_error( "** ERROR ** VSTFX : The handle was 0\n" );
return 0;
}
if ((vstfx->plugin = fhandle->main_entry (amc)) == 0) {
if ((vstfx->plugin = fhandle->main_entry (amc)) == 0)
{
vstfx_error ("** ERROR ** VSTFX : %s could not be instantiated :(\n", fhandle->name);
free (vstfx);
return 0;
}
vstfx->handle = fhandle;
vstfx->plugin->user = plugin;
vstfx->plugin->user = userptr;
if (vstfx->plugin->magic != kEffectMagic) {
if (vstfx->plugin->magic != kEffectMagic)
{
vstfx_error ("** ERROR ** VSTFX : %s is not a VST plugin\n", fhandle->name);
free (vstfx);
return 0;
}
/* need to set this here because some plugins make audioMaster
* callbacks from within effOpen, and _state must be set for
* that to work.
*/
plugin->set_state (vstfx);
vstfx->plugin->dispatcher (vstfx->plugin, effOpen, 0, 0, 0, 0);
/*May or May not need to 'switch the plugin on' here - unlikely

View File

@@ -32,7 +32,7 @@ LXVSTPlugin::LXVSTPlugin (AudioEngine& e, Session& session, VSTHandle* h)
{
/* Instantiate the plugin and return a VSTState* */
if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) {
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
@@ -44,7 +44,7 @@ LXVSTPlugin::LXVSTPlugin (const LXVSTPlugin &other)
{
_handle = other._handle;
if (vstfx_instantiate (_handle, Session::vst_callback, this) == 0) {
if ((_state = vstfx_instantiate (_handle, Session::vst_callback, this)) == 0) {
throw failed_constructor();
}
_plugin = _state->plugin;

View File

@@ -1,158 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session version="3001" name="rec_enabled" sample-rate="48000" id-counter="121" event-counter="0">
<Config>
<Option name="xfade-model" value="FullCrossfade"/>
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
<Option name="auto-xfade" value="1"/>
<Option name="short-xfade-seconds" value="0.015"/>
<Option name="destructive-xfade-msecs" value="2"/>
<Option name="use-region-fades" value="1"/>
<Option name="show-region-fades" value="1"/>
<Option name="native-file-data-format" value="FormatFloat"/>
<Option name="native-file-header-format" value="WAVE"/>
<Option name="auto-play" value="0"/>
<Option name="auto-return" value="0"/>
<Option name="auto-input" value="1"/>
<Option name="punch-in" value="0"/>
<Option name="punch-out" value="0"/>
<Option name="subframes-per-frame" value="100"/>
<Option name="timecode-format" value="timecode_30"/>
<Option name="raid-path" value=""/>
<Option name="audio-search-path" value=""/>
<Option name="midi-search-path" value=""/>
<Option name="auditioner-output-left" value="default"/>
<Option name="auditioner-output-right" value="default"/>
<Option name="timecode-source-is-synced" value="1"/>
<Option name="jack-time-master" value="1"/>
<Option name="use-video-sync" value="0"/>
<Option name="video-pullup" value="0"/>
<Option name="show-summary" value="1"/>
<Option name="show-group-tabs" value="1"/>
<Option name="external-sync" value="0"/>
<Option name="sync-source" value="JACK"/>
<Option name="insert-merge-policy" value="InsertMergeRelax"/>
<Option name="timecode-offset" value="0"/>
<Option name="timecode-offset-negative" value="1"/>
<Option name="glue-new-markers-to-bars-and-beats" value="0"/>
<Option name="midi-copy-is-fork" value="0"/>
<Option name="glue-new-regions-to-bars-and-beats" value="0"/>
</Config>
<Metadata/>
<Sources/>
<Regions/>
<Locations>
<Location id="86" name="Loop" start="0" end="1" flags="IsAutoLoop,IsHidden" locked="no" position-lock-style="AudioTime"/>
<Location id="87" name="Punch" start="0" end="1" flags="IsAutoPunch,IsHidden" locked="no" position-lock-style="AudioTime"/>
</Locations>
<Bundles/>
<Routes>
<Route id="88" name="Audio 1" default-type="audio" active="yes" phase-invert="0" denormal-protection="no" meter-point="MeterPostFader" order-keys="" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no" monitoring="" saved-meter-point="MeterPostFader" mode="Normal">
<IO name="Audio 1" id="105" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="Audio 1/audio_in 1">
<Connection other="system:capture_1"/>
</Port>
</IO>
<IO name="Audio 1" id="106" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="Audio 1/audio_out 1">
<Connection other="master/audio_in 1"/>
</Port>
<Port type="audio" name="Audio 1/audio_out 2">
<Connection other="master/audio_in 2"/>
</Port>
</IO>
<Controllable name="solo" id="90" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="92" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<Pannable>
<Controllable name="pan-azimuth" id="96" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="100" flags="" value="0.000000000000"/>
<Controllable name="pan-elevation" id="98" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="102" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="104" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="107" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="109" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="110" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="111" name="Audio 1" active="yes" user-latency="0" own-input="yes" own-output="no" output="Audio 1" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Mono to Stereo Panner"/>
</PannerShell>
</Processor>
<Controllable name="recenable" id="113" flags="Toggle" value="0.000000000000"/>
<Diskstream flags="Recordable" playlist="Audio 1.1" name="Audio 1" id="115" speed="1.000000" capture-alignment="Automatic" channels="1"/>
</Route>
<Route id="21" name="master" default-type="audio" flags="MasterOut" active="yes" phase-invert="00" denormal-protection="no" meter-point="MeterPostFader" order-keys="EditorSort=318:MixerSort=318" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no">
<IO name="master" id="38" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_in 1">
<Connection other="Audio 1/audio_out 1"/>
</Port>
<Port type="audio" name="master/audio_in 2">
<Connection other="Audio 1/audio_out 2"/>
</Port>
</IO>
<IO name="master" id="39" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="master/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Controllable name="solo" id="23" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="25" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<Pannable>
<Controllable name="pan-azimuth" id="29" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="33" flags="" value="1.000000000000"/>
<Controllable name="pan-elevation" id="31" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="35" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="37" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="40" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="42" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="43" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="44" name="master" active="yes" user-latency="0" own-input="yes" own-output="no" output="master" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Equal Power Stereo"/>
</PannerShell>
</Processor>
</Route>
</Routes>
<Playlists>
<Playlist id="116" name="Audio 1.1" type="audio" orig-track-id="88" frozen="no" combine-ops="0"/>
</Playlists>
<UnusedPlaylists/>
<RouteGroups/>
<Click>
<IO name="click" id="46" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="click/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="click/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Processor id="47" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="49" flags="GainLike" value="1.000000000000"/>
</Processor>
</Click>
<Speakers>
<Speaker azimuth="0" elevation="0" distance="1"/>
<Speaker azimuth="180" elevation="0" distance="0"/>
</Speakers>
<TempoMap>
<Tempo start="1|1|0" beats-per-minute="120.000000" note-type="4.000000" movable="no"/>
<Meter start="1|1|0" note-type="4.000000" divisions-per-bar="4.000000" movable="no"/>
</TempoMap>
<ControlProtocols>
<Protocol name="Open Sound Control (OSC)" active="no"/>
<Protocol name="Generic MIDI" feedback="0" feedback-interval="10000" active="yes">
<Controls/>
</Protocol>
<Protocol name="Mackie" bank="0" ipmidi-base="21928" device-profile="" device-name="Mackie Control Universal Pro" active="yes"/>
</ControlProtocols>
</Session>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View File

@@ -1,148 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Session version="3001" name="1region" sample-rate="48000" id-counter="120" event-counter="0">
<Config>
<Option name="xfade-model" value="FullCrossfade"/>
<Option name="xfade-choice" value="ConstantPowerMinus3dB"/>
<Option name="auto-xfade" value="1"/>
<Option name="short-xfade-seconds" value="0.015"/>
<Option name="destructive-xfade-msecs" value="2"/>
<Option name="use-region-fades" value="1"/>
<Option name="show-region-fades" value="1"/>
<Option name="native-file-data-format" value="FormatFloat"/>
<Option name="native-file-header-format" value="WAVE"/>
<Option name="auto-play" value="0"/>
<Option name="auto-return" value="0"/>
<Option name="auto-input" value="1"/>
<Option name="punch-in" value="0"/>
<Option name="punch-out" value="0"/>
<Option name="subframes-per-frame" value="100"/>
<Option name="timecode-format" value="timecode_30"/>
<Option name="raid-path" value=""/>
<Option name="audio-search-path" value=""/>
<Option name="midi-search-path" value=""/>
<Option name="auditioner-output-left" value="default"/>
<Option name="auditioner-output-right" value="default"/>
<Option name="timecode-source-is-synced" value="1"/>
<Option name="jack-time-master" value="1"/>
<Option name="use-video-sync" value="0"/>
<Option name="video-pullup" value="0"/>
<Option name="show-summary" value="1"/>
<Option name="show-group-tabs" value="1"/>
<Option name="external-sync" value="0"/>
<Option name="sync-source" value="JACK"/>
<Option name="insert-merge-policy" value="InsertMergeRelax"/>
<Option name="timecode-offset" value="0"/>
<Option name="timecode-offset-negative" value="1"/>
<Option name="glue-new-markers-to-bars-and-beats" value="0"/>
<Option name="midi-copy-is-fork" value="0"/>
<Option name="glue-new-regions-to-bars-and-beats" value="0"/>
</Config>
<Metadata/>
<Sources/>
<Regions/>
<Locations>
<Location id="86" name="Loop" start="0" end="1" flags="IsAutoLoop,IsHidden" locked="no" position-lock-style="AudioTime"/>
<Location id="87" name="Punch" start="0" end="1" flags="IsAutoPunch,IsHidden" locked="no" position-lock-style="AudioTime"/>
</Locations>
<Bundles/>
<Routes>
<Route id="21" name="master" default-type="audio" flags="MasterOut" active="yes" phase-invert="00" denormal-protection="no" meter-point="MeterPostFader" order-keys="editor=0:signal=0" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no">
<IO name="master" id="38" direction="Input" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_in 1"/>
<Port type="audio" name="master/audio_in 2"/>
</IO>
<IO name="master" id="39" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="master/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="master/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Controllable name="solo" id="23" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="25" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<RemoteControl id="318"/>
<Pannable>
<Controllable name="pan-azimuth" id="29" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="33" flags="" value="1.000000000000"/>
<Controllable name="pan-elevation" id="31" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="35" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="37" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="40" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="42" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="43" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="44" name="master" active="yes" user-latency="0" own-input="yes" own-output="no" output="master" type="main-outs" role="Main">
<PannerShell bypassed="no">
<Panner type="Equal Power Stereo"/>
</PannerShell>
</Processor>
</Route>
<Route id="88" name="MIDI 1" default-type="midi" active="yes" phase-invert="" denormal-protection="no" meter-point="MeterPostFader" order-keys="signal=2" self-solo="no" soloed-by-upstream="0" soloed-by-downstream="0" solo-isolated="no" solo-safe="no" monitoring="" saved-meter-point="MeterPostFader" note-mode="Sustained" step-editing="no" input-active="yes">
<IO name="MIDI 1" id="105" direction="Input" default-type="midi" user-latency="0">
<Port type="midi" name="MIDI 1/midi_in 1"/>
</IO>
<IO name="MIDI 1" id="106" direction="Output" default-type="midi" user-latency="0">
<Port type="midi" name="MIDI 1/midi_out 1"/>
</IO>
<Controllable name="solo" id="90" flags="Toggle" value="0.000000000000"/>
<Controllable name="mute" id="92" flags="Toggle" value="0.000000000000"/>
<MuteMaster mute-point="PreFader,PostFader,Listen,Main" muted="no"/>
<RemoteControl id="2"/>
<Pannable>
<Controllable name="pan-azimuth" id="96" flags="" value="0.500000000000"/>
<Controllable name="pan-width" id="100" flags="" value="0.000000000000"/>
<Controllable name="pan-elevation" id="98" flags="" value="0.000000000000"/>
<Controllable name="pan-frontback" id="102" flags="" value="0.000000000000"/>
<Controllable name="pan-lfe" id="104" flags="" value="0.000000000000"/>
<Automation/>
</Pannable>
<Processor id="107" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="109" flags="GainLike" value="1.000000000000"/>
</Processor>
<Processor id="110" name="Meter" active="yes" user-latency="0" type="meter"/>
<Processor id="111" name="MIDI 1" active="yes" user-latency="0" own-input="yes" own-output="no" output="MIDI 1" type="main-outs" role="Main">
<PannerShell bypassed="no"/>
</Processor>
<Controllable name="recenable" id="113" flags="Toggle" value="0.000000000000"/>
<Diskstream flags="Recordable" playlist="MIDI 1.1" name="MIDI 1" id="115" speed="1.000000" capture-alignment="Automatic" channel-mode="AllChannels" channel-mask="0xffff"/>
</Route>
</Routes>
<Playlists>
<Playlist id="116" name="MIDI 1.1" type="midi" orig-track-id="88" frozen="no" combine-ops="0"/>
</Playlists>
<UnusedPlaylists/>
<RouteGroups/>
<Click>
<IO name="click" id="46" direction="Output" default-type="audio" user-latency="0">
<Port type="audio" name="click/audio_out 1">
<Connection other="system:playback_1"/>
</Port>
<Port type="audio" name="click/audio_out 2">
<Connection other="system:playback_2"/>
</Port>
</IO>
<Processor id="47" name="Amp" active="yes" user-latency="0" type="amp">
<Controllable name="gaincontrol" id="49" flags="GainLike" value="1.000000000000"/>
</Processor>
</Click>
<NamedSelections/>
<Speakers>
<Speaker azimuth="0" elevation="0" distance="1"/>
<Speaker azimuth="180" elevation="0" distance="0"/>
</Speakers>
<TempoMap>
<Tempo start="1|1|0" beats-per-minute="120.000000" note-type="4.000000" movable="no"/>
<Meter start="1|1|0" note-type="4.000000" divisions-per-bar="4.000000" movable="no"/>
</TempoMap>
<ControlProtocols>
<Protocol name="Open Sound Control (OSC)" active="no"/>
<Protocol name="Generic MIDI" feedback="0" feedback-interval="10000" active="yes">
<Controls/>
</Protocol>
<Protocol name="Mackie" bank="0" ipmidi-base="21928" device-profile="" device-name="Mackie Control Universal Pro" active="yes"/>
</ControlProtocols>
</Session>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<UndoHistory/>

View File

@@ -257,7 +257,6 @@ Sequence<Time>::const_iterator::operator++()
throw std::logic_error("Attempt to iterate past end of Sequence");
}
DEBUG_TRACE(DEBUG::Sequence, "Sequence::const_iterator++\n");
assert(_event && _event->buffer() && _event->size() > 0);
const MIDIEvent<Time>& ev = *((MIDIEvent<Time>*)_event.get());
@@ -378,30 +377,30 @@ Sequence<Time>::const_iterator::operator++()
// Set event to reflect new position
switch (_type) {
case NOTE_ON:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note on\n");
// DEBUG_TRACE(DEBUG::Sequence, "iterator = note on\n");
*_event = (*_note_iter)->on_event();
_active_notes.push(*_note_iter);
break;
case NOTE_OFF:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note off\n");
// DEBUG_TRACE(DEBUG::Sequence, "iterator = note off\n");
assert(!_active_notes.empty());
*_event = _active_notes.top()->off_event();
_active_notes.pop();
break;
case CONTROL:
DEBUG_TRACE(DEBUG::Sequence, "iterator = control\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = control\n");
_seq->control_to_midi_event(_event, *_control_iter);
break;
case SYSEX:
DEBUG_TRACE(DEBUG::Sequence, "iterator = sysex\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = sysex\n");
*_event = *(*_sysex_iter);
break;
case PATCH_CHANGE:
DEBUG_TRACE(DEBUG::Sequence, "iterator = patch change\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = patch change\n");
*_event = (*_patch_change_iter)->message (_active_patch_change_message);
break;
default:
DEBUG_TRACE(DEBUG::Sequence, "iterator = end\n");
//DEBUG_TRACE(DEBUG::Sequence, "iterator = end\n");
_is_end = true;
}
@@ -1025,12 +1024,12 @@ Sequence<Time>::append_note_off_unlocked (NotePtr note)
_edited = true;
#ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
#ifdef PERCUSSIVE_IGNORE_NOTE_OFFS
if (_percussive) {
DEBUG_TRACE(DEBUG::Sequence, "Sequence Ignoring note off (percussive mode)\n");
return;
}
#endif
#endif
bool resolved = false;
@@ -1073,7 +1072,7 @@ template<typename Time>
void
Sequence<Time>::append_control_unlocked(const Parameter& param, Time time, double value, event_id_t /* evid */)
{
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 %2 @ %3\t=\t%4 # controls: %5\n",
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1 %2 @ %3 = %4 # controls: %5\n",
this, _type_map.to_symbol(param), time, value, _controls.size()));
boost::shared_ptr<Control> c = control(param, true);
c->list()->add (time, value);

View File

@@ -1,102 +0,0 @@
/*
* file that facilitates C++ program debugging.
*
* Copyright 1995 by Gray Watson
*
* This file is part of the dmalloc package.
*
* Permission to use, copy, modify, and distribute this software for any
* NON-COMMERCIAL purpose and without fee is hereby granted, provided
* that the above copyright notice and this permission notice appear
* in all copies, and that the name of Gray Watson not be used in
* advertising or publicity pertaining to distribution of the document
* or software without specific, written prior permission.
*
* Please see the PERMISSIONS file or contact the author for information
* about commercial licenses.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
*
* The author may be contacted via http://www.letters.com/~gray/
*
* $Id$
*/
/*
* This file is used to effectively redirect new to the more familiar
* malloc and delete to the more familiar free so they can be debugged
* with the debug malloc library.. They also give the known error
* behavior, too.
*
* Compile and link this in with the C++ program you want to debug.
*
* NOTE: I am not a C++ hacker so feedback in the form of other hints
* and ideas for C++ users would be much appreciated.
*/
#ifdef DEBUG_MALLOC
extern "C" {
#include <stdlib.h>
#include <dmalloc.h>
#include "/usr/local/src/dmalloc-4.1.2/return.h"
}
/*
* An overload function for the C++ new.
*/
void *
operator new(size_t size)
{
char *file;
GET_RET_ADDR(file);
/* handle correct C++ semantics for an alloc of size 0 */
if (size == 0) size = 1;
return _malloc_leap(file, 0, size);
}
/*
* An overload function for the C++ new[].
*/
void *
operator new[](size_t size)
{
char *file;
GET_RET_ADDR(file);
/* handle correct C++ semantics for an alloc of size 0 */
if (size == 0) size = 1;
return _malloc_leap(file, 0, size);
}
/*
* An overload function for the C++ delete.
*/
void
operator delete(void *pnt)
{
char *file;
GET_RET_ADDR(file);
_free_leap(file, 0, pnt);
}
/*
* An overload function for the C++ delete[]. Thanks to Jens Krinke
* <j.krinke@gmx.de>
*/
void
operator delete[](void *pnt)
{
char *file;
GET_RET_ADDR(file);
_free_leap(file, 0, pnt);
}
#endif

View File

@@ -1,6 +1,10 @@
/* Copyright unknown. Code by Laurent de Soras <laurent@ohmforce.com>.
*/
/*
Copyright © 2013 Laurent de Soras <laurent.de.soras@free.fr>
This work is free. You can redistribute it and/or modify it under the
terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
*/
#ifndef __pbd_fastlog_h__
#define __pbd_fastlog_h__

View File

@@ -43,7 +43,6 @@ libpbd_sources = [
'debug.cc',
'enumwriter.cc',
'event_loop.cc',
'dmalloc.cc',
'enums.cc',
'epa.cc',
'error.cc',

View File

@@ -1,21 +0,0 @@
This module works with the Griffin Powermate and allows some basic transport control.
It autodetects the Powermate on any input device of the form "/dev/input/event*". This means you must have the powermate module in your kernel. It works out-of-the-box with 64Studio and presumably lots of other modern distributions.
Turning the wheel left and right will act as a "Shuttle" wheel, adjusting playback speed up and down
Pushing the knob will switch between play and stop
Pushing the knob while turning will jump to the next or previous markers
In order for the powermate to work, you have to have permission to open the input device for reading.
In debian, I changed /etc/udev/rules.d/0_permissions.rules to have the line:
KERNEL=="event[0-9]*", MODE="0666"
but there are other ways to achieve this
Feedback, tweaks, bug fixes and feature ideas are encouraged
-Ben Loftis, ben@benloftis.com

View File

@@ -1,16 +0,0 @@
#ifndef __i18n_h__
#define __i18n_h__
#include "pbd/compose.h"
#include "pbd/convert.h"
#include "gettext.h"
#include <vector>
#include <string>
#define _(Text) dgettext (PACKAGE,Text)
#define N_(Text) gettext_noop (Text)
#define X_(Text) Text
#define I18N(Array) PBD::internationalize (PACKAGE, Array)
#endif // __i18n_h__

View File

@@ -1,57 +0,0 @@
/*
Ardour9pin interface file
Ben Loftis
Created: 05/18/06 11:07:56
Copyright Harrison Audio, LLC, 2007
*/
#include "powermate.h"
using namespace ARDOUR;
ControlProtocol*
new_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/, Session* s)
{
PowermateControlProtocol* pcp = new PowermateControlProtocol (*s);
if (pcp->set_active (true)) {
delete pcp;
return 0;
}
return pcp;
}
void
delete_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/, ControlProtocol* cp)
{
delete cp;
}
bool
probe_powermate_protocol (ControlProtocolDescriptor* /*descriptor*/)
{
return PowermateControlProtocol::probe ();
}
static ControlProtocolDescriptor powermate_descriptor = {
name : "powermate",
id : "uri://ardour.org/ardour/powermate:0",
ptr : 0,
module : 0,
mandatory : 0,
supports_feedback : false,
probe : probe_powermate_protocol,
initialize : new_powermate_protocol,
destroy : delete_powermate_protocol
};
extern "C" {
ControlProtocolDescriptor*
protocol_descriptor () {
return &powermate_descriptor;
}
}

View File

@@ -1,258 +0,0 @@
/*
powermate.cc
Ben Loftis
Created: 03/26/07 20:07:56
*/
#include <linux/input.h>
#include <cstring>
#include <cerrno>
#include <cstdio>
#include <unistd.h>
#include <fcntl.h>
#include <glibmm.h>
#include "pbd/pthread_utils.h"
#include "pbd/xml++.h"
#include "pbd/error.h"
#include "ardour/debug.h"
#include "powermate.h"
#include "i18n.h"
using namespace ARDOUR;
using namespace std;
using namespace sigc;
using namespace PBD;
#define NUM_VALID_PREFIXES 2
static const char *valid_prefix[NUM_VALID_PREFIXES] = {
"Griffin PowerMate",
"Griffin SoundKnob"
};
#define NUM_EVENT_DEVICES 16
int open_powermate (const char *dev, int mode)
{
if (!Glib::file_test (dev, Glib::FILE_TEST_EXISTS)) {
return -1;
}
int fd = open(dev, mode);
int i;
char name[255];
if (fd < 0) {
if (errno != EACCES) {
error << string_compose ("Unable to open \"%1\": %2", dev, strerror(errno)) << endmsg;
}
return -1;
}
/* placate valgrind */
name[0] = '\0';
if (ioctl (fd, EVIOCGNAME (sizeof(name)), name) < 0) {
error << string_compose ("\"%1\": EVIOCGNAME failed: %2", dev, strerror(errno)) << endmsg;
close (fd);
return -1;
}
// it's the correct device if the prefix matches what we expect it to be:
for (i = 0; i < NUM_VALID_PREFIXES; ++i) {
if (!strncasecmp (name, valid_prefix[i], strlen (valid_prefix[i]))) {
return fd;
}
}
close (fd);
return -1;
}
int find_powermate(int mode)
{
char devname[256];
int i, r;
for (i = 0; i < NUM_EVENT_DEVICES; i++) {
sprintf (devname, "/dev/input/event%d", i);
r = open_powermate (devname, mode);
if (r >= 0) {
return r;
}
}
return -1;
}
PowermateControlProtocol::PowermateControlProtocol (Session& s)
: ControlProtocol (s, "powermate")
{
}
PowermateControlProtocol::~PowermateControlProtocol ()
{
set_active (false);
}
bool
PowermateControlProtocol::probe ()
{
int port = find_powermate( O_RDONLY );
if (port < 0) {
if (errno == ENOENT) {
DEBUG_TRACE (DEBUG::ControlProtocols, "Powermate device not found; perhaps you have no powermate connected");
} else {
DEBUG_TRACE (DEBUG::ControlProtocols, string_compose ("powermate: Opening of powermate failed - %1\n", strerror(errno)));
}
return false;
}
close (port);
return true;
}
int
PowermateControlProtocol::set_active (bool inActivate)
{
if (inActivate != _active) {
if (inActivate) {
mPort = find_powermate(O_RDONLY);
if ( mPort < 0 ) {
return -1;
}
if (pthread_create_and_store ("Powermate", &mThread, SerialThreadEntry, this) == 0) {
_active = true;
} else {
return -1;
}
printf("Powermate Control Protocol activated\n");
} else {
pthread_cancel (mThread);
close (mPort);
_active = false;
printf("Powermate Control Protocol deactivated\n");
}
}
return 0;
}
XMLNode&
PowermateControlProtocol::get_state ()
{
XMLNode* node = new XMLNode (X_("Protocol"));
node->add_property (X_("name"), _name);
return *node;
}
int
PowermateControlProtocol::set_state (const XMLNode& /*node*/, int /*version*/)
{
return 0;
}
void*
PowermateControlProtocol::SerialThreadEntry (void* arg)
{
static_cast<PowermateControlProtocol*>(arg)->register_thread ("Powermate");
return static_cast<PowermateControlProtocol*>(arg)->SerialThread ();
}
#define BUFFER_SIZE 32
bool held = false;
bool skippingMarkers = false;
void
PowermateControlProtocol::ProcessEvent(struct input_event *ev)
{
#ifdef VERBOSE
fprintf(stderr, "type=0x%04x, code=0x%04x, value=%d\n",
ev->type, ev->code, (int)ev->value);
#endif
switch(ev->type){
case EV_MSC:
printf("The LED pulse settings were changed; code=0x%04x, value=0x%08x\n", ev->code, ev->value);
break;
case EV_REL:
if(ev->code != REL_DIAL)
fprintf(stderr, "Warning: unexpected rotation event; ev->code = 0x%04x\n", ev->code);
else{
if (held) {
//click and hold to skip forward and back by markers
skippingMarkers = true;;
if (ev->value > 0)
next_marker();
else
prev_marker();
} else {
//scale the range so that we can go from +/-8x within 180 degrees, with less precision at the higher speeds
float speed = get_transport_speed();
speed += (float)ev->value * 0.05;
if (speed > 1.5 || speed < -1.5 )
speed += ev->value;
set_transport_speed( speed );
}
}
break;
case EV_KEY:
if(ev->code != BTN_0)
fprintf(stderr, "Warning: unexpected key event; ev->code = 0x%04x\n", ev->code);
else
if (ev->value)
held = true;
else {
held = false;
if (skippingMarkers) {
skippingMarkers = false;
} else {
if (get_transport_speed() == 0.0) {
set_transport_speed(1.0);
} else {
set_transport_speed(0.0);
}
}
}
break;
}
fflush(stdout);
}
void*
PowermateControlProtocol::SerialThread ()
{
struct input_event ibuffer[BUFFER_SIZE];
int r, events, i;
while(1){
r = read(mPort, ibuffer, sizeof(struct input_event) * BUFFER_SIZE);
if( r > 0 ){
events = r / sizeof(struct input_event);
for(i=0; i<events; i++)
ProcessEvent(&ibuffer[i]);
}else{
fprintf(stderr, "read() failed: %s\n", strerror(errno));
return (void*) 0;
}
}
return (void*) 0;
}

View File

@@ -1,34 +0,0 @@
#ifndef ardour_powermate_h
#define ardour_powermate_h
#include <sys/time.h>
#include <pthread.h>
#include "control_protocol/control_protocol.h"
class PowermateControlProtocol : public ARDOUR::ControlProtocol
{
public:
PowermateControlProtocol (ARDOUR::Session&);
virtual ~PowermateControlProtocol();
int set_active (bool yn);
static bool probe ();
XMLNode& get_state ();
int set_state (const XMLNode&, int version);
private:
static void* SerialThreadEntry (void* arg);
void* SerialThread ();
void ProcessEvent(struct input_event *ev);
int mPort;
pthread_t mThread;
};
#endif

View File

@@ -1,37 +0,0 @@
#!/usr/bin/env python
from waflib.extras import autowaf as autowaf
import os
# Library version (UNIX style major, minor, micro)
# major increment <=> incompatible changes
# minor increment <=> compatible changes (additions)
# micro increment <=> no interface changes
LIBARDOUR_POWERMATE_LIB_VERSION = '4.1.0'
# Mandatory variables
top = '.'
out = 'build'
def options(opt):
autowaf.set_options(opt)
def configure(conf):
autowaf.configure(conf)
def build(bld):
obj = bld(features = 'cxx cxxshlib')
obj.source = '''
interface.cc
powermate.cc
'''
obj.export_includes = ['.']
obj.cxxflags = '-DPACKAGE="ardour_powermate"'
obj.includes = ['.' ]
obj.name = 'libpowermate'
obj.target = 'powermate'
obj.use = 'libardour libardour_cp'
obj.vnum = LIBARDOUR_POWERMATE_LIB_VERSION
obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3', 'surfaces')
def shutdown():
autowaf.shutdown()

View File

@@ -25,7 +25,6 @@ children = [
'generic_midi',
'mackie',
'osc',
'powermate',
'tranzport',
'wiimote'
]
@@ -48,7 +47,6 @@ def configure(conf):
#if Options.options.tranzport and conf.is_defined('HAVE_USB'):
# conf.define('BUILD_TRANZPORT', 1)
conf.check_cc (header_name='linux/input.h', define_name='BUILD_POWERMATE',mandatory=False)
autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24")
conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
@@ -68,8 +66,6 @@ def build(bld):
bld.recurse('mackie')
if bld.is_defined ('HAVE_LO'):
bld.recurse('osc')
if bld.is_defined('BUILD_POWERMATE'):
bld.recurse('powermate')
if bld.is_defined('BUILD_WIIMOTE'):
bld.recurse('wiimote')
if bld.is_defined('BUILD_TRANZPORT'):