2 SuperCollider real time audio synthesis system
3 Copyright (c) 2002 James McCartney. All rights reserved.
4 http://www.audiosynth.com
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
27 #include "SC_SndBuf.h"
35 class padded_rw_spinlock
;
41 // a pointer to private implementation, not available to plug-ins.
42 struct HiddenWorld
*hw
;
44 // a pointer to the table of function pointers that implement the plug-ins'
45 // interface to the server.
46 struct InterfaceTable
*ft
;
48 // data accessible to plug-ins :
53 uint32 mNumAudioBusChannels
;
54 uint32 mNumControlBusChannels
;
58 // vector of samples for all audio busses
61 // vector of samples for all control busses
64 // these tell if a buss has been written to during a control period
65 // if the value is equal to mBufCounter then the buss has been touched
66 // this control period.
67 int32
*mAudioBusTouched
;
68 int32
*mControlBusTouched
;
72 SndBuf
*mSndBufsNonRealTimeMirror
;
73 SndBufUpdates
*mSndBufUpdates
;
75 struct Group
*mTopGroup
;
77 Rate mFullRate
, mBufRate
;
82 uint32 mNumUnits
, mNumGraphs
, mNumGroups
;
83 int mSampleOffset
; // offset in the buffer of current event time.
87 uint32 mNumSharedControls
;
88 float *mSharedControls
;
96 float mSubsampleOffset
; // subsample accurate offset in the buffer of current event time.
99 int mErrorNotification
;
100 int mLocalErrorNotification
;
102 bool mRendezvous
; // Allow user to disable Rendezvous
104 const char* mRestrictedPath
; // OSC commands to read/write data can only do it within this path, if specified
107 nova::padded_rw_spinlock
* mAudioBusLocks
;
108 nova::spin_lock
* mControlBusLock
;
114 __declspec(dllexport
)
116 int scprintf(const char *fmt
, ...);
119 inline SndBuf
* World_GetBuf(struct World
*inWorld
, uint32 index
)
121 if (index
> inWorld
->mNumSndBufs
) index
= 0;
122 return inWorld
->mSndBufs
+ index
;
125 inline SndBuf
* World_GetNRTBuf(struct World
*inWorld
, uint32 index
)
127 if (index
> inWorld
->mNumSndBufs
) index
= 0;
128 return inWorld
->mSndBufsNonRealTimeMirror
+ index
;
131 typedef void (*LoadPlugInFunc
)(struct InterfaceTable
*);